Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xen/PVH: Make GDT selectors PVH-specific

We don't need to share PVH GDT layout with other GDTs, especially
since we now have a PVH-speciific entry (for stack canary segment).

Define PVH's own selectors.

(As a side effect of this change we are also fixing improper
reference to __KERNEL_CS)

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Boris Ostrovsky and committed by
Juergen Gross
7f47e1c5 98014068

+13 -10
+13 -10
arch/x86/xen/xen-pvh.S
··· 54 54 * charge of setting up it's own stack, GDT and IDT. 55 55 */ 56 56 57 - #define PVH_GDT_ENTRY_CANARY 4 57 + #define PVH_GDT_ENTRY_CS 1 58 + #define PVH_GDT_ENTRY_DS 2 59 + #define PVH_GDT_ENTRY_CANARY 3 60 + #define PVH_CS_SEL (PVH_GDT_ENTRY_CS * 8) 61 + #define PVH_DS_SEL (PVH_GDT_ENTRY_DS * 8) 58 62 #define PVH_CANARY_SEL (PVH_GDT_ENTRY_CANARY * 8) 59 63 60 64 ENTRY(pvh_start_xen) ··· 66 62 67 63 lgdt (_pa(gdt)) 68 64 69 - mov $(__BOOT_DS),%eax 65 + mov $PVH_DS_SEL,%eax 70 66 mov %eax,%ds 71 67 mov %eax,%es 72 68 mov %eax,%ss ··· 100 96 mov %eax, %cr0 101 97 102 98 /* Jump to 64-bit mode. */ 103 - ljmp $__KERNEL_CS, $_pa(1f) 99 + ljmp $PVH_CS_SEL, $_pa(1f) 104 100 105 101 /* 64-bit entry point. */ 106 102 .code64 ··· 140 136 or $(X86_CR0_PG | X86_CR0_PE), %eax 141 137 mov %eax, %cr0 142 138 143 - ljmp $__BOOT_CS, $1f 139 + ljmp $PVH_CS_SEL, $1f 144 140 1: 145 141 call xen_prepare_pvh 146 142 mov $_pa(pvh_bootparams), %esi 147 143 148 144 /* startup_32 doesn't expect paging and PAE to be on. */ 149 - ljmp $__BOOT_CS, $_pa(2f) 145 + ljmp $PVH_CS_SEL, $_pa(2f) 150 146 2: 151 147 mov %cr0, %eax 152 148 and $~X86_CR0_PG, %eax ··· 155 151 and $~X86_CR4_PAE, %eax 156 152 mov %eax, %cr4 157 153 158 - ljmp $__BOOT_CS, $_pa(startup_32) 154 + ljmp $PVH_CS_SEL, $_pa(startup_32) 159 155 #endif 160 156 END(pvh_start_xen) 161 157 ··· 167 163 .word 0 168 164 gdt_start: 169 165 .quad 0x0000000000000000 /* NULL descriptor */ 170 - .quad 0x0000000000000000 /* reserved */ 171 166 #ifdef CONFIG_X86_64 172 - .quad GDT_ENTRY(0xa09a, 0, 0xfffff) /* __KERNEL_CS */ 167 + .quad GDT_ENTRY(0xa09a, 0, 0xfffff) /* PVH_CS_SEL */ 173 168 #else 174 - .quad GDT_ENTRY(0xc09a, 0, 0xfffff) /* __KERNEL_CS */ 169 + .quad GDT_ENTRY(0xc09a, 0, 0xfffff) /* PVH_CS_SEL */ 175 170 #endif 176 - .quad GDT_ENTRY(0xc092, 0, 0xfffff) /* __KERNEL_DS */ 171 + .quad GDT_ENTRY(0xc092, 0, 0xfffff) /* PVH_DS_SEL */ 177 172 .quad GDT_ENTRY(0x4090, 0, 0x18) /* PVH_CANARY_SEL */ 178 173 gdt_end: 179 174