Interrupt remapping is decoupled from x2apic. Enables interrupt remapping early before io-apic and x2apic setup to avoid compatibility interrupts, because it's late to eanble interrupt remapping in init_dmars where io-apic interrupts are set and in compatibility mode.
In lapic_resume, it shouldn't check x2apic before resume interrupt remapping. Otherwise, interrupt remapping won't be resumed when x2apic is not enabled.
The patchset can be applied on the tip linux.
Regards,
Weidong-