Skip to content

Commit

Permalink
x86/hyperv: Fix definition of hv_ghcb_pg variable
Browse files Browse the repository at this point in the history
The percpu variable hv_ghcb_pg is incorrectly defined.  The __percpu
qualifier should be associated with the union hv_ghcb * (i.e.,
a pointer), not with the target of the pointer. This distinction
makes no difference to gcc and the generated code, but sparse
correctly complains.  Fix the definition in the interest of
general correctness in addition to making sparse happy.

No functional change.

Fixes: 0cc4f6d ("x86/hyperv: Initialize GHCB page in Isolation VM")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1640662315-22260-2-git-send-email-mikelley@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
  • Loading branch information
kelleymh authored and liuw committed Dec 28, 2021
1 parent db3c65b commit e187840
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/x86/hyperv/hv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ EXPORT_SYMBOL_GPL(hv_current_partition_id);
void *hv_hypercall_pg;
EXPORT_SYMBOL_GPL(hv_hypercall_pg);

union hv_ghcb __percpu **hv_ghcb_pg;
union hv_ghcb * __percpu *hv_ghcb_pg;

/* Storage to save the hypercall page temporarily for hibernation */
static void *hv_hypercall_pg_saved;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/mshyperv.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern void *hv_hypercall_pg;

extern u64 hv_current_partition_id;

extern union hv_ghcb __percpu **hv_ghcb_pg;
extern union hv_ghcb * __percpu *hv_ghcb_pg;

int hv_call_deposit_pages(int node, u64 partition_id, u32 num_pages);
int hv_call_add_logical_proc(int node, u32 lp_index, u32 acpi_id);
Expand Down

0 comments on commit e187840

Please sign in to comment.