]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/IDT: Fix IDT generation for INT $0x80
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 11 Mar 2025 21:13:33 +0000 (21:13 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 12 Mar 2025 09:25:04 +0000 (09:25 +0000)
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>
xen/arch/x86/include/asm/gen-idt.h

index 9c8810edf9d79de672a410a7ed046a2abbf00ae1..d1da73248c1c4e718817cdfbe7f5e6d44729709c 100644 (file)
@@ -77,7 +77,7 @@ GEN16(6);
 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