x86/traps: avoid interleaved writes when updating potentially-live descriptors

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Andrew Cooper authored and Jan Beulich committed 2015-02-11 17:17:38 +01:00
1 parent d3eb16b8a7
commit 52956401df
1 file changed
+4 -1
+4 -1
View 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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.