From patchwork Fri Jan 13 06:28:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 9514641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F9AD601E5 for ; Fri, 13 Jan 2017 06:29:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 392DA2871F for ; Fri, 13 Jan 2017 06:29:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D78828723; Fri, 13 Jan 2017 06:29:41 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CB9832871F for ; Fri, 13 Jan 2017 06:29:40 +0000 (UTC) Received: from localhost ([::1]:39262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRvMp-0006Et-RY for patchwork-qemu-devel@patchwork.kernel.org; Fri, 13 Jan 2017 01:29:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRvM3-00061j-9h for qemu-devel@nongnu.org; Fri, 13 Jan 2017 01:28:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRvM2-0001wS-As for qemu-devel@nongnu.org; Fri, 13 Jan 2017 01:28:51 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:35950) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRvLw-0001v5-ER; Fri, 13 Jan 2017 01:28:44 -0500 Received: by mail-pf0-x244.google.com with SMTP id b22so6874944pfd.3; Thu, 12 Jan 2017 22:28:44 -0800 (PST) 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=JOfeiIna1haG1aACwukEcuNyEOZ5CiH3nyuMiN975uo=; b=fqMPMfZsKJMoisQFyWlxdqr118QN5BEmU+U8Wy7Zt9EHGsBebwK3iTVt2z7n4fcmiJ eDm+BvtiXDQOiNs1AWtoFFK7YGe/RR+5hDWUzsdUnqR08auAe8SZRj5HN0dReZV4KjYI svLmMSpWMpcRRUWMA2w7Mjs3zwZSpx4nKWIuUjJFctvJHAylkMj2lOV0OyG/nmkH6eoo yxHFDVbuweYpTJaqB2fPG3pOkCdZemZB2wDt3d1H7OJu4HQcn5VQteQ1Hletcm1u82hi sEf1kTYsBd8OyYd0T4hexxrq2aexGsh1znhYqb/bFqNz7mHIlhEXmdTms+K/BBNU+P0t 61ag== 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=JOfeiIna1haG1aACwukEcuNyEOZ5CiH3nyuMiN975uo=; b=rIGtgRKpTb8FcupPmr138euRX2G2WLPvoy5Fl855wFEYK/TtL+H2xRt+WIri90Cuem YOAQpSG7H02sNdXaWcaKaF6H6dLBoJMG9STYKiT1h2gOT+0KqS+lKpGxe82MZpOpLv29 C2ASH6N1cXA+D81gfRIxlpFY3q0U76d/VnVCr2tuQrYYGQF9Ctzy2bGyBJhfTmtQcgwI s+CtE46c1L3GptAZiQqC4TQWqfKb4QL2PNdm3ibyQ/0mDfXfDIOlGqqPSX3oqQPu6tdW w1cPYdQHYi84TSHtQHb1kGZkvsjk0JGcshk0WHqKXanuHF9P7ctR9UE13YUgAqtK+9fO jyBg== X-Gm-Message-State: AIkVDXLRAJy1ZGhSyZsu+ZCmBg1Q7qwEAcykouL/vYVLlMchd6qg5smOhNjZyNQaRW5i5g== X-Received: by 10.84.217.18 with SMTP id o18mr27393585pli.51.1484288923672; Thu, 12 Jan 2017 22:28:43 -0800 (PST) Received: from dyn253.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id r2sm26004999pfi.67.2017.01.12.22.28.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jan 2017 22:28:43 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Fri, 13 Jan 2017 17:28:10 +1100 Message-Id: <1484288903-18807-5-git-send-email-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1484288903-18807-1-git-send-email-sjitindarsingh@gmail.com> References: <1484288903-18807-1-git-send-email-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [RFC PATCH 04/17] target/ppc/POWER9: Add ISAv3.00 MMU definition 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: qemu-devel@nongnu.org, agraf@suse.de, 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 POWER9 processors implement the mmu as defined in version 3.00 of the ISA. Add a definition for this mmu model and set the POWER9 cpu model to use this mmu model. Signed-off-by: Suraj Jitindar Singh --- target/ppc/cpu-qom.h | 5 ++++- target/ppc/mmu_helper.c | 2 ++ target/ppc/translate_init.c | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index d46c31a..1577cc8 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -86,10 +86,13 @@ enum powerpc_mmu_t { POWERPC_MMU_2_07 = POWERPC_MMU_64 | POWERPC_MMU_1TSEG | POWERPC_MMU_64K | POWERPC_MMU_AMR | 0x00000004, - /* FIXME Add POWERPC_MMU_3_OO defines */ /* Architecture 2.07 "degraded" (no 1T segments) */ POWERPC_MMU_2_07a = POWERPC_MMU_64 | POWERPC_MMU_AMR | 0x00000004, + /* Architecture 3.00 variant */ + POWERPC_MMU_3_00 = POWERPC_MMU_64 | POWERPC_MMU_1TSEG + | POWERPC_MMU_64K + | POWERPC_MMU_AMR | 0x00000005, }; /*****************************************************************************/ diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index d09fc0a..2ab4562 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -1935,6 +1935,7 @@ void ppc_tlb_invalidate_all(CPUPPCState *env) case POWERPC_MMU_2_06a: case POWERPC_MMU_2_07: case POWERPC_MMU_2_07a: + case POWERPC_MMU_3_00: #endif /* defined(TARGET_PPC64) */ env->tlb_need_flush = 0; tlb_flush(CPU(cpu), 1); @@ -1974,6 +1975,7 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ulong addr) case POWERPC_MMU_2_06a: case POWERPC_MMU_2_07: case POWERPC_MMU_2_07a: + case POWERPC_MMU_3_00: /* tlbie invalidate TLBs for all segments */ /* XXX: given the fact that there are too many segments to invalidate, * and we still don't have a tlb_flush_mask(env, n, mask) in QEMU, diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index bfc1f24..2402eef 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -8838,8 +8838,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) (1ull << MSR_PMM) | (1ull << MSR_RI) | (1ull << MSR_LE); - /* Using 2.07 defines until new radix model is added. */ - pcc->mmu_model = POWERPC_MMU_2_07; + pcc->mmu_model = POWERPC_MMU_3_00; #if defined(CONFIG_SOFTMMU) pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault; /* segment page size remain the same */