added VPICD x2APIC fix (NOPs APIC-disable WRMSRs that #GP on x2APIC-locked Intel CPUs)#44
Open
Mintsuki wants to merge 1 commit into
Open
added VPICD x2APIC fix (NOPs APIC-disable WRMSRs that #GP on x2APIC-locked Intel CPUs)#44Mintsuki wants to merge 1 commit into
Mintsuki wants to merge 1 commit into
Conversation
…ocked Intel CPUs)
Owner
|
Thanks, nice work! I'll do some test and if where not any problems (ok, not obvious ones), I’ll merge it and create new release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VPICD.VXDreadsIA32_APIC_BASE(MSR0x1B), clears bit 11 (EN, the APIC global-enable bit), and writes it back. It does this on Intel CPUs wheneverCPUID.01h:EDXreports APIC and MSR support, both at APIC detection and again before each legacy 8259 reinit.On CPUs that support
IA32_XAPIC_DISABLE_STATUS(architecturally enumerated byIA32_ARCH_CAPABILITIESbit 21), firmware may setLEGACY_XAPIC_DISABLED, which locks the LAPIC into x2APIC mode. In that state bit 10 (EXTD) ofIA32_APIC_BASEis set, and clearingENwhileEXTDis set raises#GPper the Intel SDM. Windows reports this as "While initializing device VPICD: Windows protection error. You will need to restart your computer." and stops, without identifying the actual cause.The lock is the default firmware state on Intel Core Ultra (code-named Meteor Lake) and later, where x2APIC is the default APIC mode and
xAPICfall-back is no longer recommended. On earlier CPUs that have the MSR (Sapphire Rapids and later, plus client CPUs with the CVE-2022-21233 microcode update) the lock is typically only set when SGX or TDX is enabled in firmware.This patch turns each of the two
WRMSRopcodes inVPICD.VXDinto twoNOPs. The APIC is left in whatever mode firmware (or a UEFI legacy-boot wrapper such as CSMWrap) configured - typicallyLINT0 = ExtINT,LINT1 = NMI, which is exactly the routing the legacy 8259 needs. The detection-time flag VPICD sets is left intact so the rest of its internal state stays consistent.This finding and fix was AI-assisted (Claude, Opus 4.7).