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: <86802c440806260025v3fc1970aq682b568cccba4b4e@mail.gmail.com>
Date:	Thu, 26 Jun 2008 00:25:47 -0700
From:	"Yinghai Lu" <yhlu.kernel@...il.com>
To:	"Huang, Ying" <ying.huang@...el.com>
Cc:	"H. Peter Anvin" <hpa@...or.com>, andi@...stfloor.org,
	mingo@...hat.com, tglx@...utronix.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] x86 boot: add E820_RESVD_KERN

On Wed, Jun 25, 2008 at 11:32 PM, Huang, Ying <ying.huang@...el.com> wrote:
> This patch add a new type to E820 table named E820_RESVD_KERN, which
> is used for memory area reserved for kernel itself instead of BIOS.
>
> This patch is based on latest x86/master branch of git-x86 tree and
> has been tested on i386 and x86_64 platform.
>
> Signed-off-by: Huang Ying <ying.huang@...el.com>
>
> ---
>  arch/x86/kernel/e820.c |    6 ++++--
>  include/asm-x86/e820.h |    3 +++
>  2 files changed, 7 insertions(+), 2 deletions(-)
>
> --- a/include/asm-x86/e820.h
> +++ b/include/asm-x86/e820.h
> @@ -44,6 +44,9 @@
>  #define E820_ACPI      3
>  #define E820_NVS       4
>
> +/* reserved RAM used by kernel itself */
> +#define E820_RESVD_KERN        128
> +
>  #ifndef __ASSEMBLY__
>  struct e820entry {
>        __u64 addr;     /* start of memory segment */
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -120,6 +120,7 @@ void __init e820_print_map(char *who)
>                       (e820.map[i].addr + e820.map[i].size));
>                switch (e820.map[i].type) {
>                case E820_RAM:
> +               case E820_RESVD_KERN:
>                        printk(KERN_CONT "(usable)\n");
>                        break;
>                case E820_RESERVED:
> @@ -611,7 +612,7 @@ void __init e820_mark_nosave_regions(uns
>                        register_nosave_region(pfn, PFN_UP(ei->addr));
>
>                pfn = PFN_DOWN(ei->addr + ei->size);
> -               if (ei->type != E820_RAM)
> +               if (ei->type != E820_RAM && ei->type != E820_RESVD_KERN)
>                        register_nosave_region(PFN_UP(ei->addr), pfn);
>
>                if (pfn >= limit_pfn)
> @@ -977,7 +978,7 @@ u64 __init early_reserve_e820(u64 startt
>                return 0;
>
>        addr = round_down(start + size - sizet, align);
> -       e820_update_range(addr, sizet, E820_RAM, E820_RESERVED);
> +       e820_update_range(addr, sizet, E820_RAM, E820_RESVD_KERN);

this line is not needed.

>        printk(KERN_INFO "update e820 for early_reserve_e820\n");
>        update_e820();
>
> @@ -1191,6 +1192,7 @@ void __init e820_reserve_resources(void)
>        res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
>        for (i = 0; i < e820.nr_map; i++) {
>                switch (e820.map[i].type) {
> +               case E820_RESVD_KERN:
>                case E820_RAM:  res->name = "System RAM"; break;
>                case E820_ACPI: res->name = "ACPI Tables"; break;
>                case E820_NVS:  res->name = "ACPI Non-volatile Storage"; break;
>
> --

please  move reserve_setup_data() from head.c/head64.c to setup32/64.c
or merged setup.c
also need to change reserve_early in reserve_setup_data to
e820_update_range(,,E820_RAM, E820_RESEVED_EXTRA).
calling reserve_setup_data() should around early_reserve_e820_mpc_new.

we don't need early_res_to_e820.

YH
--
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