Skip to content

Commit 7bf9a6b

Browse files
sstabellinijgross1
authored andcommitted
arm/xen: fix xen_vcpu_info allocation alignment
xen_vcpu_info is a percpu area than needs to be mapped by Xen. Currently, it could cross a page boundary resulting in Xen being unable to map it: [ 0.567318] kernel BUG at arch/arm64/xen/../../arm/xen/enlighten.c:164! [ 0.574002] Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP Fix the issue by using __alloc_percpu and requesting alignment for the memory allocation. Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com> Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2311221501340.2053963@ubuntu-linux-20-04-desktop Fixes: 24d5373 ("arm/xen: Use alloc_percpu rather than __alloc_percpu") Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 295b202 commit 7bf9a6b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm/xen/enlighten.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ static int __init xen_guest_init(void)
484484
* for secondary CPUs as they are brought up.
485485
* For uniformity we use VCPUOP_register_vcpu_info even on cpu0.
486486
*/
487-
xen_vcpu_info = alloc_percpu(struct vcpu_info);
487+
xen_vcpu_info = __alloc_percpu(sizeof(struct vcpu_info),
488+
1 << fls(sizeof(struct vcpu_info) - 1));
488489
if (xen_vcpu_info == NULL)
489490
return -ENOMEM;
490491

0 commit comments

Comments
 (0)