Message ID | 20240104123727.76987-2-ajones@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-16648-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5582150dyb; Thu, 4 Jan 2024 04:38:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSOr9Jl1F9jejJ3R4F3dEMwYD3Zf/mGDYQSLv3f0hu93jwuvuVPHEn0GNhLWobLxxoDFIH X-Received: by 2002:a05:6e02:144c:b0:35f:e83e:88ae with SMTP id p12-20020a056e02144c00b0035fe83e88aemr604251ilo.21.1704371895504; Thu, 04 Jan 2024 04:38:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704371895; cv=none; d=google.com; s=arc-20160816; b=NROX3lINhuMtxvKLC/boNFp+R3X011HyQ2lSJRAkpBF2+SXdSXofzeZ9nj1EDG+osD ZQFgNaQBFqqWvLawMHRQwx/GhHJ9mmtDzVY93N+Xpg36EtdP23zl47A7sKTeRXYxqtAC MO3lgNRmbpc+w8FVgzqCfg3LjZTVDwf+KbEoZzi+gJ7kdMCKAU9XWp89VulubgnKa1G4 pTcH0NHfRPgNJI0yIavwEA0U4r3rlUqS5OAu9Y5NkyhLjIknhwVHiSdfQ5ZNaVxR1zxV RXFMvJJGq3hS1Fgn0do3Mp4SqpgoLHCdzSGc8St47RbTmNuUSS9pzjdvTDAeFUuJtkPg 153w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=b0YjTQ6DAdt/2c3mL0l6eIgN8OTkE75G1dsO8pPOomQ=; fh=ZlrCdudDDDZUa/nUh+xBnvxzLtNVDefZjzsWyaPz48w=; b=E56p+856L8nGPTLgdYwMI8kW4VuKkIx3nc6g3BhqpShdbypHW4NrNanxwVN3W9R1tI WpQG0tL65mWQME/ip2egSSYmpj9fC3ur01qNw220lubqdQ+n06vIFlTaFptWZvvLVdIj hxSQX0Vg8dlJv+LSnVs0Yez5HpbHBa3glZ1frCKfMC2+nP4PcovCLlUazmzDnLpGlpbP +iY5YF6agNW3hTsQJCSqABhDb7ToY7LBXVBore/aCzuBkIysOrl3zBweDMG1Q54VbouY UtPgn2QE0WFRhNSAyiluqsk1qAC8EOtGHfpzDLvhkiVINgp4DE4HFlQzNzI3aKA3ClO/ oMLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=mEopR9IX; spf=pass (google.com: domain of linux-kernel+bounces-16648-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16648-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i25-20020a635419000000b005bdbf2ac2d2si23534516pgb.85.2024.01.04.04.38.15 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 04:38:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16648-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=mEopR9IX; spf=pass (google.com: domain of linux-kernel+bounces-16648-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16648-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CA537286CB6 for <ouuuleilei@gmail.com>; Thu, 4 Jan 2024 12:38:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBE08224D4; Thu, 4 Jan 2024 12:37:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="mEopR9IX" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65B6121A16 for <linux-kernel@vger.kernel.org>; Thu, 4 Jan 2024 12:37:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a2888d65f1fso54906066b.1 for <linux-kernel@vger.kernel.org>; Thu, 04 Jan 2024 04:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1704371848; x=1704976648; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b0YjTQ6DAdt/2c3mL0l6eIgN8OTkE75G1dsO8pPOomQ=; b=mEopR9IXAZ8ER49J8Uh++34YDIOVbKN5erpP/wHQxrGUcIhH6DTUSS2g8cEBokav9i A/lEtutWeDCGupSK7OlJH4mldmC3iuDl7iRxGuEzlbfECllUwkBEfZimJrki1xjBqtkm bk6V1yjmESkwv5l/KCjfKGaHNqYF/WZRwFRdNXvx/hLfvdj7uUwnZZhXbmCRjzvDUsfw KEkycmZZU3suE1Pn+x/ApdDpBAAF3T6wqrr15aV6vf2luqt05zKw8GYZHtxf9/JdFeMn es5lO5Dz5tEtTBYrioVFgNKiDrKbYIG3Uz1UwHazFVo3YLrNKKI0jVzXCcmq8XPTvLhK EfkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704371848; x=1704976648; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b0YjTQ6DAdt/2c3mL0l6eIgN8OTkE75G1dsO8pPOomQ=; b=qhy1tHSV8E+yS/SY7y3sCbWQQ6I4K7NxKAx8DPoXB1ErR+AoBOvGHQPjduqDUVVKn4 ECAgGD7+OWsDahk4MaTNDwbwwKW+4tG+Nv654KnWQC2om8bzEu76oKudYMJij1YvoRlP 9uKyRv1pgl/5We/nu3s0qsLPvsqcwqclDeuRD5aA48AGV1CNbCSZQ9N4nWFtPdRFAdny SAYHutl4BgatWjFZxGW03i5KSk8W6eMtcib/a5b+KF9T3MHjCJU8TuOOxgLiiwCeXfB8 B6o4kFbJNicxDoZGAeGF3KXgvS2dI0KP2kJ7S5PFewMJoCe7brlxFkxyGKcj73cyYuta PF4g== X-Gm-Message-State: AOJu0YxaFqZ8DF+hxf3QcYkZyJuf3QtdzItoUszZQlq0zAneIvZN7k7I fN0/itnZG4uQf3fJCtRuHOyByAmQzt0nHA== X-Received: by 2002:a17:906:fa90:b0:a26:b71e:f75 with SMTP id lt16-20020a170906fa9000b00a26b71e0f75mr299486ejb.5.1704371848691; Thu, 04 Jan 2024 04:37:28 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id gh33-20020a1709073c2100b00a26b3f29f3dsm12649478ejc.43.2024.01.04.04.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 04:37:28 -0800 (PST) From: Andrew Jones <ajones@ventanamicro.com> To: linux-riscv@lists.infradead.org, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, anup@brainfault.org, atishp@atishpatra.org, rdunlap@infradead.org, sfr@canb.auug.org.au, alex@ghiti.fr, mpe@ellerman.id.au, npiggin@gmail.com, linuxppc-dev@lists.ozlabs.org, pbonzini@redhat.com Subject: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM Date: Thu, 4 Jan 2024 13:37:28 +0100 Message-ID: <20240104123727.76987-2-ajones@ventanamicro.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787163464491998327 X-GMAIL-MSGID: 1787163464491998327 |
Series |
[-fixes,v2] RISC-V: KVM: Require HAVE_KVM
|
|
Commit Message
Andrew Jones
Jan. 4, 2024, 12:37 p.m. UTC
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(-)
Comments
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
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 >
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
On Thu, Jan 18, 2024 at 11:10 PM Sean Christopherson <seanjc@googlecom> 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
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