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: <CAAhSdy17yUD=7aMcX2VuFHm+1-TQ6jhwsnPJAQsGS_AmmP1WCg@mail.gmail.com>
Date: Fri, 11 Jul 2025 18:35:17 +0530
From: Anup Patel <anup@...infault.org>
To: Anup Patel <apatel@...tanamicro.com>
Cc: Atish Patra <atish.patra@...ux.dev>, Palmer Dabbelt <palmer@...belt.com>, 
	Paul Walmsley <paul.walmsley@...ive.com>, Alexandre Ghiti <alex@...ti.fr>, 
	Andrew Jones <ajones@...tanamicro.com>, kvm@...r.kernel.org, 
	kvm-riscv@...ts.infradead.org, linux-riscv@...ts.infradead.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 0/2] Few timer and AIA fixes for KVM RISC-V

On Mon, Jul 7, 2025 at 9:23 AM Anup Patel <apatel@...tanamicro.com> wrote:
>
> The RISC-V Privileged specificaiton says the following: "WFI is also
> required to resume execution for locally enabled interrupts pending
> at any privilege level, regardless of the global interrupt enable at
> each privilege level."
>
> Based on the above, if there is pending VS-timer interrupt when the
> host (aka HS-mode) executes WFI then such a WFI will simply become NOP
> and not do anything. This result in QEMU RISC-V consuming a lot of CPU
> time on the x86 machine where it is running. The PATCH1 solves this
> issue by adding appropriate cleanup in KVM RISC-V timer virtualization.
>
> As a result PATCH1, race conditions in updating HGEI[E|P] CSRs when a
> VCPU is moved from one host CPU to another are being observed on QEMU
> so the PATCH2 tries to minimize the chances of these race conditions.
>
> Changes since v1:
>  - Added more details about race condition in PATCH2 commit description.
>
> Anup Patel (2):
>   RISC-V: KVM: Disable vstimecmp before exiting to user-space
>   RISC-V: KVM: Move HGEI[E|P] CSR access to IMSIC virtualization
>
>  arch/riscv/include/asm/kvm_aia.h |  4 ++-
>  arch/riscv/kvm/aia.c             | 51 +++++---------------------------
>  arch/riscv/kvm/aia_imsic.c       | 45 ++++++++++++++++++++++++++++
>  arch/riscv/kvm/vcpu.c            |  2 --
>  arch/riscv/kvm/vcpu_timer.c      | 16 ++++++++++
>  5 files changed, 71 insertions(+), 47 deletions(-)
>

Queued this series as fixes for Linux-6.16

I have taken care of the comment on PATCH2 at the time of queuing.

Thanks,
Anup

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ