Skip to content

AMD MSRs#28

Merged
namazso merged 2 commits into
namazso:mainfrom
irusanov:amd
Sep 24, 2025
Merged

AMD MSRs#28
namazso merged 2 commits into
namazso:mainfrom
irusanov:amd

Conversation

@irusanov

Copy link
Copy Markdown
Contributor
  • Add PATCH_LEVEL MSR: 0x0000008B
  • Add other P-State MSRs: 0xC001006[5...B]

Document reference (p78):
https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/56255_OSRR.pdf

@namazso

namazso commented Sep 24, 2025

Copy link
Copy Markdown
Owner

LGTM, thanks!

@namazso namazso merged commit 5628d05 into namazso:main Sep 24, 2025
@irusanov

Copy link
Copy Markdown
Contributor Author

Thanks! We would probably need to add more MSRs from the OSSR, but I need to look into what would be useful.
How do you feel about adding MsrWrite? In some cases it's needed to correct Erratas and definitely needed for changing P-States/overclocking or correcting timer issues when not using HPET (there's a workaround, only applicable if the patch level is below certain version).

Reference code:

// P0 fix C001_0015 HWCR[21]=1
// Fixes timer issues when not using HPET
private bool ApplyTscWorkaround()
{
    uint eax = 0, edx = 0;

    if (cpu.ReadMsr(MSR_HWCR, ref eax, ref edx))
    {
        eax |= 0x200000;
        return cpu.WriteMsr(MSR_HWCR, eax, edx);
    }
    return false;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants