x86/desc: Drop __HYPERVISOR_CS32
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 9 Aug 2019 12:25:10 +0000 (13:25 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 12 Aug 2019 10:19:05 +0000 (11:19 +0100)
Xen, being 64bit only these days, does not use a 32bit Ring 0 code segment.

Delete __HYPERVISOR_CS32 and remove it from the GDTs.  Also delete
__HYPERVISOR_CS64 and use __HYPERVISOR_CS uniformly.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/wakeup_prot.S
xen/arch/x86/boot/x86_64.S
xen/arch/x86/desc.c
xen/include/asm-x86/config.h
xen/include/asm-x86/desc.h

index 4a926274366f4692448d5db7dbd23fd4ee67b98c..9e9fcc1ab63357637479fbda70247f819e03f331 100644 (file)
@@ -74,7 +74,7 @@ ENTRY(__ret_point)
         LOAD_GREG(sp)
 
         /* Reload code selector */
-        pushq   $(__HYPERVISOR_CS64)
+        pushq   $__HYPERVISOR_CS
         leaq    1f(%rip),%rax
         pushq   %rax
         lretq
index f762dfea11804cf27a9db9447a786e9ba2ce1294..5ab24d73fc8ebccebe1848c62ade89c569b8fb23 100644 (file)
@@ -23,7 +23,7 @@ ENTRY(__high_start)
         popf
 
         /* Reload code selector. */
-        pushq   $(__HYPERVISOR_CS64)
+        pushq   $__HYPERVISOR_CS
         leaq    1f(%rip),%rax
         pushq   %rax
         lretq
index 308aabe7d63099e9fe413cff3a3145f76065a9bd..42ccdc2f8c01925e02c71d205a1d11520f3a58d5 100644 (file)
@@ -31,7 +31,7 @@ __section(".data.page_aligned") __aligned(PAGE_SIZE)
 seg_desc_t boot_gdt[PAGE_SIZE / sizeof(seg_desc_t)] =
 {
     /* 0xe008 - Ring 0 code, 64bit mode */
-    [SEL2GDT(__HYPERVISOR_CS64)] =    { 0x00af9b000000ffff },
+    [SEL2GDT(__HYPERVISOR_CS)] =      { 0x00af9b000000ffff },
 
     /* 0xe010 - Ring 0 data */
     [SEL2GDT(__HYPERVISOR_DS32)] =    { 0x00cf93000000ffff },
@@ -47,9 +47,7 @@ seg_desc_t boot_gdt[PAGE_SIZE / sizeof(seg_desc_t)] =
     /* 0xe033 - Ring 3 code, 64-bit mode */
     [SEL2GDT(FLAT_RING3_CS64)] =      { 0x00affb000000ffff },
 
-    /* 0xe038 - Ring 0 code, compatibility */
-    [SEL2GDT(__HYPERVISOR_CS32)] =    { 0x00cf9b000000ffff },
-
+    /* 0xe038 - reserved */
     /* 0xe040 - TSS */
     /* 0xe050 - LDT */
 
@@ -61,7 +59,7 @@ __section(".data.page_aligned") __aligned(PAGE_SIZE)
 seg_desc_t boot_compat_gdt[PAGE_SIZE / sizeof(seg_desc_t)] =
 {
     /* 0xe008 - Ring 0 code, 64bit mode */
-    [SEL2GDT(__HYPERVISOR_CS64)] =    { 0x00af9b000000ffff },
+    [SEL2GDT(__HYPERVISOR_CS)] =      { 0x00af9b000000ffff },
 
     /* 0xe010 - Ring 0 data */
     [SEL2GDT(__HYPERVISOR_DS32)] =    { 0x00cf93000000ffff },
@@ -78,9 +76,7 @@ seg_desc_t boot_compat_gdt[PAGE_SIZE / sizeof(seg_desc_t)] =
     /* 0xe033 - Ring 3 data */
     [SEL2GDT(FLAT_COMPAT_RING3_DS)] = { 0x00cff3000000ffff },
 
-    /* 0xe038 - Ring 0 code, compatibility */
-    [SEL2GDT(__HYPERVISOR_CS32)] =    { 0x00cf9b000000ffff },
-
+    /* 0xe038 - reserved */
     /* 0xe040 - TSS */
     /* 0xe050 - LDT */
 
index 6e4f28d9348ff0dc3f4c98effdf8084bc9e5917d..22dc795eea6f1d9613d6b15557fa8fd8cde3eb8b 100644 (file)
@@ -264,9 +264,7 @@ extern unsigned char boot_edid_info[128];
 
 #endif
 
-#define __HYPERVISOR_CS64 0xe008
-#define __HYPERVISOR_CS32 0xe038
-#define __HYPERVISOR_CS   __HYPERVISOR_CS64
+#define __HYPERVISOR_CS   0xe008
 #define __HYPERVISOR_DS64 0x0000
 #define __HYPERVISOR_DS32 0xe010
 #define __HYPERVISOR_DS   __HYPERVISOR_DS64
index b7e62ac2a4ee3f3398f91f026fae3c66d9311e03..603b9a901382a58ed2545b692fd2119584beb542 100644 (file)
@@ -155,7 +155,7 @@ do {                                                     \
         ((unsigned long)(dpl) << 45) |                   \
         ((unsigned long)(type) << 40) |                  \
         ((unsigned long)(addr) & 0xFFFFUL) |             \
-        ((unsigned long)__HYPERVISOR_CS64 << 16) |       \
+        ((unsigned long)__HYPERVISOR_CS << 16) |         \
         (1UL << 47);                                     \
 } while (0)
 
@@ -169,7 +169,7 @@ static inline void _set_gate_lower(idt_entry_t *gate, unsigned long type,
         ((unsigned long)(dpl) << 45) |
         ((unsigned long)(type) << 40) |
         ((unsigned long)(addr) & 0xFFFFUL) |
-        ((unsigned long)__HYPERVISOR_CS64 << 16) |
+        ((unsigned long)__HYPERVISOR_CS << 16) |
         (1UL << 47);
     _write_gate_lower(gate, &idte);
 }