From nobody Wed Oct 29 11:53:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525340060576135.99580732466097; Thu, 3 May 2018 02:34:20 -0700 (PDT) Received: from localhost ([::1]:54905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEAd1-0004jh-Sh for importer@patchew.org; Thu, 03 May 2018 05:34:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEAPK-0001Dv-8M for qemu-devel@nongnu.org; Thu, 03 May 2018 05:20:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEAPJ-0005Dt-3K for qemu-devel@nongnu.org; Thu, 03 May 2018 05:20:10 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:42896) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEAPI-0005Db-SK for qemu-devel@nongnu.org; Thu, 03 May 2018 05:20:09 -0400 Received: by mail-lf0-x241.google.com with SMTP id u21-v6so24912155lfu.9 for ; Thu, 03 May 2018 02:20:08 -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 d77-v6sm2748639lfg.80.2018.05.03.02.20.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 02:20:06 -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=X6DcI3W5tGjWz34yhw3h4Fb6QZMHP9pBYteC/s/sGms=; b=u+6vDTXbomtDIJiSGfCNSPWAxKGP3WN/f/9s5JlzDPKoBhOLRAjmeQwv9DJ5UHnNUg 0Lm0lPy7eR1ixLhJVfX4OYJg9tkSnfZodLRQ8ifETnXoqR9PDPTieeiDMTbrxE4sJr16 F7tVuKnMx1sRhxPY0FUeLLdxuputpbn1KxmXo9GLzriH44i83ipDLL/fzC3Stj1fC5o6 dcTW+DT/ispuF50KPGwqP3LT2nLfMHzhHc1Ivv4B+XOjkV0u/dkhPSs4YQcLEywXV4X6 qFOmclRcLs2795H6ZOx5zLsHc71APDaajrjJPPAn4inAVnBDjj6wfih6MIiwaOXhYCMT Sxmw== 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=X6DcI3W5tGjWz34yhw3h4Fb6QZMHP9pBYteC/s/sGms=; b=ZuHZz0xjSQt06KNX9tVvTWC5Vye9Wsf/xNhk4zLj4rLNS1TjK0ruSqVFxdNdRuTHNx hRD/0iAfEkYWVGLxfSxCx8kE7E1bGeBtj5Xf+8eb/JFjMIvI8lBopLW3odDhKe3P/MfB Z10fWcNwdTC/fi7KRa3XjvZQeAVIpByxnWV/ZDOfsy6ezuUqLFJXI9UawweHuDwhGHmV 6LUsWZy9SC8YkoVhcMhvfa2D5/nf0+cuf62ndzPXomGvpK7R95hRFmQZ1Toa6vN/hPmV 1SRnKRmuWZgmw/BDMuQvH1necB+LzJbs9x+aW4q1S0+ysDOz/KqYoKwPly/Tm5NSivj8 q6+g== X-Gm-Message-State: ALQs6tBSONCEiS/Y030+45gUz/r1CMtO0EhSmlDDmUdTIyfzSNk5Z1Dh PGtZ/zQM7mDeD7di950VvK12PA== X-Google-Smtp-Source: AB8JxZqNO6fM94Kxgv7zJ9nRl4W1eYWVSjDm3zLVJF5y2/ew6YICDlPfwFo+kXTcnNHAKMxbBe4a1w== X-Received: by 2002:a2e:21c6:: with SMTP id h67-v6mr6365883lji.132.1525339207411; Thu, 03 May 2018 02:20:07 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Thu, 3 May 2018 11:19:20 +0200 Message-Id: <20180503091922.28733-28-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180503091922.28733-1-edgar.iglesias@gmail.com> References: <20180503091922.28733-1-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::241 Subject: [Qemu-devel] [PATCH v1 27/29] target-microblaze: mmu: Add a configurable output address mask 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, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add a configurable output address mask, used to mimic the configurable physical address bit width. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- target/microblaze/cpu.c | 1 + target/microblaze/mmu.c | 1 + target/microblaze/mmu.h | 1 + 3 files changed, 3 insertions(+) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 2b3f8fa374..d0649fdaaa 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -128,6 +128,7 @@ static void mb_cpu_reset(CPUState *s) env->mmu.c_mmu =3D 3; env->mmu.c_mmu_tlb_access =3D 3; env->mmu.c_mmu_zones =3D 16; + env->mmu.c_addr_mask =3D MAKE_64BIT_MASK(0, cpu->cfg.addr_size); #endif } =20 diff --git a/target/microblaze/mmu.c b/target/microblaze/mmu.c index a379968618..166c79908c 100644 --- a/target/microblaze/mmu.c +++ b/target/microblaze/mmu.c @@ -164,6 +164,7 @@ unsigned int mmu_translate(struct microblaze_mmu *mmu, tlb_rpn =3D d & TLB_RPN_MASK; =20 lu->vaddr =3D tlb_tag; + lu->paddr =3D tlb_rpn & mmu->c_addr_mask; lu->paddr =3D tlb_rpn; lu->size =3D tlb_size; lu->err =3D ERR_HIT; diff --git a/target/microblaze/mmu.h b/target/microblaze/mmu.h index 1714caf82e..9fbdf38f36 100644 --- a/target/microblaze/mmu.h +++ b/target/microblaze/mmu.h @@ -72,6 +72,7 @@ struct microblaze_mmu int c_mmu; int c_mmu_tlb_access; int c_mmu_zones; + uint64_t c_addr_mask; /* Mask to apply to physical addresses. */ }; =20 struct microblaze_mmu_lookup --=20 2.14.1