Attention is currently required from: Kyösti Mälkki. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/55262 )
Change subject: cpu/x86/lapic: Support switching to X2APIC mode ......................................................................
Patch Set 10: Code-Review+1
(1 comment)
Patchset:
PS8:
Where do you need is_x2apic_mode() to return false? There might be a problem with initial_lapicid() and lapicid() being stashed.
Maybe I didn't explain myself, I don't need `is_x2apic_mode()` to return false at any point. I just explained my train of thought. I noted that `is_x2apic_mode()` never returns false in the X2APIC_RUNTIME case, so the only difference with X2APIC_ONLY is that the `rdmsr(LAPIC_BASE_MSR)` call is omitted.
This makes X2APIC_ONLY work?
diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h index 4fbae88ca5..50417acca5 100644 --- a/src/include/cpu/x86/lapic.h +++ b/src/include/cpu/x86/lapic.h @@ -75,11 +75,12 @@ static inline bool is_x2apic_mode(void) if (CONFIG(XAPIC_ONLY)) return false;
msr_t msr;
msr = rdmsr(LAPIC_BASE_MSR);
- if (CONFIG(X2APIC_ONLY)) return true;
msr_t msr;
return ((msr.lo & LAPIC_BASE_X2APIC_ENABLED) == LAPIC_BASE_X2APIC_ENABLED);msr = rdmsr(LAPIC_BASE_MSR);
}
Yes, I can try again to be sure.