Skip to content

Commit b464b46

Browse files
Jason Andryukjgross1
authored andcommitted
x86/pvh: Set phys_base when calling xen_prepare_pvh()
phys_base needs to be set for __pa() to work in xen_pvh_init() when finding the hypercall page. Set it before calling into xen_prepare_pvh(), which calls xen_pvh_init(). Clear it afterward to avoid __startup_64() adding to it and creating an incorrect value. Signed-off-by: Jason Andryuk <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Message-ID: <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent 1db29f9 commit b464b46

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arch/x86/platform/pvh/head.S

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,20 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
125125
xor %edx, %edx
126126
wrmsr
127127

128+
/*
129+
* Calculate load offset and store in phys_base. __pa() needs
130+
* phys_base set to calculate the hypercall page in xen_pvh_init().
131+
*/
132+
movq %rbp, %rbx
133+
subq $_pa(pvh_start_xen), %rbx
134+
movq %rbx, phys_base(%rip)
128135
call xen_prepare_pvh
136+
/*
137+
* Clear phys_base. __startup_64 will *add* to its value,
138+
* so reset to 0.
139+
*/
140+
xor %rbx, %rbx
141+
movq %rbx, phys_base(%rip)
129142

130143
/* startup_64 expects boot_params in %rsi. */
131144
lea pvh_bootparams(%rip), %rsi

0 commit comments

Comments
 (0)