Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp361089rwb; Thu, 27 Jul 2023 14:03:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlETJ5pADm1Tbb5F+yEueC1kY29sr+c6CKQuuzL7bcotxduuAJu1x0lnCEY2mvpU8HlGB7Do X-Received: by 2002:a17:907:761b:b0:988:bb33:53b7 with SMTP id jx27-20020a170907761b00b00988bb3353b7mr304648ejc.60.1690491804312; Thu, 27 Jul 2023 14:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690491804; cv=none; d=google.com; s=arc-20160816; b=iUL7f+09UhP+vujKzIiUqSUu5um9DPuefY2OAOr83aZS5NOjUQBewb8FUBfnRuxNGN oGyhbk61JrIzmSJUl21DFteOglTV8COQgb8pNvCmST0eArYYzj80fP/iRVSANers9Sjk AZG0DRV0E1VosqjAs4TS3ZzZYN8Y/h16tRDtMMpoYFXbwQ7G2nj/8/u0eFU4M3RK8t3i L46mxSWQtrtKzLcY6q80g/0Bm1O8RU5XeEf9jRAM3Acl1poWLu5xM/11PDPD3zrsyTGY OTKiG7PfFLAqU2ieTHd74hMBSRfKgcXg5Aoj2/J9vHX2++IxLZJyPGpii8eJ8FM7NHgO 36wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature:dkim-filter; bh=wGfZhJLEaC76tXaMBUSgR/sQMRomiL0nmnXuuYZ5TlE=; fh=y8tS7hHyMnVm4J/EG8JBk7xmqgMCnIiFB1dTM3zggRY=; b=SETFntKW19mVpTGnXKjU1JNKwiOT4Q0xPXRg81erl1bIxr8KZ/cbnTYQSmafTvGjhe cmuWBrDLijDGDCFdFRLWcQBsBuOq9LbS51daQU3l/AyeCWN7g0UFIQMCXzGaJAymJ6Gs /2NLoivFIuYfiP8C1/iKzHv2SPMeKO0FXWJkzVFN6exIWNmfU1KO7M0uRa3oDPnDs+4/ HD0hjV631SQI4uJZ6sa/ww5JHpb79u1oeM7xGVyiMk3I8Li0ISe2NLI7WlEcsLqzhvYQ VryhXlu6snuMmwffiPW0YqrX0kWM00IopKBYWqZydv8NCJP5LwJdGka/BAfiMbxCiFch L68w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=somuhVoS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j25-20020a170906255900b00997e71d036csi1685319ejb.678.2023.07.27.14.02.59; Thu, 27 Jul 2023 14:03:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=somuhVoS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232528AbjG0Tzq (ORCPT + 99 others); Thu, 27 Jul 2023 15:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232185AbjG0TzC (ORCPT ); Thu, 27 Jul 2023 15:55:02 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 65EC02D7B; Thu, 27 Jul 2023 12:55:00 -0700 (PDT) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id E17252384267; Thu, 27 Jul 2023 12:54:57 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E17252384267 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1690487697; bh=wGfZhJLEaC76tXaMBUSgR/sQMRomiL0nmnXuuYZ5TlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=somuhVoSD73dYczAjl0JO509Rh6HViWVDmb6fZwsw5hEFI4CNplqoiStzHQon+Y1W HYr3dJju+K/vr39gLNZxq8d52LU+4Kj7qJV+MfQrd7aNEg33x+432473gRKGTAts3l 9Oif5XkDmhjpPJg5wbTsWo2WQ39W2MQNf0BmcKbo= From: Nuno Das Neves To: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org Cc: mikelley@microsoft.com, kys@microsoft.com, wei.liu@kernel.org, haiyangz@microsoft.com, decui@microsoft.com, ssengar@linux.microsoft.com, mukeshrathor@microsoft.com, stanislav.kinsburskiy@gmail.com, jinankjain@linux.microsoft.com, apais@linux.microsoft.com, Tianyu.Lan@microsoft.com, vkuznets@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, will@kernel.org, catalin.marinas@arm.com Subject: [PATCH 14/15] asm-generic: hyperv: Use mshv headers conditionally. Add asm-generic/hyperv-defs.h Date: Thu, 27 Jul 2023 12:54:49 -0700 Message-Id: <1690487690-2428-15-git-send-email-nunodasneves@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1690487690-2428-1-git-send-email-nunodasneves@linux.microsoft.com> References: <1690487690-2428-1-git-send-email-nunodasneves@linux.microsoft.com> X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham 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 In order to keep unstable hyper-v interfaces independent of hyperv-tlfs.h, hvhdk.h must replace hyperv-tlfs.h eveywhere it will be used in the mshv driver. Add hyperv-defs.h to replace some inclusions of hyperv-tlfs.h. It includes hyperv-tlfs.h or hvhdk.h depending on a compile-time constant HV_HYPERV_DEFS which will be defined in the mshv driver. Signed-off-by: Nuno Das Neves --- arch/arm64/include/asm/mshyperv.h | 2 +- arch/x86/include/asm/mshyperv.h | 3 +-- drivers/hv/hyperv_vmbus.h | 1 - include/asm-generic/hyperv-defs.h | 26 ++++++++++++++++++++++++++ include/asm-generic/mshyperv.h | 2 +- include/linux/hyperv.h | 2 +- 6 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 include/asm-generic/hyperv-defs.h diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h index 20070a847304..8ec14caf3d4f 100644 --- a/arch/arm64/include/asm/mshyperv.h +++ b/arch/arm64/include/asm/mshyperv.h @@ -20,7 +20,7 @@ #include #include -#include +#include /* * Declare calls to get and set Hyper-V VP register values on ARM64, which diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 1a0655a93672..d4fa6e46e7e2 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -6,10 +6,9 @@ #include #include #include -#include #include #include -#include +#include /* * Hyper-V always provides a single IO-APIC at this MMIO address. diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 85f3c08bb42b..49529f0b8b99 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/include/asm-generic/hyperv-defs.h b/include/asm-generic/hyperv-defs.h new file mode 100644 index 000000000000..ac6fcba35c8c --- /dev/null +++ b/include/asm-generic/hyperv-defs.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_GENERIC_HYPERV_DEFS_H +#define _ASM_GENERIC_HYPERV_DEFS_H + +/* + * There are cases where Microsoft Hypervisor ABIs are needed which may not be + * stable or present in the Hyper-V TLFS document. E.g. the mshv_root driver. + * + * As these interfaces are unstable and may differ from hyperv-tlfs.h, they + * must be kept separate and independent. + * + * However, code from files that depend on hyperv-tlfs.h (such as mshyperv.h) + * is still needed, so work around the issue by conditionally including the + * correct definitions. + * + * Note: Since they are independent of each other, there are many definitions + * duplicated in both hyperv-tlfs.h and uapi/hyperv/hv*.h files. + */ +#ifdef HV_HYPERV_DEFS +#include +#else +#include +#endif + +#endif /* _ASM_GENERIC_HYPERV_DEFS_H */ + diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index 2b20994d809e..e86b6f51fb64 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #define VTPM_BASE_ADDRESS 0xfed40000 diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index f90de5abcd50..66ed8b3e5d89 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #define MAX_PAGE_BUFFER_COUNT 32 #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ -- 2.25.1