From nobody Thu Nov 21 20:46:14 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 969971C1F22 for ; Mon, 18 Nov 2024 17:20:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731950410; cv=none; b=V0E/XB55DOjP8NwSPgodvtENtq5wtZMa/I5F6qOuURmQIKxxjgN5U3GWRcSQkK2GNN9PfseMJJ3B+DPAKoCxbKBhjnL9BJgLZRE+k2+jvPPAEyfgJDYd7C8PXELA+VzksoX6Mb8k069pXTqAhecJtgjS5AfqOcJ2Bfrk6RVi9jI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731950410; c=relaxed/simple; bh=M3657UEqaxjhlwGguiJIV2JlitIiGOg2Rw6A7FApcAE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Phj15jBLqq2LgRXrpGNXAGT8bzKAA5trbt/Pd30U+RQyuqwlxaOmk962IUn5wcfvigZVnXCkWBvmKD2c4Zk6af2EEcU3QVfCjPkYOWR+nUOW7csn9monj1CSED+qvKhRU32pCslNvc3muozPLnur+D4NFGM+YLN8wzFB0QaNRDo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=MlQVdKRp; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MlQVdKRp" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e293b3e014aso2705614276.3 for ; Mon, 18 Nov 2024 09:20:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1731950407; x=1732555207; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=LJkNhNdMu2zqacMxiFxt/S7RLEzafW8TtjYcz3deGhk=; b=MlQVdKRpcL+t+4xXyRwjC260b+UqdwJWl1LQBdNJshz3z7hKdq3ABIR80mgUDBSUAs 8TMrtFH7B06QosCE3pZq59jkVfN7L5wLdla35I2SxDkXnk/CZyIO0sUSHvWj5nktXCgW abLiMJTyfXLyNpZIoX+37YtnMA11kb4PMRU831vSikKhbk/sOae8qh0+g1g1s30sVdMz w66Ma26Vu58rnnXr9WfZWcC7HDLIIBGNy6c5kaS1paYqVAoAPZNgxM/YqJgage8fVaqU GX4hehZpRkguIm+Cjp3t2mERbgpNVn50yw5hgUd2LzBuBqrAONg7ikMDihYzaMv6aLNy pD5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731950407; x=1732555207; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LJkNhNdMu2zqacMxiFxt/S7RLEzafW8TtjYcz3deGhk=; b=UIKeptYl4pLCEvnyhmEXyzL8FrOHJ05XfCf2suwkuG5L7lG9K87+GjSS2c/X3Kl2S0 0XxgAv1vie1vvMutYz+tg2atc46YwSV1e9PmQlzRUHfzsPzlel5nWQsgFRJMj9odBMeC cJVI2QKHQ/mSyw/9QzjU1QC/Uf8peNKiWIFA8mIHz8hbn6emPNi+wDROsJRTxEboEMwg 6WKcDrJmJK+sJ5TCQEknqDWanpZGOgvSvbCCVxMUpo/W74CxSDJu5HwJj09CuA0KoYK0 zN7jHrbybM827g526HM5S0hUeo9TKHaigdCxDSAv0qXZog2K38aEWmcwBrSPCht26KpP AmLQ== X-Forwarded-Encrypted: i=1; AJvYcCVWuSBaIDzSKt11SPpaq+iqnW+ZYNS4PthVQkw5J3/ZDLBdwssxexoZN2/YFZim8fhx/VoAEy3g3XfQ180=@vger.kernel.org X-Gm-Message-State: AOJu0YyY6NLJl1VLrcufMgdEd0Wtf4v83KnVCUQzMu9MKhQpxcdEYs07 msfLWdnBXxpyuaViVZD+iQopaqGI8ktPWglN3QNMD+vCsspfiw1p/wdto7wMkPjw4pjpmIXDDYe fYw== X-Google-Smtp-Source: AGHT+IEKCGX3iqyqIKJGlyXgIDuMTtUBvK329iOqiDt0sB2xzK6GmqPfdKdozrddvcHp5efBeol80n+RCtw= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a5b:9d2:0:b0:e38:d1e:af86 with SMTP id 3f1490d57ef6-e3825d2828dmr9902276.2.1731950407594; Mon, 18 Nov 2024 09:20:07 -0800 (PST) Reply-To: Sean Christopherson Date: Mon, 18 Nov 2024 09:20:01 -0800 In-Reply-To: <20241118172002.1633824-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241118172002.1633824-1-seanjc@google.com> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241118172002.1633824-2-seanjc@google.com> Subject: [PATCH 1/2] KVM: x86: add back X86_LOCAL_APIC dependency From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann Enabling KVM now causes a build failure on x86-32 if X86_LOCAL_APIC is disabled: arch/x86/kvm/svm/svm.c: In function 'svm_emergency_disable_virtualization_c= pu': arch/x86/kvm/svm/svm.c:597:9: error: 'kvm_rebooting' undeclared (first use = in this function); did you mean 'kvm_irq_routing'? 597 | kvm_rebooting =3D true; | ^~~~~~~~~~~~~ | kvm_irq_routing arch/x86/kvm/svm/svm.c:597:9: note: each undeclared identifier is reported = only once for each function it appears in make[6]: *** [scripts/Makefile.build:221: arch/x86/kvm/svm/svm.o] Error 1 In file included from include/linux/rculist.h:11, from include/linux/hashtable.h:14, from arch/x86/kvm/svm/avic.c:18: arch/x86/kvm/svm/avic.c: In function 'avic_pi_update_irte': arch/x86/kvm/svm/avic.c:909:38: error: 'struct kvm' has no member named 'ir= q_routing' 909 | irq_rt =3D srcu_dereference(kvm->irq_routing, &kvm->irq_src= u); | ^~ include/linux/rcupdate.h:538:17: note: in definition of macro '__rcu_derefe= rence_check' 538 | typeof(*p) *local =3D (typeof(*p) *__force)READ_ONCE(p); \ Move the dependency to the same place as before. Fixes: ea4290d77bda ("KVM: x86: leave kvm.ko out of the build if no vendor = module is requested") Cc: stable@vger.kernel.org Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202410060426.e9Xsnkvi-lkp@int= el.com/ Signed-off-by: Arnd Bergmann Acked-by: Sean Christopherson [sean: add Cc to stable, tweak shortlog scope] Signed-off-by: Sean Christopherson --- arch/x86/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index f09f13c01c6b..887df30297f3 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -19,7 +19,6 @@ if VIRTUALIZATION =20 config KVM_X86 def_tristate KVM if KVM_INTEL || KVM_AMD - depends on X86_LOCAL_APIC select KVM_COMMON select KVM_GENERIC_MMU_NOTIFIER select HAVE_KVM_IRQCHIP @@ -49,6 +48,7 @@ config KVM_X86 =20 config KVM tristate "Kernel-based Virtual Machine (KVM) support" + depends on X86_LOCAL_APIC help Support hosting fully virtualized guest machines using hardware virtualization extensions. You will need a fairly recent --=20 2.47.0.338.g60cca15819-goog From nobody Thu Nov 21 20:46:14 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 766921C1F38 for ; Mon, 18 Nov 2024 17:20:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731950412; cv=none; b=BIRHreRGxgQ9n0UJfq7Vlx2he8n4xNXpNeflllWF/yk3B2daM6Jv4UJimzoKre0pcsgi8e7L1dOQK+MYpXfwoBWXbYYuOdf1N0rNPTVOSRKcKR2qnJxdTA8S3Xh9NPWdw+3w7utrdrC0VCvDOe4oMy6R7uAKX+Nx3SOG23YfWOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731950412; c=relaxed/simple; bh=N5R/4FtDw0N3yusA4O8BioFqu3X2Sgch3e5Yy83zhhY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=pLPCvydx+I4rOv0dkIKiCq3+67qQK8kDpt7pohLTn1YOxD7j5YYf55a2SrzX6BNzy0plM++ObVqNcmb+oXJt4H8jt4sOfJEABzRrRmx6k3aZWdxHN7fgQjDE91VEDD3xtXreMZxVHqXjpzD4+Iz4P9nPtU3bZrLWQrhx66iX+X4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=vXvSMFBD; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vXvSMFBD" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6eac7417627so1253487b3.2 for ; Mon, 18 Nov 2024 09:20:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1731950409; x=1732555209; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=sgtLcMTJEjPEalmZ9zl8RzwpzJCWvEmQXuhCm+oPkB8=; b=vXvSMFBDuY3xAtA2v27YHQv3eSELjF3DV5p1iDKR18ik4jqtAS30J7AN2+Ax0wAA0S 3keV0FODykPFr4Ir4dK0dqujH0wg7N49Lve0bxWNSI6M534iobdVW2+IhwdYbHQAo6+P 5allEdp4fljr34Cp5TCgclmzMGza6HGAl+nxi+Dbma75duTevg5pQLyjTfXwnd4kRPJJ LQ3VrjBbRTrfgFpzbrp9+SfExcx3kVNQxz14DSAu1jl/qp6LUyjFnxGElY+vPQIHlTSO xlDbYCiblFq+4ZE5bdxiW0N6dqhvu6pbslP22ft+H8BNby90ezDKMDXs+KecEOglye6p BS1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731950409; x=1732555209; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sgtLcMTJEjPEalmZ9zl8RzwpzJCWvEmQXuhCm+oPkB8=; b=H3mz3MpfhF3Tn4OssRnkqwqULT3exhzrNlwa1RO5B9VveoPPBvWZwSRlRJaM+cMWuS xNh1a8zhtVwUIXQL+N5N4vk/Cwn7B9ImpoJta94Ew2cVNOY0fpDq0vgzdNfRxObG0HmZ NDrUcYsItPAkyomfn6dLI+PFJvWTuspbIHA6fxTrqh7rwCp7l+6LtwrRWCFLbOGWtLD9 ZNg5cktAMegLgvhbRQaclcuqt3rwcRaWMGzCWc5JCr05aNqI2HbSR8MTRaobajfpD7l4 nHTIPqBXwcH2m/P2juKr1+VyfOislc+BhcGezkJLnycq+aoOESyAVeNonZfYqnffLGjy GXCg== X-Forwarded-Encrypted: i=1; AJvYcCVtuVgw3IYEdG/yCV7tUUzSO+UlTvzS6UiNb08/HXTdjtwPGOr1gzOTYVXGAG+2hswG3wn43TM9rwHt/K0=@vger.kernel.org X-Gm-Message-State: AOJu0YzaYqSQZZ9RtxLpJ/EQNWxXi8Ap+WhSZgOvGT4MqYkNOcgZKzlB 3qE8Wxoq3az1Je8uSVNuamTlIvPYYzv6r4SqKL8us/N8Tf267UlVRR7V4vovu7WrW2OtJ8561q+ b3A== X-Google-Smtp-Source: AGHT+IEtVCOpP39tTFVwQnJjsV3PYNG2x18HZgOMURORvWB+91/HhO57tnwC7V9xek4bGfXWXJWZqLCV66Q= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a05:690c:dc2:b0:6ee:93e6:caac with SMTP id 00721157ae682-6ee93e6ceebmr2351967b3.7.1731950409577; Mon, 18 Nov 2024 09:20:09 -0800 (PST) Reply-To: Sean Christopherson Date: Mon, 18 Nov 2024 09:20:02 -0800 In-Reply-To: <20241118172002.1633824-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241118172002.1633824-1-seanjc@google.com> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241118172002.1633824-3-seanjc@google.com> Subject: [PATCH 2/2] KVM: x86: Break CONFIG_KVM_X86's direct dependency on KVM_INTEL || KVM_AMD From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rework CONFIG_KVM_X86's dependency to only check if KVM_INTEL or KVM_AMD is selected, i.e. not 'n'. Having KVM_X86 depend directly on the vendor modules results in KVM_X86 being set to 'm' if at least one of KVM_INTEL or KVM_AMD is enabled, but neither is 'y', regardless of the value of KVM itself. The documentation for def_tristate doesn't explicitly state that this is the intended behavior, but it does clearly state that the "if" section is parsed as a dependency, i.e. the behavior is consistent with how tristate dependencies are handled in general. Optionally dependencies for this default value can be added with "if". Fixes: ea4290d77bda ("KVM: x86: leave kvm.ko out of the build if no vendor = module is requested") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson --- arch/x86/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 887df30297f3..b91ec2e9c916 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -18,7 +18,7 @@ menuconfig VIRTUALIZATION if VIRTUALIZATION =20 config KVM_X86 - def_tristate KVM if KVM_INTEL || KVM_AMD + def_tristate KVM if (KVM_INTEL !=3D n || KVM_AMD !=3D n) select KVM_COMMON select KVM_GENERIC_MMU_NOTIFIER select HAVE_KVM_IRQCHIP --=20 2.47.0.338.g60cca15819-goog