Skip to content

Commit bc90aef

Browse files
vegardingomolnar
authored andcommitted
x86/asm: Add DB flag to 32-bit percpu GDT entry
The D/B size flag for the 32-bit percpu GDT entry was not set. The Intel manual (vol 3, section 3.4.5) only specifies the meaning of this flag for three cases: 1) code segments used for %cs -- doesn't apply here 2) stack segments used for %ss -- doesn't apply 3) expand-down data segments -- but we don't have the expand-down flag set, so it also doesn't apply here The flag likely doesn't do anything here, although the manual does also say: "This flag should always be set to 1 for 32-bit code and data segments [...]" so we should probably do it anyway. Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/20231219151200.2878271-6-vegard.nossum@oracle.com
1 parent 3b184b7 commit bc90aef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/kernel/setup_percpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void __init pcpu_populate_pte(unsigned long addr)
106106
static inline void setup_percpu_segment(int cpu)
107107
{
108108
#ifdef CONFIG_X86_32
109-
struct desc_struct d = GDT_ENTRY_INIT(DESC_DATA32 & ~_DESC_DB,
109+
struct desc_struct d = GDT_ENTRY_INIT(DESC_DATA32,
110110
per_cpu_offset(cpu), 0xFFFFF);
111111

112112
write_gdt_entry(get_cpu_gdt_rw(cpu), GDT_ENTRY_PERCPU, &d, DESCTYPE_S);

0 commit comments

Comments
 (0)