[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DA04W4PO99EJ.1XWOAUMZV4BXG@ventanamicro.com>
Date: Mon, 19 May 2025 14:25:36 +0200
From: Radim Krčmář <rkrcmar@...tanamicro.com>
To: "Anup Patel" <anup@...infault.org>
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
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.
Thanks.
Powered by blists - more mailing lists