[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <01696003-e2b4-4450-85cf-715e31b136d5@rivosinc.com>
Date: Fri, 23 May 2025 21:23:41 +0200
From: Clément Léger <cleger@...osinc.com>
To: Atish Patra <atish.patra@...ux.dev>,
Radim Krčmář <rkrcmar@...tanamicro.com>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
<palmer@...belt.com>, Anup Patel <anup@...infault.org>,
Atish Patra <atishp@...shpatra.org>, Shuah Khan <shuah@...nel.org>,
Jonathan Corbet <corbet@....net>, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
kvm@...r.kernel.org, kvm-riscv@...ts.infradead.org,
linux-kselftest@...r.kernel.org
Cc: Samuel Holland <samuel.holland@...ive.com>,
Andrew Jones <ajones@...tanamicro.com>, Deepak Gupta <debug@...osinc.com>,
Charlie Jenkins <charlie@...osinc.com>,
linux-riscv <linux-riscv-bounces@...ts.infradead.org>
Subject: Re: [PATCH v8 13/14] RISC-V: KVM: add support for FWFT SBI extension
On 23/05/2025 20:02, Atish Patra wrote:
> On 5/23/25 9:27 AM, Radim KrÄmáŠwrote:
>> 2025-05-23T17:29:49+02:00, Clément Léger <cleger@...osinc.com>:
>>> On 23/05/2025 15:05, Radim Krčmář wrote:
>>>> 2025-05-23T12:19:30+02:00, Clément Léger <cleger@...osinc.com>:
>>>>> +++ b/arch/riscv/kvm/vcpu_sbi_fwft.c
>>>>> +static const enum sbi_fwft_feature_t kvm_fwft_defined_features[] = {
>>>>> + SBI_FWFT_MISALIGNED_EXC_DELEG,
>>>>> + SBI_FWFT_LANDING_PAD,
>>>>> + SBI_FWFT_SHADOW_STACK,
>>>>> + SBI_FWFT_DOUBLE_TRAP,
>>>>> + SBI_FWFT_PTE_AD_HW_UPDATING,
>>>>> + SBI_FWFT_POINTER_MASKING_PMLEN,
>>>>> +};
>>>>
>>>> How will userspace control which subset of these features is allowed in
>>>> the guest?
>>>>
>>>> (We can reuse the KVM SBI extension interface if we don't want to add a
>>>> FWFT specific ONE_REG.)
>>>
>>> Hi Radim,
>>>
>>> I didn't looked at that part. But most likely using the kvm one reg
>>> interface seems ok like what is done for STA ? We could have per feature
>>> override with one reg per feature.
>>
>> Sounds fine.
>>
>
> Yeah. We can have a follow up series for SBI FWFT state that allows user
> space to toggle each state individually.
>
>>> Is this something blocking though ? We'd like to merge FWFT once SBI 3.0
>>> is ratified so that would be nice not delaying it too much. I'll take a
>>> look at it to see if it isn't too long to implement.
>>
>> Not blocking, but I would at least default FWFT to disabled, because
>> current userspace cannot handle [14/14]. (Well... save/restore was
>> probably broken even before, but let's try to not make it worse. :])
>>
>
> User space can not enable or disable misaligned access delegation as
> there is no interface for now rightly pointed by you. I guess supporting
> that would be quicker than fixing the broader guest save/restore
> anyways. Isn't it ?
>
> We can have the patches ready for the next MW for FWFT one reg interface.
Yeah sure I'll work on that in the meantime.
>
>> Thanks.
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@...ts.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
>
Powered by blists - more mailing lists