From patchwork Wed May 16 18:51:32 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: 10404757 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 3A027602C2 for ; Wed, 16 May 2018 19:26:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2954C28695 for ; Wed, 16 May 2018 19:26:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DDB02869A; Wed, 16 May 2018 19:26:26 +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=-4.0 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 9512428695 for ; Wed, 16 May 2018 19:26:25 +0000 (UTC) Received: from localhost ([::1]:35067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ248-000627-Qp for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 May 2018 15:26:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ1XK-0003NF-5K for qemu-devel@nongnu.org; Wed, 16 May 2018 14:52:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJ1XI-0000rA-Bc for qemu-devel@nongnu.org; Wed, 16 May 2018 14:52:30 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:32921) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJ1XI-0000qh-4z for qemu-devel@nongnu.org; Wed, 16 May 2018 14:52:28 -0400 Received: by mail-wr0-x244.google.com with SMTP id o4-v6so2794778wrm.0 for ; Wed, 16 May 2018 11:52:27 -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=tJBDx2S+rIXBJizRR6qB6SyagLDl2XsEQs+u3bWzV9UDNsAkGKT9LZBgG+P0errYLs AlLUtKLfSdlgKC/J8+899Gn6Hj/C/LdfH6MyACKww/dethy7QHuVepgypG2fWlr1A0rf KN0ZRRj0SRGSyRcM8i/fKgXLDG8JKs8I13w8FrT3guwDBQ3B27I7+diPq6GicEnGT5UD ckJg5xx+WxB+GBm3NCiURy+iELpk44WtpMDNRtQr/TNhjzHsCwrUWelIGDxAF6qPQNxZ 4IqHM74Pr0yCWwUN1yI47b6VnH5SQTTf5QlG9hqi6vsXBoedaKf0k+LxqhLHA14WGHeX KUdw== 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=LlwhMOYCR9WQ2b7/LYufby1Te8pl12fFtFWBzr29uSwiBETVqic/PU/M06KpXpiyRT oPQg5/otRqOIasNBaaMH2EBbHwA1X4N5DAxkimmhZCJ5GuuDvmlGnWE6AdzZ0ozAsmxK dw8hGNNw+A6i1q9lrB4H5UGs/GzK+wAnMnNkXGhNZUMtEp0sE8pn3NAf5AjH3ioB2eRV Eh/GeZN6rs+IC03f1FF67b8mncvYcr5hpJ7a4zrxmQZtdgjXv445uO4CCoDhazYCO2bU 7CBqCotcz4bZau244LS9D/oNoGi4rES8JWEhvZyS6WmTuoRjyDVYMnuy6vuSN1yo457k N7dw== X-Gm-Message-State: ALKqPwf4FfGmfJnqD4FAkIZya8VGOLIunIMIvYN26hBCZ/RqabviZiuh Jdp6Qe+707co04JzXNxOBTfBEA== X-Google-Smtp-Source: AB8JxZo+oXX3fa2ntaG09wu6NHU5kLiGeKiQ7kIh55iq3SofOa3ZrBpC7dy276KGqyhYVpKhiz9UqQ== X-Received: by 2002:a19:ead6:: with SMTP id y83-v6mr15151370lfi.117.1526496746782; Wed, 16 May 2018 11:52:26 -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 a70-v6sm511763ljb.78.2018.05.16.11.52.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 11:52:25 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Wed, 16 May 2018 20:51:32 +0200 Message-Id: <20180516185146.30708-25-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180516185146.30708-1-edgar.iglesias@gmail.com> References: <20180516185146.30708-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] [PATCH v3 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, sstabellini@kernel.org, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com 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