|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] x86/boot: Further minor GDT corrections
commit ec92fcd1d089855a170b77c98055e1e49592aa5b
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Aug 19 13:18:06 2019 +0100
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Aug 28 19:41:29 2019 +0100
x86/boot: Further minor GDT corrections
gdt_boot_descr and gdt_48 disagree on how long trampoline_gdt is.
Introduce an end label for each GDT and have the linker calculate their
size,
rather than hard coding it.
Also, just as with c/s af292b41e9, there is no point forcing the CPU to set
Access bits. Fix all affected GDTs.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/arch/x86/boot/head.S | 2 +-
xen/arch/x86/boot/trampoline.S | 15 ++++++++-------
xen/arch/x86/x86_64/kexec_reloc.S | 7 ++++---
3 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 26b680521d..a1564b520b 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -129,7 +129,7 @@ multiboot2_header:
.word 0
gdt_boot_descr:
- .word 7*8-1
+ .word .Ltrampoline_gdt_end - trampoline_gdt - 1
gdt_boot_base:
.long sym_offs(trampoline_gdt)
.long 0 /* Needed for 64-bit lgdt */
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 7c6a2328d2..e98db7e3cc 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -63,22 +63,23 @@ trampoline_gdt:
/* 0x0000: unused */
.quad 0x0000000000000000
/* 0x0008: ring 0 code, 32-bit mode */
- .quad 0x00cf9a000000ffff
+ .quad 0x00cf9b000000ffff
/* 0x0010: ring 0 code, 64-bit mode */
- .quad 0x00af9a000000ffff
+ .quad 0x00af9b000000ffff
/* 0x0018: ring 0 data */
- .quad 0x00cf92000000ffff
+ .quad 0x00cf93000000ffff
/* 0x0020: real-mode code @ BOOT_TRAMPOLINE */
.long 0x0000ffff
- .long 0x00009a00
+ .long 0x00009b00
/* 0x0028: real-mode data @ BOOT_TRAMPOLINE */
.long 0x0000ffff
- .long 0x00009200
+ .long 0x00009300
/*
* 0x0030: ring 0 Xen data, 16 MiB size, base
* address is computed at runtime.
*/
- .quad 0x00c0920000000fff
+ .quad 0x00c0930000000fff
+.Ltrampoline_gdt_end:
.pushsection .trampoline_rel, "a"
.long trampoline_gdt + BOOT_PSEUDORM_CS + 2 - .
@@ -182,7 +183,7 @@ start64:
.word 0
idt_48: .word 0, 0, 0 # base = limit = 0
.word 0
-gdt_48: .word 6*8-1
+gdt_48: .word .Ltrampoline_gdt_end - trampoline_gdt - 1
.long bootsym_rel(trampoline_gdt,4)
/* The first page of trampoline is permanent, the rest boot-time only. */
diff --git a/xen/arch/x86/x86_64/kexec_reloc.S
b/xen/arch/x86/x86_64/kexec_reloc.S
index 5bf61d5c2d..d488d127cf 100644
--- a/xen/arch/x86/x86_64/kexec_reloc.S
+++ b/xen/arch/x86/x86_64/kexec_reloc.S
@@ -176,14 +176,15 @@ compatibility_mode_far:
.word 0x0010
compat_mode_gdt_desc:
- .word (3*8)-1
+ .word .Lcompat_mode_gdt_end - compat_mode_gdt -1
.quad 0x0000000000000000 /* set in call_32_bit above */
.align 8
compat_mode_gdt:
.quad 0x0000000000000000 /* null */
- .quad 0x00cf92000000ffff /* 0x0008 ring 0 data */
- .quad 0x00cf9a000000ffff /* 0x0010 ring 0 code, compatibility */
+ .quad 0x00cf93000000ffff /* 0x0008 ring 0 data */
+ .quad 0x00cf9b000000ffff /* 0x0010 ring 0 code, compatibility */
+.Lcompat_mode_gdt_end:
compat_mode_idt:
.word 0 /* limit */
--
generated by git-patchbot for /home/xen/git/xen.git#staging
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |