diff mbox series

[QEMU-PPC,06/13] target/ppc: Enforce that the root page directory size must be at least 5

Message ID 20190503055316.6441-7-sjitindarsingh@gmail.com (mailing list archive)
State New, archived
Headers show
Series target/ppc: Implement KVM support under TCG | expand

Commit Message

Suraj Jitindar Singh May 3, 2019, 5:53 a.m. UTC
According to the ISA the root page directory size of a radix tree for
either process or partition scoped translation must be >= 5.

Thus add this to the list of conditions checked when validating the
partition table entry in validate_pate();

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
---
 target/ppc/mmu-radix64.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

David Gibson May 10, 2019, 2:11 a.m. UTC | #1
On Fri, May 03, 2019 at 03:53:09PM +1000, Suraj Jitindar Singh wrote:
> According to the ISA the root page directory size of a radix tree for
> either process or partition scoped translation must be >= 5.
> 
> Thus add this to the list of conditions checked when validating the
> partition table entry in validate_pate();
> 
> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  target/ppc/mmu-radix64.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c
> index a6ab290323..afa5ba506a 100644
> --- a/target/ppc/mmu-radix64.c
> +++ b/target/ppc/mmu-radix64.c
> @@ -249,6 +249,8 @@ static bool validate_pate(PowerPCCPU *cpu, uint64_t lpid, ppc_v3_pate_t *pate)
>      if (lpid == 0 && !msr_hv) {
>          return false;
>      }
> +    if ((pate->dw0 & PATE1_R_PRTS) < 5)
> +        return false;
>      /* More checks ... */
>      return true;
>  }
diff mbox series

Patch

diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c
index a6ab290323..afa5ba506a 100644
--- a/target/ppc/mmu-radix64.c
+++ b/target/ppc/mmu-radix64.c
@@ -249,6 +249,8 @@  static bool validate_pate(PowerPCCPU *cpu, uint64_t lpid, ppc_v3_pate_t *pate)
     if (lpid == 0 && !msr_hv) {
         return false;
     }
+    if ((pate->dw0 & PATE1_R_PRTS) < 5)
+        return false;
     /* More checks ... */
     return true;
 }