|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v3 1/2] xen/x86: Return virtual address from alloc_stub_page()
Currently alloc_stub_page() returns the virtual address of the mapped
stubs page, and the caller adds the per-CPU offset. Make
alloc_stub_page() return the final address. This is in preparation for
changing the stubs allocation where the offset will not be tied to the
CPU number.
The call to alloc_stub_page() in setup.c:start_xen() did not add the
offset as it is assumed to run on CPU0.
Change the local variable stub_page to stub_va to reflect the value.
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
xen/arch/x86/smpboot.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index ff05955bae..d7619f534b 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -675,7 +675,7 @@ unsigned long alloc_stub_page(unsigned int cpu, unsigned
long *mfn)
else if ( !*mfn )
*mfn = mfn_x(page_to_mfn(pg));
- return stub_va;
+ return stub_va ? stub_va + STUB_BUF_CPU_OFFS(cpu) : 0;
}
void cpu_exit_clear(unsigned int cpu)
@@ -1044,7 +1044,7 @@ static int cpu_smpboot_alloc(unsigned int cpu)
unsigned int i, memflags = 0;
nodeid_t node = cpu_to_node(cpu);
seg_desc_t *gdt;
- unsigned long stub_page;
+ unsigned long stub_va;
int rc = -ENOMEM;
if ( node != NUMA_NO_NODE )
@@ -1099,10 +1099,10 @@ static int cpu_smpboot_alloc(unsigned int cpu)
break;
}
BUG_ON(i == cpu);
- stub_page = alloc_stub_page(cpu, &per_cpu(stubs.mfn, cpu));
- if ( !stub_page )
+ stub_va = alloc_stub_page(cpu, &per_cpu(stubs.mfn, cpu));
+ if ( !stub_va )
goto out;
- per_cpu(stubs.addr, cpu) = stub_page + STUB_BUF_CPU_OFFS(cpu);
+ per_cpu(stubs.addr, cpu) = stub_va;
rc = setup_cpu_root_pgt(cpu);
if ( rc )
--
2.54.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |