public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Bernhard Walle <bwalle@suse.de>
Cc: x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, yhlu.kernel@gmail.com,
	gregkh@suse.de
Subject: Re: [PATCH 1/2] Add /sys/firmware/memmap
Date: Thu, 26 Jun 2008 16:45:11 -0400	[thread overview]
Message-ID: <20080626204511.GF3878@redhat.com> (raw)
In-Reply-To: <1214511542-28458-2-git-send-email-bwalle@suse.de>

On Thu, Jun 26, 2008 at 10:19:01PM +0200, Bernhard Walle wrote:
> This patch adds /sys/firmware/memmap interface that represents the BIOS
> (or Firmware) provided memory map. The tree looks like:
> 
>     /sys/firmware/memmap/0/start   (hex number)
>                            end     (hex number)
>                            type    (string)
>     ...                 /1/start
>                            end
>                            type
> 
> With the following shell snippet one can print the memory map in the same form
> the kernel prints itself when booting on x86 (the E820 map).
> 
>   --------- 8< --------------------------
>     #!/bin/sh
>     cd /sys/firmware/memmap
>     for dir in * ; do
>         start=$(cat $dir/start)
>         end=$(cat $dir/end)
>         type=$(cat $dir/type)
>         printf "%016x-%016x (%s)\n" $start $[ $end +1] "$type"
>     done
>   --------- >8 --------------------------
> 
> That patch only provides the needed interface:
> 
>  1. The sysfs interface.
>  2. The structure and enumeration definition.
>  3. The function firmware_map_add() and firmware_map_add_early()
>     that should be called from architecture code (E820/EFI, for
>     example) to add the contents to the interface.
> 
> If the kernel is compiled without CONFIG_FIRMWARE_MEMMAP, the interface does
> nothing without cluttering the architecture-specific code with #ifdef's.
> 
> The purpose of the new interface is kexec: While /proc/iomem represents
> the *used* memory map (e.g. modified via kernel parameters like 'memmap'
> and 'mem'), the /sys/firmware/memmap tree represents the unmodified memory
> map provided via the firmware. So kexec can:
> 
>  - use the original memory map for rebooting,
>  - use the /proc/iomem for setting up the ELF core headers for kdump
>    case that should only represent the memory of the system.
> 
> The patch has been tested on i386 and x86_64.
> 
> 
> Signed-off-by: Bernhard Walle <bwalle@suse.de>
> ---
>  drivers/firmware/Kconfig     |    8 ++
>  drivers/firmware/Makefile    |    1 +
>  drivers/firmware/memmap.c    |  164 ++++++++++++++++++++++++++++++++++++++++++
>  include/linux/firmware-map.h |   84 +++++++++++++++++++++
>  4 files changed, 257 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/firmware/memmap.c
>  create mode 100644 include/linux/firmware-map.h

I think you also need to introduce some documentation about this new
sysfs interface. Looks like in Documentation/ABI/ somewhere. Greg
can tell more...

Thanks
Vivek

  reply	other threads:[~2008-06-26 20:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26 20:19 x86: Add /sys/firmware/memmap Bernhard Walle
2008-06-26 20:19 ` [PATCH 1/2] " Bernhard Walle
2008-06-26 20:45   ` Vivek Goyal [this message]
2008-06-26 22:24   ` Greg KH
2008-06-27 11:08     ` Bernhard Walle
2008-06-26 20:19 ` [PATCH 2/2] Use FIRMWARE_MEMMAP on x86/E820 Bernhard Walle
2008-06-26 20:54   ` Yinghai Lu
2008-06-27 11:14     ` Bernhard Walle
2008-06-27 18:31       ` Yinghai Lu
  -- strict thread matches above, loose matches on Subject: below --
2008-06-27 11:12 x86: Add /sys/firmware/memmap Bernhard Walle
2008-06-27 11:12 ` [PATCH 1/2] " Bernhard Walle
2008-06-27 18:51   ` Dave Hansen
2008-06-27 20:56   ` Greg KH
2008-07-01 20:30     ` Bernhard Walle
2008-07-01 20:33       ` Ingo Molnar
2008-07-12  0:36   ` Andrew Morton
2008-06-26  8:14 x86: " Bernhard Walle
2008-06-26  8:14 ` [PATCH 1/2] " Bernhard Walle
2008-06-25 19:57 x86: " Bernhard Walle
2008-06-25 19:57 ` [PATCH 1/2] " Bernhard Walle
2008-06-25 22:43   ` Vivek Goyal
2008-06-26  8:13     ` Mikael Pettersson
2008-06-26  8:45       ` Bernhard Walle
2008-06-26  9:11         ` Mikael Pettersson
2008-06-26 18:00           ` H. Peter Anvin
2008-06-26 18:18             ` Vivek Goyal
2008-06-26 19:18               ` H. Peter Anvin
2008-06-26 18:23             ` Bernhard Walle
2008-06-26 12:42       ` Vivek Goyal
2008-06-26  8:15     ` Bernhard Walle

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=20080626204511.GF3878@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=bwalle@suse.de \
    --cc=gregkh@suse.de \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    --cc=yhlu.kernel@gmail.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