From: Peter Xu <peterx@redhat.com>
To: Jintack Lim <incredible.tack@gmail.com>
Cc: QEMU Devel Mailing List <qemu-devel@nongnu.org>
Subject: Re: Using virtual IOMMU in guest hypervisors other than KVM and Xen?
Date: Sat, 19 Oct 2019 11:36:51 +0800 [thread overview]
Message-ID: <20191019033651.GA9478@xz-x1> (raw)
In-Reply-To: <CAHyh4xgzqMuWR7moxPfWZarED5HtPcu3LmnTHMe7CpwScHa4Eg@mail.gmail.com>
On Wed, Oct 16, 2019 at 03:01:22PM -0700, Jintack Lim wrote:
> On Mon, Oct 14, 2019 at 7:50 PM Peter Xu <peterx@redhat.com> wrote:
> >
> > On Mon, Oct 14, 2019 at 01:28:49PM -0700, Jintack Lim wrote:
> > > Hi,
> >
> > Hello, Jintack,
> >
> Hi Peter,
>
> > >
> > > I'm trying to pass through a physical network device to a nested VM
> > > using virtual IOMMU. While I was able to do it successfully using KVM
> > > and Xen guest hypervisors running in a VM respectively, I couldn't do
> > > it with Hyper-V as I described below. I wonder if anyone have
> > > successfully used virtual IOMMU in other hypervisors other than KVM
> > > and Xen? (like Hyper-V or VMware)
> > >
> > > The issue I have with Hyper-V is that Hyper-V gives an error that the
> > > underlying hardware is not capable of doing passthrough. The exact
> > > error message is as follows.
> > >
> > > Windows Power-shell > (Get-VMHost).IovSupportReasons
> > > The chipset on the system does not do DMA remapping, without which
> > > SR-IOV cannot be supported.
> > >
> > > I'm pretty sure that Hyper-V recognizes virtual IOMMU, though; I have
> > > enabled iommu in windows boot loader[1], and I see differences when
> > > booing a Windows VM with and without virtual IOMMU. I also checked
> > > that virtual IOMMU traces are printed.
> >
> > What traces have you checked? More explicitly, have you seen DMAR
> > enabled and page table setup for that specific device to be
> > pass-throughed?
>
> Thanks for the pointers. I checked that DMAR is NOT enabled. The only
> registers that Windows guest accessed were Version Register,
> Capability Register, and Extended Capability Register. On the other
> hand, a Linux guest accessed other registers and enabled DMAR.
> Here's a link to the trace I got using QEMU 4.1.0. Do you see anything
> interesting there?
> http://paste.ubuntu.com/p/YcSyxG9Z3x/
Then I feel like Windows is reluctant to enable DMAR due to lacking of
some caps.
>
> >
> > >
> > > I have tried multiple KVM/QEMU versions including the latest ones
> > > (kernel v5.3, QEMU 4.1.0) as well as two different Windows servers
> > > (2016 and 2019), but I see the same result. [4]
> > >
> > > I'd love to hear if somebody is using virtual IOMMU in Hyper-V or
> > > VMware successfully, especially for passthrough. I also appreciate if
> > > somebody can point out any configuration errors I have.
> > >
> > > Here's the qemu command line I use, basically from the QEMU vt-d
> > > page[2] and Hyper-v on KVM from kvmforum [3].
> > >
> > > ./qemu/x86_64-softmmu/qemu-system-x86_64 -device
> > > intel-iommu,intremap=on,caching-mode=on -smp 6 -m 24G -M
> >
> > Have you tried to use 4-level IOMMU page table (aw-bits=48 on latest
> > QEMU, or x-aw-bits=48 on some old ones)? IIRC we've encountered
> > issues when trying to pass the SVVP Windows test with this, in which
> > 4-level is required. I'm not sure whether whether that is required in
> > general usages of vIOMMU in Windows.
>
> I just tried the option you mentioned, but it didn't change anything.
> BTW, what version of Windows was it?
Sorry I don't remember that. I didn't do the test but I was just
acknowledged that with it the test passed. I assume you're using the
latest QEMU here because I know Windows could require another
capability (DMA draining) and it should be on by default in latest
qemu master.
At that time the complete cmdline to pass the test should be:
-device intel-iommu,intremap=on,aw-bits=48,caching-mode=off,eim=on
I also don't remember on why caching-mode needs to be off at that
time (otherwise SVVP fails too).
--
Peter Xu
next prev parent reply other threads:[~2019-10-19 3:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 20:28 Using virtual IOMMU in guest hypervisors other than KVM and Xen? Jintack Lim
2019-10-15 2:49 ` Peter Xu
2019-10-16 22:01 ` Jintack Lim
2019-10-19 3:36 ` Peter Xu [this message]
2019-10-19 6:19 ` Jintack Lim
2019-10-21 0:44 ` Peter Xu
2019-10-21 11:33 ` Vitaly Kuznetsov
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=20191019033651.GA9478@xz-x1 \
--to=peterx@redhat.com \
--cc=incredible.tack@gmail.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).