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

[xen staging-4.13] x86/S3: put data segment registers into known state upon resume

commit e9e72fb1579d6b81c0bddb5e2c16ee6a34f801b2
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Aug 7 17:21:28 2020 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Aug 7 17:21:28 2020 +0200

    x86/S3: put data segment registers into known state upon resume
    wakeup_32 sets %ds and %es to BOOT_DS, while leaving %fs at what
    wakeup_start did set it to, and %gs at whatever BIOS did load into it.
    All of this may end up confusing the first load_segments() to run on
    the BSP after resume, in particular allowing a non-nul selector value
    to be left in %fs.
    Alongside %ss, also put all other data segment registers into the same
    state that the boot and CPU bringup paths put them in.
    Reported-by: M. Vefa Bicakci <m.v.b@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 55f8c389d4348cc517946fdcb10794112458e81e
    master date: 2020-07-24 10:17:26 +0200
 xen/arch/x86/acpi/wakeup_prot.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 74261cb4f1..15c22e597e 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -66,6 +66,12 @@ ENTRY(__ret_point)
         mov     REF(saved_ss), %ss
+        mov     $__HYPERVISOR_DS64, %eax
+        mov     %eax, %ds
+        mov     %eax, %es
+        mov     %eax, %fs
+        mov     %eax, %gs
         /* Reload code selector */
         pushq   $__HYPERVISOR_CS
         leaq    1f(%rip),%rax
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.