summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorYuntao Wang <ytcoode@gmail.com>2023-08-07 11:45:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 13:58:53 +0300
commit8d75ebf26a2eb09aa4f27e4868b3edd2205724cc (patch)
treeb9b3906e8d991b309e48f0dc5cd0dbb47f850ec7 /arch/x86
parent95846cd88c683876e15edb518483a568629c1804 (diff)
downloadlinux-8d75ebf26a2eb09aa4f27e4868b3edd2205724cc.tar.xz
x86/boot: Fix incorrect startup_gdt_descr.size
[ Upstream commit 001470fed5959d01faecbd57fcf2f60294da0de1 ] Since the size value is added to the base address to yield the last valid byte address of the GDT, the current size value of startup_gdt_descr is incorrect (too large by one), fix it. [ mingo: This probably never mattered, because startup_gdt[] is only used in a very controlled fashion - but make it consistent nevertheless. ] Fixes: 866b556efa12 ("x86/head/64: Install startup GDT") Signed-off-by: Yuntao Wang <ytcoode@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Link: https://lore.kernel.org/r/20230807084547.217390-1-ytcoode@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/head64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 49f7629b17f7..bbc21798df10 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -80,7 +80,7 @@ static struct desc_struct startup_gdt[GDT_ENTRIES] = {
* while the kernel still uses a direct mapping.
*/
static struct desc_ptr startup_gdt_descr = {
- .size = sizeof(startup_gdt),
+ .size = sizeof(startup_gdt)-1,
.address = 0,
};