From nobody Tue Nov 26 16:31:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=1706212440; cv=none; d=zohomail.com; s=zohoarc; b=Lq9XrGvJ/dyckLvUHHHC4OCJmp5YIIALH3D5BdhOyInhHGZC9RbNRVk3AyMfL91/n5f8lrXrO+iyG4eNEt3iCbziUsV44tBQJ5s9gTjVpKPpD8V78x1RC+5WxMrMyWeDgktll4dSxxOFZCUrrf1vqzV5rapt4LtB6udEr6lUN5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706212440; h=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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LQBov+3obq4yDLy1SQOmpy/NkorWmiTmSoDtME+DQ+c=; b=NFS/f1fhnex6sJB31LBrHxVrcxr4VVxdkJXBLYzY/nIoil/zaIgEwjBacBQTaasre2dMZYx/cXFiBPlDcDu6GlzkwrQUPM84lAmKx9Kml1t64nflk8JxcSwbbD5b+8FSkT8f3ZCMQTApww56C3cHvY4UnZqrKLiq94uDSsxrDY8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1706212440667467.104660441933; Thu, 25 Jan 2024 11:54:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT5nD-0004dr-Kr; Thu, 25 Jan 2024 14:53:43 -0500 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 1rT5nB-0004cw-BR for qemu-devel@nongnu.org; Thu, 25 Jan 2024 14:53:41 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rT5n9-0001Zv-PM for qemu-devel@nongnu.org; Thu, 25 Jan 2024 14:53:41 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-290b37bb7deso3520833a91.0 for ; Thu, 25 Jan 2024 11:53:39 -0800 (PST) Received: from grind.. ([2804:7f0:bdcd:fb00:6501:2693:db52:c621]) by smtp.gmail.com with ESMTPSA id r7-20020a17090ad40700b0028b6759d8c1sm1958613pju.29.2024.01.25.11.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 11:53:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1706212418; x=1706817218; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LQBov+3obq4yDLy1SQOmpy/NkorWmiTmSoDtME+DQ+c=; b=fDFA51HzADNXQ9Lrp0Q7A3H9An0r8Qtl66oT54rMLeUZ6BVfXH49mvt3MbdWgOb3kV OQfnaXDTsVx/qzB5CaCY1mCz1LPwhLiboYbDO3+tvu/VVJj8hdXzGRifSLpg1opupW2/ Uv7hFzCSB4MYn9v64aPVLV6bh3K99Kqm74qZKoYLo3qrQyKSWtoW/5P9jkHUZ8Xh5Akq R0MRFi/+N4gLzdcq1GKBS7OjBt7Sx4vgW0uZAl3sifsf20p52NwlzOrPD5HDTA5E2P95 A9veB3AODPIbuuLBePFrHTe/kEuS6bAAbDCRQrBlAAx2UlwqO7BqYVEbKYlnNT89WiDd calQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706212418; x=1706817218; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LQBov+3obq4yDLy1SQOmpy/NkorWmiTmSoDtME+DQ+c=; b=GuQ7sUKP/C0kHmsQvkNM+q1b+kbRaNukC4Te6/nntnqvH2xvYCZosVZtHDhL+tCIsK Gmlp0nZk22WSiG7hO5VTd+7tTHiGx6t/C1R893W15HZctdVorDpTqmrIELudJ1qeArVR 3AJE+aC3uJ9meOu+4b/49Q+xnI/QNKbB8NVGvjspzamSrN73UZgjvD9kSRgTDBWGqCqm ktU0d0ib9uOy/Q/1z0ewQZLOGboWDq6jGDQfjreCAVtRhKlsiy+swgbVvuV4FZaGNRcA nJSTN3gqA+ZnF4446Z+mB29mt+z1p8Eiz2VnXZ6Ce3/TY6NS1LsWtE7FDofdEWyuTQkX frfg== X-Gm-Message-State: AOJu0YzFZZyqObsr7y955ffXV7GTlIQap++4l2zcr++QdPfD3d6osvFH tbRZi2Lnbv7tuy5Ux/MZSe6s0gclj1xbmpwjgofbvCXgQ20ijjJv68U7lA7/KTDnI+WXi/LeR/m t X-Google-Smtp-Source: AGHT+IGi7LQEjLFm0wH4Z6JEEQ7kCOFsdn3zXsSyAVfed37sCRo2kviAd8WlKr2Eu212IMUi/uxjrw== X-Received: by 2002:a17:90a:e551:b0:28c:bb6d:4d16 with SMTP id ei17-20020a17090ae55100b0028cbb6d4d16mr134807pjb.31.1706212417953; Thu, 25 Jan 2024 11:53:37 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, ajones@ventanamicro.com, Daniel Henrique Barboza Subject: [PATCH 4/6] target/riscv: Reset henvcfg to zero Date: Thu, 25 Jan 2024 16:53:17 -0300 Message-ID: <20240125195319.329181-5-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240125195319.329181-1-dbarboza@ventanamicro.com> References: <20240125195319.329181-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::102f; envelope-from=dbarboza@ventanamicro.com; helo=mail-pj1-x102f.google.com 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_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1706212442737100011 Content-Type: text/plain; charset="utf-8" From: Andrew Jones The hypervisor should decide what it wants to enable. Zero all configuration enable bits on reset. Also, commit ed67d63798f2 ("target/riscv: Update CSR bits name for svadu extension") missed one reference to 'hade'. Change it now. Fixes: 0af3f115e68e ("target/riscv: Add *envcfg.HADE related check in addre= ss translation") Fixes: ed67d63798f2 ("target/riscv: Update CSR bits name for svadu extensio= n") Signed-off-by: Andrew Jones Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 3 +-- target/riscv/csr.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 1ecd8a57ed..7fd433daee 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -961,8 +961,7 @@ static void riscv_cpu_reset_hold(Object *obj) =20 env->menvcfg =3D (cpu->cfg.ext_svpbmt ? MENVCFG_PBMTE : 0) | (cpu->cfg.ext_svadu ? MENVCFG_ADUE : 0); - env->henvcfg =3D (cpu->cfg.ext_svpbmt ? HENVCFG_PBMTE : 0) | - (cpu->cfg.ext_svadu ? HENVCFG_ADUE : 0); + env->henvcfg =3D 0; =20 /* Initialized default priorities of local interrupts. */ for (i =3D 0; i < ARRAY_SIZE(env->miprio); i++) { diff --git a/target/riscv/csr.c b/target/riscv/csr.c index d9a010387f..93f7bc2cb4 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -2115,7 +2115,7 @@ static RISCVException read_henvcfg(CPURISCVState *env= , int csrno, /* * henvcfg.pbmte is read_only 0 when menvcfg.pbmte =3D 0 * henvcfg.stce is read_only 0 when menvcfg.stce =3D 0 - * henvcfg.hade is read_only 0 when menvcfg.hade =3D 0 + * henvcfg.adue is read_only 0 when menvcfg.adue =3D 0 */ *val =3D env->henvcfg & (~(HENVCFG_PBMTE | HENVCFG_STCE | HENVCFG_ADUE= ) | env->menvcfg); --=20 2.43.0