[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251024072001.3164600-1-maobibo@loongson.cn>
Date: Fri, 24 Oct 2025 15:19:59 +0800
From: Bibo Mao <maobibo@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>,
Xianglai Li <lixianglai@...ngson.cn>,
Song Gao <gaosong@...ngson.cn>
Cc: kvm@...r.kernel.org,
loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH 0/2] LoongArch: KVM: Restore guest PMU if it is enabled
On LoongArch system, guest PMU hardware is shared by guest and host
and PMU interrupt is separated. PMU is pass-through to VM, and there is
PMU context switch when exit to host and return to guest.
There is optimiation to check whether PMU is enabled by guest. If not,
it is not necessary to return to guest. However it is enabled, PMU
context for guest need switch on. Now KVM_REQ_PMU notification is set
on vcpu context switch, however it is missing if there is no vcpu context
switch and PMU is used by guest VM.
Also there is code cleanup about PMU checking on vCPU sched-on callback,
since it is already checked on VM exit entry or VM PMU CSR access abort
routine.
Bibo Mao (2):
LoongArch: KVM: Restore guest PMU if it is enabled
LoongArch: KVM: Skip PMU checking on vCPU context switch
arch/loongarch/kvm/vcpu.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
base-commit: 6fab32bb6508abbb8b7b1c5498e44f0c32320ed5
--
2.39.3
Powered by blists - more mailing lists