microsoftfeedback / WinDbg-Feedback

Public issue and feedback tracking for WinDbg Preview.
Creative Commons Attribution 4.0 International
49 stars 12 forks source link

rdmsr/wrmsr on ARM64 #191

Open scottnoone opened 6 months ago

scottnoone commented 6 months ago

Is there any updated documentation on how to use the rdmsr/wrmsr commands on ARM64 targets? The register parameter appears to be an encoding of the op0, op1, CRn, CRm, and op2 bits though it's not intuitive. I've created this macro that I think does the encoding properly but official confirmation/documentation would be appreciated:

#define ARM64_WINDBG_SYSREG(op0, op1, crn, crm, op2) \
        ( ((op0) << 16) | \
          ((op1) << 12) | \
          ((crn) << 8) | \
          ((crm) << 4) | \
          ((op2) << 0) )

    DWORD ttbr0_el1 = ARM64_WINDBG_SYSREG(3, 0, 2, 0, 0);
== 0x00030200

0: kd> rdmsr 0x00030200
msr[30200] = 00400000`80d45000
0: kd> ??@$prcb->ProcessorState.ArchState.Ttbr0_El1
unsigned int64 0x00400000`80d45000