On 11/03/2025 9:22 pm, Andrew Cooper wrote:
> When PV is enabled, entry_int80 needs to be DPL3, not DPL0.
>
> This 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
>
> (Clearly I have a bug in XTF's rendering of the error code too.)
Fixes: 3da2149cf4dc ("x86/IDT: Generate bsp_idt[] at build time")
Adjusted locally.
~Andrew
> Reported-by: Luca Fancellu <[email protected]>
> Signed-off-by: Andrew Cooper <[email protected]>
> ---
> CC: Jan Beulich <[email protected]>
> CC: Roger Pau Monné <[email protected]>
> CC: Luca Fancellu <[email protected]>
> ---
> xen/arch/x86/include/asm/gen-idt.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/include/asm/gen-idt.h
> b/xen/arch/x86/include/asm/gen-idt.h
> index 9c8810edf9d7..d1da73248c1c 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