WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86/EFI: fix interrupt and fault handling

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86/EFI: fix interrupt and fault handling during runtime services calls
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 08 Jul 2011 06:22:27 +0100
Delivery-date: Thu, 07 Jul 2011 22:27:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1309549303 -3600
# Node ID 7631c461132000979f05759705c055eb3c975c0b
# Parent  335e96664589dd14dfce7ef72e3fee71ad9c39e3
x86/EFI: fix interrupt and fault handling during runtime services calls

The missing piece was the setting up of an accessible GDT prior to
switching page tables (and reverting to the original setting after
having established the normal page tables again afterwards).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---


diff -r 335e96664589 -r 7631c4611320 xen/arch/x86/efi/runtime.c
--- a/xen/arch/x86/efi/runtime.c        Fri Jul 01 20:31:18 2011 +0100
+++ b/xen/arch/x86/efi/runtime.c        Fri Jul 01 20:41:43 2011 +0100
@@ -44,6 +44,17 @@
     /* prevent fixup_page_fault() from doing anything */
     irq_enter();
 
+    if ( !is_hvm_vcpu(current) && !is_idle_vcpu(current) )
+    {
+        struct desc_ptr gdt_desc = {
+            .limit = LAST_RESERVED_GDT_BYTE,
+            .base  = (unsigned long)(per_cpu(gdt_table, smp_processor_id()) -
+                                     FIRST_RESERVED_GDT_ENTRY)
+        };
+
+        asm volatile ( "lgdt %0" : : "m" (gdt_desc) );
+    }
+
     write_cr3(virt_to_maddr(efi_l4_pgtable));
 
     return cr3;
@@ -52,6 +63,15 @@
 void efi_rs_leave(unsigned long cr3)
 {
     write_cr3(cr3);
+    if ( !is_hvm_vcpu(current) && !is_idle_vcpu(current) )
+    {
+        struct desc_ptr gdt_desc = {
+            .limit = LAST_RESERVED_GDT_BYTE,
+            .base  = GDT_VIRT_START(current)
+        };
+
+        asm volatile ( "lgdt %0" : : "m" (gdt_desc) );
+    }
     irq_exit();
     spin_unlock(&efi_rs_lock);
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86/EFI: fix interrupt and fault handling during runtime services calls, Xen patchbot-unstable <=