mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
x86/traps: avoid interleaved writes when updating potentially-live descriptors
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
d3eb16b8a7
commit
52956401df
1 file changed
+4
-1
@@ -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
|
||||
|
||||