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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhSdy1uKpp=WKXmbnH5BQvTSrK9o-Jd6+nCrQEi3A3efLX52g@mail.gmail.com>
Date: Tue, 20 May 2025 21:13:24 +0530
From: Anup Patel <anup@...infault.org>
To: Radim Krčmář <rkrcmar@...tanamicro.com>
Cc: kvm-riscv@...ts.infradead.org, kvm@...r.kernel.org, 
	linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org, 
	Atish Patra <atishp@...shpatra.org>, Paul Walmsley <paul.walmsley@...ive.com>, 
	Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>, 
	Alexandre Ghiti <alex@...ti.fr>, Andrew Jones <ajones@...tanamicro.com>
Subject: Re: [PATCH v3 1/2] RISC-V: KVM: add KVM_CAP_RISCV_MP_STATE_RESET

On Mon, May 19, 2025 at 5:55 PM Radim Krčmář <rkrcmar@...tanamicro.com> wrote:
>
> 2025-05-16T17:55:05+05:30, Anup Patel <anup@...infault.org>:
> > On Thu, May 15, 2025 at 8:22 PM Radim Krčmář <rkrcmar@...tanamicro.com> wrote:
> >>
> >> Add a toggleable VM capability to reset the VCPU from userspace by
> >> setting MP_STATE_INIT_RECEIVED through IOCTL.
> >>
> >> Reset through a mp_state to avoid adding a new IOCTL.
> >> Do not reset on a transition from STOPPED to RUNNABLE, because it's
> >> better to avoid side effects that would complicate userspace adoption.
> >> The MP_STATE_INIT_RECEIVED is not a permanent mp_state -- IOCTL resets
> >> the VCPU while preserving the original mp_state -- because we wouldn't
> >> gain much from having a new state it in the rest of KVM, but it's a very
> >> non-standard use of the IOCTL.
> >>
> >> Signed-off-by: Radim Krčmář <rkrcmar@...tanamicro.com>
> >> ---
> >> If we want a permanent mp_state, I think that MP_STATE_UNINITIALIZED
> >> would be reasonable.  KVM could reset on transition to any other state.
> >
> > Yes, MP_STATE_UNINITIALIZED looks better. I also suggest
> > that VCPU should be reset when set_mpstate() is called with
> > MP_STATE_UNINITIALIZED and the current state is
> > MP_STATE_STOPPED.
>
> That would result in two resets (stopped -> uninitialized -> *), unless
> we changed the logic.
>
> Would you prefer to reset on transition to the new permanent mp_state?
> MP_STATE_INIT_RECEIVED seems a more fitting name for the state, then.
>

Let's not introduce unnecessary state transitions and go ahead with
MP_STATE_INIT_RECEIVED

Reviewed-by: Anup Patel <anup@...infault.org>

Queued this patch for Linux-6.16

Thanks,
Anup

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ