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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130107155457.GC29449@x1.alien8.de>
Date:	Mon, 7 Jan 2013 16:54:57 +0100
From:	Borislav Petkov <bp@...en8.de>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
	"H. Peter Anvin" <hpa@...or.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jan Kiszka <jan.kiszka@....de>,
	Jason Wessel <jason.wessel@...driver.com>,
	linux-kernel@...r.kernel.org,
	Jarkko Sakkinen <jarkko.sakkinen@...el.com>
Subject: Re: [PATCH v7u1 07/31] x86, realmode: Separate real_mode reserve and
 setup

On Thu, Jan 03, 2013 at 04:48:27PM -0800, Yinghai Lu wrote:
> After we switch to use #PF handler help to set page table, init_level4_pgt
> will only have entries set after init_mem_mapping.
> We need to move copying init_level4_pgt to trampoline_pgd after that.
> 
> So split reserve and setup, and move the setup after init_mem_mapping()
> 
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
> Cc: Jarkko Sakkinen <jarkko.sakkinen@...el.com>
> ---
>  arch/x86/include/asm/realmode.h |    3 ++-
>  arch/x86/kernel/setup.c         |    4 +++-
>  arch/x86/realmode/init.c        |   30 +++++++++++++++++++-----------
>  3 files changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/x86/include/asm/realmode.h b/arch/x86/include/asm/realmode.h
> index fe1ec5b..9c6b890 100644
> --- a/arch/x86/include/asm/realmode.h
> +++ b/arch/x86/include/asm/realmode.h
> @@ -58,6 +58,7 @@ extern unsigned char boot_gdt[];
>  extern unsigned char secondary_startup_64[];
>  #endif
>  
> -extern void __init setup_real_mode(void);
> +void reserve_real_mode(void);
> +void setup_real_mode(void);
>  
>  #endif /* _ARCH_X86_REALMODE_H */
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index 81ea5a5..01b22d0 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -913,10 +913,12 @@ void __init setup_arch(char **cmdline_p)
>  	printk(KERN_DEBUG "initial memory mapped: [mem 0x00000000-%#010lx]\n",
>  			(max_pfn_mapped<<PAGE_SHIFT) - 1);
>  
> -	setup_real_mode();
> +	reserve_real_mode();
>  
>  	init_mem_mapping();
>  
> +	setup_real_mode();
> +
>  	memblock.current_limit = get_max_mapped();
>  	dma_contiguous_reserve(0);
>  
> diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c
> index 384b3f4..3baae96 100644
> --- a/arch/x86/realmode/init.c
> +++ b/arch/x86/realmode/init.c
> @@ -8,9 +8,26 @@
>  struct real_mode_header *real_mode_header;
>  u32 *trampoline_cr4_features;
>  
> -void __init setup_real_mode(void)
> +void __init reserve_real_mode(void)
>  {
>  	phys_addr_t mem;
> +	unsigned char *base;
> +	size_t size = PAGE_ALIGN(real_mode_blob_end - real_mode_blob);
> +
> +	/* Has to be in very low memory so we can execute real-mode AP code. */

While we're at it, can we change the comment to say "has to be in the
first megabyte..." to be more precise. "very low" is not very telling
:-).

Thanks.

-- 
Regards/Gruss,
Boris.
--
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