[kvm-unit-tests PATCH v2 2/4] Specify %cs for exception_handler iret

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

 



The exception handler longjmp should happen in the code segment of the
exception handler rather than in the code segment of the exception
(particularly when the exception occurs in compatibility mode).

Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
---
 lib/x86/desc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/x86/desc.c b/lib/x86/desc.c
index 830c5d127dbc..fc6a67eb0a19 100644
--- a/lib/x86/desc.c
+++ b/lib/x86/desc.c
@@ -388,6 +388,7 @@ static void exception_handler(struct ex_regs *regs)
 	/* longjmp must happen after iret, so do not do it now.  */
 	exception = true;
 	regs->rip = (unsigned long)&exception_handler_longjmp;
+	regs->cs = read_cs();
 }
 
 bool test_for_exception(unsigned int ex, void (*trigger_func)(void *data),
-- 
2.13.2.725.g09c95d1e9-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux