Skip to contentSkip to conversation

x86/pv: Rename hypercall_table_t to pv_hypercall_table_t

PATCH In review Andrew Cooper 2 participants 3 messages Apr 15, 2021 – Apr 16, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/pv: Rename hypercall_table_t to pv_hypercall_table_t

The type is no longer appropriate for anything other than PV, and therefore should not retain its generic name.

Fixes 527922008bc ("x86: slim down hypercall handling when !PV32")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>

---
 xen/arch/x86/pv/hypercall.c     | 2 +-
 xen/arch/x86/pv/shim.c          | 2 +-
 xen/include/asm-x86/hypercall.h | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
xen/arch/x86/pv/hypercall.c +1 -1
index 5d02eebc8d..e30c59b628 100644
@@ -40,7 +40,7 @@
 
 #define do_arch_1             paging_domctl_continuation
 
-const hypercall_table_t pv_hypercall_table[] = {
+const pv_hypercall_table_t pv_hypercall_table[] = {
     COMPAT_CALL(set_trap_table),
     HYPERCALL(mmu_update),
     COMPAT_CALL(set_gdt),
xen/arch/x86/pv/shim.c +1 -1
index 92cb1adeed..62201ae182 100644
@@ -204,7 +204,7 @@ void __init pv_shim_setup_dom(struct domain *d, l4_pgentry_t *l4start,
                               unsigned long console_va, unsigned long vphysmap,
                               start_info_t *si)
 {
-    hypercall_table_t *rw_pv_hypercall_table;
+    pv_hypercall_table_t *rw_pv_hypercall_table;
     uint64_t param = 0;
     long rc;
 
xen/include/asm-x86/hypercall.h +2 -2
index 39e7ab7022..0ae3b8b043 100644
@@ -20,7 +20,7 @@ typedef struct {
 #ifdef CONFIG_PV32
     hypercall_fn_t *compat;
 #endif
-} hypercall_table_t;
+} pv_hypercall_table_t;
 
 typedef struct {
     uint8_t native;
@@ -32,7 +32,7 @@ typedef struct {
 extern const hypercall_args_t hypercall_args_table[NR_hypercalls];
 
 #ifdef CONFIG_PV
-extern const hypercall_table_t pv_hypercall_table[];
+extern const pv_hypercall_table_t pv_hypercall_table[];
 void pv_hypercall(struct cpu_user_regs *regs);
 #endif
 
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andrew Cooper

The type is no longer appropriate for anything other than PV, and therefore should not retain its generic name.

Fixes 527922008bc ("x86: slim down hypercall handling when !PV32")

I'm not convinced this warrants a Fixes: tag (afaict there's no breakage), but in any event

I had considered doing the rename at the same time, but then decided to save on the extra code churn. I'm sorry if this was the wrong choice.

Jan

#2 lore raw
Quoted 11 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper

The type is no longer appropriate for anything other than PV, and therefore should not retain its generic name.

Fixes 527922008bc ("x86: slim down hypercall handling when !PV32")

I'm not convinced this warrants a Fixes: tag (afaict there's no breakage), but in any event

I had considered doing the rename at the same time, but then decided to save on the extra code churn. I'm sorry if this was the wrong choice.

I would have requested the change on code review.  Not necessarily part of that patch, if it were easier to split out into an adjacent change, but the patch did fundamentally change the purpose of the type.

Part of me still wonders whether it would be better to drop the type entirely, as on the HVM side.  However, whichever way you rewrite this, you've always got an ugly plumbing problem with the pvshim alterations.

~Andrew