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: 140840 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1405546vqi; Fri, 15 Sep 2023 17:40:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNruKMtt4KdfVq3yaJ7AFER1uVXkjBwUMFOUljouaxYuPulD1Ye/Mt6ROqBQmM4AYPn29b X-Received: by 2002:aa7:88cd:0:b0:68f:c9df:2ccb with SMTP id k13-20020aa788cd000000b0068fc9df2ccbmr3498155pff.1.1694824859145; Fri, 15 Sep 2023 17:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694824859; cv=none; d=google.com; s=arc-20160816; b=hG2xdWySuMAFCCvoC690mx2QyFw47st2zFj2uMZFcH0rroRxObOUgLgvkSbETKBKqr 8sIoBKrnXTskpz5RvY6l5U26C7eFxS109uH6G8aQ2Glw6Fb7MR+7ESWx1ZeD0YcBVTnR mQus38bNtPmxmUUJyYgdCRVfP+MdrGpPWaSJQ3qJG+ykf5ljIuUNffxeYfF9mi1HeSpq RPQTzIGoPogCEyPQMv+spoSU33lo96ipDM4mqtm+aI4qiMcfNHoUIzflCbk8bhSfnOwP 2UNL1WPJCKEESAJexjey0HKE6JOJeU9kwW6fKbZXcVlbkoLxSwVvSSDwlCNs9XJUhKlz mMeQ== 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 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id p23-20020a056a000a1700b0069026fd5a29si4209745pfh.19.2023.09.15.17.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 17:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; 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 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 7E5B783C9D46; Fri, 15 Sep 2023 17:34:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238537AbjIPAdY (ORCPT + 28 others); Fri, 15 Sep 2023 20:33:24 -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 X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 groat.vger.email 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 (groat.vger.email [0.0.0.0]); Fri, 15 Sep 2023 17:34:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777152671381136779 X-GMAIL-MSGID: 1777152671381136779 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