From patchwork Thu Oct 3 19:51:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Das Neves X-Patchwork-Id: 13821491 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 0918DCF34C3 for ; Thu, 3 Oct 2024 19:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kjAmLLXPZLA9nM0ptEZ4YBcAzeekWKCJ1ye+7nS9LiY=; b=lAuC6p09Fizi8LroF9BI2oGnzu ylAw0E8NxqusZw+fNuCj//L+bSpfWXdW4F3jkcq68wpMhuhUsZK1zN69nCoeB9tGqzqF+B2GhZ6Y2 PaD565DRw5W2Q77xjkMOXRPiL5lX7I6ieLYutLTfVAuJMcqCmqYObqJfdzowJcB9aExlLaOO1dsOU OYGre3ejV1SuS05bQ242GS9VT1u7j7cYt0SXxlVzU7vRK7h3H8CSueRrVsmUSl4sN4LqFwQwzd/kA 3rGdjxqdRLkErD/bG4ssbDJ9lCky9SxTDep4LZBj1uqWO9DBqxTCh6hULiNlDHoPInMm+cWlNQdyy CPvX6nMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swRxG-0000000AFME-07Zq; Thu, 03 Oct 2024 19:57:42 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swRqz-0000000AEBQ-3CVt for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2024 19:51:17 +0000 Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 7480C20DB362; Thu, 3 Oct 2024 12:51:10 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7480C20DB362 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1727985070; bh=kjAmLLXPZLA9nM0ptEZ4YBcAzeekWKCJ1ye+7nS9LiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UZU7Ua9ToVi/LsN5CRm/YoIJ1UG3CRa0YVkRMgcLpILwOn8E0WZH/5bV74INCcyJ5 Nm84mVqfMIhILD6ezLKgADSyNpQIUTlzahiOpKdfkE3YR+fBFhLyAW7zxBJIUXn8/B 2MHCHWW/gWuohGMmcKVrVGPlHmTB0GBbv7mwnt+M= From: Nuno Das Neves To: linux-hyperv@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, iommu@lists.linux.dev, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arch@vger.kernel.org, virtualization@lists.linux.dev Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, catalin.marinas@arm.com, will@kernel.org, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, seanjc@google.com, pbonzini@redhat.com, peterz@infradead.org, daniel.lezcano@linaro.org, joro@8bytes.org, robin.murphy@arm.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, arnd@arndb.de, sgarzare@redhat.com, jinankjain@linux.microsoft.com, muminulrussell@gmail.com, skinsburskii@linux.microsoft.com, mukeshrathor@microsoft.com Subject: [PATCH 5/5] hyperv: Use hvhdk.h instead of hyperv-tlfs.h in Hyper-V code Date: Thu, 3 Oct 2024 12:51:04 -0700 Message-Id: <1727985064-18362-6-git-send-email-nunodasneves@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1727985064-18362-1-git-send-email-nunodasneves@linux.microsoft.com> References: <1727985064-18362-1-git-send-email-nunodasneves@linux.microsoft.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241003_125113_947922_3836D2EA X-CRM114-Status: GOOD ( 12.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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To move toward importing headers from Hyper-V directly, switch to using hvhdk.h in all Hyper-V code. KVM code that uses Hyper-V definitions from hyperv-tlfs.h remains untouched. Add HYPERV_NONTLFS_HEADERS everywhere mshyperv.h, asm/svm.h, clocksource/hyperv_timer.h is included in Hyper-V code. Replace hyperv-tlfs.h with hvhdk.h directly in linux/hyperv.h, and define HYPERV_NONTLFS_HEADERS there, since it is only used in Hyper-V device code. Update a couple of definitions to updated names found in the new headers: HV_EXT_MEM_HEAT_HINT, HV_SUBNODE_TYPE_ANY. Signed-off-by: Nuno Das Neves --- arch/arm64/hyperv/hv_core.c | 1 + arch/arm64/hyperv/mshyperv.c | 1 + arch/x86/entry/vdso/vma.c | 1 + arch/x86/hyperv/hv_apic.c | 1 + arch/x86/hyperv/hv_init.c | 1 + arch/x86/hyperv/hv_proc.c | 3 ++- arch/x86/hyperv/hv_spinlock.c | 1 + arch/x86/hyperv/hv_vtl.c | 1 + arch/x86/hyperv/irqdomain.c | 1 + arch/x86/hyperv/ivm.c | 1 + arch/x86/hyperv/mmu.c | 1 + arch/x86/hyperv/nested.c | 1 + arch/x86/include/asm/vdso/gettimeofday.h | 1 + arch/x86/kernel/cpu/mshyperv.c | 1 + arch/x86/kernel/cpu/mtrr/generic.c | 1 + drivers/clocksource/hyperv_timer.c | 1 + drivers/hv/channel.c | 1 + drivers/hv/channel_mgmt.c | 1 + drivers/hv/connection.c | 1 + drivers/hv/hv.c | 1 + drivers/hv/hv_balloon.c | 3 ++- drivers/hv/hv_common.c | 1 + drivers/hv/hv_util.c | 1 + drivers/hv/ring_buffer.c | 1 + drivers/hv/vmbus_drv.c | 1 + drivers/iommu/hyperv-iommu.c | 1 + drivers/net/hyperv/netvsc.c | 1 + drivers/pci/controller/pci-hyperv.c | 1 + include/linux/hyperv.h | 3 ++- 29 files changed, 32 insertions(+), 3 deletions(-) diff --git a/arch/arm64/hyperv/hv_core.c b/arch/arm64/hyperv/hv_core.c index 9d1969b875e9..bb7f28f74bf4 100644 --- a/arch/arm64/hyperv/hv_core.c +++ b/arch/arm64/hyperv/hv_core.c @@ -14,6 +14,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include /* diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c index b1a4de4eee29..62b2a270ae65 100644 --- a/arch/arm64/hyperv/mshyperv.c +++ b/arch/arm64/hyperv/mshyperv.c @@ -15,6 +15,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include static bool hyperv_initialized; diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index 6d83ceb7f1ba..5f4053c49658 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c @@ -25,6 +25,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #undef _ASM_X86_VVAR_H diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c index f022d5f64fb6..4fe3b3b13256 100644 --- a/arch/x86/hyperv/hv_apic.c +++ b/arch/x86/hyperv/hv_apic.c @@ -26,6 +26,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index fc3c3d76c181..680c4abc456e 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -19,6 +19,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include #include diff --git a/arch/x86/hyperv/hv_proc.c b/arch/x86/hyperv/hv_proc.c index b74c06c04ff1..428542134b84 100644 --- a/arch/x86/hyperv/hv_proc.c +++ b/arch/x86/hyperv/hv_proc.c @@ -7,6 +7,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include @@ -176,7 +177,7 @@ int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags) input->partition_id = partition_id; input->vp_index = vp_index; input->flags = flags; - input->subnode_type = HvSubnodeAny; + input->subnode_type = HV_SUBNODE_ANY; input->proximity_domain_info = hv_numa_node_to_pxm_info(node); status = hv_do_hypercall(HVCALL_CREATE_VP, input, NULL); local_irq_restore(irq_flags); diff --git a/arch/x86/hyperv/hv_spinlock.c b/arch/x86/hyperv/hv_spinlock.c index 151e851bef09..7e8e2c03f669 100644 --- a/arch/x86/hyperv/hv_spinlock.c +++ b/arch/x86/hyperv/hv_spinlock.c @@ -12,6 +12,7 @@ #include +#define HYPERV_NONTLFS_HEADERS #include #include #include diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c index 04775346369c..a8bb6ad7efb6 100644 --- a/arch/x86/hyperv/hv_vtl.c +++ b/arch/x86/hyperv/hv_vtl.c @@ -10,6 +10,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include #include <../kernel/smpboot.h> diff --git a/arch/x86/hyperv/irqdomain.c b/arch/x86/hyperv/irqdomain.c index 3215a4a07408..977f90d08471 100644 --- a/arch/x86/hyperv/irqdomain.c +++ b/arch/x86/hyperv/irqdomain.c @@ -10,6 +10,7 @@ #include #include +#define HYPERV_NONTLFS_HEADERS #include static int hv_map_interrupt(union hv_device_id device_id, bool level, diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c index b56d70612734..557a308e8e0a 100644 --- a/arch/x86/hyperv/ivm.c +++ b/arch/x86/hyperv/ivm.c @@ -9,6 +9,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include #include diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c index cc8c3bd0e7c2..6bf9915611b8 100644 --- a/arch/x86/hyperv/mmu.c +++ b/arch/x86/hyperv/mmu.c @@ -5,6 +5,7 @@ #include #include +#define HYPERV_NONTLFS_HEADERS #include #include #include diff --git a/arch/x86/hyperv/nested.c b/arch/x86/hyperv/nested.c index ee06d0315c24..03775d72b7f9 100644 --- a/arch/x86/hyperv/nested.c +++ b/arch/x86/hyperv/nested.c @@ -11,6 +11,7 @@ #include +#define HYPERV_NONTLFS_HEADERS #include #include diff --git a/arch/x86/include/asm/vdso/gettimeofday.h b/arch/x86/include/asm/vdso/gettimeofday.h index b2d2df026f6e..528ac66e366b 100644 --- a/arch/x86/include/asm/vdso/gettimeofday.h +++ b/arch/x86/include/asm/vdso/gettimeofday.h @@ -18,6 +18,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #define __vdso_data (VVAR(_vdso_data)) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 8e8fd23b1439..59bb8ab93dc2 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -20,6 +20,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include #include diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index 7b29ebda024f..22228f2f550d 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c @@ -13,6 +13,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include #include diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c index 1b7de45a7185..ec37476c4e15 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -22,6 +22,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index fb8cd8469328..76d3c27e961e 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -19,6 +19,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include "hyperv_vmbus.h" diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 3c6011a48dab..e6d56c73175a 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -20,6 +20,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index f001ae880e1d..88546b0c2242 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -21,6 +21,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include "hyperv_vmbus.h" diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index e0d676c74f14..42f3790656e2 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -18,6 +18,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include #include diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index a120e9b80ded..6b270ee75747 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -28,6 +28,7 @@ #include #include +#define HYPERV_NONTLFS_HEADERS #include #define CREATE_TRACE_POINTS @@ -1583,7 +1584,7 @@ static int hv_free_page_report(struct page_reporting_dev_info *pr_dev_info, return -ENOSPC; } - hint->type = HV_EXT_MEMORY_HEAT_HINT_TYPE_COLD_DISCARD; + hint->heat_type = HV_EXTMEM_HEAT_HINT_COLD_DISCARD; hint->reserved = 0; for_each_sg(sgl, sg, nents, i) { union hv_gpa_page_range *range; diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c index a5217f837237..2723711868bc 100644 --- a/drivers/hv/hv_common.c +++ b/drivers/hv/hv_common.c @@ -28,6 +28,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include /* diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c index c4f525325790..a17f6e6024a4 100644 --- a/drivers/hv/hv_util.c +++ b/drivers/hv/hv_util.c @@ -17,6 +17,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include "hyperv_vmbus.h" diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index 3c9b02471760..6bfd064b4e65 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c @@ -18,6 +18,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include "hyperv_vmbus.h" diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 7242c4920427..71745d62e064 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -36,6 +36,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include #include "hyperv_vmbus.h" diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c index 8a5c17b97310..ade14cc9c071 100644 --- a/drivers/iommu/hyperv-iommu.c +++ b/drivers/iommu/hyperv-iommu.c @@ -20,6 +20,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include #include "irq_remapping.h" diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 2b6ec979a62f..55095c02cc78 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -23,6 +23,7 @@ #include #include +#define HYPERV_NONTLFS_HEADERS #include #include "hyperv_net.h" diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index cdd5be16021d..261ff8b80caa 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -50,6 +50,7 @@ #include #include #include +#define HYPERV_NONTLFS_HEADERS #include /* diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index d0893ec488ae..64fd385723fc 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -24,7 +24,8 @@ #include #include #include -#include +#include +#define HYPERV_NONTLFS_HEADERS #define MAX_PAGE_BUFFER_COUNT 32 #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */