Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1532936 > unrolled thread

[PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than E820MAX

Started byAlex Thorlton <athorlton@sgi.com>
First post2016-11-30 04:30 +0100
Last post2016-12-01 19:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than E820MAX Alex Thorlton <athorlton@sgi.com> - 2016-11-30 04:30 +0100
    Re: [PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than  E820MAX Ingo Molnar <mingo@kernel.org> - 2016-11-30 07:30 +0100
      Re: [PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than  E820MAX Alex Thorlton <athorlton@sgi.com> - 2016-12-01 19:40 +0100

#1532936 — [PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than E820MAX

FromAlex Thorlton <athorlton@sgi.com>
Date2016-11-30 04:30 +0100
Subject[PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than E820MAX
Message-ID<sJ3KO-zy-7@gated-at.bofh.it>
It's really not necessary to limit E820_X_MAX to 128 in the non-EFI
case.  This commit drops E820_X_MAX's dependency on CONFIG_EFI, so that
E820_X_MAX is always at least slightly larger than E820MAX.

The real motivation behind this is actually to prevent some issues in
the Xen kernel, where the XENMEM_machine_memory_map hypercall can
produce an e820 map larger than 128 entries, even on systems where the
original e820 table was quite a bit smaller than that, depending on how
many IOAPICs are installed on the system.

Signed-off-by: Alex Thorlton <athorlton@sgi.com>
Suggested-by: Ingo Molnar <mingo@redhat.com>
Cc: Russ Anderson <rja@sgi.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: x86@kernel.org
Cc: xen-devel@lists.xenproject.org
---
 arch/x86/include/asm/e820.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 476b574..aa00d33 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -1,13 +1,15 @@
 #ifndef _ASM_X86_E820_H
 #define _ASM_X86_E820_H
 
-#ifdef CONFIG_EFI
+/*
+ * We need to make sure that E820_X_MAX is defined
+ * before we include uapi/asm/e820.h
+ */
 #include <linux/numa.h>
 #define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES)
-#else	/* ! CONFIG_EFI */
-#define E820_X_MAX E820MAX
-#endif
+
 #include <uapi/asm/e820.h>
+
 #ifndef __ASSEMBLY__
 /* see comment in arch/x86/kernel/e820.c */
 extern struct e820map *e820;
-- 
1.8.5.6

[toc] | [next] | [standalone]


#1533000 — Re: [PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than E820MAX

FromIngo Molnar <mingo@kernel.org>
Date2016-11-30 07:30 +0100
SubjectRe: [PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than E820MAX
Message-ID<sJ6z0-2x2-17@gated-at.bofh.it>
In reply to#1532936
* Alex Thorlton <athorlton@sgi.com> wrote:

> It's really not necessary to limit E820_X_MAX to 128 in the non-EFI
> case.  This commit drops E820_X_MAX's dependency on CONFIG_EFI, so that
> E820_X_MAX is always at least slightly larger than E820MAX.
> 
> The real motivation behind this is actually to prevent some issues in
> the Xen kernel, where the XENMEM_machine_memory_map hypercall can
> produce an e820 map larger than 128 entries, even on systems where the
> original e820 table was quite a bit smaller than that, depending on how
> many IOAPICs are installed on the system.
> 
> Signed-off-by: Alex Thorlton <athorlton@sgi.com>
> Suggested-by: Ingo Molnar <mingo@redhat.com>
> Cc: Russ Anderson <rja@sgi.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Denys Vlasenko <dvlasenk@redhat.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: x86@kernel.org
> Cc: xen-devel@lists.xenproject.org
> ---
>  arch/x86/include/asm/e820.h | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
> index 476b574..aa00d33 100644
> --- a/arch/x86/include/asm/e820.h
> +++ b/arch/x86/include/asm/e820.h
> @@ -1,13 +1,15 @@
>  #ifndef _ASM_X86_E820_H
>  #define _ASM_X86_E820_H
>  
> -#ifdef CONFIG_EFI
> +/*
> + * We need to make sure that E820_X_MAX is defined
> + * before we include uapi/asm/e820.h
> + */
>  #include <linux/numa.h>
>  #define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES)

What we need an explanation for in the comment is what does this stand for (what 
does the 'X' mean?), and what is the magic 3*MAX_NUMNODES about?

Thanks,

	Ingo

[toc] | [prev] | [next] | [standalone]


#1534380 — Re: [PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than E820MAX

FromAlex Thorlton <athorlton@sgi.com>
Date2016-12-01 19:40 +0100
SubjectRe: [PATCH 1/2] x86: Make E820_X_MAX unconditionally larger than E820MAX
Message-ID<sJEr0-8du-35@gated-at.bofh.it>
In reply to#1533000
On Wed, Nov 30, 2016 at 07:21:48AM +0100, Ingo Molnar wrote:
> 
> * Alex Thorlton <athorlton@sgi.com> wrote:
> 
> > It's really not necessary to limit E820_X_MAX to 128 in the non-EFI
> > case.  This commit drops E820_X_MAX's dependency on CONFIG_EFI, so that
> > E820_X_MAX is always at least slightly larger than E820MAX.
> > 
> > The real motivation behind this is actually to prevent some issues in
> > the Xen kernel, where the XENMEM_machine_memory_map hypercall can
> > produce an e820 map larger than 128 entries, even on systems where the
> > original e820 table was quite a bit smaller than that, depending on how
> > many IOAPICs are installed on the system.
> > 
> > Signed-off-by: Alex Thorlton <athorlton@sgi.com>
> > Suggested-by: Ingo Molnar <mingo@redhat.com>
> > Cc: Russ Anderson <rja@sgi.com>
> > Cc: David Vrabel <david.vrabel@citrix.com>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Juergen Gross <jgross@suse.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: "H. Peter Anvin" <hpa@zytor.com>
> > Cc: Denys Vlasenko <dvlasenk@redhat.com>
> > Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> > Cc: x86@kernel.org
> > Cc: xen-devel@lists.xenproject.org
> > ---
> >  arch/x86/include/asm/e820.h | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
> > index 476b574..aa00d33 100644
> > --- a/arch/x86/include/asm/e820.h
> > +++ b/arch/x86/include/asm/e820.h
> > @@ -1,13 +1,15 @@
> >  #ifndef _ASM_X86_E820_H
> >  #define _ASM_X86_E820_H
> >  
> > -#ifdef CONFIG_EFI
> > +/*
> > + * We need to make sure that E820_X_MAX is defined
> > + * before we include uapi/asm/e820.h
> > + */
> >  #include <linux/numa.h>
> >  #define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES)
> 
> What we need an explanation for in the comment is what does this stand for (what 
> does the 'X' mean?), and what is the magic 3*MAX_NUMNODES about?

I'm not actually certain why 3*MAX_NUMNODES was chosen as the max size
for this table, but it was written by somebody here at SGI, so I'm sure
I can find out :)

As for the 'X,' I'm assuming that's meant to imply that this is the
maxmimum size for the 'eXtended' table, but that could be made more
clear in the comment as well.

I'll come up with a better comment for this and submit a v3.

Thanks, Ingo!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web