Skip to content

Commit 86f0a5f

Browse files
committed
Merge tag 'for-linus-5.9b-rc9-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fix from Juergen Gross: "One fix for a regression when booting as a Xen guest on ARM64 introduced probably during the 5.9 cycle. It is very low risk as it is modifying Xen specific code only. The exact commit introducing the bug hasn't been identified yet, but everything was fine in 5.8 and only in 5.9 some configurations started to fail" * tag 'for-linus-5.9b-rc9-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: arm/arm64: xen: Fix to convert percpu address to gfn correctly
2 parents ec0fa0b + 5a06771 commit 86f0a5f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

arch/arm/xen/enlighten.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static int xen_starting_cpu(unsigned int cpu)
150150
pr_info("Xen: initializing cpu%d\n", cpu);
151151
vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
152152

153-
info.mfn = virt_to_gfn(vcpup);
153+
info.mfn = percpu_to_gfn(vcpup);
154154
info.offset = xen_offset_in_page(vcpup);
155155

156156
err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, xen_vcpu_nr(cpu),

include/xen/arm/page.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ static inline unsigned long bfn_to_pfn(unsigned long bfn)
8383
})
8484
#define gfn_to_virt(m) (__va(gfn_to_pfn(m) << XEN_PAGE_SHIFT))
8585

86+
#define percpu_to_gfn(v) \
87+
(pfn_to_gfn(per_cpu_ptr_to_phys(v) >> XEN_PAGE_SHIFT))
88+
8689
/* Only used in PV code. But ARM guests are always HVM. */
8790
static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr)
8891
{

0 commit comments

Comments
 (0)