From: Andrew Cooper Date: Tue, 11 Mar 2025 21:13:33 +0000 (+0000) Subject: x86/IDT: Fix IDT generation for INT $0x80 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7323c93b2af24b3373f4934989988f8e47bb8ea4;p=people%2Froyger%2Fxen.git x86/IDT: Fix IDT generation for INT $0x80 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 Signed-off-by: Andrew Cooper Tested-by: Luca Fancellu Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/include/asm/gen-idt.h b/xen/arch/x86/include/asm/gen-idt.h index 9c8810edf9..d1da73248c 100644 --- a/xen/arch/x86/include/asm/gen-idt.h +++ b/xen/arch/x86/include/asm/gen-idt.h @@ -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