]> xenbits.xensource.com Git - xen.git/commitdiff
x86/traps: avoid interleaved writes when updating potentially-live descriptors
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 11 Feb 2015 16:17:38 +0000 (17:17 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Feb 2015 16:17:38 +0000 (17:17 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/include/asm-x86/processor.h

index 2773ea81019cdbff21df49ad506b633e7efa68b2..c5c647a1c4808e675ecae81c959d31b025bdfcb2 100644 (file)
@@ -444,9 +444,12 @@ struct __packed __cacheline_aligned tss_struct {
  * descriptor table entry. */
 static always_inline void set_ist(idt_entry_t *idt, unsigned long ist)
 {
+    idt_entry_t new = *idt;
+
     /* IST is a 3 bit field, 32 bits into the IDT entry. */
     ASSERT(ist <= IST_MAX);
-    idt->a = (idt->a & ~(7UL << 32)) | (ist << 32);
+    new.a = (idt->a & ~(7UL << 32)) | (ist << 32);
+    _write_gate_lower(idt, &new);
 }
 
 #define IDT_ENTRIES 256