xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/bigmem: eliminate struct domain address width restriction
@ 2015-08-26  7:41 Jan Beulich
  2015-08-26  8:55 ` Andrew Cooper
  2015-09-01 10:57 ` Ian Campbell
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2015-08-26  7:41 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

PDX-es are 64 bits wide in that case, and hence no limit needs to be
enforced.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -204,6 +204,7 @@ smap_check_policy_t smap_policy_change(s
     return old_policy;
 }
 
+#ifndef CONFIG_BIGMEM
 /*
  * The hole may be at or above the 44-bit boundary, so we need to determine
  * the total bit count until reaching 32 significant (not squashed out) bits
@@ -225,10 +226,12 @@ static unsigned int __init noinline _dom
 
     return bits;
 }
+#endif
 
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
+#ifndef CONFIG_BIGMEM
     /*
      * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
@@ -237,12 +240,16 @@ struct domain *alloc_domain_struct(void)
 
     if ( unlikely(!bits) )
          bits = _domain_struct_bits();
+#else
+# define bits 0
+#endif
 
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
     d = alloc_xenheap_pages(0, MEMF_bits(bits));
     if ( d != NULL )
         clear_page(d);
     return d;
+#undef bits
 }
 
 void free_domain_struct(struct domain *d)




[-- Attachment #2: x86-bigmem-no-struct-domain-limit.patch --]
[-- Type: text/plain, Size: 1342 bytes --]

x86/bigmem: eliminate struct domain address width restriction

PDX-es are 64 bits wide in that case, and hence no limit needs to be
enforced.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -204,6 +204,7 @@ smap_check_policy_t smap_policy_change(s
     return old_policy;
 }
 
+#ifndef CONFIG_BIGMEM
 /*
  * The hole may be at or above the 44-bit boundary, so we need to determine
  * the total bit count until reaching 32 significant (not squashed out) bits
@@ -225,10 +226,12 @@ static unsigned int __init noinline _dom
 
     return bits;
 }
+#endif
 
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
+#ifndef CONFIG_BIGMEM
     /*
      * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
@@ -237,12 +240,16 @@ struct domain *alloc_domain_struct(void)
 
     if ( unlikely(!bits) )
          bits = _domain_struct_bits();
+#else
+# define bits 0
+#endif
 
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
     d = alloc_xenheap_pages(0, MEMF_bits(bits));
     if ( d != NULL )
         clear_page(d);
     return d;
+#undef bits
 }
 
 void free_domain_struct(struct domain *d)

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/bigmem: eliminate struct domain address width restriction
  2015-08-26  7:41 [PATCH] x86/bigmem: eliminate struct domain address width restriction Jan Beulich
@ 2015-08-26  8:55 ` Andrew Cooper
  2015-09-01 10:57 ` Ian Campbell
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Cooper @ 2015-08-26  8:55 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Keir Fraser

On 26/08/15 08:41, Jan Beulich wrote:
> PDX-es are 64 bits wide in that case, and hence no limit needs to be
> enforced.
>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/bigmem: eliminate struct domain address width restriction
  2015-08-26  7:41 [PATCH] x86/bigmem: eliminate struct domain address width restriction Jan Beulich
  2015-08-26  8:55 ` Andrew Cooper
@ 2015-09-01 10:57 ` Ian Campbell
  2015-09-01 11:58   ` Jan Beulich
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2015-09-01 10:57 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Andrew Cooper, Keir Fraser

On Wed, 2015-08-26 at 01:41 -0600, Jan Beulich wrote:
> @@ -225,10 +226,12 @@ static unsigned int __init noinline _dom
>  
>      return bits;
>  }
> +#endif
>  
>  struct domain *alloc_domain_struct(void)
>  {
>      struct domain *d;
> +#ifndef CONFIG_BIGMEM
>      /*
>       * We pack the PDX of the domain structure into a 32-bit field 
> within
>       * the page_info structure. Hence the MEMF_bits() restriction.
> @@ -237,12 +240,16 @@ struct domain *alloc_domain_struct(void)
>  
>      if ( unlikely(!bits) )
>           bits = _domain_struct_bits();
> +#else
> +# define bits 0

const unsigned int bits = 0;

Seems nicer than the trailing #undef?

> +#endif
>  
>      BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
>      d = alloc_xenheap_pages(0, MEMF_bits(bits));
>      if ( d != NULL )
>          clear_page(d);
>      return d;
> +#undef bits
>  }
>  
>  void free_domain_struct(struct domain *d)
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/bigmem: eliminate struct domain address width restriction
  2015-09-01 10:57 ` Ian Campbell
@ 2015-09-01 11:58   ` Jan Beulich
  2015-09-01 12:14     ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2015-09-01 11:58 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Andrew Cooper, Keir Fraser, xen-devel

>>> On 01.09.15 at 12:57, <ian.campbell@citrix.com> wrote:
> On Wed, 2015-08-26 at 01:41 -0600, Jan Beulich wrote:
>> @@ -225,10 +226,12 @@ static unsigned int __init noinline _dom
>>  
>>      return bits;
>>  }
>> +#endif
>>  
>>  struct domain *alloc_domain_struct(void)
>>  {
>>      struct domain *d;
>> +#ifndef CONFIG_BIGMEM
>>      /*
>>       * We pack the PDX of the domain structure into a 32-bit field 
>> within
>>       * the page_info structure. Hence the MEMF_bits() restriction.
>> @@ -237,12 +240,16 @@ struct domain *alloc_domain_struct(void)
>>  
>>      if ( unlikely(!bits) )
>>           bits = _domain_struct_bits();
>> +#else
>> +# define bits 0
> 
> const unsigned int bits = 0;
> 
> Seems nicer than the trailing #undef?

Hmm, yes, in cases like this I agree (assuming that all compiler
versions we care about will be intelligent enough to eliminate the
variable).

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/bigmem: eliminate struct domain address width restriction
  2015-09-01 11:58   ` Jan Beulich
@ 2015-09-01 12:14     ` Ian Campbell
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2015-09-01 12:14 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Andrew Cooper, Keir Fraser, xen-devel

On Tue, 2015-09-01 at 05:58 -0600, Jan Beulich wrote:
> > 
> > > > On 01.09.15 at 12:57, <ian.campbell@citrix.com> wrote:
> > On Wed, 2015-08-26 at 01:41 -0600, Jan Beulich wrote:
> > > @@ -225,10 +226,12 @@ static unsigned int __init noinline _dom
> > >  
> > >      return bits;
> > >  }
> > > +#endif
> > >  
> > >  struct domain *alloc_domain_struct(void)
> > >  {
> > >      struct domain *d;
> > > +#ifndef CONFIG_BIGMEM
> > >      /*
> > >       * We pack the PDX of the domain structure into a 32-bit field 
> > > within
> > >       * the page_info structure. Hence the MEMF_bits() restriction.
> > > @@ -237,12 +240,16 @@ struct domain *alloc_domain_struct(void)
> > >  
> > >      if ( unlikely(!bits) )
> > >           bits = _domain_struct_bits();
> > > +#else
> > > +# define bits 0
> > 
> > const unsigned int bits = 0;
> > 
> > Seems nicer than the trailing #undef?
> 
> Hmm, yes, in cases like this I agree (assuming that all compiler
> versions we care about will be intelligent enough to eliminate the
> variable).

Even if it weren't I don't think it would be noticeable in
alloc_domain_struct().

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-01 12:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-26  7:41 [PATCH] x86/bigmem: eliminate struct domain address width restriction Jan Beulich
2015-08-26  8:55 ` Andrew Cooper
2015-09-01 10:57 ` Ian Campbell
2015-09-01 11:58   ` Jan Beulich
2015-09-01 12:14     ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).