[tip:x86/boot] x86/boot: Make the GDT 8-byte aligned

From: tip-bot for Xiaoyao Li
Date: Thu Jun 27 2019 - 05:02:25 EST


Commit-ID: 2238246ff8d533a5f2327d1f953375876d8a013c
Gitweb: https://git.kernel.org/tip/2238246ff8d533a5f2327d1f953375876d8a013c
Author: Xiaoyao Li <xiaoyao.li@xxxxxxxxxxxxxxx>
AuthorDate: Thu, 27 Jun 2019 12:55:25 +0800
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitDate: Thu, 27 Jun 2019 10:56:11 +0200

x86/boot: Make the GDT 8-byte aligned

The segment descriptors are loaded with an implicitly LOCK-ed instruction,
which could trigger the split lock #AC exception if the variable is not
properly aligned and crosses a cache line.

Align the GDT properly so the descriptors are all 8 byte aligned.

Signed-off-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx>
Link: https://lkml.kernel.org/r/20190627045525.105266-1-xiaoyao.li@xxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
arch/x86/boot/compressed/head_64.S | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index fafb75c6c592..6233ae35d0d9 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -659,6 +659,7 @@ no_longmode:
gdt64:
.word gdt_end - gdt
.quad 0
+ .balign 8
gdt:
.word gdt_end - gdt
.long gdt