public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Nuno Das Neves <nunodasneves@linux.microsoft.com>
To: linux-hyperv@vger.kernel.org, x86@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	mhklinux@outlook.com, ltykernel@gmail.com,
	stanislav.kinsburskiy@gmail.com, linux-acpi@vger.kernel.org,
	eahariha@linux.microsoft.com, jeff.johnson@oss.qualcomm.com
Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
	decui@microsoft.com, catalin.marinas@arm.com, will@kernel.org,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com,
	daniel.lezcano@linaro.org, joro@8bytes.org, robin.murphy@arm.com,
	arnd@arndb.de, jinankjain@linux.microsoft.com,
	muminulrussell@gmail.com, skinsburskii@linux.microsoft.com,
	mrathor@linux.microsoft.com, ssengar@linux.microsoft.com,
	apais@linux.microsoft.com, gregkh@linuxfoundation.org,
	vkuznets@redhat.com, prapal@linux.microsoft.com,
	anrayabh@linux.microsoft.com, rafael@kernel.org, lenb@kernel.org,
	corbet@lwn.net
Subject: [PATCH v6 00/10] Introduce /dev/mshv root partition driver
Date: Fri, 14 Mar 2025 12:28:46 -0700	[thread overview]
Message-ID: <1741980536-3865-1-git-send-email-nunodasneves@linux.microsoft.com> (raw)

This series introduces support for creating and running guest virtual
machines while running on the Microsoft Hypervisor[0] as root partition.
This is done via an IOCTL interface accessed through /dev/mshv, similar to
/dev/kvm. Another series introducing this support was previously posted in
2021[1], and versions 1-4 of this series were posted in 2023[2].

Patches 1-4 are small refactors and additions to Hyper-V code.
Patches 5-6 just export some definitions needed by /dev/mshv.
Patches 7-9 introduce some functionality and definitions in common code, that
are specific to the driver.
Patch 10 contains the driver code.

-----------------
[0] "Hyper-V" is more well-known, but it really refers to the whole stack
    including the hypervisor and other components that run in Windows
    kernel and userspace.
[1] Previous /dev/mshv patch series (2021) and discussion:
https://lore.kernel.org/linux-hyperv/1632853875-20261-1-git-send-email-nunodasneves@linux.microsoft.com/
[2] v4 (2023):
https://lore.kernel.org/linux-hyperv/1696010501-24584-1-git-send-email-nunodasneves@linux.microsoft.com/

-----------------
Changes since v5:
* Rework patch 1:
 1. Introduce hv_status_printk() logging macros which print the raw HV_STATUS_
    code along with string [Roman Kisel]
 2. Iterate over an array of data items to get the string and errno for the
    hv_result_to_*() functions. [Michael Kelley]
 3. Use hv_status_printk() to log errors in hyperv/irqdomain.c and
    hyperv-iommu.c [Easwar Hariharan]
* Minor cleanup, improvements, and commit wording changes in patches 2, 3, 4, 6
  [Roman Kisel, Easwar Hariharan, Michael Kelley]
* Fix issues with declaration and lifecycle of hv_synic_eventring_tail in patch
  7 [Michael Kelley]
* Improve detail and clarity of commit message in patch 8 [Michael Kelley]
* Minor cleanups in patch 9 - uapi types -> kernel types, #ifdef CONFIG_X86_64
  -> CONFIG_X86 for consistency, fix HVCALL_* ordering, remove redundant
  __packed, use explicit enum value [Stanislav Kinsburskii, Easwar Hariharan,
  Michael Kelley, Tianyu Lan]
* Minor fixes and cleanup in patch 10 [Michael Kelley]
* Add MODULE_DESCRIPTION() to patch 10 [Jeff Johnson]

Changes since v4:
* Slim down the IOCTL interface significantly, via several means:
  1. Use generic "passthrough" call MSHV_ROOT_HVCALL to replace many ioctls.
  2. Use MSHV_* versions of some of the HV_* definitions.
  3. Move hv headers out of uapi altogether, into include/hyperv/, see:
https://lore.kernel.org/linux-hyperv/1732577084-2122-1-git-send-email-nunodasneves@linux.microsoft.com/
* Remove mshv_vtl module altogther, it will be posted in followup series
  * Also remove the parent "mshv" module which didn't serve much purpose
* Update and refactor parts of the driver code for clarity, extensibility

Changes since v3 (summarized):
* Clean up the error and debug logging:
  1. Add a set of macros vp_*() and partition_*() which call the equivalent
     dev_*(), passing the device from the partition struct
     * The new macros also print the partition and vp ids to aid debugging
	   and reduce repeated code
  2. Use dev_*() (mostly via the new macros) instead of pr_*() *almost*
  everywhere - in interrupt context we can't always get the device struct
  3. Remove pr_*() logging from hv_call.c and mshv_root_hv_call.c

Changes since v2 (summarized):
* Fix many checkpatch.pl --strict style issues
* Initialize status in get/set registers hypercall helpers
* Add missing return on error in get_vp_signaled_count

Changes since v1 (summarized):
* Clean up formatting, commit messages

Nuno Das Neves (9):
  hyperv: Log hypercall status codes as strings
  arm64/hyperv: Add some missing functions to arm64
  hyperv: Introduce hv_recommend_using_aeoi()
  acpi: numa: Export node_to_pxm()
  Drivers: hv: Export some functions for use by root partition module
  Drivers: hv: Introduce per-cpu event ring tail
  x86: hyperv: Add mshv_handler() irq handler and setup function
  hyperv: Add definitions for root partition driver to hv headers
  Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs

Stanislav Kinsburskii (1):
  x86/mshyperv: Add support for extended Hyper-V features

 .../userspace-api/ioctl/ioctl-number.rst      |    2 +
 arch/arm64/hyperv/hv_core.c                   |   17 +
 arch/arm64/hyperv/mshyperv.c                  |    1 +
 arch/arm64/include/asm/mshyperv.h             |   13 +
 arch/x86/hyperv/irqdomain.c                   |    6 +-
 arch/x86/kernel/cpu/mshyperv.c                |   16 +-
 drivers/acpi/numa/srat.c                      |    1 +
 drivers/hv/Makefile                           |    5 +-
 drivers/hv/hv.c                               |   12 +-
 drivers/hv/hv_common.c                        |  175 +-
 drivers/hv/hv_proc.c                          |   13 +-
 drivers/hv/mshv.h                             |   30 +
 drivers/hv/mshv_common.c                      |  161 ++
 drivers/hv/mshv_eventfd.c                     |  833 ++++++
 drivers/hv/mshv_eventfd.h                     |   71 +
 drivers/hv/mshv_irq.c                         |  124 +
 drivers/hv/mshv_portid_table.c                |   84 +
 drivers/hv/mshv_root.h                        |  308 +++
 drivers/hv/mshv_root_hv_call.c                |  852 ++++++
 drivers/hv/mshv_root_main.c                   | 2333 +++++++++++++++++
 drivers/hv/mshv_synic.c                       |  665 +++++
 drivers/iommu/hyperv-iommu.c                  |    4 +-
 include/asm-generic/mshyperv.h                |   34 +-
 include/hyperv/hvgdk_mini.h                   |   72 +-
 include/hyperv/hvhdk.h                        |  132 +-
 include/hyperv/hvhdk_mini.h                   |   91 +
 include/uapi/linux/mshv.h                     |  287 ++
 27 files changed, 6266 insertions(+), 76 deletions(-)
 create mode 100644 drivers/hv/mshv.h
 create mode 100644 drivers/hv/mshv_common.c
 create mode 100644 drivers/hv/mshv_eventfd.c
 create mode 100644 drivers/hv/mshv_eventfd.h
 create mode 100644 drivers/hv/mshv_irq.c
 create mode 100644 drivers/hv/mshv_portid_table.c
 create mode 100644 drivers/hv/mshv_root.h
 create mode 100644 drivers/hv/mshv_root_hv_call.c
 create mode 100644 drivers/hv/mshv_root_main.c
 create mode 100644 drivers/hv/mshv_synic.c
 create mode 100644 include/uapi/linux/mshv.h

-- 
2.34.1


             reply	other threads:[~2025-03-14 19:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14 19:28 Nuno Das Neves [this message]
2025-03-14 19:28 ` [PATCH v6 01/10] hyperv: Log hypercall status codes as strings Nuno Das Neves
2025-03-18 18:01   ` Michael Kelley
2025-03-21 19:12     ` Nuno Das Neves
2025-03-25 18:02       ` Michael Kelley
2025-03-19  4:17   ` Easwar Hariharan
2025-03-14 19:28 ` [PATCH v6 02/10] x86/mshyperv: Add support for extended Hyper-V features Nuno Das Neves
2025-03-14 19:28 ` [PATCH v6 03/10] arm64/hyperv: Add some missing functions to arm64 Nuno Das Neves
2025-03-19  4:08   ` Easwar Hariharan
2025-03-14 19:28 ` [PATCH v6 04/10] hyperv: Introduce hv_recommend_using_aeoi() Nuno Das Neves
2025-03-14 19:28 ` [PATCH v6 05/10] acpi: numa: Export node_to_pxm() Nuno Das Neves
2025-03-14 19:28 ` [PATCH v6 06/10] Drivers: hv: Export some functions for use by root partition module Nuno Das Neves
2025-03-14 19:28 ` [PATCH v6 07/10] Drivers: hv: Introduce per-cpu event ring tail Nuno Das Neves
2025-03-14 19:28 ` [PATCH v6 08/10] x86: hyperv: Add mshv_handler() irq handler and setup function Nuno Das Neves
2025-03-14 19:28 ` [PATCH v6 09/10] hyperv: Add definitions for root partition driver to hv headers Nuno Das Neves
2025-03-19  4:04   ` Easwar Hariharan
2025-03-14 19:28 ` [PATCH v6 10/10] Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs Nuno Das Neves
2025-03-18 19:54   ` Michael Kelley
2025-03-18 20:00     ` Wei Liu
2025-03-18 20:23       ` Michael Kelley
2025-03-17 21:27 ` [PATCH v6 00/10] Introduce /dev/mshv root partition driver Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1741980536-3865-1-git-send-email-nunodasneves@linux.microsoft.com \
    --to=nunodasneves@linux.microsoft.com \
    --cc=anrayabh@linux.microsoft.com \
    --cc=apais@linux.microsoft.com \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=daniel.lezcano@linaro.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=eahariha@linux.microsoft.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=jeff.johnson@oss.qualcomm.com \
    --cc=jinankjain@linux.microsoft.com \
    --cc=joro@8bytes.org \
    --cc=kys@microsoft.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltykernel@gmail.com \
    --cc=mhklinux@outlook.com \
    --cc=mingo@redhat.com \
    --cc=mrathor@linux.microsoft.com \
    --cc=muminulrussell@gmail.com \
    --cc=prapal@linux.microsoft.com \
    --cc=rafael@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=skinsburskii@linux.microsoft.com \
    --cc=ssengar@linux.microsoft.com \
    --cc=stanislav.kinsburskiy@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@kernel.org \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox