Removing x86_64 restriction#72
Conversation
06b6fb5 to
a443991
Compare
Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
a443991 to
6f13cf5
Compare
andreeaflorescu
left a comment
There was a problem hiding this comment.
I am not sure this is the right thing to do in this case. We are not exporting the KVM bindings on platforms where they're not supported on purpose to reduce the risk of misuing them. What feature would make it necessary to manipulate something that is x86_64 specific on aarch64?
|
At the moment for me this is a convenience change. I'm designing some CPUID functionality in Firecracker in a crate, to restrict the relevant functionality to
I find 2nd approach here preferable (this usage of The I think only adding I would add that it is not unforeseeable an application would want to manipulate |
|
@JonathanWoollett-Light sorry, I forgot to reply to this. We don't do this kind of future looking changes for the crates because by the time this feature would actually be needed (i.e. manipulating CpuId on aarch64 to start an x86 machine) it might come with different requirements and the code changes we did might not actually be appropriate anymore. That is why we're implementing features using working back from customer requests. Having these defines on aarch64 as well can lead to undefined behavior, and to security concerns because of the difference in structures on different platforms. In this case I don't find it appropriate to merge these changes for convenience. |
Summary of the PR
It can be useful to manipulate x86_64 structures on other system architectures (e.g. aarch64). These can be easily exposed on non-x86_64 systems to allow this without any drawbacks or breaking changes by making the module public and removing the
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))].Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commitmessage has max 60 characters for the summary and max 75 characters for each
description line.
test.
unsafecode is properly documented.