From: Andrew Jones <ajones@ventanamicro.com>
To: kvm-riscv@lists.infradead.org, Atish Patra <atishp@rivosinc.com>,
Anup Patel <anup@brainfault.org>,
Atish Patra <atishp@atishpatra.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alexandre Ghiti <alex@ghiti.fr>
Cc: kvm@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] RISC-V: KVM: Remove scounteren initialization
Date: Fri, 16 May 2025 11:56:31 +0200 [thread overview]
Message-ID: <C74B29B0-FB1F-4E67-AFDF-FAD7C86FB329@ventanamicro.com> (raw)
In-Reply-To: <20250515-fix_scounteren_vs-v3-1-729dc088943e@rivosinc.com>
On May 16, 2025 1:11:18 AM GMT+02:00, Atish Patra <atishp@rivosinc.com> wrote:
>Scounteren CSR controls the direct access the hpmcounters and cycle/
>instret/time from the userspace. It's the supervisor's responsibility
>to set it up correctly for it's user space. They hypervisor doesn't
>need to decide the policy on behalf of the supervisor.
>
>Signed-off-by: Atish Patra <atishp@rivosinc.com>
>---
>Changes in v3:
>- Removed the redundant declaration
>- Link to v2: https://lore.kernel.org/r/20250515-fix_scounteren_vs-v2-1-1fd8dc0693e8@rivosinc.com
>
>Changes in v2:
>- Remove the scounteren initialization instead of just setting the TM bit.
>- Link to v1: https://lore.kernel.org/r/20250513-fix_scounteren_vs-v1-1-c1f52af93c79@rivosinc.com
>---
> arch/riscv/kvm/vcpu.c | 4 ----
> 1 file changed, 4 deletions(-)
>
>diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c
>index 60d684c76c58..9bfaae9a11ea 100644
>--- a/arch/riscv/kvm/vcpu.c
>+++ b/arch/riscv/kvm/vcpu.c
>@@ -111,7 +111,6 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
> {
> int rc;
> struct kvm_cpu_context *cntx;
>- struct kvm_vcpu_csr *reset_csr = &vcpu->arch.guest_reset_csr;
>
> spin_lock_init(&vcpu->arch.mp_state_lock);
>
>@@ -146,9 +145,6 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
> if (kvm_riscv_vcpu_alloc_vector_context(vcpu, cntx))
> return -ENOMEM;
>
>- /* By default, make CY, TM, and IR counters accessible in VU mode */
>- reset_csr->scounteren = 0x7;
>-
> /* Setup VCPU timer */
> kvm_riscv_vcpu_timer_init(vcpu);
>
>
>---
>base-commit: 01f95500a162fca88cefab9ed64ceded5afabc12
>change-id: 20250513-fix_scounteren_vs-fdd86255c7b7
>--
>Regards,
>Atish patra
>
>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
next prev parent reply other threads:[~2025-05-16 9:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 23:11 Atish Patra
2025-05-16 9:56 ` Andrew Jones [this message]
2025-05-16 12:18 ` Anup Patel
2025-05-16 12:39 ` Andrew Jones
2025-05-16 23:53 ` Atish Patra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C74B29B0-FB1F-4E67-AFDF-FAD7C86FB329@ventanamicro.com \
--to=ajones@ventanamicro.com \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=atishp@atishpatra.org \
--cc=atishp@rivosinc.com \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®