From c22f60e6e55f1bf300dd76d2222a93911f3b2bb2 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 12 Oct 2023 04:00:49 +0000 Subject: automatic import of xen --- ...16-x86-S3-put-data-sregs-into-known-state.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 5f1a9916-x86-S3-put-data-sregs-into-known-state.patch (limited to '5f1a9916-x86-S3-put-data-sregs-into-known-state.patch') diff --git a/5f1a9916-x86-S3-put-data-sregs-into-known-state.patch b/5f1a9916-x86-S3-put-data-sregs-into-known-state.patch new file mode 100644 index 0000000..c6a0e78 --- /dev/null +++ b/5f1a9916-x86-S3-put-data-sregs-into-known-state.patch @@ -0,0 +1,35 @@ +# Commit 55f8c389d4348cc517946fdcb10794112458e81e +# Date 2020-07-24 10:17:26 +0200 +# Author Jan Beulich +# Committer Jan Beulich +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 +Signed-off-by: Jan Beulich +Reviewed-by: Roger Pau Monné +Reviewed-by: Andrew Cooper + +--- 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 + LOAD_GREG(sp) + ++ 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 -- cgit v1.2.3