lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H7AFE3Th0NzmwwmN4vxsFtj1w_fUzk1CWuUyycuP9twfQ@mail.gmail.com>
Date: Sat, 26 Apr 2025 18:19:38 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Bibo Mao <maobibo@...ngson.cn>
Cc: Tianrui Zhao <zhaotianrui@...ngson.cn>, Song Gao <gaosong@...ngson.cn>, kvm@...r.kernel.org, 
	loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] LoongArch: KVM: Fix PMU pass-through issue if VM exits to
 host finally

Applied, thanks.

Huacai

On Mon, Apr 21, 2025 at 9:18 AM Bibo Mao <maobibo@...ngson.cn> wrote:
>
> In function kvm_pre_enter_guest(), it prepares to enter guest and check
> whether there are pending signals or events. And it will not enter guest
> if there are, PMU pass-through preparation for guest should be cancelled
> and host should own PMU hardware.
>
> Fixes: f4e40ea9f78f ("LoongArch: KVM: Add PMU support for guest")
> Signed-off-by: Bibo Mao <maobibo@...ngson.cn>
> ---
>  arch/loongarch/kvm/vcpu.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c
> index 8e427b379661..d96191d65f53 100644
> --- a/arch/loongarch/kvm/vcpu.c
> +++ b/arch/loongarch/kvm/vcpu.c
> @@ -294,6 +294,8 @@ static int kvm_pre_enter_guest(struct kvm_vcpu *vcpu)
>                 vcpu->arch.aux_inuse &= ~KVM_LARCH_SWCSR_LATEST;
>
>                 if (kvm_request_pending(vcpu) || xfer_to_guest_mode_work_pending()) {
> +                       /* Lose pmu for guest and let host own it */
> +                       kvm_lose_pmu(vcpu);
>                         /* make sure the vcpu mode has been written */
>                         smp_store_mb(vcpu->mode, OUTSIDE_GUEST_MODE);
>                         local_irq_enable();
>
> base-commit: 3088d26962e802efa3aa5188f88f82a957f50b22
> --
> 2.39.3
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ