mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	andi@firstfloor.org, mingo@redhat.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] x86 boot: early_res_to_e820
Date: Thu, 26 Jun 2008 00:13:29 -0700	[thread overview]
Message-ID: <86802c440806260013u447d15d8v94df7bb7bd00da19@mail.gmail.com> (raw)
In-Reply-To: <1214461980.10809.7.camel@caritas-dev.intel.com>

On Wed, Jun 25, 2008 at 11:33 PM, Huang, Ying <ying.huang@intel.com> wrote:
> This patch reserves some memory areas of early_res in E820 as
> E820_RESVD_KERN. This is used mainly on i386, for some memory area
> from boot-loader and in highmem, such as linked list of setup_data,
> EFI memory map, etc.
>
> 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@intel.com>
>
> ---
>  arch/x86/kernel/e820.c     |   22 ++++++++++++++++++++++
>  arch/x86/kernel/setup_32.c |    2 ++
>  include/asm-x86/e820.h     |    1 +
>  3 files changed, 25 insertions(+)
>
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -844,6 +844,28 @@ void __init early_res_to_bootmem(u64 sta
>        }
>  }
>
> +void __init early_res_to_e820(u64 start, u64 end)
> +{
> +       int i, changed = 0;
> +       u64 final_start, final_end;
> +       for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
> +               struct early_res *r = &early_res[i];
> +               final_start = max(start, r->start);
> +               final_end = min(end, r->end);
> +               if (final_start >= final_end)
> +                       continue;
> +               printk(KERN_INFO "  early res: %d [%llx-%llx] %s\n", i,
> +                       final_start, final_end - 1, r->name);
> +               e820_update_range(final_start, final_end - final_start,
> +                                 E820_RAM, E820_RESVD_KERN);
> +               changed = 1;
> +       }
> +       if (changed) {
> +               printk(KERN_INFO "update e820 for early_res\n");
> +               update_e820();
> +       }
> +}
> +
>  /* Check for already reserved areas */
>  static inline int __init bad_addr(u64 *addrp, u64 size, u64 align)
>  {
> --- a/include/asm-x86/e820.h
> +++ b/include/asm-x86/e820.h
> @@ -96,6 +96,7 @@ extern void reserve_early(u64 start, u64
>  extern void reserve_early_overlap_ok(u64 start, u64 end, char *name);
>  extern void free_early(u64 start, u64 end);
>  extern void early_res_to_bootmem(u64 start, u64 end);
> +extern void early_res_to_e820(u64 start, u64 end);
>  extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align);
>
>  extern unsigned long e820_end_of_ram(void);
> --- a/arch/x86/kernel/setup_32.c
> +++ b/arch/x86/kernel/setup_32.c
> @@ -447,6 +447,8 @@ void __init setup_arch(char **cmdline_p)
>         acpi_numa_init();
>  #endif
>
> +       early_res_to_e820(max_low_pfn<<PAGE_SHIFT, -1);
> +
>        initmem_init(0, max_pfn);
>
>  #ifdef CONFIG_ACPI_SLEEP
>
> --

this one is not needed.

YH

  reply	other threads:[~2008-06-26  7:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26  6:33 Huang, Ying
2008-06-26  7:13 ` Yinghai Lu [this message]
2008-06-26  7:27   ` Huang, Ying
2008-06-26  7:29     ` Yinghai Lu
2008-06-26  8:03       ` Huang, Ying
2008-06-26  9:43         ` Yinghai Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86802c440806260013u447d15d8v94df7bb7bd00da19@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®