[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240415-cdc6d5bc6c5145f9d6f54afc@orel>
Date: Mon, 15 Apr 2024 15:23:35 +0200
From: Andrew Jones <ajones@...tanamicro.com>
To: Atish Patra <atishp@...osinc.com>
Cc: linux-kernel@...r.kernel.org, Anup Patel <anup@...infault.org>,
Ajay Kaher <ajay.kaher@...adcom.com>, Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alexghiti@...osinc.com>, Alexey Makhalov <alexey.amakhalov@...adcom.com>,
Atish Patra <atishp@...shpatra.org>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>, Conor Dooley <conor.dooley@...rochip.com>,
Juergen Gross <jgross@...e.com>, kvm-riscv@...ts.infradead.org, kvm@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-riscv@...ts.infradead.org,
Mark Rutland <mark.rutland@....com>, Palmer Dabbelt <palmer@...belt.com>,
Paolo Bonzini <pbonzini@...hat.com>, Paul Walmsley <paul.walmsley@...ive.com>,
Shuah Khan <shuah@...nel.org>, virtualization@...ts.linux.dev, Will Deacon <will@...nel.org>,
x86@...nel.org
Subject: Re: [PATCH v6 14/24] RISC-V: KVM: Add perf sampling support for
guests
On Wed, Apr 10, 2024 at 05:07:42PM -0700, Atish Patra wrote:
> KVM enables perf for guest via counter virtualization. However, the
> sampling can not be supported as there is no mechanism to enabled
> trap/emulate scountovf in ISA yet. Rely on the SBI PMU snapshot
> to provide the counter overflow data via the shared memory.
>
> In case of sampling event, the host first sets the guest's LCOFI
> interrupt and injects to the guest via irq filtering mechanism defined
> in AIA specification. Thus, ssaia must be enabled in the host in order
> to use perf sampling in the guest. No other AIA dependency w.r.t kernel
> is required.
>
> Reviewed-by: Anup Patel <anup@...infault.org>
> Signed-off-by: Atish Patra <atishp@...osinc.com>
> ---
> arch/riscv/include/asm/csr.h | 3 +-
> arch/riscv/include/asm/kvm_vcpu_pmu.h | 3 ++
> arch/riscv/include/uapi/asm/kvm.h | 1 +
> arch/riscv/kvm/aia.c | 5 ++
> arch/riscv/kvm/vcpu.c | 15 ++++--
> arch/riscv/kvm/vcpu_onereg.c | 6 +++
> arch/riscv/kvm/vcpu_pmu.c | 68 +++++++++++++++++++++++++--
> 7 files changed, 93 insertions(+), 8 deletions(-)
>
Reviewed-by: Andrew Jones <ajones@...tanamicro.com>
Powered by blists - more mailing lists