From patchwork Thu Oct 3 19:50:59 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: 13821488 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 B734BCF34C1 for ; Thu, 3 Oct 2024 19:54:05 +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: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:In-Reply-To:References:List-Owner; bh=nHGX8zwwOomC34dyU6ixeYDufe9vxK5rO4mA9Rus51s=; b=XbRPvjWFYIX0EIeaMQNt8N4tim 66TD2lkuh5amdxX+XUA0saX7QdoAbf+R1rBWpotrPnMsANRdybtU+5ywZu2UxKhR0csrbNXT3MP5i oYvN4LZehPKCw/zPvPr8v/rjgAVAsocmKbHOwWT6zZ1LXTXRo+if3KwZV/J1z6asUCJunj4NGBhG5 MJvxRHRPVlyVOnrJ6JLe5KmB8jlWhL7mO/6ISV1vpz5prxD5lvCM2vUHB6ttxKgLHL7NAhjc0Absc Oe1rDv0rWvNlC7ConPBbUqrMrmCe1zoC8FkMHiZdXTEx5tMpe5jmN0AFByia/n//1R5nulNg1Sjah wX/oJ1sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swRtZ-0000000AEsy-2uFh; Thu, 03 Oct 2024 19:53:53 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swRqx-0000000AE8g-2baa for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2024 19:51:13 +0000 Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id D046520DB35D; Thu, 3 Oct 2024 12:51:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D046520DB35D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1727985069; bh=nHGX8zwwOomC34dyU6ixeYDufe9vxK5rO4mA9Rus51s=; h=From:To:Cc:Subject:Date:From; b=iaCjs6WodUbua+uhfLTMTGJP+jo8u/Ibyom3MPqrld6rOPAcIq3clyN04GFNZxD7o F4+idAjqql3s/AtcZibCieqsrWZnfMrJuFDoVS423rFzlmEeEiKcqiOibiDmoiNPXF l+KBC+uTKON85PgSs1bs0u1xWYYmhsJOVKSYjthI= 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 0/5] Add new headers for Hyper-V Dom0 Date: Thu, 3 Oct 2024 12:50:59 -0700 Message-Id: <1727985064-18362-1-git-send-email-nunodasneves@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241003_125111_734931_01B7CD1B X-CRM114-Status: GOOD ( 13.32 ) 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 support Hyper-V Dom0 (aka Linux as root partition), many new definitions are required. The plan going forward is to directly import headers from Hyper-V. This is a more maintainable way to import definitions rather than via the TLFS doc. This patch series introduces new headers (hvhdk.h, hvgdk.h, etc, see patch #3) directly derived from Hyper-V code. This patch series replaces hyperv-tlfs.h with hvhdk.h, but only in Microsoft-maintained Hyper-V code where they are needed. This leaves the existing hyperv-tlfs.h in use elsewhere - notably for Hyper-V enlightenments on KVM guests. An intermediary header "hv_defs.h" is introduced to conditionally include either hyperv-tlfs.h or hvhdk.h. This is required because several headers which today include hyperv-tlfs.h, are shared between Hyper-V and KVM code (e.g. mshyperv.h). Summary: Patch 1-2: Cleanup patches Patch 3: Add the new headers (hvhdk.h, etc..) in include/hyperv/ Patch 4: Add hv_defs.h and use it in mshyperv.h, svm.h, hyperv_timer.h Patch 5: Switch to the new headers, only in Hyper-V code Nuno Das Neves (5): hyperv: Move hv_connection_id to hyperv-tlfs.h hyperv: Remove unnecessary #includes hyperv: Add new Hyper-V headers hyperv: Add hv_defs.h to conditionally include hyperv-tlfs.h or hvhdk.h hyperv: Use hvhdk.h instead of hyperv-tlfs.h in Hyper-V code arch/arm64/hyperv/hv_core.c | 3 +- arch/arm64/hyperv/mshyperv.c | 1 + arch/arm64/include/asm/mshyperv.h | 2 +- arch/x86/entry/vdso/vma.c | 1 + arch/x86/hyperv/hv_apic.c | 2 +- arch/x86/hyperv/hv_init.c | 3 +- arch/x86/hyperv/hv_proc.c | 4 +- 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 | 2 +- arch/x86/hyperv/mmu.c | 2 +- arch/x86/hyperv/nested.c | 2 +- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/include/asm/mshyperv.h | 3 +- arch/x86/include/asm/svm.h | 2 +- arch/x86/include/asm/vdso/gettimeofday.h | 1 + arch/x86/kernel/cpu/mshyperv.c | 2 +- arch/x86/kernel/cpu/mtrr/generic.c | 1 + arch/x86/kvm/vmx/vmx_onhyperv.h | 1 - arch/x86/mm/pat/set_memory.c | 2 - drivers/clocksource/hyperv_timer.c | 2 +- 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 | 5 +- drivers/hv/hv_common.c | 2 +- drivers/hv/hv_kvp.c | 1 - drivers/hv/hv_snapshot.c | 1 - drivers/hv/hv_util.c | 1 + drivers/hv/hyperv_vmbus.h | 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/asm-generic/hyperv-tlfs.h | 9 + include/asm-generic/mshyperv.h | 2 +- include/clocksource/hyperv_timer.h | 2 +- include/hyperv/hv_defs.h | 29 + include/hyperv/hvgdk.h | 66 ++ include/hyperv/hvgdk_ext.h | 46 + include/hyperv/hvgdk_mini.h | 1212 ++++++++++++++++++++++ include/hyperv/hvhdk.h | 733 +++++++++++++ include/hyperv/hvhdk_mini.h | 310 ++++++ include/linux/hyperv.h | 12 +- net/vmw_vsock/hyperv_transport.c | 1 - 48 files changed, 2442 insertions(+), 40 deletions(-) create mode 100644 include/hyperv/hv_defs.h create mode 100644 include/hyperv/hvgdk.h create mode 100644 include/hyperv/hvgdk_ext.h create mode 100644 include/hyperv/hvgdk_mini.h create mode 100644 include/hyperv/hvhdk.h create mode 100644 include/hyperv/hvhdk_mini.h