From nobody Thu Oct 16 04:52:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1760474271; cv=none; d=zohomail.com; s=zohoarc; b=mAfFlDLtajuralv+9Zp8upK3ZhkXExzDClih56mdhCdFRJUEF7pp1/0WwCyh52njPZO/LrpbOdyLwSGnPl/wIApzkg3dchqqkVqdUwswBHzPU1aSq+y+3kN1zdrsGgzx/DW50mD4ucFjpSZOhl9hw5p+5ALDd3/e/1f6eUhNt18= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760474271; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=fSSEyCgGhG/Br8uHW3p8RTCpAFHMerOVC1jsUMyncQs=; b=nv4GusIDHAdoqZtcOJInmvBszjpKo9NUNalu1lB8csIl4xQN3y0Y/YSHd0T5jN7WsNg1Xutse6jMT7cVU2Y/vtLE+0/Dtm3W56dBKREVZJowO9xw7ePm5JiA6VDiFscVj9s1frBLVEesOESWqoIgsVQ+OLikpRJjR3MnElPO8iQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760474271810494.2742036841041; Tue, 14 Oct 2025 13:37:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v8lif-0001I1-S8; Tue, 14 Oct 2025 16:34:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v8lid-0001Eu-Ex for qemu-devel@nongnu.org; Tue, 14 Oct 2025 16:34:03 -0400 Received: from rev.ng ([94.130.142.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v8lia-0000X5-Fv for qemu-devel@nongnu.org; Tue, 14 Oct 2025 16:34:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:List-Unsubscribe:List-Unsubscribe-Post: List-Help; bh=fSSEyCgGhG/Br8uHW3p8RTCpAFHMerOVC1jsUMyncQs=; b=SfBxIQQT7XrJg0V T8GWgvv/bjclZU/d9oVu0OGb3R2r2oCiBFIf3BI3A2MWtUPp7RwUXvaaQgbSri9W3WleBWhKGosv5 MWHqkhZ4t7/6Dg1uElrJxFBc3qwsRCcqvUPxBU93Smiw135t8q/Fpep69eVqyz4F86VdKInKxeOxU 7s=; To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, philmd@linaro.org, alistair.francis@wdc.com, palmer@dabbelt.com Subject: [PATCH v3 30/34] target/riscv: Fix size of mseccfg Date: Tue, 14 Oct 2025 22:35:07 +0200 Message-ID: <20251014203512.26282-31-anjo@rev.ng> In-Reply-To: <20251014203512.26282-1-anjo@rev.ng> References: <20251014203512.26282-1-anjo@rev.ng> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=94.130.142.21; envelope-from=anjo@rev.ng; helo=rev.ng X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Anton Johansson From: Anton Johansson via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1760474273522158500 mseccfg is defined in version 20250508 of the privileged specification to be 64 bits in size. Update relevant function arguments. Signed-off-by: Anton Johansson Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/cpu.h | 2 +- target/riscv/pmp.h | 4 ++-- target/riscv/pmp.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index e404b120bc..5e9fa0ab10 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -463,7 +463,7 @@ struct CPUArchState { =20 /* physical memory protection */ pmp_table_t pmp_state; - target_ulong mseccfg; + uint64_t mseccfg; =20 /* trigger module */ uint16_t mcontext; diff --git a/target/riscv/pmp.h b/target/riscv/pmp.h index 271cf24169..e322904637 100644 --- a/target/riscv/pmp.h +++ b/target/riscv/pmp.h @@ -69,8 +69,8 @@ void pmpcfg_csr_write(CPURISCVState *env, uint32_t reg_in= dex, target_ulong val); target_ulong pmpcfg_csr_read(CPURISCVState *env, uint32_t reg_index); =20 -void mseccfg_csr_write(CPURISCVState *env, target_ulong val); -target_ulong mseccfg_csr_read(CPURISCVState *env); +void mseccfg_csr_write(CPURISCVState *env, uint64_t val); +uint64_t mseccfg_csr_read(CPURISCVState *env); =20 void pmpaddr_csr_write(CPURISCVState *env, uint32_t addr_index, target_ulong val); diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 72f1372a49..85199c7387 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -597,7 +597,7 @@ target_ulong pmpaddr_csr_read(CPURISCVState *env, uint3= 2_t addr_index) /* * Handle a write to a mseccfg CSR */ -void mseccfg_csr_write(CPURISCVState *env, target_ulong val) +void mseccfg_csr_write(CPURISCVState *env, uint64_t val) { int i; uint64_t mask =3D MSECCFG_MMWP | MSECCFG_MML; @@ -643,7 +643,7 @@ void mseccfg_csr_write(CPURISCVState *env, target_ulong= val) /* * Handle a read from a mseccfg CSR */ -target_ulong mseccfg_csr_read(CPURISCVState *env) +uint64_t mseccfg_csr_read(CPURISCVState *env) { trace_mseccfg_csr_read(env->mhartid, env->mseccfg); return env->mseccfg; --=20 2.51.0