Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-10-24 Thread Nick Sarnie
On Tue, Oct 24, 2017 at 5:39 PM, geoff--- via iommu wrote: > On 2017-10-25 08:31, Alex Williamson wrote: >> >> On Wed, 25 Oct 2017 07:16:46 +1100 >> geoff--- via iommu wrote: >> >>> I have isolated it to a single change, although I do not completely >>> understand what other implications it might

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-10-24 Thread geoff--- via iommu
On 2017-10-25 08:31, Alex Williamson wrote: On Wed, 25 Oct 2017 07:16:46 +1100 geoff--- via iommu wrote: I have isolated it to a single change, although I do not completely understand what other implications it might have. By just changing the line in `init_vmcb` that reads: save->g_pat =

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-10-24 Thread Alex Williamson
On Wed, 25 Oct 2017 07:16:46 +1100 geoff--- via iommu wrote: > I have isolated it to a single change, although I do not completely > understand what other implications it might have. > > By just changing the line in `init_vmcb` that reads: > >save->g_pat = svm->vcpu.arch.pat; > > To: > >

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-10-24 Thread geoff--- via iommu
I have isolated it to a single change, although I do not completely understand what other implications it might have. By just changing the line in `init_vmcb` that reads: save->g_pat = svm->vcpu.arch.pat; To: save->g_pat = 0x0606060606060606; This enables write back and performance jumps

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-10-24 Thread geoff--- via iommu
I have identified the issue! With NPT enabled I am now getting near bare metal performance with PCI pass through. The issue was with some stubs that have not been properly implemented. I will clean my code up and submit a patch shortly. This is a 10 year old bug that has only become evident with

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-10-23 Thread geoff--- via iommu
Further to this I have verified that IOMMU is working fine, traces and additional printk's added to the kernel module were used to check. All accesses are successful and hit the correct addresses. However profiling under Windows shows there might be an issue with IRQs not reaching the guest. When

AMD Ryzen KVM/NPT/IOMMU issue

2017-10-23 Thread geoff--- via iommu
Hi, I realize this is an older thread but I have spent much of today trying to diagnose the problem. I have discovered how to reliably reproduce the problem with very little effort. It seems that reproducing the issue has been hit and miss for people as it seems to primarily affect games/pr

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-10-16 Thread Nick Sarnie
On Wed, Jun 28, 2017 at 2:53 PM, Suravee Suthikulpanit 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) >>>

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-07-01 Thread Thiago Padilha
Hi Just wanted to add that I've also tested passthrough with Xen and my radeon rx460(unfortunately Xen doesn't work with nvidia yet) and confirm that hardware assisted paging seems to work flawless without affecting GPU performance. An easy way to verify this is to run the following Passmark's Pe

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Thiago Padilha
Some more data from 3DMark benchmarks: Time Spy(DirectX 12): - Graphics test 1: - npt=0: 37.65 FPS - npt=1: 24.22 FPS (36% drop) - Graphics test 2: - npt=0: 33.05 FPS - npt=1: 29.65 FPS (10% drop) - CPU test: - npt=0: 17.35 FPS - npt=1: 12.03 FPS (31% drop) Fire Strike(DirectX 11): -

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Nick Sarnie
On Wed, Jun 28, 2017 at 9:50 PM, Thiago Padilha wrote: > Some more data from 3DMark benchmarks: > > Time Spy(DirectX 12): > - Graphics test 1: > - npt=0: 37.65 FPS > - npt=1: 24.22 FPS (36% drop) > - Graphics test 2: > - npt=0: 33.05 FPS > - npt=1: 29.65 FPS (10% drop) > - CPU test: > -

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Thiago Padilha
On Wed, Jun 28, 2017 at 7:34 PM, Nick Sarnie wrote: > Hi Suravee, > > Thanks a lot for helping. Torcs does not appear graphically demanding > on modern hardware, so this issue may not be easily noticeable. I was > able to easily reproduce the problem using the Unigine Heaven > benchmark, but I'm s

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Nick Sarnie
On Wed, Jun 28, 2017 at 4:33 PM, Paolo Bonzini wrote: > > > On 28/06/2017 21:52, Graham Neville wrote: >> 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

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Paolo Bonzini
On 28/06/2017 21:52, Graham Neville wrote: > 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 unab

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Graham Neville
gt; To: Suthikulpanit, Suravee > Cc: Steven Walter; Nick Sarnie; Paolo Bonzini; > iommu@lists.linux-foundation.org; Matthias Ehrenfeuchter; > k...@vger.kernel.org; Bridgman, John > Subject: Re: AMD Ryzen KVM/NPT/IOMMU issue > > On Thu, 29 Jun 2017 01:53:57 +0700 > Suravee Suthikulp

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Bridgman, John
From: Alex Williamson Sent: June 28, 2017 3:08 PM To: Suthikulpanit, Suravee Cc: Steven Walter; Nick Sarnie; Paolo Bonzini; iommu@lists.linux-foundation.org; Matthias Ehrenfeuchter; k...@vger.kernel.org; Bridgman, John Subject: Re: AMD Ryzen KVM/NPT/IOMMU issue   On Thu, 29 Jun 2017 01:53

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Bridgman, John
From: Alex Williamson Sent: June 28, 2017 3:08 PM To: Suthikulpanit, Suravee Cc: Steven Walter; Nick Sarnie; Paolo Bonzini; iommu@lists.linux-foundation.org; Matthias Ehrenfeuchter; k...@vger.kernel.org; Bridgman, John Subject: Re: AMD Ryzen KVM/NPT/IOMMU issue

AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Graham Neville
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-k

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Alex Williamson
On Thu, 29 Jun 2017 01:53:57 +0700 Suravee Suthikulpanit 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) > >> > >> *

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Suravee Suthikulpanit
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 Q

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Alex Williamson
On Thu, 29 Jun 2017 00:23:20 +0700 Suravee Suthikulpanit 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 = rade

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Steven Walter
On Wed, Jun 28, 2017 at 1:23 PM, Suravee Suthikulpanit wrote: > > > On 6/25/17 12:55, Nick Sarnie wrote: >> >> On Fri, May 5, 2017 at 1:27 PM, Alex Williamson >> wrote: >>> >>> On Wed, 3 May 2017 12:28:35 -0400 >>> Nick Sarnie wrote: >>> On Wed, May 3, 2017 at 10:37 AM, Matthias Ehrenfeucht

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-28 Thread Suravee Suthikulpanit
On 6/25/17 12:55, Nick Sarnie wrote: On Fri, May 5, 2017 at 1:27 PM, Alex Williamson wrote: On Wed, 3 May 2017 12:28:35 -0400 Nick Sarnie wrote: On Wed, May 3, 2017 at 10:37 AM, Matthias Ehrenfeuchter wrote: Hi, There are a lot of messages/threads out there about bad performance while u

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-06-24 Thread Nick Sarnie
On Fri, May 5, 2017 at 1:27 PM, Alex Williamson wrote: > On Wed, 3 May 2017 12:28:35 -0400 > Nick Sarnie wrote: > >> On Wed, May 3, 2017 at 10:37 AM, Matthias Ehrenfeuchter >> wrote: >> > Hi, >> > >> > There are a lot of messages/threads out there about bad performance while >> > using AMDs Ryz

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-05-05 Thread Alex Williamson
On Wed, 3 May 2017 12:28:35 -0400 Nick Sarnie wrote: > On Wed, May 3, 2017 at 10:37 AM, Matthias Ehrenfeuchter > wrote: > > Hi, > > > > There are a lot of messages/threads out there about bad performance while > > using AMDs Ryzen with KVM GPU passthrough. It revolves all on > > enabling/disabl

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-05-05 Thread Matthias Ehrenfeuchter
I recognized (with npt disabled) the VM is getting slower over time, like in Windows the system process is taking more and more CPU usage. A soft restart does help makeing it "usable" again. Also wondering if this is an hardware related issue in Ryzen, so the upcoming Naples does have it too? T

Re: AMD Ryzen KVM/NPT/IOMMU issue

2017-05-03 Thread Nick Sarnie
On Wed, May 3, 2017 at 10:37 AM, Matthias Ehrenfeuchter wrote: > Hi, > > There are a lot of messages/threads out there about bad performance while > using AMDs Ryzen with KVM GPU passthrough. It revolves all on > enabling/disabling npt, while enabled overall VM performance is nice but the > GPU pe

AMD Ryzen KVM/NPT/IOMMU issue

2017-05-03 Thread Matthias Ehrenfeuchter
Hi, There are a lot of messages/threads out there about bad performance while using AMDs Ryzen with KVM GPU passthrough. It revolves all on enabling/disabling npt, while enabled overall VM performance is nice but the GPU performance gives me about 20% (and a lot of drops to zero GPU usage, wh