From nobody Wed Nov 19 01:41:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1613921501; cv=none; d=zohomail.com; s=zohoarc; b=RO17Heq8f157AYZfZv1+ZR1sAygxOSJ0JwPCe9xqvZg6SjmJCzVUtZm/IS9hI2og5oWFnSbWnZWYuPfPRSXQPp2/q8riXqzzoUSc/oVTBnt8+pWrLmzYhruJ51gS1kqjGvXuLFstWgiVp8jGLpupI+CULmxLi6WHytzr3QOy5xo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613921501; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L0QqQiXY8TMImOPT+At0bmv3t/0AG4P6soIIyBqMxA4=; b=cNlqAikydlfPyQHzlXjra3GWWcA3Y4OulIOjKLeTku/mRq6RwxJrs9a7r3WMR64sd5+sdSoy8YtrhoGtETTjeQgJL9Uz1AScuTc75aKN2V7Gg5aB8dmy9I4/oHyEBT3KLTtOp99f+lq3p2xJq3YGsskwbB/fV96A4CAwj/rsr+I= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613921501197493.0590734397679; Sun, 21 Feb 2021 07:31:41 -0800 (PST) Received: from localhost ([::1]:33694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDqhv-0001tJ-Qz for importer@patchew.org; Sun, 21 Feb 2021 10:31:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDpJp-0005mQ-6I; Sun, 21 Feb 2021 09:02:41 -0500 Received: from exmail.andestech.com ([60.248.187.195]:10481 helo=ATCSQR.andestech.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDpJl-00058q-V1; Sun, 21 Feb 2021 09:02:40 -0500 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 11LDurVW062705; Sun, 21 Feb 2021 21:56:53 +0800 (GMT-8) (envelope-from cwshu@andestech.com) Received: from ubuntu1604.andestech.com (10.0.12.177) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.487.0; Sun, 21 Feb 2021 22:02:24 +0800 From: Jim Shu To: , Subject: [PATCH 2/3] target/riscv: add log of PMP permission checking Date: Sun, 21 Feb 2021 22:01:21 +0800 Message-ID: <1613916082-19528-3-git-send-email-cwshu@andestech.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613916082-19528-1-git-send-email-cwshu@andestech.com> References: <1613916082-19528-1-git-send-email-cwshu@andestech.com> MIME-Version: 1.0 X-Originating-IP: [10.0.12.177] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 11LDurVW062705 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=60.248.187.195; envelope-from=cwshu@andestech.com; helo=ATCSQR.andestech.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 21 Feb 2021 10:29:58 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , Palmer Dabbelt , Jim Shu , Sagar Karandikar , Bastian Koppelmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Like MMU translation, add qemu log of PMP permission checking for debugging. Signed-off-by: Jim Shu --- target/riscv/cpu_helper.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index f6ac63bf0e..c1ecb8a710 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -794,6 +794,12 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, if (ret =3D=3D TRANSLATE_SUCCESS) { ret =3D get_physical_address_pmp(env, &prot_pmp, &tlb_size= , pa, size, access_type, mode); + + qemu_log_mask(CPU_LOG_MMU, + "%s PMP address=3D" TARGET_FMT_plx " ret %d = prot" + " %d tlb_size " TARGET_FMT_lu "\n", + __func__, pa, ret, prot_pmp, tlb_size); + prot &=3D prot_pmp; } =20 @@ -821,6 +827,12 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, if (ret =3D=3D TRANSLATE_SUCCESS) { ret =3D get_physical_address_pmp(env, &prot_pmp, &tlb_size, pa, size, access_type, mode); + + qemu_log_mask(CPU_LOG_MMU, + "%s PMP address=3D" TARGET_FMT_plx " ret %d prot" + " %d tlb_size " TARGET_FMT_lu "\n", + __func__, pa, ret, prot_pmp, tlb_size); + prot &=3D prot_pmp; } } --=20 2.30.1