Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Bernhard Walle <bwalle@suse.de>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH 2/3] Remove redundancy between get_memory_ranges_proc_iomem() and get_memory_ranges_sysfs()
Date: Wed, 9 Jul 2008 10:41:39 +1000	[thread overview]
Message-ID: <20080709004138.GD13710@verge.net.au> (raw)
In-Reply-To: <1215441822-13820-3-git-send-email-bwalle@suse.de>

On Mon, Jul 07, 2008 at 04:43:41PM +0200, Bernhard Walle wrote:
> With the previous patch, we have a duplication between that both functions
> for following tasks:
> 
>  - don't report the interrupt table as RAM,
>  - set the mem_min and mem_max limits for kdump.
> 
> This patch removes that redundancy into the function get_memory_ranges()
> that calls both functions internally.

Hi Bernhard,

these patches seem fine to me, but I am still having minor troubles
with missing defines. For the record, I am seeing the problems with
gcc-3.4.5 + glibc-2.3.6. Yes, I know this is old, but it would
be nice if this minor issue didn't break it.

1. The snippet below looks good, but it needs to be included
   in or berfore " [PATCH 1/3] Parse /sys/firmware/memmap".

> diff --git a/kexec/firmware_memmap.c b/kexec/firmware_memmap.c
> index cdac6f3..2ad450d 100644
> --- a/kexec/firmware_memmap.c
> +++ b/kexec/firmware_memmap.c
> @@ -31,6 +31,13 @@
>  #include "firmware_memmap.h"
>  #include "kexec.h"
>  
> +/*
> + * If the system is too old for ULLONG_MAX, define it here.
> + */
> +#ifndef ULLONG_MAX
> +#    define ULLONG_MAX (~0ULL)
> +#endif
> +
>  /**
>   * The full path to the sysfs interface that provides the memory map.
>   */

2. I did not realise this at the time that I sent my previous response,
   but LLONG_MAX is also a problem. I believe that the following
   code, based on your code above, fixes the problem.

/*
 * If the system is too old for LLONG_MAX, define it here.
 */
#ifndef LLONG_MAX
#define LLONG_MAX     (~0ULL >> 1)
#endif

I have verified on i386 using gcc-3.4.5 + glibc-2.3.6 and gcc-4.3.1 +
glibc-2.7 that this value is 9223372036854775807 (=2^63-1), which is
what the latter provides as LLONG_MAX.

Just for good measure, I have also verified, using the same method, that
your code gives 18446744073709551615 (=2^64-1), which matches the value
internally provided by gcc-4.3.1 + glibc-2.7.

-- 
Horms


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2008-07-09  0:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06 23:06 Use /sys/firmware/memmap in kexec Bernhard Walle
2008-07-06 23:06 ` [PATCH 1/5] Remove trailing whitespace Bernhard Walle
2008-07-07  7:02   ` Simon Horman
2008-07-06 23:06 ` [PATCH 2/5] Fix compiler warning in kexec-x86.c Bernhard Walle
2008-07-07  7:03   ` Simon Horman
2008-07-06 23:06 ` [PATCH 3/5] Parse /sys/firmware/memmap Bernhard Walle
2008-07-07  7:06   ` Simon Horman
2008-07-07 14:43     ` Bernhard Walle
2008-07-07 14:43     ` [PATCH 1/3] " Bernhard Walle
2008-07-07 14:43     ` [PATCH 2/3] Remove redundancy between get_memory_ranges_proc_iomem() and get_memory_ranges_sysfs() Bernhard Walle
2008-07-09  0:41       ` Simon Horman [this message]
2008-07-09 11:10         ` Parse /sys/firmware/memmap Bernhard Walle
2008-07-09 11:11         ` [PATCH 1/3] " Bernhard Walle
2008-07-10 23:29           ` Simon Horman
2008-07-09 11:11         ` [PATCH 2/3] Remove redundancy between get_memory_ranges_proc_iomem() and get_memory_ranges_sysfs() Bernhard Walle
2008-07-09 11:11         ` [PATCH 3/3] Use get_memory_ranges() on x86-64 Bernhard Walle
2008-07-09 11:12         ` [PATCH 2/3] Remove redundancy between get_memory_ranges_proc_iomem() and get_memory_ranges_sysfs() Bernhard Walle
     [not found]           ` <20080710232834.GG11227@verge.net.au>
2008-07-11 15:09             ` Bernhard Walle
2008-07-07 14:43     ` [PATCH 3/3] Use get_memory_ranges() on x86-64 Bernhard Walle
2008-07-06 23:06 ` [PATCH 4/5] Remove redundancy between get_memory_ranges_proc_iomem() and get_memory_ranges_sysfs() Bernhard Walle
2008-07-06 23:06 ` [PATCH 5/5] Use get_memory_ranges() on x86-64 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=20080709004138.GD13710@verge.net.au \
    --to=horms@verge.net.au \
    --cc=bwalle@suse.de \
    --cc=kexec@lists.infradead.org \
    /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