Patch "x86/pvh: Set phys_base when calling xen_prepare_pvh()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/pvh: Set phys_base when calling xen_prepare_pvh()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-pvh-set-phys_base-when-calling-xen_prepare_pvh.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b52836e5679e1aa967c015806956b70a9562548d
Author: Jason Andryuk <jason.andryuk@xxxxxxx>
Date:   Fri Aug 23 15:36:28 2024 -0400

    x86/pvh: Set phys_base when calling xen_prepare_pvh()
    
    [ Upstream commit b464b461d27d564125db760938643374864c1b1f ]
    
    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 <jason.andryuk@xxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    Message-ID: <20240823193630.2583107-4-jason.andryuk@xxxxxxx>
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Stable-dep-of: e8fbc0d9cab6 ("x86/pvh: Call C code via the kernel virtual mapping")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
index 72c1e42d121df..af6195d230b86 100644
--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -99,7 +99,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. */
 	mov $_pa(pvh_bootparams), %rsi




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux