From patchwork Sat Sep 16 00:31:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13387994 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6A74CD37B0 for ; Sat, 16 Sep 2023 00:34:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID :References:Mime-Version:In-Reply-To:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tpMCpue4GEhBQ70ONlb1Ew5iY2a0UPBB6sBL6v6pkzM=; b=yfloAFW5uRxAba jiUFE3GxaaYcW5rfNHNymd9lkeAIr08jHVi8pVkeKP1LvtpAomGoK+to8KqkzdqhsyBJ6cIiehBjs YAxbI8BpGI/4rI/l2s5DahXLc7kBs6ZNtgaxZGqWzfnX6f0PbCSQ/GdlUoGGGOhPKIB1COwrlgR/E 9FmM//k1obwE693H0reoo4cHqs8jv7/SKSZ38Q2ju5g5LuACI/kWyw8gnhiOEFgx+IHPsXUJM7/fN mXxOA8m00yggNQ31n+jcgK3iDDlOYxrl2ZAPEWvpf5g3qf9aTgWOmAs8xBFA8SudiJVl17Raib2Pu o5ASxuVnkrO1NrbR4Ihw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhJG5-00BenL-1Q; Sat, 16 Sep 2023 00:34:01 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhJED-00Bd4O-1l for linux-arm-kernel@bombadil.infradead.org; Sat, 16 Sep 2023 00:32:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Cc:To:From:Subject: Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To:Sender: Content-Transfer-Encoding:Content-ID:Content-Description; bh=I1k7UlFLK1e3KB496SGnrZE1fwTPdTtkvkYnZUVfXtU=; b=OwnLQE4fP/feA992zKoAMzseXW 9fusg3uynvfpYxC+bQjm8znyux2bEJ984gjFnJ+LQcQCtM1Qr9+T2DPsuY1ALREILy4i3/uckfN3P HJu6gJfacsSvkNw36crpd7JHG5MshG7DHz32QDJmq+GkE25KqGph030YHZaSM6QCZW2N2M0Jiw00I vKclraAbI8DDXbIhhJ8th8CZNsIV72yG8sR/KdSZsXiMM807jV/rFke+QTPDCTDrSkdG2dRVqAg6W qtyjdxYyhonmQKGeyHY/Uy/0nqXflUQFK/9fVhhGP1OZLCAybInBYd69wIolbW/hfvwX427hQoUZv UmmRyvsQ==; Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhJE7-009jqe-1J for linux-arm-kernel@lists.infradead.org; Sat, 16 Sep 2023 00:32:03 +0000 Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1c43e6ba8d1so8895175ad.3 for ; Fri, 15 Sep 2023 17:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694824318; x=1695429118; darn=lists.infradead.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=LninouIESa0KhCQ7s2s7e/7/Wi4jcjxaKK3DmhL0tk+25q/r2EeGx0NW5FhYePynRq N3YRKoIRggHCBrqjwPhEUgqraXu28OJD+pNPvv2qF5kYMyviCfO6Cb+xalO2ErzcGv6h Aj0Uh9n6QC0GPHnD6X8l/99e7soXL3+7HwFKbfXJHpZoeQFBx2UQnaXzF/F5YO+EtAiQ Wr24Xtf2N1LXRMh2+voWnsvDbvnwX78rA1Z3pMdg0CGEPi/TFQ/JcT+BR4J5pequjwX1 rxGo/0sWGvh5aLeeTXR830QnC/N7iBDHC5TE0gNe4OCfJ6r5f94Tp2tqGOy8v/G7koV+ KGug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694824318; x=1695429118; 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=pw6cLdbUXYXKqENyMdBoy9qsi7VVoqIjFYOqn0lIXxNrZSYKINDGhQ++phxMaFvij8 59I8UV5EvTow7zW6rVfRwVTkP2vuv4xlDKUjeSOJASqPAqPP1ZH3OVRVovG9IIN+bmeL 8g+/S75BSd/hBeMRISRNVsEy6STbs8xUNz/uK/hBfa8BgIiXiF34mnTJs4EKjbLjr5lN 5BlGuN5svQyz7jNXKqMtB8KZJEypJFTsddIMPXHnfDrgFPljI6PIqvOOSV+NZ94wXdCD tz/49tOysz5KdfpCjOdwDsRVmnQfriNM29SJ3ZG3bQ1FzznWr10HW1kVRZcnjV2TUGij nibA== X-Gm-Message-State: AOJu0YxHJtaDZAfzXYQQL+dPV6igKwcV9IOpYYzhAswRP3wvBxubQ8D6 6n6+9rzfcWYIvSHOP2C8RzV9Nz3ZcgA= X-Google-Smtp-Source: AGHT+IFCF5MUMD869yhPhgA85k1sz5CoJq/QTd908FyvX67dvIc3xBcuRDs8mX3N7g5mT6MCs9yGRfwK12c= 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_013201_224712_6C0CB7BA X-CRM114-Status: GOOD ( 13.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Sean Christopherson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Acked-by: Anup Patel --- 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