From patchwork Fri May 3 05:53:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 10927935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E92F92A for ; Fri, 3 May 2019 06:03:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BA3427DCD for ; Fri, 3 May 2019 06:03:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B58027E71; Fri, 3 May 2019 06:03:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AACE227DCD for ; Fri, 3 May 2019 06:03:13 +0000 (UTC) Received: from localhost ([127.0.0.1]:35091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMRHt-0005JF-1M for patchwork-qemu-devel@patchwork.kernel.org; Fri, 03 May 2019 02:03:13 -0400 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 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:36068) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMR9C-0002zZ-0e; Fri, 03 May 2019 01:54:14 -0400 Received: by mail-pf1-x442.google.com with SMTP id v80so2353483pfa.3; Thu, 02 May 2019 22:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wUZAXOTwdw2I/hZuC5jS4/OqNN0mBHOWVDEizVGw6GQ=; b=Af6AxvyqyVqgdx5sR9vt6CetSMY498qPkmWf3OjJNGMDcg2ddNIfbPZzyq332xmqsh NBeya8BT1uEgWonEwLsDp0/ne3QtR6PIDAj7nXYqtdPCPT2iablRFHZPdA4jSbVOJ2DC lxS9KGmLzAx2wgO+Q6jrlzyczAAU18o8BnwqvswvsjMRvOGV9ga1aPLZPWxIHv15f9pC 2Gh/X9ZyQDVS2ObIlOzM+pdcwbjAlrp+tSH2+BKG4wRgZK+9ziayr1LhDM67RFvQM4d5 tCxrigMfEz85CBu9Y+RotUlGLdpLo92zY5I09Bq/Uo6/BzeLicQXP9tj/f5HYKTCD9Tt F/4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wUZAXOTwdw2I/hZuC5jS4/OqNN0mBHOWVDEizVGw6GQ=; b=tDC2aLc5XRJPV3Jq9kFocopDf2qSU6B58UDEgLkFGOsXQfnISbsIC7MS+sPC8Tl3RB kdwwnaSwaysD70ge++46GKTHyhhTrZaKi6HwGcbXAerZ6HlBFfvQcmzPPGP7I1Ncuh8k aQ+Zjrl7Eqek7U/ptw82z4MR7f4QqetwGUrJMAanWB0McFjsKahXjRRe+Ny/iYrpkxgy WqmyJLGcJGCAx6BpW6qm3kdNuX3+XzMHFA/Foovk7VyepejbBWmkwHwUIxtTEnsT+2g3 gcEKsYIgiTikPR9GeqM9n+JHdw/q3j11uBNMUMD0pA38L08aBZkcJ3vzzr0AS/vpo4GY l0Vw== X-Gm-Message-State: APjAAAWb0xajo2J7SYoLLSpl2s4C0UBPfLxngs1kpIxUCfJVWHeF9p+B oAitc5WK8cO9WUfnl3VQvEbSKENOCpA= X-Google-Smtp-Source: APXvYqxPUPVhxF4jxE8BFdmppxcc+9qa8+6brNnYwfd4qF10qVOD5UY8ZyVwxrLGWVAt/gTJ4VchIQ== X-Received: by 2002:a63:9541:: with SMTP id t1mr4336289pgn.97.1556862848390; Thu, 02 May 2019 22:54:08 -0700 (PDT) Received: from localhost.ibm.com ([1.129.142.217]) by smtp.gmail.com with ESMTPSA id h187sm1292983pfc.52.2019.05.02.22.54.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 22:54:07 -0700 (PDT) From: Suraj Jitindar Singh To: qemu-devel@nongnu.org Date: Fri, 3 May 2019 15:53:09 +1000 Message-Id: <20190503055316.6441-7-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190503055316.6441-1-sjitindarsingh@gmail.com> References: <20190503055316.6441-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [QEMU-PPC] [PATCH 06/13] target/ppc: Enforce that the root page directory size must be at least 5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, Suraj Jitindar Singh , david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: David Gibson --- 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; }