From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95436C433F5 for ; Sat, 14 May 2022 02:22:34 +0000 (UTC) Received: from localhost ([::1]:47216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nphQP-0001AA-76 for qemu-devel@archiver.kernel.org; Fri, 13 May 2022 22:22:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nphPd-0008Pa-KC for qemu-devel@nongnu.org; Fri, 13 May 2022 22:21:45 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:39554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nphPb-0004jy-TR for qemu-devel@nongnu.org; Fri, 13 May 2022 22:21:45 -0400 Received: by mail-ed1-x52f.google.com with SMTP id s11so8091143edy.6 for ; Fri, 13 May 2022 19:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D7Cjve6oVbvbq4mfrf+2D8PGe71UvGWRoO0r4pyFkJM=; b=C9/BT/hQXYCTbyBsf4lNX8znSockOzmbO1NmtvwFjD/F+GmTQCzl1Wif+bbtZhAYcx 5UylEb22pXLzHheFspy1cmdxLToRwPgfJKJHyw7jhiWo/AJ1DuY4ppLhjrt57bIMLifG BmbMJkTEMtltLJSBeBgWpQ+YMg4nyEDg53ho8WD/hikh9e4oigyCNme/g4lXxHMY7bNv iQ08qBm29yUYvkHSKll+yaXZ8TdLsrKl4zG27fGUwFquwXy2N8Fi2XArFrjkN27kWlm2 WIwSEn082rDKXywLMHDmUmPyD6WkYd/5JoR92jql9ZzKjFh+9jewNZ5CmggvWEN26BYg 9R+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D7Cjve6oVbvbq4mfrf+2D8PGe71UvGWRoO0r4pyFkJM=; b=Z/fdq0GVMUwIx/+n9fhZVNte1Cs2pixH6tyVVcCcW9HMCUzJqaCY6pwcdHAsiaY2Cz M3IGD9kcOk2c0fw8NZPUCR2H0ZbwVxEznPhK9PjQHuyneViZsgZuFB/dpI5bUyu+e2Xz zYlTP+UA4Q+RSygWwrqm9i2TM4z475ho1Easw2ujBRoT0kMBLIRH9GY/OFSlkPEZdN0j tuPbm9HnLOS2oP7OgKE3d+mCuw8bxbo99b3xcTNcgqK8faX2/dDhAGW9XQV3DSy0w+cr bF1NFORSgoXLMymcaA9iulNEiJDkheEwuYCXq73WmzesyzrYiNPwHXebMnHYMZzwFM0O W0Hg== X-Gm-Message-State: AOAM530Zj25X/6FG3qTLu1axJRd8Y67QNn8ygDZfa1NavrCAh/TeW9Lz 1+feNps5/BZMVx+FIRcu+yvPR3vhZvFbRlllFo5eQA== X-Google-Smtp-Source: ABdhPJzeYAxkhgz90+cV4xzjxuYXWK3FMvXNU8unx1ubipJguwj8JbmG3y6hvp2zYCNQbarkufBVgQCknZhoyDkaBMo= X-Received: by 2002:a05:6402:ca9:b0:425:ff4d:f6fd with SMTP id cn9-20020a0564020ca900b00425ff4df6fdmr1539826edb.405.1652494901250; Fri, 13 May 2022 19:21:41 -0700 (PDT) MIME-Version: 1.0 References: <20220513221458.1192933-1-atishp@rivosinc.com> In-Reply-To: <20220513221458.1192933-1-atishp@rivosinc.com> From: Frank Chang Date: Sat, 14 May 2022 10:21:30 +0800 Message-ID: Subject: Re: [PATCH] hw/intc: Pass correct hartid while updating mtimecmp To: Atish Patra Cc: "qemu-devel@nongnu.org Developers" , Alistair Francis , Anup Patel , "open list:RISC-V" , dylan@rivosinc.com, Bin Meng , Jim Shu Content-Type: multipart/alternative; boundary="0000000000009520b505deef7303" Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=frank.chang@sifive.com; helo=mail-ed1-x52f.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --0000000000009520b505deef7303 Content-Type: text/plain; charset="UTF-8" Reviewed-by: Frank Chang On Sat, May 14, 2022 at 6:15 AM Atish Patra wrote: > timecmp update function should be invoked with hartid for which > timecmp is being updated. The following patch passes the incorrect > hartid to the update function. > > Fixes: e2f01f3c2e13 ("hw/intc: Make RISC-V ACLINT mtime MMIO register > writable") > > Signed-off-by: Atish Patra > --- > hw/intc/riscv_aclint.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/intc/riscv_aclint.c b/hw/intc/riscv_aclint.c > index 0412edc98257..e6bceceefdbc 100644 > --- a/hw/intc/riscv_aclint.c > +++ b/hw/intc/riscv_aclint.c > @@ -233,7 +233,8 @@ static void riscv_aclint_mtimer_write(void *opaque, > hwaddr addr, > continue; > } > riscv_aclint_mtimer_write_timecmp(mtimer, RISCV_CPU(cpu), > - i, env->timecmp); > + mtimer->hartid_base + i, > + env->timecmp); > } > return; > } > -- > 2.25.1 > > --0000000000009520b505deef7303 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Frank Chang <frank.chang@sifive.com>

On Sat, May 14, 2022 at 6:15 AM = Atish Patra <atishp@rivosinc.com<= /a>> wrote:
t= imecmp update function should be invoked with hartid for which
timecmp is being updated. The following patch passes the incorrect
hartid to the update function.

Fixes: e2f01f3c2e13 ("hw/intc: Make RISC-V ACLINT mtime MMIO register = writable")

Signed-off-by: Atish Patra <
atishp@rivosinc.com>
---
=C2=A0hw/intc/riscv_aclint.c | 3 ++-
=C2=A01 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/intc/riscv_aclint.c b/hw/intc/riscv_aclint.c
index 0412edc98257..e6bceceefdbc 100644
--- a/hw/intc/riscv_aclint.c
+++ b/hw/intc/riscv_aclint.c
@@ -233,7 +233,8 @@ static void riscv_aclint_mtimer_write(void *opaque, hwa= ddr addr,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0riscv_aclint_mtimer_write_t= imecmp(mtimer, RISCV_CPU(cpu),
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 i, env->timecmp);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 mtimer->hartid_base + i,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 env->timecmp);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return;
=C2=A0 =C2=A0 =C2=A0}
--
2.25.1

--0000000000009520b505deef7303--