diff options
author | Juergen Gross <jgross@suse.com> | 2023-11-24 08:48:52 +0100 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2023-11-28 12:47:11 +0100 |
commit | db2832309a82b9acc4b8cc33a1831d36507ec13e (patch) | |
tree | 372b03193c3333e5cef2b001c67adcca0944c189 /arch/x86/xen/xen-ops.h | |
parent | arm/xen: fix xen_vcpu_info allocation alignment (diff) | |
download | linux-db2832309a82b9acc4b8cc33a1831d36507ec13e.tar.xz linux-db2832309a82b9acc4b8cc33a1831d36507ec13e.zip |
x86/xen: fix percpu vcpu_info allocation
Today the percpu struct vcpu_info is allocated via DEFINE_PER_CPU(),
meaning that it could cross a page boundary. In this case registering
it with the hypervisor will fail, resulting in a panic().
This can easily be fixed by using DEFINE_PER_CPU_ALIGNED() instead,
as struct vcpu_info is guaranteed to have a size of 64 bytes, matching
the cache line size of x86 64-bit processors (Xen doesn't support
32-bit processors).
Fixes: 5ead97c84fa7 ("xen: Core Xen implementation")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.con>
Link: https://lore.kernel.org/r/20231124074852.25161-1-jgross@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'arch/x86/xen/xen-ops.h')
-rw-r--r-- | arch/x86/xen/xen-ops.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 408a2aa66c69..a87ab36889e7 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -21,7 +21,7 @@ extern void *xen_initial_gdt; struct trap_info; void xen_copy_trap_info(struct trap_info *traps); -DECLARE_PER_CPU(struct vcpu_info, xen_vcpu_info); +DECLARE_PER_CPU_ALIGNED(struct vcpu_info, xen_vcpu_info); DECLARE_PER_CPU(unsigned long, xen_cr3); DECLARE_PER_CPU(unsigned long, xen_current_cr3); |