-
Notifications
You must be signed in to change notification settings - Fork 2.6k
For 3.1 Backport #25958 Modify amd64walker to use table based decode #28033
Conversation
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 the additional +43/-43 changes (as compared to #25958) are just stripping additional whitespace from the end of lines in src/debug/ee/amd64/amd64walker.cpp
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.
Also verified the customer scenario reported gets fixed.
Will consider again in a few months |
src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructioTableGenerator.csproj
Outdated
Show resolved
Hide resolved
I'm taking a look at the change but one question that rises to the top - do we have telemetry telling us how much usage we've gotten on this code path in .Net 5? For example can we determine the number of VS debugging sessions that have occurred with a .Net 5 x64 runtime? My fear is that we'd make an assumption that .Net 5 has given the scenario lots of coverage and the lack of feedback implies the change has no issues when in practice the code had been used relatively little and there are still bugs lurking. It seems unlikely that we'd catch an issue in this change via code review. |
A basic pass through revealed no obvious issues, but again I wouldn't expect to be able to spot anything without spending considerable time studying the X64 instruction encoding reference documentation and then doing a detailed comparison between the spec and this code. If we can demonstrate considerable usage has already occurred in .Net 5 that would bring down the risk. |
* Modify amd64walker to use table based decode Use tables for NativeWalker::DecodeInstructionForPatchSkip() Also files used to generate the decode tables in doc folder.
+ Typos (dotnet#26968) + Feedback from 3.1 amd64InstrDecode review (dotnet/runtime#35670)
Over the last 90 days, there have been
|
@tannergooding @hoyosjs @jkotas can you review and approve the change after the latest commits ? |
Fixes dotnet/runtime#34109
This has already been fixed in .NET 5 (see #25958). This PR ports that fix to release/3.1.
Customer Impact
Setting a debugger breakpoint on Amd64 (x64) can result in incorrect calculation of floating point values.
Regression?
This was a known and difficult to fix issue. The hand written Amd64 instruction parser was flaky and nearly impossible to maintain.
The problem arose because the debugger must determine the length and form of the instruction where the breakpoint is inserted. The original code was a minimal implementation which only covered the instruction form historically used by the JIT. As new forms and especially intrinsics were added, the code was not updated because the complexity was far too high.
We completely missed decode of all x64 simd instruction forms.
The fix required was this substantial change. At the time we missed the 3.0 branch and we did not have sufficient feedback to consider backport to 3.x.
Testing
Risk
Low.
NativeWalker::DecodeInstructionForPatchSkip()
. Used only for debugging x64 code.Code Reviewers
@hoyosjs @tannergooding @noahfalk @jkotas