From: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
To: Mukesh R <mrathor@linux.microsoft.com>
Cc: easwar.hariharan@linux.microsoft.com,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux.dev, linux-arch@vger.kernel.org,
jgg@nvidia.com, jacob.pan@linux.microsoft.com, kys@microsoft.com,
haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
joro@8bytes.org, will@kernel.org, robin.murphy@arm.com,
arnd@arndb.de
Subject: Re: [PATCH V0 3/3] x86/hyperv: Implement root VM IOMMU kernel only driver
Date: Thu, 24 Sep 2026 09:30:20 -0700 [thread overview]
Message-ID: <dca62265-c75a-4ea9-9540-7a9da833b83e@linux.microsoft.com> (raw)
In-Reply-To: <21f8bbbc-0298-2e31-c165-0db660ae5208@linux.microsoft.com>
On 9/22/2026 14:42, Mukesh R wrote:
> On 9/22/26 10:49, Easwar Hariharan wrote:
>> On 9/21/2026 15:50, Mukesh R wrote:
>>> Add a new file to implement a kernel only virtual IOMMU that works
>>> with Microsoft Hyper-V hypervisor on privileged VMs aka root VMs. The
>>> hypervisor claims the IOMMU upon boot, and this driver communicates with
>>> it for creating and deleting paging domains, attaching of devices, mapping
>>> and unmapping of pages, etc. During boot, hypervisor automatically creates
>>> identity and blocked domains, so there is no need to do hypercalls to
>>> create them. This is a kernel only driver and only supported on baremetal
>>> root (and not L1VH root) without any guest passthru support. Support
>>> for guest device passthru will be added incrementally.
>>>
>>> Signed-off-by: Mukesh R <mrathor@linux.microsoft.com>
>>> ---
>>> arch/x86/kernel/pci-dma.c | 2 +
>>> drivers/iommu/Kconfig | 1 +
>>> drivers/iommu/hyperv/Kconfig | 15 +
>>> drivers/iommu/hyperv/Makefile | 1 +
>>> drivers/iommu/hyperv/hv-iommu-root.c | 645 +++++++++++++++++++++++++++
>>> include/asm-generic/mshyperv.h | 3 +
>>> include/linux/hyperv.h | 6 +
>>> 7 files changed, 673 insertions(+)
>>> create mode 100644 drivers/iommu/hyperv/Kconfig
>>> create mode 100644 drivers/iommu/hyperv/hv-iommu-root.c
>>>
<snip>
>>> diff --git a/drivers/iommu/hyperv/hv-iommu-root.c b/drivers/iommu/hyperv/hv-iommu-root.c
>>> new file mode 100644
>>> index 000000000000..a5268e0e52cc
>>> --- /dev/null
>>> +++ b/drivers/iommu/hyperv/hv-iommu-root.c
>>> @@ -0,0 +1,645 @@
>>> +// SPDX-License-Identifier: GPL-2.0
>>> +/*
>>> + * Hyper-V root vIOMMU driver.
>>> + * Copyright (C) 2026, Microsoft, Inc.
>>> + */
<snip>
>>> +
>>> +/*
>>> + * Currently, hypervisor does not provide list of devices it is using
>>> + * dynamically. So use this to allow users to manually specify devices that
>>> + * should be skipped. (eg. hypervisor debugger using some network device).
>>> + */
>>
>> Maybe a flag, say OwnedByHyp = 1 returned for the root equivalent of the guest driver's
>> GetLogicalDeviceProperty hypercall can solve this.
>
> "hypervisor does not provide list of devices it is using dynamically"
Sorry, can you be more verbose? When I read this response yesterday, I thought by dynamically, you
meant at runtime, but on thinking this through, the current scheme doesn't help with that either.
You have to pass the kernel command-line parameter at boot because the IOMMU driver is built-in, and
so if a debugger is attached to the hypervisor "at runtime", your current scheme, just like my suggestion
for a flag returned by GetPhysicalDeviceProperty above, requires a reboot of the root partition.
>
<snip>
>>> #endif /* _HYPERV_H */
>
prev parent reply other threads:[~2026-09-24 16:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 22:50 [PATCH V0 0/3] Hyper-V: root VM iommu " Mukesh R
2026-09-21 22:50 ` [PATCH V0 1/3] PCI: hv: Export hv_build_devid_type_pci() and change return type Mukesh R
2026-09-22 17:48 ` Easwar Hariharan
2026-09-21 22:50 ` [PATCH V0 2/3] mshv: Import data structs around device domains from hyperv headers Mukesh R
2026-09-22 17:48 ` Easwar Hariharan
2026-09-22 21:10 ` Mukesh R
2026-09-22 21:34 ` Easwar Hariharan
2026-09-21 22:50 ` [PATCH V0 3/3] x86/hyperv: Implement root VM IOMMU kernel only driver Mukesh R
2026-09-22 17:49 ` Easwar Hariharan
2026-09-22 21:42 ` Mukesh R
2026-09-24 16:30 ` Easwar Hariharan [this message]
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=dca62265-c75a-4ea9-9540-7a9da833b83e@linux.microsoft.com \
--to=easwar.hariharan@linux.microsoft.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux.dev \
--cc=jacob.pan@linux.microsoft.com \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mrathor@linux.microsoft.com \
--cc=robin.murphy@arm.com \
--cc=tglx@kernel.org \
--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
all inboxes | Powered by JetHome®