-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Arm64 RDM on Windows #109493
base: main
Are you sure you want to change the base?
Enable Arm64 RDM on Windows #109493
Conversation
CC @dotnet/jit-contrib Doesn't look like the bot notified anyone on this one. I couldn't get a clean CI run, but none of the failures are related. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable to me.
I finally found enough documentation to support enabling RDM by implication
@a74nh - can you double check this?
This is a reasonable assumption to make. However, I think you can go a bit further. This change will miss some cases - you'll disable For that reason, I'd recommend you also enable You'll still miss some cases, but I think that's the best you can do given the available outputs in windows. |
Actually, scratch that. For any given feature, it's possible that either now or in the future it is backported to an earlier architecture revision due to a particular customer requirement.
Definitely do not this this! The correct and safe solution here is that the windows API needs expanding to include more features. The full list is much bigger and this issue is only going to occur again for other features. |
In the unlikely event this actually happened and such a device happened to run Windows and someone tried to run a .NET app using RDM on that device, we do still have the
That would be ideal, but with no movement from the Windows side in over 4 years, I don't know what else we can do. This is broken on hardware (including Microsoft-branded) that exists and runs Windows today, so a workaround seems reasonable. The main issue here is that the config knobs can disable an ISA but can't forcibly enable it, meaning there's no way to use the hardware we know is present. |
@jkotas, @kunalspathak. Anyone we can reach out to and ensure such config knobs are exposed? Unlike x64, there is no user-mode instruction (like
This isn't a knob that's really meant for use in production scenarios and certainly not by typical end users of applications. Rather its something that is primarily meant for testing scenarios, so that developers can validate their fallback paths instead. I don't think any scenario where we emit invalid instructions by default for regular code is going to be viable for the shipping product. |
Done (both of you are on cc line) |
If it helps, we might be able to provide some code could be used by the kernel to do the detection of all the features. |
Had an internal conversation that basically boils down to Windows doesn't have any plans to expose a FEAT_RDM flag at this point in time. Rather instead we can encode this essentially as This will exclude Windows 10, but that is going out of support next year in October 2025; prior to when .NET 10 will ship. CC. @jkotas |
More context: Rdm is supported on all Arm hardware supported by Windows 11 today and it is not expected to change in future. |
ef44d3e
to
91ed568
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #39094
On Windows, we currently never enable RDM intrinsics because
IsProcessorFeaturePresent
does not have a flag for the Armv8.1 RDM optional extension. This results inRdm.IsSupported
returning different values on Windows vs Linux on the same hardware (realistically, anything newer than 2016).I finally found enough documentation to support enabling RDM by implication. The docs for Armv8.1 extensions include the following:
Since we require a baseline of AdvSIMD support, we may assume that if we have an Armv8.1 processor, it has RDM support. This leads to a second problem, which is that there is also no
IsProcessorFeaturePresent
flag for Armv8.1 baseline. However, from the generic docs for Armv8 extensions:We may assume that the presence of any Armv8.2 optional feature means we have at least Armv8.1. And because
IsProcessorFeaturePresent
does have a flag for the Armv8.2 DP optional extension, we may safely assume that its presence also implies RDM.