All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atish Patra <atish.patra@linux.dev>
To: "Andrew Jones" <ajones@ventanamicro.com>,
	"Radim Krčmář" <rkrcmar@ventanamicro.com>
Cc: Atish Patra <atish.patra@linux.dev>,
	Anup Patel <anup@brainfault.org>, Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Mayuresh Chitale <mchitale@ventanamicro.com>,
	linux-riscv@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Palmer Dabbelt <palmer@rivosinc.com>,
	kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
	linux-riscv <linux-riscv-bounces@lists.infradead.org>
Subject: Re: [PATCH v3 9/9] RISC-V: KVM: Upgrade the supported SBI version to 3.0
Date: Wed, 28 May 2025 07:16:11 -0700	[thread overview]
Message-ID: <ace8be22-3dba-41b0-81f0-bf6d661b4343@linux.dev> (raw)
In-Reply-To: <20250526-224478e15ee50987124a47ac@orel>

On 5/26/25 4:13 AM, Andrew Jones wrote:
> On Mon, May 26, 2025 at 11:00:30AM +0200, Radim Krčmář wrote:
>> 2025-05-23T10:16:11-07:00, Atish Patra <atish.patra@linux.dev>:
>>> On 5/23/25 6:31 AM, Radim Krčmář wrote:
>>>> 2025-05-22T12:03:43-07:00, Atish Patra <atishp@rivosinc.com>:
>>>>> Upgrade the SBI version to v3.0 so that corresponding features
>>>>> can be enabled in the guest.
>>>>>
>>>>> Signed-off-by: Atish Patra <atishp@rivosinc.com>
>>>>> ---
>>>>> diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h
>>>>> -#define KVM_SBI_VERSION_MAJOR 2
>>>>> +#define KVM_SBI_VERSION_MAJOR 3
>>>> I think it's time to add versioning to KVM SBI implementation.
>>>> Userspace should be able to select the desired SBI version and KVM would
>>>> tell the guest that newer features are not supported.
> 
> We need new code for this, but it's a good idea.
> 
>>>
>>> We can achieve that through onereg interface by disabling individual SBI
>>> extensions.
>>> We can extend the existing onereg interface to disable a specific SBI
>>> version directly
>>> instead of individual ones to save those IOCTL as well.
>>
>> Yes, I am all in favor of letting userspace provide all values in the
>> BASE extension.
> 

We already support vendorid/archid/impid through one reg. I think we 
just need to add the SBI version support to that so that user space can 
set it.

> This is covered by your recent patch that provides userspace_sbi.

Why do we need to invent new IOCTL for this ? Once the user space sets 
the SBI version, KVM can enforce it.

> With that, userspace can disable all extensions that aren't
> supported by a given spec version, disable BASE and then provide
> a BASE that advertises the version it wants. The new code is needed
> for extensions that userspace still wants KVM to accelerate, but then
> KVM needs to be informed it should deny all functions not included in
> the selected spec version.
> 
> Thanks,
> drew
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv


-- 
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Atish Patra <atish.patra@linux.dev>
To: "Andrew Jones" <ajones@ventanamicro.com>,
	"Radim Krčmář" <rkrcmar@ventanamicro.com>
Cc: Atish Patra <atish.patra@linux.dev>,
	Anup Patel <anup@brainfault.org>, Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Mayuresh Chitale <mchitale@ventanamicro.com>,
	linux-riscv@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Palmer Dabbelt <palmer@rivosinc.com>,
	kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
	linux-riscv <linux-riscv-bounces@lists.infradead.org>
Subject: Re: [PATCH v3 9/9] RISC-V: KVM: Upgrade the supported SBI version to 3.0
Date: Wed, 28 May 2025 07:16:11 -0700	[thread overview]
Message-ID: <ace8be22-3dba-41b0-81f0-bf6d661b4343@linux.dev> (raw)
In-Reply-To: <20250526-224478e15ee50987124a47ac@orel>

On 5/26/25 4:13 AM, Andrew Jones wrote:
> On Mon, May 26, 2025 at 11:00:30AM +0200, Radim Krčmář wrote:
>> 2025-05-23T10:16:11-07:00, Atish Patra <atish.patra@linux.dev>:
>>> On 5/23/25 6:31 AM, Radim Krčmář wrote:
>>>> 2025-05-22T12:03:43-07:00, Atish Patra <atishp@rivosinc.com>:
>>>>> Upgrade the SBI version to v3.0 so that corresponding features
>>>>> can be enabled in the guest.
>>>>>
>>>>> Signed-off-by: Atish Patra <atishp@rivosinc.com>
>>>>> ---
>>>>> diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h
>>>>> -#define KVM_SBI_VERSION_MAJOR 2
>>>>> +#define KVM_SBI_VERSION_MAJOR 3
>>>> I think it's time to add versioning to KVM SBI implementation.
>>>> Userspace should be able to select the desired SBI version and KVM would
>>>> tell the guest that newer features are not supported.
> 
> We need new code for this, but it's a good idea.
> 
>>>
>>> We can achieve that through onereg interface by disabling individual SBI
>>> extensions.
>>> We can extend the existing onereg interface to disable a specific SBI
>>> version directly
>>> instead of individual ones to save those IOCTL as well.
>>
>> Yes, I am all in favor of letting userspace provide all values in the
>> BASE extension.
> 

We already support vendorid/archid/impid through one reg. I think we 
just need to add the SBI version support to that so that user space can 
set it.

> This is covered by your recent patch that provides userspace_sbi.

Why do we need to invent new IOCTL for this ? Once the user space sets 
the SBI version, KVM can enforce it.

> With that, userspace can disable all extensions that aren't
> supported by a given spec version, disable BASE and then provide
> a BASE that advertises the version it wants. The new code is needed
> for extensions that userspace still wants KVM to accelerate, but then
> KVM needs to be informed it should deny all functions not included in
> the selected spec version.
> 
> Thanks,
> drew
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv


WARNING: multiple messages have this Message-ID (diff)
From: Atish Patra <atish.patra@linux.dev>
To: "Andrew Jones" <ajones@ventanamicro.com>,
	"Radim Krčmář" <rkrcmar@ventanamicro.com>
Cc: Atish Patra <atish.patra@linux.dev>,
	Anup Patel <anup@brainfault.org>, Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Mayuresh Chitale <mchitale@ventanamicro.com>,
	linux-riscv@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Palmer Dabbelt <palmer@rivosinc.com>,
	kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
	linux-riscv <linux-riscv-bounces@lists.infradead.org>
Subject: Re: [PATCH v3 9/9] RISC-V: KVM: Upgrade the supported SBI version to 3.0
Date: Wed, 28 May 2025 07:16:11 -0700	[thread overview]
Message-ID: <ace8be22-3dba-41b0-81f0-bf6d661b4343@linux.dev> (raw)
In-Reply-To: <20250526-224478e15ee50987124a47ac@orel>

On 5/26/25 4:13 AM, Andrew Jones wrote:
> On Mon, May 26, 2025 at 11:00:30AM +0200, Radim Krčmář wrote:
>> 2025-05-23T10:16:11-07:00, Atish Patra <atish.patra@linux.dev>:
>>> On 5/23/25 6:31 AM, Radim Krčmář wrote:
>>>> 2025-05-22T12:03:43-07:00, Atish Patra <atishp@rivosinc.com>:
>>>>> Upgrade the SBI version to v3.0 so that corresponding features
>>>>> can be enabled in the guest.
>>>>>
>>>>> Signed-off-by: Atish Patra <atishp@rivosinc.com>
>>>>> ---
>>>>> diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h
>>>>> -#define KVM_SBI_VERSION_MAJOR 2
>>>>> +#define KVM_SBI_VERSION_MAJOR 3
>>>> I think it's time to add versioning to KVM SBI implementation.
>>>> Userspace should be able to select the desired SBI version and KVM would
>>>> tell the guest that newer features are not supported.
> 
> We need new code for this, but it's a good idea.
> 
>>>
>>> We can achieve that through onereg interface by disabling individual SBI
>>> extensions.
>>> We can extend the existing onereg interface to disable a specific SBI
>>> version directly
>>> instead of individual ones to save those IOCTL as well.
>>
>> Yes, I am all in favor of letting userspace provide all values in the
>> BASE extension.
> 

We already support vendorid/archid/impid through one reg. I think we 
just need to add the SBI version support to that so that user space can 
set it.

> This is covered by your recent patch that provides userspace_sbi.

Why do we need to invent new IOCTL for this ? Once the user space sets 
the SBI version, KVM can enforce it.

> With that, userspace can disable all extensions that aren't
> supported by a given spec version, disable BASE and then provide
> a BASE that advertises the version it wants. The new code is needed
> for extensions that userspace still wants KVM to accelerate, but then
> KVM needs to be informed it should deny all functions not included in
> the selected spec version.
> 
> Thanks,
> drew
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2025-05-28 14:28 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22 19:03 [PATCH v3 0/9] Add SBI v3.0 PMU enhancements Atish Patra
2025-05-22 19:03 ` Atish Patra
2025-05-22 19:03 ` Atish Patra
2025-05-22 19:03 ` [PATCH v3 1/9] drivers/perf: riscv: Add SBI v3.0 flag Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-07-17 15:11   ` Anup Patel
2025-07-17 15:11     ` Anup Patel
2025-07-17 15:11     ` Anup Patel
2025-05-22 19:03 ` [PATCH v3 2/9] drivers/perf: riscv: Add raw event v2 support Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-07-17 15:17   ` Anup Patel
2025-07-17 15:17     ` Anup Patel
2025-07-17 15:17     ` Anup Patel
2025-05-22 19:03 ` [PATCH v3 3/9] RISC-V: KVM: Add support for Raw event v2 Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-07-17 15:18   ` Anup Patel
2025-07-17 15:18     ` Anup Patel
2025-07-17 15:18     ` Anup Patel
2025-05-22 19:03 ` [PATCH v3 4/9] drivers/perf: riscv: Implement PMU event info function Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-07-18  4:32   ` Anup Patel
2025-07-18  4:32     ` Anup Patel
2025-07-18  4:32     ` Anup Patel
2025-05-22 19:03 ` [PATCH v3 5/9] drivers/perf: riscv: Export " Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-07-18  4:39   ` Anup Patel
2025-07-18  4:39     ` Anup Patel
2025-07-18  4:39     ` Anup Patel
2025-05-22 19:03 ` [PATCH v3 6/9] KVM: Add a helper function to validate vcpu gpa range Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-07-17 16:04   ` Anup Patel
2025-07-17 16:04     ` Anup Patel
2025-07-17 16:04     ` Anup Patel
2025-07-17 16:07   ` Anup Patel
2025-07-17 16:07     ` Anup Patel
2025-07-17 16:07     ` Anup Patel
2025-05-22 19:03 ` [PATCH v3 7/9] RISC-V: KVM: Use the new gpa range validate helper function Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-07-18  4:40   ` Anup Patel
2025-07-18  4:40     ` Anup Patel
2025-07-18  4:40     ` Anup Patel
2025-05-22 19:03 ` [PATCH v3 8/9] RISC-V: KVM: Implement get event info function Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-07-18  5:44   ` Anup Patel
2025-07-18  5:44     ` Anup Patel
2025-07-18  5:44     ` Anup Patel
2025-05-22 19:03 ` [PATCH v3 9/9] RISC-V: KVM: Upgrade the supported SBI version to 3.0 Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-22 19:03   ` Atish Patra
2025-05-23 13:31   ` Radim Krčmář
2025-05-23 13:31     ` Radim Krčmář
2025-05-23 13:31     ` Radim Krčmář
2025-05-23 17:16     ` Atish Patra
2025-05-23 17:16       ` Atish Patra
2025-05-23 17:16       ` Atish Patra
2025-05-26  9:00       ` Radim Krčmář
2025-05-26  9:00         ` Radim Krčmář
2025-05-26  9:00         ` Radim Krčmář
2025-05-26 11:13         ` Andrew Jones
2025-05-26 11:13           ` Andrew Jones
2025-05-26 11:13           ` Andrew Jones
2025-05-28 14:16           ` Atish Patra [this message]
2025-05-28 14:16             ` Atish Patra
2025-05-28 14:16             ` Atish Patra
2025-05-28 15:09             ` Andrew Jones
2025-05-28 15:09               ` Andrew Jones
2025-05-28 15:09               ` Andrew Jones
2025-05-28 19:21               ` Atish Patra
2025-05-28 19:21                 ` Atish Patra
2025-05-28 19:21                 ` Atish Patra
2025-05-29  1:17                 ` Atish Patra
2025-05-29  1:17                   ` Atish Patra
2025-05-29  1:17                   ` Atish Patra
2025-05-29 10:24                 ` Radim Krčmář
2025-05-29 10:24                   ` Radim Krčmář
2025-05-29 10:24                   ` Radim Krčmář
2025-05-29 18:44                   ` Atish Patra
2025-05-29 18:44                     ` Atish Patra
2025-05-29 18:44                     ` Atish Patra
2025-05-29 19:14                     ` Andrew Jones
2025-05-29 19:14                       ` Andrew Jones
2025-05-29 19:14                       ` Andrew Jones
2025-05-30 11:45                       ` Anup Patel
2025-05-30 11:45                         ` Anup Patel
2025-05-30 11:45                         ` Anup Patel
2025-05-30 11:09                     ` Radim Krčmář
2025-05-30 11:09                       ` Radim Krčmář
2025-05-30 11:09                       ` Radim Krčmář
2025-05-30 19:29                       ` Atish Patra
2025-05-30 19:29                         ` Atish Patra
2025-05-30 19:29                         ` Atish Patra
2025-06-03 11:40                         ` Radim Krčmář
2025-06-03 11:40                           ` Radim Krčmář
2025-06-03 11:40                           ` Radim Krčmář
2025-06-04  0:29                           ` Atish Patra
2025-06-04  0:29                             ` Atish Patra
2025-06-04  0:29                             ` Atish Patra
2025-07-18  4:44   ` Anup Patel
2025-07-18  4:44     ` Anup Patel
2025-07-18  4:44     ` Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ace8be22-3dba-41b0-81f0-bf6d661b4343@linux.dev \
    --to=atish.patra@linux.dev \
    --cc=ajones@ventanamicro.com \
    --cc=anup@brainfault.org \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv-bounces@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=mchitale@ventanamicro.com \
    --cc=palmer@dabbelt.com \
    --cc=palmer@rivosinc.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rkrcmar@ventanamicro.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.