Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5062244rdb; Sat, 16 Sep 2023 01:01:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqNTFGkq/phFVQjghtAfjIV/yWUSl6pnt0FMc8UHh6/nd+B0AbJa0TQ3GYGDqbmK/6oBPG X-Received: by 2002:a05:6358:7251:b0:133:b42:69ca with SMTP id i17-20020a056358725100b001330b4269camr5219348rwa.18.1694851260019; Sat, 16 Sep 2023 01:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694851259; cv=none; d=google.com; s=arc-20160816; b=xWKSFVA3CSbMMSaNGD87vNMRBw7Uxp6itthQJk2Wuf1c3fV7Y1OtoyDSImBLUD5qeB Z+j7yGLjcgkgvlg6Sv5RqpXlb+JN52EX+Zz+ZH3aNDJLzti6AeM6K1FXCWOtcSu87S5F abzbMjgS1ywDYBltiyOBW3GL2QMo/DAsRL0lR+9hxk5WE0X/nGT83/JOEdsVUbLf6aDX CSGYWliMbNyXWX+3VvNlHNP9MqL75QofqFEKwoVaZLBHEZGNyIChWm/aNiL8U7KsZHWz dMrk1Xu0v5Og3b8SPoeXQ7Z7L+Sq8T6N0J3atGDde6eOgtGB+tK9m/S1Op0Hqw8UY20S H90A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=I1k7UlFLK1e3KB496SGnrZE1fwTPdTtkvkYnZUVfXtU=; fh=kXSkXFacTVTlVHq0XnHvR0iN61knZqi7sPJIGv3JAWo=; b=sdImjxm0RWcaEVAGu+gSg3hEUSZAy2f7hxPD/MskqbKwX675TClh75FEGzj8DsMfq8 dyBKkFXdB1cDwyZpvRSIZ3fODflPRDXdoR/BPtaI7shOfMKezqS1vf8ppoB4UGz1DbHF YFWYm+mgKtPUOt2bK5Hk73EQZzWpWnPVjdO9wDKHQ6pEphwYfl5Bk1qBpDmk2nPuBqga GRhvoT4E2KzfxXlEnMw0IDSLDqbG58/tGGlRrdI+Q6u49J0PcT04UZy1pqfvOKGTph+I c5w6eVMTPqhqFWEkP9dH/CKsbG+SGfDpZPwcCXgsxy6TV9Pw3ewidqoSks7KAimc3Mfj qmxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=IWC0OkgW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a4-20020a63d204000000b00565ec2a1e2asi4493719pgg.760.2023.09.16.01.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 01:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=IWC0OkgW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7932F834E765; Fri, 15 Sep 2023 17:33:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238530AbjIPAdX (ORCPT + 99 others); Fri, 15 Sep 2023 20:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238774AbjIPAcn (ORCPT ); Fri, 15 Sep 2023 20:32:43 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 431AA1FD2 for ; Fri, 15 Sep 2023 17:31:59 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1c43e6ba8d1so8895215ad.3 for ; Fri, 15 Sep 2023 17:31:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694824319; x=1695429119; 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=I1k7UlFLK1e3KB496SGnrZE1fwTPdTtkvkYnZUVfXtU=; b=IWC0OkgWuATSfuo1F1dQCwyIx+b/WZpIdXnlA2378o7EYl9hFcmP717IG0O306dLn0 foehRodde+VX2DfIEUjgrrM1Eon0688x7Uc1rZpXhaW922hWaAU9WZkTYLnrtkjDyItx bWgsoMv8If1qO23dFbpQ+FjPuBVLHkuowtKkRVWhhg+n500FUE0kmhHAToObw2Sgbi7m jXvF4n/9DAADe5Lxbp2YyBI42mXIjiAhYJz0rOplK0JxxxJDFjW2LvwCm8ep+6tGZo66 kUp3ad0vQQCdrix+Yt2Z/spbVBivm71cUo/+LgEVVK4um4SkpAsjPoALFSActnL5+a0Z oLbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694824319; x=1695429119; 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=I1k7UlFLK1e3KB496SGnrZE1fwTPdTtkvkYnZUVfXtU=; b=IFgvnQqki2kLiYZOouEb7Cmoo0ioRsBNaSPLs7DvSofCTgIvPurI4KHE4V73k1Tmmm /HPhQ1b47ud3Jwn+GDOJuBAgbYioBR+mgADjZO98D+r86N2s0Y4dfVAvaT/3Ldk/d9Ww 83/NYB51i8AIAaBqqqigD1N+8xU7hlXHxaQevbQ+9J35IhyiaSjjhR7G6Fqyo1QadDPN FCwyD+ocolzN9JarR3t/Yo4ZvRItmCC/6IuiIUIWQumpuH21h5ppypuTQiaVsyg4v9ul TzN9uGX51T9Gn/IAYL8KM8E9WR4/fISC8jdGQ4/PeyYLPN15k+E14aQu2A71Ou7ICNXt nE7w== X-Gm-Message-State: AOJu0YwMmfU3b5bK7xEnN1vPCI1fmSB2GO9DWQ3OJf9kpGggdyvkws+O A7Dc6Th25iw0E3712HVhZZIVlOvNQ08= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:ec8b:b0:1bf:cc5:7b53 with SMTP id x11-20020a170902ec8b00b001bf0cc57b53mr68748plg.1.1694824318653; Fri, 15 Sep 2023 17:31:58 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 15 Sep 2023 17:31:11 -0700 In-Reply-To: <20230916003118.2540661-1-seanjc@google.com> Mime-Version: 1.0 References: <20230916003118.2540661-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog Message-ID: <20230916003118.2540661-20-seanjc@google.com> Subject: [PATCH 19/26] KVM: Standardize include paths across all architectures From: Sean Christopherson To: Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Peter Zijlstra , Arnaldo Carvalho de Melo , Sean Christopherson , Paolo Bonzini , Tony Krowiak , Halil Pasic , Jason Herne , Harald Freudenberger , Alex Williamson , Andy Lutomirski Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Anish Ghulati , Venkatesh Srinivas , Andrew Thornton Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 15 Sep 2023 17:33:49 -0700 (PDT) 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")). 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 c0c050e53157..3996489baeef 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 $(srctree)/$(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 08a0e53d58c7..d6c6678ddf65 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 4c2067fc59fc..ff7d5f67e229 100644 --- a/arch/riscv/kvm/Makefile +++ b/arch/riscv/kvm/Makefile @@ -3,8 +3,6 @@ # Makefile for RISC-V KVM support # -ccflags-y += -I $(srctree)/$(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 f17249ab2a72..f8153189e003 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 diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile index 80e3fe184d17..d13f1a7b7b3d 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 ifeq ($(CONFIG_FRAME_POINTER),y) diff --git a/virt/kvm/Makefile.kvm b/virt/kvm/Makefile.kvm index 29373b59d89a..e85079ad245d 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$(srctree)/$(src) + KVM ?= ../../../virt/kvm kvm-y := $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/binary_stats.o -- 2.42.0.459.ge4e396fd5e-goog