From nobody Sat Oct 11 12:15:04 2025 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.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 9B0181898E9 for ; Wed, 11 Jun 2025 00:10:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749600661; cv=none; b=T924ctJ94omm9Ezfy7BLRN6jUQ5JOkqx+JL43d+OMM40dnhHUbyfdnRHmZQ9f0vLvL48cStCSJA3/2xcPz3i5RXPwabo3izksq/ncv8sRkkYzyfRnd3HAlHxe5Hx5t5ujTOHbhPGkrvhJP4/5/ABteRwsNNJjRDTuk1rG+/B/zQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749600661; c=relaxed/simple; bh=AcY3H8bGfIWZWHawREnW4VSuG2ZvHv2SK1gbpEk3yi4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=AwaRFHcGcP0VEwfTso6bDXgIc6I1G7+L/Nb7thrChf05V992yjbkpvSm6x8oCtVCY/fQkaSgpM+vro5jxDSJD0f4twBSsxCiq7bXK4tgRT/ZIn3y5vzwF8Qq2U3/aWdypmJjPWGxeFRy8My+D08z5C3xjZx/1rGPPIojl5KTfcY= 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=mtw7h/hu; arc=none smtp.client-ip=209.85.210.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="mtw7h/hu" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-74834bc5d37so6092228b3a.0 for ; Tue, 10 Jun 2025 17:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1749600659; x=1750205459; 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=t+Mj+r8r7UAjF4+0LNUZhsvI8NJHwfinPsCt24LIifo=; b=mtw7h/huIuU+Dojq7oaTp5DnWiKxzyUxE+gBVHjv85aTL3ZducZyuLoUYAUgdFFU9b Qn7ObnA/iJVFX5uKWlzdeujXMgt03FmD880lK3hB98uATPY68rCw8AgqaK0xWqBVsbX5 r1DM/oa8283rjsgINUS21bNMAzrrGSipU2Lj2+vlDqNB+TBdLtTu4dOEpg+ZdsICUFFK RBhfYzh/tBQTOHQ2uYjOXz3R3jM5KSuHvJOV14QTSSabiPWDNX97vBlCct+3s+yuaY4A O7O+8nLfWWS3kkWdJ10e/wKIkYusjF5qcEDhk3JT7e/o6SZy3bj73g6uYill5335sM5Y tsfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749600659; x=1750205459; 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=t+Mj+r8r7UAjF4+0LNUZhsvI8NJHwfinPsCt24LIifo=; b=ennpYuIAqQnR4+3+hlm9JWq7FblImLUtRQhnBGubujm+CKLju1pxzzDO9sbAQPH0x0 fOa65gTFi0xL2B6yeVfx4rDp7KcVZfbdj1EfCtPj4R7vGUhluwzQyI+3hAlRx2g+uaow 50hHNO2KmHSGvtGt9dE3m6FHVjpD6bD+rK7f5tZJ6KVOAYmJ/G68aXyFD7NmoK9mF0d6 4pUHO2GmzNtMUMUqVBKAZeVSEa1efGyJUevxcxWNV4mWfXxHYqErNOB3YBMkgygzvHFX nrTt6o2YiNqJltU82ZhqLLT3eviMEYFekeY2QvE7/z2o4PoV3lpyPoh4vQuTjHw/6FUD RA4Q== X-Forwarded-Encrypted: i=1; AJvYcCVKBQyxHuNrGZid0vyfoNTE4C+0wCnS+iKUmSl39deOfYoQaG3Nu3zQNJXkHoYS36B+yeE/B4NzpMV72Kk=@vger.kernel.org X-Gm-Message-State: AOJu0Yxm3JveI+Zebzkwmzt2iKrTULd+KB1ncNqZ6QPwg3qCrqh39VI/ /g624oVoerGa3reMUuijp7biRECzXqoHKqCTfiKwx6tm+rzW1gHRqc5AYtYGdJCes5MGqDiqbn3 yg1iJjg== X-Google-Smtp-Source: AGHT+IHdKstC+XlYUus8Wdm0HR7HPxHMBlUy5ahB8xm3L+Y1hmecIZTBPJ5vhN4Gi0qdwz1eVbXtQ9xfH68= X-Received: from pgam16.prod.google.com ([2002:a05:6a02:2b50:b0:b2f:6348:f715]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:9012:b0:1f5:8f7f:8f19 with SMTP id adf61e73a8af0-21f8663f76dmr1960513637.10.1749600659002; Tue, 10 Jun 2025 17:10:59 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 10 Jun 2025 17:10:42 -0700 In-Reply-To: <20250611001042.170501-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: <20250611001042.170501-1-seanjc@google.com> X-Mailer: git-send-email 2.50.0.rc0.642.g800a2b2222-goog Message-ID: <20250611001042.170501-9-seanjc@google.com> Subject: [PATCH 8/8] KVM: Standardize include paths across all architectures From: Sean Christopherson To: Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Madhavan Srinivasan , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Sean Christopherson , Paolo Bonzini Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anish Ghulati , Colton Lewis , Thomas Huth Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Standardize KVM's include paths across all architectures by declaring the KVM-specific includes in the common Makefile.kvm. Having common KVM "own" the included paths reduces the temptation to unnecessarily add virt/kvm to arch include paths, and conversely if allowing arch code to grab headers from virt/kvm becomes desirable, virt/kvm can be added to all architecture's include path with a single line update. Having the common KVM makefile append to ccflags also provides a convenient location to append other things, e.g. KVM-specific #defines. Note, this changes the behavior of s390 and PPC, as s390 and PPC previously overwrote ccflags-y instead of adding on. There is no evidence that overwriting ccflags-y was necessary or even deliberate, as both s390 and PPC switched to the overwrite behavior without so much as a passing mention when EXTRA_CFLAGS was replaced with ccflags-y (commit c73028a02887 ("s390: change to new flag variable") and commit 4108d9ba9091 ("powerpc/Makefiles: Change to new flag variables")). Acked-by: Anup Patel Signed-off-by: Sean Christopherson --- arch/arm64/kvm/Makefile | 2 -- arch/mips/kvm/Makefile | 2 -- arch/powerpc/kvm/Makefile | 2 -- arch/riscv/kvm/Makefile | 2 -- arch/s390/kvm/Makefile | 2 -- arch/x86/kvm/Makefile | 1 - virt/kvm/Makefile.kvm | 2 ++ 7 files changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/arm64/kvm/Makefile b/arch/arm64/kvm/Makefile index 7c329e01c557..86035b311269 100644 --- a/arch/arm64/kvm/Makefile +++ b/arch/arm64/kvm/Makefile @@ -3,8 +3,6 @@ # Makefile for Kernel-based Virtual Machine module # =20 -ccflags-y +=3D -I $(src) - include $(srctree)/virt/kvm/Makefile.kvm =20 obj-$(CONFIG_KVM) +=3D kvm.o diff --git a/arch/mips/kvm/Makefile b/arch/mips/kvm/Makefile index 96a7cd21b140..d198e1addea7 100644 --- a/arch/mips/kvm/Makefile +++ b/arch/mips/kvm/Makefile @@ -4,8 +4,6 @@ =20 include $(srctree)/virt/kvm/Makefile.kvm =20 -ccflags-y +=3D -Iarch/mips/kvm - kvm-$(CONFIG_CPU_HAS_MSA) +=3D msa.o =20 kvm-y +=3D mips.o emulate.o entry.o \ diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile index 1a575db2666e..6f12edd465df 100644 --- a/arch/powerpc/kvm/Makefile +++ b/arch/powerpc/kvm/Makefile @@ -3,8 +3,6 @@ # Makefile for Kernel-based Virtual Machine module # =20 -ccflags-y :=3D -Iarch/powerpc/kvm - include $(srctree)/virt/kvm/Makefile.kvm =20 common-objs-y +=3D powerpc.o emulate_loadstore.o diff --git a/arch/riscv/kvm/Makefile b/arch/riscv/kvm/Makefile index 4e0bba91d284..dbe61a398cc8 100644 --- a/arch/riscv/kvm/Makefile +++ b/arch/riscv/kvm/Makefile @@ -3,8 +3,6 @@ # Makefile for RISC-V KVM support # =20 -ccflags-y +=3D -I $(src) - include $(srctree)/virt/kvm/Makefile.kvm =20 obj-$(CONFIG_KVM) +=3D kvm.o diff --git a/arch/s390/kvm/Makefile b/arch/s390/kvm/Makefile index b742e08c036b..5cbcaa7f241a 100644 --- a/arch/s390/kvm/Makefile +++ b/arch/s390/kvm/Makefile @@ -5,8 +5,6 @@ =20 include $(srctree)/virt/kvm/Makefile.kvm =20 -ccflags-y :=3D -Iarch/s390/kvm - kvm-y +=3D kvm-s390.o intercept.o interrupt.o priv.o sigp.o kvm-y +=3D diag.o gaccess.o guestdbg.o vsie.o pv.o gmap-vsie.o =20 diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile index a5d362c7b504..f78f11b582d2 100644 --- a/arch/x86/kvm/Makefile +++ b/arch/x86/kvm/Makefile @@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 =20 -ccflags-y +=3D -I $(srctree)/arch/x86/kvm ccflags-$(CONFIG_KVM_WERROR) +=3D -Werror =20 include $(srctree)/virt/kvm/Makefile.kvm diff --git a/virt/kvm/Makefile.kvm b/virt/kvm/Makefile.kvm index 724c89af78af..0e7ba49026fc 100644 --- a/virt/kvm/Makefile.kvm +++ b/virt/kvm/Makefile.kvm @@ -3,6 +3,8 @@ # Makefile for Kernel-based Virtual Machine module # =20 +ccflags-y +=3D -I$(src) + KVM ?=3D ../../../virt/kvm =20 kvm-y :=3D $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/binary_stats.o --=20 2.50.0.rc0.642.g800a2b2222-goog