* [PATCH] powerpc/mm: Correct process and partition table max size
@ 2016-11-09 5:36 Suraj Jitindar Singh
2016-11-10 0:30 ` Balbir Singh
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Suraj Jitindar Singh @ 2016-11-09 5:36 UTC (permalink / raw)
To: linuxppc-dev; +Cc: sjitindarsingh, benh, paulus, mpe, aneesh.kumar, bsingharora
Version 3.00 of the ISA states that the PATS (partition table size) field
of the PTCR (partition table control register) and the PRTS (process table
size) field of the partition table entry must both be less than or equal
to 24. However the actual size of the partition and process tables is equal
to 2 to the power of 12 plus the PATS and PRTS fields, respectively. This
means that the max allowable size of each of these tables is 2^36 or 64GB
for both.
Thus when checking the size shift for each we should be checking for values
of greater than 36 instead of the current check for shifts larger than 24
and 23.
Fixes: 2bfd65e45e877fb5704730244da67c748d28a1b8
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
---
arch/powerpc/mm/pgtable-radix.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index ed7bddc..80f3479 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -159,7 +159,7 @@ static void __init radix_init_pgtable(void)
* Allocate Partition table and process table for the
* host.
*/
- BUILD_BUG_ON_MSG((PRTB_SIZE_SHIFT > 23), "Process table size too large.");
+ BUILD_BUG_ON_MSG((PRTB_SIZE_SHIFT > 36), "Process table size too large.");
process_tb = early_alloc_pgtable(1UL << PRTB_SIZE_SHIFT);
/*
* Fill in the process table.
@@ -181,7 +181,7 @@ static void __init radix_init_partition_table(void)
rts_field = radix__get_tree_size();
- BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 24), "Partition table size too large.");
+ BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 36), "Partition table size too large.");
partition_tb = early_alloc_pgtable(1UL << PATB_SIZE_SHIFT);
partition_tb->patb0 = cpu_to_be64(rts_field | __pa(init_mm.pgd) |
RADIX_PGD_INDEX_SIZE | PATB_HR);
--
2.5.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/mm: Correct process and partition table max size
2016-11-09 5:36 [PATCH] powerpc/mm: Correct process and partition table max size Suraj Jitindar Singh
@ 2016-11-10 0:30 ` Balbir Singh
2016-11-10 9:36 ` Aneesh Kumar K.V
2016-11-17 12:04 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Balbir Singh @ 2016-11-10 0:30 UTC (permalink / raw)
To: Suraj Jitindar Singh, linuxppc-dev; +Cc: benh, paulus, mpe, aneesh.kumar
On 09/11/16 16:36, Suraj Jitindar Singh wrote:
> Version 3.00 of the ISA states that the PATS (partition table size) field
> of the PTCR (partition table control register) and the PRTS (process table
> size) field of the partition table entry must both be less than or equal
> to 24. However the actual size of the partition and process tables is equal
> to 2 to the power of 12 plus the PATS and PRTS fields, respectively. This
> means that the max allowable size of each of these tables is 2^36 or 64GB
> for both.
>
> Thus when checking the size shift for each we should be checking for values
> of greater than 36 instead of the current check for shifts larger than 24
> and 23.
>
I looked at the ISA and the patch seems reasonable to me. It has no functional
impact other than when we decide to increase the size of PA(R)TB_SIZE_SHIFT
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/mm: Correct process and partition table max size
2016-11-09 5:36 [PATCH] powerpc/mm: Correct process and partition table max size Suraj Jitindar Singh
2016-11-10 0:30 ` Balbir Singh
@ 2016-11-10 9:36 ` Aneesh Kumar K.V
2016-11-17 12:04 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2016-11-10 9:36 UTC (permalink / raw)
To: Suraj Jitindar Singh, linuxppc-dev
Cc: sjitindarsingh, benh, paulus, mpe, bsingharora
Suraj Jitindar Singh <sjitindarsingh@gmail.com> writes:
> Version 3.00 of the ISA states that the PATS (partition table size) field
> of the PTCR (partition table control register) and the PRTS (process table
> size) field of the partition table entry must both be less than or equal
> to 24. However the actual size of the partition and process tables is equal
> to 2 to the power of 12 plus the PATS and PRTS fields, respectively. This
> means that the max allowable size of each of these tables is 2^36 or 64GB
> for both.
>
> Thus when checking the size shift for each we should be checking for values
> of greater than 36 instead of the current check for shifts larger than 24
> and 23.
>
> Fixes: 2bfd65e45e877fb5704730244da67c748d28a1b8
> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> arch/powerpc/mm/pgtable-radix.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
> index ed7bddc..80f3479 100644
> --- a/arch/powerpc/mm/pgtable-radix.c
> +++ b/arch/powerpc/mm/pgtable-radix.c
> @@ -159,7 +159,7 @@ static void __init radix_init_pgtable(void)
> * Allocate Partition table and process table for the
> * host.
> */
> - BUILD_BUG_ON_MSG((PRTB_SIZE_SHIFT > 23), "Process table size too large.");
> + BUILD_BUG_ON_MSG((PRTB_SIZE_SHIFT > 36), "Process table size too large.");
> process_tb = early_alloc_pgtable(1UL << PRTB_SIZE_SHIFT);
> /*
> * Fill in the process table.
> @@ -181,7 +181,7 @@ static void __init radix_init_partition_table(void)
>
> rts_field = radix__get_tree_size();
>
> - BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 24), "Partition table size too large.");
> + BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 36), "Partition table size too large.");
> partition_tb = early_alloc_pgtable(1UL << PATB_SIZE_SHIFT);
> partition_tb->patb0 = cpu_to_be64(rts_field | __pa(init_mm.pgd) |
> RADIX_PGD_INDEX_SIZE | PATB_HR);
> --
> 2.5.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: powerpc/mm: Correct process and partition table max size
2016-11-09 5:36 [PATCH] powerpc/mm: Correct process and partition table max size Suraj Jitindar Singh
2016-11-10 0:30 ` Balbir Singh
2016-11-10 9:36 ` Aneesh Kumar K.V
@ 2016-11-17 12:04 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-11-17 12:04 UTC (permalink / raw)
To: Suraj Jitindar Singh, linuxppc-dev; +Cc: paulus, aneesh.kumar, sjitindarsingh
On Wed, 2016-09-11 at 05:36:33 UTC, Suraj Jitindar Singh wrote:
> Version 3.00 of the ISA states that the PATS (partition table size) field
> of the PTCR (partition table control register) and the PRTS (process table
> size) field of the partition table entry must both be less than or equal
> to 24. However the actual size of the partition and process tables is equal
> to 2 to the power of 12 plus the PATS and PRTS fields, respectively. This
> means that the max allowable size of each of these tables is 2^36 or 64GB
> for both.
>
> Thus when checking the size shift for each we should be checking for values
> of greater than 36 instead of the current check for shifts larger than 24
> and 23.
>
> Fixes: 2bfd65e45e877fb5704730244da67c748d28a1b8
> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
> Reviewed-by: Balbir Singh <bsingharora@gmail.com>
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/555c16328ae6d75a90e234eac9b519
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-17 12:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-09 5:36 [PATCH] powerpc/mm: Correct process and partition table max size Suraj Jitindar Singh
2016-11-10 0:30 ` Balbir Singh
2016-11-10 9:36 ` Aneesh Kumar K.V
2016-11-17 12:04 ` Michael Ellerman
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).