From mboxrd@z Thu Jan 1 00:00:00 1970 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 03AF31898E9 for ; Wed, 11 Jun 2025 00:11:04 +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=1749600666; cv=none; b=eqT9DMKpaM1iV6RhKIjmAy3PGEsn1SXrygy7/5vNkcwkCTG00eM6eny2wKFoWXw4oPdcPZP2oVWRtmFn4sUlAKHsoph1t5BYpTnQUmCiAGR6Neoter8j4lgvozhh4JLhbB4vIZSbT1JafI8UqAPHl7nS53XTOX7kkIGsQSkljic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749600666; c=relaxed/simple; bh=AcY3H8bGfIWZWHawREnW4VSuG2ZvHv2SK1gbpEk3yi4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tZbxUnAZyiQyBZZbhVg41P8pKIFCpS61AOATlDF3Lrdy2lwHyk2t8LxZK9m7/ovjnPu2vsy9pfkj3xZFjGI4QIS9G5idPtrWIzq3aVPv4r0EkX3/bk7RtLYqxGHEV3osJMBW04ouwUBGYnsZzrqfKuZZjupXyUAzi6/stpFltO8= 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=ndo04N6W; 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="ndo04N6W" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-742cf6f6a10so8241793b3a.1 for ; Tue, 10 Jun 2025 17:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1749600664; x=1750205464; 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=ndo04N6W5ydEOOjDq4FmGNzjNQbu8nfIRTELeSX8vOND/0Ul9y2hsx9FWdV5SX3Ao5 syJolhzckbWMmIFJB/4d7xt+ipsaU2RsXv9qyIivXnjpMoZaAC/WKKwroRZ6057Z6ZDC JL+uZ6kgI0hfY8h459sOwD6oAAghE8liEGtYaE8DBnOAU5dFkebdx2ycfIHfNvUwyDh4 QuZC89fIrujsHR9yXemQpe+sRPIN9QYHyOlI1ny0DGbrrJwa4vbT9Lf7xMRYua5G/AjL afLtHjvnsIgrbcv5PGdHY2R7D9Is9+uUYm+USPBtsOr93ELnrWCiq2lrFrcQvut+Bp/q cRow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749600664; x=1750205464; 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=wPHBWystaYAHyLjeXq3JywnhalP+KD+zzIT2U4PmUrzX278aXjtR2hUFYqLx25LchT LYoqDOjMgCaqK+RGEA1dGf/5myxZq5mPnIvKODzczKYPtXRDZJxyhKgXOBdWxqi4lSq0 mYWFZdcnMhXrv1JC4bqrv8Unl/6yxIMuZuxSq0+ipAZRNB5e7kft89jzqCE+Gfr6cuJb ZviecACrNznpnG8O/UZNwGfrjsKTRLLWvXkbT1uvja9GeFAlUdAk0z7E1OZWPwUZ7/Xo 2wtBwq3PyHIrpTqr2wotXIcsfETqCLh4k+9/Pr5ZuPrbPLgUCa3GbsAOJI104FZl9mQO 7ALA== X-Forwarded-Encrypted: i=1; AJvYcCWEzy2jFC+TbXGm49cU5zon4DpKPp/pncUhZ8iaC84ZA5tFa1cMNvWY+q1izJDtNz1g7MPscVvgzc1E@vger.kernel.org X-Gm-Message-State: AOJu0YytzTB3EQRPilTWIjMd2bgKx51wIGnUvJ39i3O7wyGt/PVr8pIP c0U5N6P3TWOnKCw/Ier78N0UWQk/WBz6TZ410kcQInkUhSYlcyYraBsOM50qzPLVo08alnEXsxI guRb2cg== 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-mips@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-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 # -ccflags-y += -I $(src) - include $(srctree)/virt/kvm/Makefile.kvm obj-$(CONFIG_KVM) += 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 @@ include $(srctree)/virt/kvm/Makefile.kvm -ccflags-y += -Iarch/mips/kvm - kvm-$(CONFIG_CPU_HAS_MSA) += msa.o kvm-y += 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 # -ccflags-y := -Iarch/powerpc/kvm - include $(srctree)/virt/kvm/Makefile.kvm common-objs-y += 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 # -ccflags-y += -I $(src) - include $(srctree)/virt/kvm/Makefile.kvm obj-$(CONFIG_KVM) += 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 @@ include $(srctree)/virt/kvm/Makefile.kvm -ccflags-y := -Iarch/s390/kvm - kvm-y += kvm-s390.o intercept.o interrupt.o priv.o sigp.o kvm-y += diag.o gaccess.o guestdbg.o vsie.o pv.o gmap-vsie.o 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 -ccflags-y += -I $(srctree)/arch/x86/kvm ccflags-$(CONFIG_KVM_WERROR) += -Werror 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 # +ccflags-y += -I$(src) + KVM ?= ../../../virt/kvm kvm-y := $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/binary_stats.o -- 2.50.0.rc0.642.g800a2b2222-goog