From patchwork Tue May 29 10:49:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 10435015 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 4F2D9602CC for ; Tue, 29 May 2018 11:18:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8104627F2B for ; Tue, 29 May 2018 11:18:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71D9327F90; Tue, 29 May 2018 11:18:47 +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=-3.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FSL_HELO_FAKE, MAILING_LIST_MULTI, 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 F3C8227F2B for ; Tue, 29 May 2018 11:18:46 +0000 (UTC) Received: from localhost ([::1]:60236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNceM-0005dj-6S for patchwork-qemu-devel@patchwork.kernel.org; Tue, 29 May 2018 07:18:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcDQ-0001fC-5b for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNcDP-0004AK-DI for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:56 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:42383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNcDP-0004A5-66 for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:55 -0400 Received: by mail-wr0-x244.google.com with SMTP id w10-v6so24707564wrk.9 for ; Tue, 29 May 2018 03:50:55 -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=PuhOytwb0WLmtnwVlDs0IWCCrXihpIuNF/JyaLK6K90=; b=SxHvRIyGxjby+SMWzoBwZBknlN+H8Sd0aAtxPxKNy45nBUFCQrwZ3S4eGr9KwEHbA2 avRlo6cvOTmskxtm84LbOg3GzLghwQudvXpBtBaLhmPp3kLiY2h3sMNsPSFsm/NoR9/5 D25J6xYyryoZf6wDtVYoF6v2jFQyzdsOZXaX7XtYmhSH75zEUG69ACTOtN2PCel7vybs NujNZTq/rc5nj7wflnoiKjQ/9PQWeyhEyfqVRwmvjS9NV5o+1Eh2CQkqBDw9rBApPEIy B2MVobPmamtCAY6pZ4vVnCZGBghOrS63s0cc3+z/OH0Jmy6CaiMH+cTtXOYFe3DI4PNM 2kPg== 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=PuhOytwb0WLmtnwVlDs0IWCCrXihpIuNF/JyaLK6K90=; b=RCslsXgUqZRE3bJgNm5XDnEaWDs7BFaGpXVBIbur+TGSmPSdp525ckX+v6cyuT66xv bat/UYnTkPvsBiC8Rg5lHQxuuQMJ1nwEDY6lXT24NH+596wt45l5FTL4WxhxKxfBSu/y 2q221VAHutU0vRxC0Xa/FssEGGxQ3fVLbZbZThRO4X67PgAxTj/ifb1qIGsLeMQuDqpk lU+M2quC+r0DkBVeM9lnGPJAMYdpee682OyEMH55Y6QSXYnTYThkCC2GDO0908jJpBYZ e1RqtfbpAYWPOtWcaNm2Ke2foRoEKJCzPWf8MXJ0YE4SgB6gi1bFFEmHsyysOwSNAMkX ht5Q== X-Gm-Message-State: ALKqPwe5lN1C9Vp5gVCH9dsQNsJE3olZLEz1oO62OVrFriTVQzeAs2ex 8OuCPfIQhxWsSh+PUDli1KmZqw== X-Google-Smtp-Source: ADUXVKLvwzjypIWOwDxoX4NvhfhURfgGF8hGHqhn6mXuJRlM5SqEyC7QGKLujr1xGHbtEPmpHZ1p9w== X-Received: by 2002:a19:7b11:: with SMTP id w17-v6mr8981262lfc.103.1527591053777; Tue, 29 May 2018 03:50:53 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id v3-v6sm6402988ljj.71.2018.05.29.03.50.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 03:50:52 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 29 May 2018 12:49:57 +0200 Message-Id: <20180529105011.1914-25-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180529105011.1914-1-edgar.iglesias@gmail.com> References: <20180529105011.1914-1-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PULL v1 24/38] target-microblaze: mmu: Add R_TBLX_MISS macros 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Add a R_TBLX_MISS MASK and SHIFT macros. Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Edgar E. Iglesias --- target/microblaze/mmu.c | 5 +++-- target/microblaze/mmu.h | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target/microblaze/mmu.c b/target/microblaze/mmu.c index 0019ebd18f..f4a4c339c9 100644 --- a/target/microblaze/mmu.c +++ b/target/microblaze/mmu.c @@ -292,8 +292,9 @@ void mmu_write(CPUMBState *env, uint32_t rn, uint32_t v) v & TLB_EPN_MASK, 0, cpu_mmu_index(env, false)); if (hit) { env->mmu.regs[MMU_R_TLBX] = lu.idx; - } else - env->mmu.regs[MMU_R_TLBX] |= 0x80000000; + } else { + env->mmu.regs[MMU_R_TLBX] |= R_TBLX_MISS_MASK; + } break; } default: diff --git a/target/microblaze/mmu.h b/target/microblaze/mmu.h index 3b7a9983d5..113539c6e9 100644 --- a/target/microblaze/mmu.h +++ b/target/microblaze/mmu.h @@ -54,6 +54,10 @@ #define TLB_M 0x00000002 /* Memory is coherent */ #define TLB_G 0x00000001 /* Memory is guarded from prefetch */ +/* TLBX */ +#define R_TBLX_MISS_SHIFT 31 +#define R_TBLX_MISS_MASK (1U << R_TBLX_MISS_SHIFT) + #define TLB_ENTRIES 64 struct microblaze_mmu