public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: correct size of level2_kernel_pgt
@ 2010-10-29 15:56 Ian Campbell
  2010-10-29 16:18 ` Jeremy Fitzhardinge
  2010-10-29 17:22 ` Jeremy Fitzhardinge
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Campbell @ 2010-10-29 15:56 UTC (permalink / raw)
  To: xen-devel, linux-kernel; +Cc: Ian Campbell, Jeremy Fitzhardinge

sizeof(pmd_t *) is 4 bytes on PAE leading to an allocation of only
2048 bytes. The correct size is sizeof(pmd_t) giving us a full page
allocation.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
---

Applies to mainline since 2.6.36 and to xen.git 2.6.32 based trees

 arch/x86/xen/mmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index c237b81..21ed8d7 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2126,7 +2126,7 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
 {
 	pmd_t *kernel_pmd;
 
-	level2_kernel_pgt = extend_brk(sizeof(pmd_t *) * PTRS_PER_PMD, PAGE_SIZE);
+	level2_kernel_pgt = extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE);
 
 	max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
 				  xen_start_info->nr_pt_frames * PAGE_SIZE +
-- 
1.5.6.5


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

* Re: [PATCH] xen: correct size of level2_kernel_pgt
  2010-10-29 15:56 [PATCH] xen: correct size of level2_kernel_pgt Ian Campbell
@ 2010-10-29 16:18 ` Jeremy Fitzhardinge
  2010-10-29 17:22 ` Jeremy Fitzhardinge
  1 sibling, 0 replies; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2010-10-29 16:18 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, linux-kernel

 On 10/29/2010 08:56 AM, Ian Campbell wrote:
> sizeof(pmd_t *) is 4 bytes on PAE leading to an allocation of only
> 2048 bytes. The correct size is sizeof(pmd_t) giving us a full page
> allocation.

Oooooh.  Nasty.

    J
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> ---
>
> Applies to mainline since 2.6.36 and to xen.git 2.6.32 based trees
>
>  arch/x86/xen/mmu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index c237b81..21ed8d7 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -2126,7 +2126,7 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
>  {
>  	pmd_t *kernel_pmd;
>  
> -	level2_kernel_pgt = extend_brk(sizeof(pmd_t *) * PTRS_PER_PMD, PAGE_SIZE);
> +	level2_kernel_pgt = extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE);
>  
>  	max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
>  				  xen_start_info->nr_pt_frames * PAGE_SIZE +


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

* Re: [PATCH] xen: correct size of level2_kernel_pgt
  2010-10-29 15:56 [PATCH] xen: correct size of level2_kernel_pgt Ian Campbell
  2010-10-29 16:18 ` Jeremy Fitzhardinge
@ 2010-10-29 17:22 ` Jeremy Fitzhardinge
  2010-10-29 17:37   ` Ian Campbell
  1 sibling, 1 reply; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2010-10-29 17:22 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, linux-kernel

 On 10/29/2010 08:56 AM, Ian Campbell wrote:
> sizeof(pmd_t *) is 4 bytes on PAE leading to an allocation of only
> 2048 bytes. The correct size is sizeof(pmd_t) giving us a full page
> allocation.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> ---
>
> Applies to mainline since 2.6.36 and to xen.git 2.6.32 based trees

This is just for 2.6.37?

    J

>  arch/x86/xen/mmu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index c237b81..21ed8d7 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -2126,7 +2126,7 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
>  {
>  	pmd_t *kernel_pmd;
>  
> -	level2_kernel_pgt = extend_brk(sizeof(pmd_t *) * PTRS_PER_PMD, PAGE_SIZE);
> +	level2_kernel_pgt = extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE);
>  
>  	max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
>  				  xen_start_info->nr_pt_frames * PAGE_SIZE +


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

* Re: [PATCH] xen: correct size of level2_kernel_pgt
  2010-10-29 17:22 ` Jeremy Fitzhardinge
@ 2010-10-29 17:37   ` Ian Campbell
  2010-10-29 17:45     ` [Xen-devel] " Jeremy Fitzhardinge
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2010-10-29 17:37 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org

On Fri, 2010-10-29 at 18:22 +0100, Jeremy Fitzhardinge wrote:
> On 10/29/2010 08:56 AM, Ian Campbell wrote:
> > sizeof(pmd_t *) is 4 bytes on PAE leading to an allocation of only
> > 2048 bytes. The correct size is sizeof(pmd_t) giving us a full page
> > allocation.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> > ---
> >
> > Applies to mainline since 2.6.36 and to xen.git 2.6.32 based trees
> 
> This is just for 2.6.37?

2.6.36.stable too, I think. I added stable@kernel.org to my patch header
but didn't "guilt refresh" so it didn't show up here.

Ian.

> 
>     J
> 
> >  arch/x86/xen/mmu.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> > index c237b81..21ed8d7 100644
> > --- a/arch/x86/xen/mmu.c
> > +++ b/arch/x86/xen/mmu.c
> > @@ -2126,7 +2126,7 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
> >  {
> >  	pmd_t *kernel_pmd;
> >  
> > -	level2_kernel_pgt = extend_brk(sizeof(pmd_t *) * PTRS_PER_PMD, PAGE_SIZE);
> > +	level2_kernel_pgt = extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE);
> >  
> >  	max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
> >  				  xen_start_info->nr_pt_frames * PAGE_SIZE +
> 



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

* Re: [Xen-devel] Re: [PATCH] xen: correct size of level2_kernel_pgt
  2010-10-29 17:37   ` Ian Campbell
@ 2010-10-29 17:45     ` Jeremy Fitzhardinge
  2010-10-29 17:55       ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2010-10-29 17:45 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org

 On 10/29/2010 10:37 AM, Ian Campbell wrote:
> On Fri, 2010-10-29 at 18:22 +0100, Jeremy Fitzhardinge wrote:
>> On 10/29/2010 08:56 AM, Ian Campbell wrote:
>>> sizeof(pmd_t *) is 4 bytes on PAE leading to an allocation of only
>>> 2048 bytes. The correct size is sizeof(pmd_t) giving us a full page
>>> allocation.
>>>
>>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>>> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
>>> ---
>>>
>>> Applies to mainline since 2.6.36 and to xen.git 2.6.32 based trees
>> This is just for 2.6.37?
> 2.6.36.stable too, I think. I added stable@kernel.org to my patch header
> but didn't "guilt refresh" so it didn't show up here.

The extend_brk() stuff was all merged this merge window.  I checked out
.36 to confirm, and there's nothing there for your patch to apply to...

    J

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

* Re: [Xen-devel] Re: [PATCH] xen: correct size of level2_kernel_pgt
  2010-10-29 17:45     ` [Xen-devel] " Jeremy Fitzhardinge
@ 2010-10-29 17:55       ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2010-10-29 17:55 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org

On Fri, 2010-10-29 at 18:45 +0100, Jeremy Fitzhardinge wrote:
> On 10/29/2010 10:37 AM, Ian Campbell wrote:
> > On Fri, 2010-10-29 at 18:22 +0100, Jeremy Fitzhardinge wrote:
> >> On 10/29/2010 08:56 AM, Ian Campbell wrote:
> >>> sizeof(pmd_t *) is 4 bytes on PAE leading to an allocation of only
> >>> 2048 bytes. The correct size is sizeof(pmd_t) giving us a full page
> >>> allocation.
> >>>
> >>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >>> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> >>> ---
> >>>
> >>> Applies to mainline since 2.6.36 and to xen.git 2.6.32 based trees
> >> This is just for 2.6.37?
> > 2.6.36.stable too, I think. I added stable@kernel.org to my patch header
> > but didn't "guilt refresh" so it didn't show up here.
> 
> The extend_brk() stuff was all merged this merge window.  I checked out
> .36 to confirm, and there's nothing there for your patch to apply to...

Ah, I was suffering the classic confusion regarding a branch from before
a release getting merged after. Thanks!

Ian.



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

end of thread, other threads:[~2010-10-29 17:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-29 15:56 [PATCH] xen: correct size of level2_kernel_pgt Ian Campbell
2010-10-29 16:18 ` Jeremy Fitzhardinge
2010-10-29 17:22 ` Jeremy Fitzhardinge
2010-10-29 17:37   ` Ian Campbell
2010-10-29 17:45     ` [Xen-devel] " Jeremy Fitzhardinge
2010-10-29 17:55       ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox