When PV is enabled, entry_int80 needs to be DPL3, not DPL0.
This, combined with a QEMU bug which incorrectly calculates the error
code (fix submitted separately), causes the XSA-259 PoC to fail with:
--- Xen Test Framework ---
Environment: PV 64bit (Long mode 4 levels)
XSA-259 PoC
Error: Unexpected fault 0x800d0802, #GP[IDT[256]]
Test result: ERROR
Fixes: 3da2149cf4dc ("x86/IDT: Generate bsp_idt[] at build time")
Reported-by: Luca Fancellu <luca.fancellu@arm.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
GEN16(7);
#ifdef CONFIG_PV
-GEN(0x80, entry_int80, DPL0, manual);
+GEN(0x80, entry_int80, DPL3, manual);
#else
GEN(0x80, entry_0x80, DPL0, autogen);
#endif