All of lore.kernel.org
 help / color / mirror / Atom feed
From: Graham Neville <grahamneville-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Bridgman, John" <John.Bridgman-5C7GfCeVMHo@public.gmane.org>
Cc: "kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Matthias Ehrenfeuchter
	<efeu-5Zrl/DuVEGLQT0dZR+AlfA@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Paolo Bonzini <pbonzini-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: AMD Ryzen KVM/NPT/IOMMU issue
Date: Wed, 28 Jun 2017 19:52:27 +0000	[thread overview]
Message-ID: <CAEk7i1-Ar0ES8ekmSGiRrrWzTz8gFb2RDTW6KsbuNdDubVerww@mail.gmail.com> (raw)
In-Reply-To: <BN6PR12MB13481A39CD3EA714754FEE49E8DD0-/b2+HYfkarQX0pEhCR5T8QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 4766 bytes --]

Although not related to graphics card performance, there is definitely
another issue with regards to running KVM nested L2 guests when npt=1.

Thought I'd mention this in case it helps with identifying performance
issues with NPT.

I'm unable to start any L2 guests with KVM acceleration (--enable-kvm). As
soon as it attempts to bring up the L2 guest the L1 host crashes, L0 host
remains online. Nothing is printed in either L1 or L0's dmesg.

My L0 is running Arch with 4.11.0-rc6, with qemu 2.8.0. I've tried
different L1 hosts (Ubuntu,Arch) and different kernels right to 4.12-rc5
kernel, along with different qemu versions.

This used to work fine with my Intel i7-4770s setup.

With npt=0, L2 guests can start but performance is dier.

On Wed, Jun 28, 2017 at 7:29 PM, Bridgman, John <John.Bridgman-5C7GfCeVMHo@public.gmane.org>
wrote:

>
>
> From: Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Sent: June 28, 2017 3:08 PM
> To: Suthikulpanit, Suravee
> Cc: Steven Walter; Nick Sarnie; Paolo Bonzini;
> iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Matthias Ehrenfeuchter;
> kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Bridgman, John
> Subject: Re: AMD Ryzen KVM/NPT/IOMMU issue
>
> On Thu, 29 Jun 2017 01:53:57 +0700
> Suravee Suthikulpanit <Suravee.Suthikulpanit-5C7GfCeVMHo@public.gmane.org> wrote:
>
> > On 6/29/17 00:26, Steven Walter wrote:
> > >> So, I'm trying to reproduce this issue on the Ryzen system w/ the
> following
> > >> setup:
> > >>
> > >>   * Host kernel v4.11 (with this patch  https://lkml.org/lkml/2017/6/
> 23/295)
> > >>
> > >>   * guest VM RHEL7.3
> > >>
> > >>   * guest graphic driver = radeon
> > >>
> > >>   * qemu-system-x86_64 --version
> > >>     QEMU emulator version 2.9.50 (v2.9.0-1659-g577caa2-dirty)
> > >>
> > >>   * kvm-amd npt=1
> > >>
> > >>   * dGPU is 08:00.0 VGA compatible controller: Advanced Micro
> Devices, Inc.
> > >> [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81)
> > >>
> > >>   * qemu-system-x86_64 -smp 4 -enable-kvm -M q35 -m 4096 -cpu host
> -bios
> > >> /usr/share/qemu/bios.bin -device
> > >> ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,
> chassis=1,id=root.1
> > >> -drive file=/sandbox/vm-images/rhel7.3.qcow2,if=virtio,id=disk0 -net
> none
> > >> -vga none -nodefaults -device
> > >> vfio-pci,host=08:00.0,x-vga=on,addr=0.0,multifunction=on,
> bus=root.1,romfile=/sandbox/vm-images/vbios.rom
> > >> -usb -device usb-host,hostbus=3,hostport=1 -device
> > >> usb-host,hostbus=3,hostport=3 -device vfio-pci,host=0000:08:00.1
> -device
> > >> vfio-pci,host=0000:09:00.0
> > >>
> > >> With this setup, I am able to pass-through the dGPU and run the
> following
> > >> test:
> > >>   * Starting up the guest w/ full GNOME GUI on the attached monitor.
> > >>   * glxgears (running @ 60 FPS)
> > >>   * Playing 1080p HD video on Youtube
> > >>
> > >> I am not noticing issues here. What kind of test are you running in
> the
> > >> guest VM?
> > > Try running the open source game "torcs" inside the VM.  I think
> > > you'll find that there's a very noticeable performance different
> > > between npt=1 and npt=0
> >
> > Hm.. actually torcs seems to be running fine w/ npt=1 setup. Although I
> think my
> > driving skill is ~20% worse :(
>
> >A clarification on the issue, it's not that these games/benchmarks
> >don't work or aren't playable, it's that they run slower (as measured by
> >framerate) with npt=1 vs npt=0.  A virtualized guest on AMD hardware is
> >hindered either by lower graphics performance (npt=1) or higher CPU
> >virtualization overhead (npt=0) for high intensity games or graphics
> >workloads.  Intel's equivalent ept feature does not have this issue.  I
> >would encourage looking at the framerate for one mode vs the other
> >before drawing any conclusions on whether it's working well.  Thanks,
> >Alex
>
> One more data point - Nick did some testing with Xen enabling/disabling
> npt and
> found that (a) performance was not affected much whether npt was on or
> off, and
> (b) performance with npt on was pretty close to KVM performance with npt
> off.
>
> This suggests something specific to KVM that doesn't play well with npt,
> although
> I have no idea what that might be. I was going to talk to our folks to see
> if they had
> any suggestions re: ways to narrow down where the performance impact is
> coming
> from, but I ended up going off sick instead.
>
> Haven't gone through the whole thread here yet so apologies if this has
> already been
> mentioned (and Nick sorry for the delay).
>
> _______________________________________________
> iommu mailing list
> iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
>

[-- Attachment #1.2: Type: text/html, Size: 6552 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2017-06-28 19:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 14:37 AMD Ryzen KVM/NPT/IOMMU issue Matthias Ehrenfeuchter
     [not found] ` <575f8fbc-0fdc-f336-e3da-53f27da4b2e1-5Zrl/DuVEGLQT0dZR+AlfA@public.gmane.org>
2017-05-03 16:28   ` Nick Sarnie
     [not found]     ` <CAOcCaLbdi9KZoXiV5htjShc_mYvZ5jK2B3Ot7NeM=3v_ZA39aA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-05 12:05       ` Matthias Ehrenfeuchter
2017-05-05 17:27     ` Alex Williamson
     [not found]       ` <20170505112706.7785948c-1yVPhWWZRC1BDLzU/O5InQ@public.gmane.org>
2017-06-25  5:55         ` Nick Sarnie
     [not found]           ` <CAOcCaLbAS0FkRrG8YZNM5rYUtCFeUGkdgdy=4o16Njufdy8Gag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-28 17:23             ` Suravee Suthikulpanit
2017-06-28 17:26               ` Steven Walter
     [not found]                 ` <CAK8d-aJ+XHi+5sr6bHj3D2BaG94v6Lyk1C_ZuA4erDVhEyp-uQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-28 18:53                   ` Suravee Suthikulpanit
     [not found]                     ` <5d2ea709-8f90-bfaa-975d-48aed39e75ad-5C7GfCeVMHo@public.gmane.org>
2017-06-28 19:08                       ` Alex Williamson
     [not found]                         ` <20170628130855.76c2b700-DGNDKt5SQtizQB+pC5nmwQ@public.gmane.org>
2017-06-28 19:28                           ` Bridgman, John
2017-06-28 19:29                             ` Bridgman, John
     [not found]                               ` <BN6PR12MB13481A39CD3EA714754FEE49E8DD0-/b2+HYfkarQX0pEhCR5T8QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-06-28 19:52                                 ` Graham Neville [this message]
     [not found]                                   ` <CAEk7i1-Ar0ES8ekmSGiRrrWzTz8gFb2RDTW6KsbuNdDubVerww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-28 20:33                                     ` Paolo Bonzini
2017-06-28 22:34                                       ` Nick Sarnie
     [not found]                                         ` <CAOcCaLao_Y-8KP60baoSehtCu7C5CVnuuZNEom-zi54Fa2h+sQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-29  0:21                                           ` Thiago Padilha
     [not found]                                             ` <CAAq2Xdpu_rv7FgVfGCv-nYttGzH6hZujqdYvcf4qgXetkOGLzw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-29  1:50                                               ` Thiago Padilha
     [not found]                                                 ` <CAAq2XdppNcKcmbJhPQ9WfTowKSmp76jhDa9JHM1rc92Enx=1Zg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-29  1:54                                                   ` Nick Sarnie
2017-07-01 14:15                                                     ` Thiago Padilha
2017-10-17  4:16                                                       ` Nick Sarnie
     [not found]               ` <545f19a3-4923-cdec-4ce9-2a4155a04f6a-5C7GfCeVMHo@public.gmane.org>
2017-06-28 17:31                 ` Alex Williamson
2017-06-28 19:17 Graham Neville
2017-10-23 23:49 geoff--- via iommu
     [not found] ` <b88fc14b230d7ecac6066bdd9e95be19-9M2dFRIgpjGrDvn5mFPilA@public.gmane.org>
2017-10-24  5:15   ` geoff--- via iommu
     [not found]     ` <cb2b1ee0a3b705e668ac3cf19cfa1ecc-9M2dFRIgpjGrDvn5mFPilA@public.gmane.org>
2017-10-24 19:08       ` geoff--- via iommu
     [not found]         ` <1b4a39530fde35783be63470003f0911-9M2dFRIgpjGrDvn5mFPilA@public.gmane.org>
2017-10-24 20:16           ` geoff--- via iommu
2017-10-24 21:31             ` Alex Williamson
2017-10-24 21:31               ` Alex Williamson
     [not found]               ` <20171024233137.295a6b39-1yVPhWWZRC1BDLzU/O5InQ@public.gmane.org>
2017-10-24 21:39                 ` geoff--- via iommu
     [not found]                   ` <a909bd77b381f5beef6d74c97307265d-9M2dFRIgpjGrDvn5mFPilA@public.gmane.org>
2017-10-24 23:39                     ` Nick Sarnie

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=CAEk7i1-Ar0ES8ekmSGiRrrWzTz8gFb2RDTW6KsbuNdDubVerww@mail.gmail.com \
    --to=grahamneville-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=John.Bridgman-5C7GfCeVMHo@public.gmane.org \
    --cc=efeu-5Zrl/DuVEGLQT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pbonzini-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.