Skip to contentSkip to conversation

x86/PV32: fix physdev_op_compat handling

PATCH In review Jan Beulich 3 participants 3 messages Oct 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/PV32: fix physdev_op_compat handling

The conversion of the original code failed to recognize that the 32-bit compat variant of this (sorry, two different meanings of "compat" here) needs to continue to invoke the compat handler, not the native one. Arrange for this by adding yet another #define.

Affected functions (having existed prior to the introduction of the new hypercall) are PHYSDEVOP_set_iobitmap and PHYSDEVOP_apic_{read,write}. For all others the operand struct layout doesn't differ.

Fixes 1252e2823117 ("x86/pv: Export pv_hypercall_table[] rather than working around it in several ways")

---
v2: Don't remove do_physdev_op override.

xen/arch/x86/x86_64/compat.c +1 -0
@@ -12,6 +12,7 @@ EMIT_FILE;
 #define physdev_op_t                  physdev_op_compat_t
 #define do_physdev_op                 compat_physdev_op
 #define do_physdev_op_compat(x)       compat_physdev_op_compat(_##x)
+#define native                        compat
 
 #define COMPAT
 #define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Jan Beulich

The conversion of the original code failed to recognize that the 32-bit compat variant of this (sorry, two different meanings of "compat" here) needs to continue to invoke the compat handler, not the native one. Arrange for this by adding yet another #define.

Affected functions (having existed prior to the introduction of the new hypercall) are PHYSDEVOP_set_iobitmap and PHYSDEVOP_apic_{read,write}. For all others the operand struct layout doesn't differ.

Fixes 1252e2823117 ("x86/pv: Export pv_hypercall_table[] rather than working around it in several ways")

Thanks, Roger.

Reviewed-by
#2 lore raw
Quoted 6 lines · Roger Pau Monné
Quoted 5 lines · Jan Beulich

The conversion of the original code failed to recognize that the 32-bit compat variant of this (sorry, two different meanings of "compat" here) needs to continue to invoke the compat handler, not the native one. Arrange for this by adding yet another #define.

Quoted 7 lines
Quoted 6 lines

Affected functions (having existed prior to the introduction of the new hypercall) are PHYSDEVOP_set_iobitmap and PHYSDEVOP_apic_{read,write}. For all others the operand struct layout doesn't differ.

Fixes 1252e2823117 ("x86/pv: Export pv_hypercall_table[] rather than working around it in several ways")