* [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM
@ 2024-01-04 12:37 Andrew Jones
2024-01-04 16:02 ` Randy Dunlap
2024-01-18 12:59 ` Anup Patel
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Jones @ 2024-01-04 12:37 UTC (permalink / raw)
To: linux-riscv, linux-next, linux-kernel, kvm, kvm-riscv
Cc: paul.walmsley, palmer, aou, anup, atishp, rdunlap, sfr, alex,
mpe, npiggin, linuxppc-dev, pbonzini
KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM
supporting architectures select HAVE_KVM and then their KVM
Kconfigs ensure its there with a depends on HAVE_KVM. Make RISCV
consistent with that approach which fixes configs which have KVM
but not EVENTFD, as was discovered with a randconfig test.
Fixes: 99cdc6c18c2d ("RISC-V: Add initial skeletal KVM support")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/all/44907c6b-c5bd-4e4a-a921-e4d3825539d8@infradead.org/
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
v2:
- Added Fixes tag and -fixes prefix [Alexandre/Anup]
arch/riscv/Kconfig | 1 +
arch/riscv/kvm/Kconfig | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index a935a5f736b9..daba06a3b76f 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -128,6 +128,7 @@ config RISCV
select HAVE_KPROBES if !XIP_KERNEL
select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
select HAVE_KRETPROBES if !XIP_KERNEL
+ select HAVE_KVM
# https://github.com/ClangBuiltLinux/linux/issues/1881
select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !LD_IS_LLD
select HAVE_MOVE_PMD
diff --git a/arch/riscv/kvm/Kconfig b/arch/riscv/kvm/Kconfig
index 1fd76aee3b71..36fa8ec9e5ba 100644
--- a/arch/riscv/kvm/Kconfig
+++ b/arch/riscv/kvm/Kconfig
@@ -19,7 +19,7 @@ if VIRTUALIZATION
config KVM
tristate "Kernel-based Virtual Machine (KVM) support (EXPERIMENTAL)"
- depends on RISCV_SBI && MMU
+ depends on HAVE_KVM && RISCV_SBI && MMU
select HAVE_KVM_IRQCHIP
select HAVE_KVM_IRQ_ROUTING
select HAVE_KVM_MSI
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM
2024-01-04 12:37 [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM Andrew Jones
@ 2024-01-04 16:02 ` Randy Dunlap
2024-01-18 12:59 ` Anup Patel
1 sibling, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2024-01-04 16:02 UTC (permalink / raw)
To: Andrew Jones, linux-riscv, linux-next, linux-kernel, kvm, kvm-riscv
Cc: paul.walmsley, palmer, aou, anup, atishp, sfr, alex, mpe,
npiggin, linuxppc-dev, pbonzini
On 1/4/24 04:37, Andrew Jones wrote:
> KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM
> supporting architectures select HAVE_KVM and then their KVM
> Kconfigs ensure its there with a depends on HAVE_KVM. Make RISCV
> consistent with that approach which fixes configs which have KVM
> but not EVENTFD, as was discovered with a randconfig test.
>
> Fixes: 99cdc6c18c2d ("RISC-V: Add initial skeletal KVM support")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Closes: https://lore.kernel.org/all/44907c6b-c5bd-4e4a-a921-e4d3825539d8@infradead.org/
> Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Thanks.
> ---
>
> v2:
> - Added Fixes tag and -fixes prefix [Alexandre/Anup]
>
> arch/riscv/Kconfig | 1 +
> arch/riscv/kvm/Kconfig | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index a935a5f736b9..daba06a3b76f 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -128,6 +128,7 @@ config RISCV
> select HAVE_KPROBES if !XIP_KERNEL
> select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
> select HAVE_KRETPROBES if !XIP_KERNEL
> + select HAVE_KVM
> # https://github.com/ClangBuiltLinux/linux/issues/1881
> select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !LD_IS_LLD
> select HAVE_MOVE_PMD
> diff --git a/arch/riscv/kvm/Kconfig b/arch/riscv/kvm/Kconfig
> index 1fd76aee3b71..36fa8ec9e5ba 100644
> --- a/arch/riscv/kvm/Kconfig
> +++ b/arch/riscv/kvm/Kconfig
> @@ -19,7 +19,7 @@ if VIRTUALIZATION
>
> config KVM
> tristate "Kernel-based Virtual Machine (KVM) support (EXPERIMENTAL)"
> - depends on RISCV_SBI && MMU
> + depends on HAVE_KVM && RISCV_SBI && MMU
> select HAVE_KVM_IRQCHIP
> select HAVE_KVM_IRQ_ROUTING
> select HAVE_KVM_MSI
--
#Randy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM
2024-01-04 12:37 [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM Andrew Jones
2024-01-04 16:02 ` Randy Dunlap
@ 2024-01-18 12:59 ` Anup Patel
2024-01-18 17:40 ` Sean Christopherson
1 sibling, 1 reply; 5+ messages in thread
From: Anup Patel @ 2024-01-18 12:59 UTC (permalink / raw)
To: Andrew Jones
Cc: linux-riscv, linux-next, linux-kernel, kvm, kvm-riscv,
paul.walmsley, palmer, aou, atishp, rdunlap, sfr, alex, mpe,
npiggin, linuxppc-dev, pbonzini
On Thu, Jan 4, 2024 at 6:07 PM Andrew Jones <ajones@ventanamicro.com> wrote:
>
> KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM
> supporting architectures select HAVE_KVM and then their KVM
> Kconfigs ensure its there with a depends on HAVE_KVM. Make RISCV
> consistent with that approach which fixes configs which have KVM
> but not EVENTFD, as was discovered with a randconfig test.
>
> Fixes: 99cdc6c18c2d ("RISC-V: Add initial skeletal KVM support")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Closes: https://lore.kernel.org/all/44907c6b-c5bd-4e4a-a921-e4d3825539d8@infradead.org/
> Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Queued this patch for Linux-6.8
Regards,
Anup
> ---
>
> v2:
> - Added Fixes tag and -fixes prefix [Alexandre/Anup]
>
> arch/riscv/Kconfig | 1 +
> arch/riscv/kvm/Kconfig | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index a935a5f736b9..daba06a3b76f 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -128,6 +128,7 @@ config RISCV
> select HAVE_KPROBES if !XIP_KERNEL
> select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
> select HAVE_KRETPROBES if !XIP_KERNEL
> + select HAVE_KVM
> # https://github.com/ClangBuiltLinux/linux/issues/1881
> select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !LD_IS_LLD
> select HAVE_MOVE_PMD
> diff --git a/arch/riscv/kvm/Kconfig b/arch/riscv/kvm/Kconfig
> index 1fd76aee3b71..36fa8ec9e5ba 100644
> --- a/arch/riscv/kvm/Kconfig
> +++ b/arch/riscv/kvm/Kconfig
> @@ -19,7 +19,7 @@ if VIRTUALIZATION
>
> config KVM
> tristate "Kernel-based Virtual Machine (KVM) support (EXPERIMENTAL)"
> - depends on RISCV_SBI && MMU
> + depends on HAVE_KVM && RISCV_SBI && MMU
> select HAVE_KVM_IRQCHIP
> select HAVE_KVM_IRQ_ROUTING
> select HAVE_KVM_MSI
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM
2024-01-18 12:59 ` Anup Patel
@ 2024-01-18 17:40 ` Sean Christopherson
2024-01-19 3:12 ` Anup Patel
0 siblings, 1 reply; 5+ messages in thread
From: Sean Christopherson @ 2024-01-18 17:40 UTC (permalink / raw)
To: Anup Patel
Cc: Andrew Jones, linux-riscv, linux-next, linux-kernel, kvm,
kvm-riscv, paul.walmsley, palmer, aou, atishp, rdunlap, sfr,
alex, mpe, npiggin, linuxppc-dev, pbonzini
On Thu, Jan 18, 2024, Anup Patel wrote:
> On Thu, Jan 4, 2024 at 6:07 PM Andrew Jones <ajones@ventanamicro.com> wrote:
> >
> > KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM
> > supporting architectures select HAVE_KVM and then their KVM
> > Kconfigs ensure its there with a depends on HAVE_KVM. Make RISCV
> > consistent with that approach which fixes configs which have KVM
> > but not EVENTFD, as was discovered with a randconfig test.
> >
> > Fixes: 99cdc6c18c2d ("RISC-V: Add initial skeletal KVM support")
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Closes: https://lore.kernel.org/all/44907c6b-c5bd-4e4a-a921-e4d3825539d8@infradead.org/
> > Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
>
> Queued this patch for Linux-6.8
That should be unnecessary. Commit caadf876bb74 ("KVM: introduce CONFIG_KVM_COMMON"),
which is in Paolo's pull request for 6.8, addresses the EVENTFD issue. And the
rest of Paolo's series[*], which presumably will get queued for 6.9, eliminates
HAVE_KVM entirely.
[*] https://lore.kernel.org/all/20240108124740.114453-6-pbonzini@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM
2024-01-18 17:40 ` Sean Christopherson
@ 2024-01-19 3:12 ` Anup Patel
0 siblings, 0 replies; 5+ messages in thread
From: Anup Patel @ 2024-01-19 3:12 UTC (permalink / raw)
To: Sean Christopherson
Cc: Anup Patel, Andrew Jones, linux-riscv, linux-next, linux-kernel,
kvm, kvm-riscv, paul.walmsley, palmer, aou, atishp, rdunlap, sfr,
alex, mpe, npiggin, linuxppc-dev, pbonzini
On Thu, Jan 18, 2024 at 11:10 PM Sean Christopherson <seanjc@google.com> wrote:
>
> On Thu, Jan 18, 2024, Anup Patel wrote:
> > On Thu, Jan 4, 2024 at 6:07 PM Andrew Jones <ajones@ventanamicro.com> wrote:
> > >
> > > KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM
> > > supporting architectures select HAVE_KVM and then their KVM
> > > Kconfigs ensure its there with a depends on HAVE_KVM. Make RISCV
> > > consistent with that approach which fixes configs which have KVM
> > > but not EVENTFD, as was discovered with a randconfig test.
> > >
> > > Fixes: 99cdc6c18c2d ("RISC-V: Add initial skeletal KVM support")
> > > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > > Closes: https://lore.kernel.org/all/44907c6b-c5bd-4e4a-a921-e4d3825539d8@infradead.org/
> > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
> >
> > Queued this patch for Linux-6.8
>
> That should be unnecessary. Commit caadf876bb74 ("KVM: introduce CONFIG_KVM_COMMON"),
> which is in Paolo's pull request for 6.8, addresses the EVENTFD issue. And the
> rest of Paolo's series[*], which presumably will get queued for 6.9, eliminates
> HAVE_KVM entirely.
>
> [*] https://lore.kernel.org/all/20240108124740.114453-6-pbonzini@redhat.com
I was not sure about the timeline of when Paolo's series would be merged
hence thought of taking this patch as a fix.
For now, I will drop this patch from my queue. If required we can have it
as a 6.8-rc fix.
Regards,
Anup
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-01-19 3:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04 12:37 [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM Andrew Jones
2024-01-04 16:02 ` Randy Dunlap
2024-01-18 12:59 ` Anup Patel
2024-01-18 17:40 ` Sean Christopherson
2024-01-19 3:12 ` Anup Patel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).