lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 21 Mar 2007 03:31:03 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>, Andi Kleen <andi@...stfloor.org>,
	lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] i386 GDT cleanups: Use per-cpu GDT immediately upon boot

Rusty Russell <rusty@...tcorp.com.au> writes:

> Now we are no longer dynamically allocating the GDT, we don't need the
> "cpu_gdt_table" at all: we can switch straight from "boot_gdt_table"
> to the per-cpu GDT.  This means initializing the cpu_gdt array in C.
>
> The boot CPU uses the per-cpu var directly, then in smp_prepare_cpus()
> it switches to the per-cpu copy just allocated.  For secondary CPUs,
> the early_gdt_descr is set to point directly to their per-cpu copy.
>
> For UP the code is very simple: it keeps using the "per-cpu" GDT as
> per SMP, but we never have to move.

> diff -r a8a4e2f9da08 arch/i386/kernel/head.S
> --- a/arch/i386/kernel/head.S	Wed Mar 21 15:20:48 2007 +1100
> +++ b/arch/i386/kernel/head.S	Wed Mar 21 15:32:38 2007 +1100
> @@ -599,67 +599,10 @@ idt_descr:
>  	.word 0				# 32 bit align gdt_desc.address
>  ENTRY(early_gdt_descr)
>  	.word GDT_ENTRIES*8-1
> -	.long cpu_gdt_table
> -
> -/*
> - * The boot_gdt_table must mirror the equivalent in setup.S and is
> - * used only for booting.
> - */

It looks like you are killing a useful comment here for no good reason.

> +	.long per_cpu__cpu_gdt		/* Overwritten for secondary CPUs */
> +
>  	.align L1_CACHE_BYTES
>  ENTRY(boot_gdt_table)
>  	.fill GDT_ENTRY_BOOT_CS,8,0
>  	.quad 0x00cf9a000000ffff	/* kernel 4GB code at 0x00000000 */
>  	.quad 0x00cf92000000ffff	/* kernel 4GB data at 0x00000000 */


Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ