]> Git Repo - linux.git/commitdiff
x86/pvh: Set phys_base when calling xen_prepare_pvh()
authorJason Andryuk <[email protected]>
Fri, 23 Aug 2024 19:36:28 +0000 (15:36 -0400)
committerJuergen Gross <[email protected]>
Wed, 25 Sep 2024 12:15:11 +0000 (14:15 +0200)
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: <20240823193630.2583107[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
arch/x86/platform/pvh/head.S

index ba4d0eab443662bb9faf3cac0683a74f0ff29ce2..14b4345d9bae8f8e43ff89a57bdc25140e61ad30 100644 (file)
@@ -125,7 +125,20 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
        xor %edx, %edx
        wrmsr
 
+       /*
+        * Calculate load offset and store in phys_base.  __pa() needs
+        * phys_base set to calculate the hypercall page in xen_pvh_init().
+        */
+       movq %rbp, %rbx
+       subq $_pa(pvh_start_xen), %rbx
+       movq %rbx, phys_base(%rip)
        call xen_prepare_pvh
+       /*
+        * Clear phys_base.  __startup_64 will *add* to its value,
+        * so reset to 0.
+        */
+       xor  %rbx, %rbx
+       movq %rbx, phys_base(%rip)
 
        /* startup_64 expects boot_params in %rsi. */
        lea pvh_bootparams(%rip), %rsi
This page took 0.054923 seconds and 4 git commands to generate.