Received: from eggs.gnu.org ([209.51.188.92]:54623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMR9D-0005S0-W2 for qemu-devel@nongnu.org; Fri, 03 May 2019 01:54:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMR9C-00032k-A2 for qemu-devel@nongnu.org; Fri, 03 May 2019 01:54:15 -0400 From: Suraj Jitindar Singh Date: Fri, 3 May 2019 15:53:09 +1000 Message-Id: <20190503055316.6441-7-sjitindarsingh@gmail.com> In-Reply-To: <20190503055316.6441-1-sjitindarsingh@gmail.com> References: <20190503055316.6441-1-sjitindarsingh@gmail.com> Subject: [Qemu-devel] [QEMU-PPC] [PATCH 06/13] target/ppc: Enforce that the root page directory size must be at least 5 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, clg@kaod.org, groug@kaod.org, Suraj Jitindar Singh 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 --- 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; } -- 2.13.6