FIO_DEVICE_FLAGS_PCI_PAGE_ALIGNED
VFIO_DEVICE_FLAGS_PCI_MSIX_MMAP
- Add a Kconfig option to support for mmapping MSI-X table.
[1] http://www.spinics.net/lists/kvm/msg127812.html
Yongji Xie (7):
PCI: Add a new option for resource_alignment to reassign alignment
PCI: Use IORESOURCE_WINDOW to identify bridge resources
When using resource_alignment kernel parameter, the current
implement reassigns the alignment by changing resources' size
which can potentially break some drivers.
So this patch adds a new option "noresize" for the parameter
to solve this problem.
Signed-off-by: Yongji Xie
---
patch replaces IORESOURCE_STARTALIGN with
IORESOURCE_WINDOW.
Signed-off-by: Yongji Xie
---
drivers/pci/setup-bus.c | 21 -
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 7796d0a..4ff10ca 100644
--- a/dr
th other BARs.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c |7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 1ce1d36..49d7a69 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/p
mmio page would not be
shared with other BARs.
Signed-off-by: Yongji Xie
---
Documentation/kernel-parameters.txt |2 +
drivers/pci/pci.c | 90 ++-
include/linux/pci.h |4 ++
3 files changed, 85 insertions(+), 11 deleti
Current vfio-pci implementation disallows to mmap MSI-X
table in case that user get to touch this directly.
But we should allow to mmap these MSI-X tables if IOMMU
supports interrupt remapping which can ensure that a
given pci device can only shoot the MSIs assigned for it.
Signed-off-by: Yongji
This patch adds IOMMU_CAP_INTR_REMAP for IODA host bridge so that
we can mmap MSI-X table in vfio driver.
Signed-off-by: Yongji Xie
---
arch/powerpc/platforms/powernv/pci-ioda.c | 17 +
1 file changed, 17 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c
b
use firmware
setup and not to reassign any resources.
To solve this problem, this patch ignores
resource_alignment if PCI_PROBE_ONLY was set.
Signed-off-by: Yongji Xie
---
Documentation/kernel-parameters.txt |2 ++
drivers/pci/probe.c |3 ++-
2 files changed, 4 insertions
On 2016/3/10 10:19, Alexey Kardashevskiy wrote:
On 03/07/2016 06:48 PM, Yongji Xie wrote:
When using resource_alignment kernel parameter, the current
implement reassigns the alignment by changing resources' size
which can potentially break some drivers.
How can this possibly break any d
Ping.
On 2016/3/7 15:48, Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap
sub-page(size < PAGE_SIZE) MMIO BARs and MSI-X table. This is because
sub-page BARs' mmio page may be shared with other BARs and MSI-X table
should not be accessed directly from the guest for
On 2016/3/17 0:32, Alex Williamson wrote:
On Mon, 7 Mar 2016 15:48:38 +0800
Yongji Xie wrote:
This patch adds IOMMU_CAP_INTR_REMAP for IODA host bridge so that
we can mmap MSI-X table in vfio driver.
Signed-off-by: Yongji Xie
---
arch/powerpc/platforms/powernv/pci-ioda.c | 17
On 2016/3/17 0:30, Alex Williamson wrote:
On Mon, 7 Mar 2016 15:48:35 +0800
Yongji Xie wrote:
When vfio passthrough a PCI device of which MMIO BARs
are smaller than PAGE_SIZE, guest will not handle the
mmio accesses to the BARs which leads to mmio emulations
in host.
This is because vfio
On 2016/3/17 20:40, Alex Williamson wrote:
On Thu, 17 Mar 2016 19:28:34 +0800
Yongji Xie wrote:
On 2016/3/17 0:30, Alex Williamson wrote:
On Mon, 7 Mar 2016 15:48:35 +0800
Yongji Xie wrote:
When vfio passthrough a PCI device of which MMIO BARs
are smaller than PAGE_SIZE, guest will not
On 2016/3/16 22:10, Bjorn Helgaas wrote:
On Wed, Mar 16, 2016 at 06:51:56PM +0800, Yongji Xie wrote:
Ping.
This is mainly VFIO stuff, and Alex had some security concerns, so I'm
not going to spend much time looking at this until he's satisfied.
When I do, I'll be look
On 2016/3/17 0:31, Alex Williamson wrote:
On Mon, 7 Mar 2016 15:48:34 +0800
Yongji Xie wrote:
The resource_alignment will releases memory resources
allocated by firmware so that kernel can reassign new
resources later on. But this will cause the problem
that no resources can be allocated by
On 2016/3/17 20:48, Alex Williamson wrote:
On Thu, 17 Mar 2016 19:38:29 +0800
Yongji Xie wrote:
On 2016/3/17 0:32, Alex Williamson wrote:
On Mon, 7 Mar 2016 15:48:38 +0800
Yongji Xie wrote:
This patch adds IOMMU_CAP_INTR_REMAP for IODA host bridge so that
we can mmap MSI-X table in
On 2016/3/17 0:31, Alex Williamson wrote:
[cc+ Eric, Will]
On Mon, 7 Mar 2016 15:48:37 +0800
Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap MSI-X
table in case that user get to touch this directly.
But we should allow to mmap these MSI-X tables if IOMMU
supports
On 2016/3/17 0:30, Alex Williamson wrote:
On Mon, 7 Mar 2016 15:48:36 +0800
Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap
sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio
page may be shared with other BARs.
But we should allow to mmap these sub-p
stead of doing it on PPC64 arch code.
- Remove flags: VFIO_DEVICE_FLAGS_PCI_PAGE_ALIGNED
VFIO_DEVICE_FLAGS_PCI_MSIX_MMAP
- Add a Kconfig option to support for mmapping MSI-X table.
[1] http://www.spinics.net/lists/kvm/msg127812.html
Yongji Xie (7):
PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set
PCI: D
use firmware setup and not to
reassign any resources.
To solve this problem, this patch ignores
resource_alignment if PCI_PROBE_ONLY was set.
Signed-off-by: Yongji Xie
---
drivers/pci/pci.c |6 ++
1 file changed, 6 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index
ridge resources.
Signed-off-by: Yongji Xie
---
drivers/pci/setup-bus.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 7796d0a..bffcf1e 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -391,6 +
t;noresize" for the
parameter to solve this problem.
Signed-off-by: Yongji Xie
---
Documentation/kernel-parameters.txt |5 -
drivers/pci/pci.c | 37 +--
2 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/Docum
lignment of all MMIO BARs to be at
least PAGE_SIZE so that one BAR's mmio page would
not be shared with other BARs.
And we also define a macro PCIBIOS_MIN_ALIGNMENT
to enable this automatically on PPC64 platform
which can easily hit this issue because its
PAGE_SIZE is 64KB.
Signe
will never be assigned into the
hole. So we add shadow resources and put them
into the hole in this patch. With these two
guarantees, I think it should be safe to mmap
sub-page BAR.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c | 58 +
This patch enables mmapping MSI-X tables if
hardware supports interrupt remapping which
can ensure that a given pci device can only
shoot the MSIs assigned for it.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c |9 +++--
drivers/vfio/pci/vfio_pci_private.h |1
is
capability, like this patch does.
Compared with IOMMU_CAP_INTR_REMAP, this
flag is more common. Any arch can set/use this
easily. And it can provide a better granularity
(pci_bus_type -> pci_bus).
[1] http://www.spinics.net/lists/kvm/msg130262.html
Signed-off-by: Yongji Xie
---
arch/powerpc/p
On 2016/4/6 8:55, Gavin Shan wrote:
On Tue, Apr 05, 2016 at 09:43:30PM +0800, Yongji Xie wrote:
Now we use the IORESOURCE_STARTALIGN to identify
bridge resources in __assign_resources_sorted().
That's quite fragile. We can't make sure that
the PCI devices' resourc
On 2016/4/6 8:48, Gavin Shan wrote:
On Tue, Apr 05, 2016 at 09:43:29PM +0800, Yongji Xie wrote:
The resource_alignment will releases memory
resources allocated by firmware so that kernel
can reassign new resources later on. But this
will cause the problem that no resources can be
allocated by
On 2016/4/6 9:43, Gavin Shan wrote:
On Tue, Apr 05, 2016 at 09:43:31PM +0800, Yongji Xie wrote:
When using resource_alignment kernel parameter,
the current implement reassigns the alignment by
changing resources' size which can potentially
break some drivers. For example, the driver use
On 2016/4/6 8:11, Gavin Shan wrote:
On Tue, Apr 05, 2016 at 09:46:43PM +0800, Yongji Xie wrote:
I'm trying to find a proper way to indicate
the capability of interrupt remapping on PPC64
because we need this to determine whether it is
safe to mmap MSI-X table in VFIO driver.
There
On 2016/4/6 8:00, Gavin Shan wrote:
On Tue, Apr 05, 2016 at 09:46:44PM +0800, Yongji Xie wrote:
This patch enables mmapping MSI-X tables if
hardware supports interrupt remapping which
can ensure that a given pci device can only
shoot the MSIs assigned for it.
Signed-off-by: Yongji Xie
On 2016/4/6 22:45, Alex Williamson wrote:
On Tue, 5 Apr 2016 21:46:44 +0800
Yongji Xie wrote:
This patch enables mmapping MSI-X tables if
hardware supports interrupt remapping which
can ensure that a given pci device can only
shoot the MSIs assigned for it.
Signed-off-by: Yongji Xie
Hi Eric,
On 2016/4/7 22:23, Eric Auger wrote:
Hi Yongji,
On 04/07/2016 01:38 PM, Yongji Xie wrote:
On 2016/4/6 22:45, Alex Williamson wrote:
On Tue, 5 Apr 2016 21:46:44 +0800
Yongji Xie wrote:
This patch enables mmapping MSI-X tables if
hardware supports interrupt remapping which
can
Hi Eric,
On 2016/4/8 17:10, Eric Auger wrote:
Hi Yongji,
On 04/08/2016 10:14 AM, Yongji Xie wrote:
Hi Eric,
On 2016/4/7 22:23, Eric Auger wrote:
Hi Yongji,
On 04/07/2016 01:38 PM, Yongji Xie wrote:
On 2016/4/6 22:45, Alex Williamson wrote:
On Tue, 5 Apr 2016 21:46:44 +0800
Yongji Xie wrote
parameter to enforce all MMIO BARs to be page aligned
on PCI core code instead of doing it on PPC64 arch code.
- Remove flags: VFIO_DEVICE_FLAGS_PCI_PAGE_ALIGNED
[1] http://www.spinics.net/lists/kvm/msg127812.html
[2] http://www.spinics.net/lists/kvm/msg130256.html
Yongji Xie (10):
PCI: Ignore
use firmware
setup and not to reassign any resources.
To solve this problem, this patch ignores resource_alignment
if PCI_PROBE_ONLY was set.
Signed-off-by: Yongji Xie
---
drivers/pci/pci.c |6 ++
1 file changed, 6 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index
ption "noresize" for the parameter to
solve this problem.
Signed-off-by: Yongji Xie
---
Documentation/kernel-parameters.txt |5 -
drivers/pci/pci.c | 35 +--
2 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/Docum
lignment of all MMIO BARs to be at least PAGE_SIZE so that
one BAR's mmio page would not be shared with other BARs.
And we also define a macro PCIBIOS_MIN_ALIGNMENT to enable this
automatically on PPC64 platform which can easily hit this issue
because its PAGE_SIZE is 64KB.
Signe
ridge resources.
Signed-off-by: Yongji Xie
---
drivers/pci/setup-bus.c |9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 7796d0a..45fc484 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -391,6 +
will never be assigned
into the hole. So we add shadow resources and put them into the
hole in this patch. With these two guarantees, I think it should
be safe to mmap sub-page BAR.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c | 58 +
sg130256.html
Signed-off-by: Yongji Xie
---
include/linux/pci.h |1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 27df4a6..d619228 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -193,6 +193,7 @@ typedef unsigned short _
.
Signed-off-by: Yongji Xie
---
drivers/iommu/iommu.c | 15 +++
1 file changed, 15 insertions(+)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 0e3b009..5d2b6f6 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -813,6 +813,16 @@ struct iommu_group
.
[1] http://www.spinics.net/lists/kvm/msg130256.html
Signed-off-by: Yongji Xie
---
drivers/pci/msi.c | 12
drivers/pci/probe.c |3 +++
include/linux/msi.h |6 +-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index
Any IODA host bridge have the capability of IRQ remapping.
So we set PCI_BUS_FLAGS_MSI_REMAP when this kind of host birdge
is detected.
Signed-off-by: Yongji Xie
---
arch/powerpc/platforms/powernv/pci-ioda.c |8
1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/platforms
: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c |7 +--
drivers/vfio/pci/vfio_pci_rdwr.c |3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index dc1779c..b08abe0 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b
On 2016/4/18 19:30, David Laight wrote:
From: Yongji Xie
Sent: 18 April 2016 11:59
We introduce a new pci_bus_flags, PCI_BUS_FLAGS_MSI_REMAP
which indicates all devices on the bus are protected by the
hardware which supports IRQ remapping(intel naming).
This flag will be used to know whether
Hi Alex,
Any comment?
Thanks,
Yongji
On 2016/4/18 18:53, Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap
sub-page(size < PAGE_SIZE) MMIO BARs and MSI-X table. This is because
sub-page BARs' mmio page may be shared with other BARs and MSI-X table
should not be
On 2016/4/26 13:41, Alexey Kardashevskiy wrote:
On 04/18/2016 08:56 PM, Yongji Xie wrote:
When vfio passthrough a PCI device of which MMIO BARs are
smaller than PAGE_SIZE, guest will not handle the mmio
accesses to the BARs which leads to mmio emulations in host.
This is because vfio will not
On 2016/4/27 0:40, Alex Williamson wrote:
On Mon, 25 Apr 2016 18:05:53 +0800
Yongji Xie wrote:
Hi Alex,
Any comment?
TBH, I shuffled this to the bottom of the review pile because you're
depending on a patch series for ARM MSI mapping that's still very much
in flux. You've
use firmware
setup and not to reassign any resources.
To solve this problem, this patch ignores resource_alignment
if PCI_PROBE_ONLY was set.
Signed-off-by: Yongji Xie
---
drivers/pci/pci.c |6 ++
1 file changed, 6 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index
PCI BARs; patch 4
modified resource_alignment to support syntax which can be used to
enforce the alignment of all MMIO BARs to be at least PAGE_SIZE.
Yongji Xie (4):
PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set
PCI: Do not Use IORESOURCE_STARTALIGN to identify bridge resources
PCI: A
ridge resources.
Signed-off-by: Yongji Xie
---
drivers/pci/setup-bus.c |9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 55641a3..216ddbc 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -390,6 +
to enforce the
alignment of all MMIO BARs to be at least PAGE_SIZE so that
one BAR's mmio page would not be shared with other BARs.
And we also define a macro PCIBIOS_MIN_ALIGNMENT to enable this
automatically on PPC64 platform which can easily hit this issue
because its PAGE_SIZE is 64KB.
S
ption "noresize" for the parameter to
solve this problem.
Signed-off-by: Yongji Xie
---
Documentation/kernel-parameters.txt |5 -
drivers/pci/pci.c | 35 +--
2 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/Docum
shadow resource to reserve the remaind of the page which hot-add
device's BAR might be assigned into.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c | 58 ++-
drivers/vfio/pci/vfio_pci_private.h |8 +
2 files changed, 59 insertions(+)
.
Signed-off-by: Yongji Xie
---
drivers/iommu/iommu.c | 15 +++
1 file changed, 15 insertions(+)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 0e3b009..5d2b6f6 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -813,6 +813,16 @@ struct iommu_group
we introduce a new bus_flags
PCI_BUS_FLAGS_MSI_REMAP to test this capability on PCI side
for different archs.
The patch 3 are based on the proposed patchset[1].
[1] http://www.spinics.net/lists/kvm/msg130256.html
Yongji Xie (5):
PCI: Add a new PCI_BUS_FLAGS_MSI_REMAP flag
iommu: Set
ists/kvm/msg130256.html
Signed-off-by: Yongji Xie
---
include/linux/pci.h |1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 27df4a6..d619228 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -193,6 +193,7 @@ typedef unsigned short _
: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c |7 +--
drivers/vfio/pci/vfio_pci_rdwr.c |3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 98059df..7eba77d 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b
Any IODA host bridge have the capability of IRQ remapping.
So we set PCI_BUS_FLAGS_MSI_REMAP when this kind of host birdge
is detected.
Signed-off-by: Yongji Xie
---
arch/powerpc/platforms/powernv/pci-ioda.c |8
1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/platforms
.
[1] http://www.spinics.net/lists/kvm/msg130256.html
Signed-off-by: Yongji Xie
---
drivers/pci/msi.c | 12
drivers/pci/probe.c |3 +++
include/linux/msi.h |6 +-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index
tl to indicate that platform
support all PCI BARs are page aligned.
- Add support for a VFIO-PCI ioctl to indicate that platform
support mmapping MSI-X table.
Yongji Xie (3):
powerpc/pci: Enforce all MMIO BARs to be page aligned
vfio-pci: Allow to mmap sub-page MMIO BA
ned-off-by: Yongji Xie
---
arch/powerpc/kernel/pci-common.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 0f7a60f..6989e0f 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/
ed
with other BARs.
This patch adds support for this case and we also add a
VFIO_DEVICE_FLAGS_PCI_PAGE_ALIGNED flag to notify userspace that
platform supports all MMIO BARs to be page aligned.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c | 10 +-
dri
userspace that it's safe to mmap MSI-X table.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c |5 -
drivers/vfio/pci/vfio_pci_private.h |5 +
include/uapi/linux/vfio.h |2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/vfi
On 2015/12/17 4:04, Alex Williamson wrote:
On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap
sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio page
may be shared with other BARs.
But we should allow to mmap these sub-p
On 2015/12/17 4:14, Alex Williamson wrote:
On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap MSI-X table in
case that user get to touch this directly.
However, EEH mechanism could ensure that a given pci device
can only shoot the MSIs
On 2015/12/18 5:46, Alex Williamson wrote:
On Thu, 2015-12-17 at 18:26 +0800, yongji xie wrote:
On 2015/12/17 4:04, Alex Williamson wrote:
On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap
sub-page(size < PAGE_SIZE) MMIO BARs beca
64 arch code.
- Remove flags: VFIO_DEVICE_FLAGS_PCI_PAGE_ALIGNED
VFIO_DEVICE_FLAGS_PCI_MSIX_MMAP
- Add a Kconfig option to support for mmapping MSI-X table.
[1] https://lkml.org/lkml/2015/11/23/748
Yongji Xie (3):
PCI: Add support for enforcing all MMIO BARs to be page aligned
vfio-pci: Allow to mmap sub-pag
because its PAGE_SIZE is 64KB.
Signed-off-by: Yongji Xie
---
Documentation/kernel-parameters.txt |4
arch/powerpc/include/asm/pci.h | 11 +++
drivers/pci/pci.c | 17 +
drivers/pci/pci.h |7 ++-
include/linux/pci.h
upport for mmapping MSI-X table.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/Kconfig|4
drivers/vfio/pci/vfio_pci.c |6 --
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
index 02912f1..67b0a2c 100644
---
AGE_SIZE.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c |7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 7e9f497..09b3805 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@
On 2016/1/5 4:47, Alex Williamson wrote:
On Thu, 2015-12-31 at 16:50 +0800, Yongji Xie wrote:
When vfio passthrough a PCI device of which MMIO BARs
are smaller than PAGE_SIZE, guest will not handle the
mmio accesses to the BARs which leads to mmio emulations
in host.
This is because vfio will
On 2016/1/5 5:42, Benjamin Herrenschmidt wrote:
On Mon, 2016-01-04 at 14:07 -0700, Alex Williamson wrote:
On Thu, 2015-12-31 at 16:50 +0800, Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap MSI-X
table in case that user get to touch this directly.
However, EEH mechanism can
ion to support for mmapping MSI-X table.
[1] https://lkml.org/lkml/2015/11/23/748
Yongji Xie (5):
PCI: Add support for enforcing all MMIO BARs to be page aligned
vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive
PCI: Add host bridge attribute to indicate filtering of MS
th other BARs.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c |7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 7e9f497..11fd0f0 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/p
issue because
its PAGE_SIZE is 64KB.
Note that the kernel parameter won't works if kernel doesn't do
resources reallocation.
Signed-off-by: Yongji Xie
---
Documentation/kernel-parameters.txt |5 +
arch/powerpc/include/asm/pci.h | 11 +++
dr
To support this case, this patch adds a pci_host_bridge
attribute to indicate if this PCI host bridge supports
filtering of MSIs.
Signed-off-by: Yongji Xie
---
drivers/pci/host-bridge.c |6 ++
include/linux/pci.h |3 +++
2 files changed, 9 insertions(+)
diff --git a/driver
This patch enables msi_filtered bit for any IODA host bridge.
Signed-off-by: Yongji Xie
---
arch/powerpc/platforms/powernv/pci-ioda.c |6 ++
1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c
b/arch/powerpc/platforms/powernv/pci-ioda.c
index 414fd1a
Current vfio-pci implementation disallows to mmap MSI-X
table in case that user get to touch this directly.
But we should allow to mmap these MSI-X tables if the PCI
host bridge supports filtering of MSIs.
Signed-off-by: Yongji Xie
---
drivers/vfio/pci/vfio_pci.c |6 --
1 file changed
On 2016/1/16 1:24, David Laight wrote:
From: Yongji Xie
Sent: 15 January 2016 07:06
MSI-X tables are not allowed to be mmapped in vfio-pci
driver in case that user get to touch this directly.
This will cause some performance issues when when PCI
adapters have critical registers in the same
Ping...
Alex, any comment?
Regards,
Yongji Xie
On 2016/1/15 15:06, Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap
sub-page(size < PAGE_SIZE) MMIO BARs and MSI-X table. This is because
sub-page BARs' mmio page may be shared with other BARs and MSI-X table
shoul
On 2016/1/29 6:46, Alex Williamson wrote:
On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote:
When vfio passthrough a PCI device of which MMIO BARs
are smaller than PAGE_SIZE, guest will not handle the
mmio accesses to the BARs which leads to mmio emulations
in host.
This is because vfio
On 2016/1/29 6:46, Alex Williamson wrote:
On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote:
MSI-X tables are not allowed to be mmapped in vfio-pci
driver in case that user get to touch this directly.
This will cause some performance issues when when PCI
adapters have critical registers in
On 2016/1/29 6:46, Alex Williamson wrote:
On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote:
Current vfio-pci implementation disallows to mmap MSI-X
table in case that user get to touch this directly.
But we should allow to mmap these MSI-X tables if the PCI
host bridge supports filtering
On 2016/1/30 3:01, Alex Williamson wrote:
On Fri, 2016-01-29 at 18:37 +0800, Yongji Xie wrote:
On 2016/1/29 6:46, Alex Williamson wrote:
On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote:
When vfio passthrough a PCI device of which MMIO BARs
are smaller than PAGE_SIZE, guest will not handle
On 2016/1/30 3:05, Alex Williamson wrote:
- Original Message -
On 2016/1/29 6:46, Alex Williamson wrote:
On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote:
MSI-X tables are not allowed to be mmapped in vfio-pci
driver in case that user get to touch this directly.
This will cause
On Thu, Mar 23, 2017 at 03:53:42PM -0500, Bjorn Helgaas wrote:
> Hi Yongji,
>
> On Wed, Feb 15, 2017 at 02:45:05PM +0800, Yongji Xie wrote:
>> When vfio passthroughs a PCI device of which MMIO BARs are
>> smaller than PAGE_SIZE, guest will not handle the mmio
>> accesses
On Thu, Mar 23, 2017 at 04:55:58PM -0500, Bjorn Helgaas wrote:
>
> On Wed, Feb 15, 2017 at 02:45:06PM +0800, Yongji Xie wrote:
>> Currently we reassign the alignment by extending resources' size in
>> pci_reassigndev_resource_alignment(). This could potentially break
&
Code style improvements
Changelog v3:
- Ignore enforced alignment to fixed BARs
- Fix issue that disabling memory decoding when reassigning the alignment
- Only enable default alignment on PowerNV platform
Changelog v2:
- Ignore enforced alignment to VF BARs on pci_reassigndev_resource_alignme
In case that one device's alignment is greater than its size,
we may get an incorrect size and alignment for its bus's memory
window in pbus_size_mem(). This patch fixes this case.
Signed-off-by: Yongji Xie
---
drivers/pci/setup-bus.c |4 ++--
1 file changed, 2 insertions(+), 2
alignment for all PCI devices.
An arch can override it to force the PCI core to place memory BARs on
their own pages.
Signed-off-by: Yongji Xie
---
drivers/pci/pci.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7904d02
This overrides pcibios_default_alignment() to set default alignment
to PAGE_SIZE for all PCI devices on PowerNV platform. Thus sub-page
BARs would not share a page and could be mapped into guest when VFIO
passthrough them.
Signed-off-by: Yongji Xie
---
arch/powerpc/include/asm/machdep.h
risk in this case. So this patch tries to use
START_ALIGNMENT to identify the resource's alignment without extending
the size when the alignment reassigning is caused by the default alignment.
Signed-off-by: Yongji Xie
---
drivers/pci/pci.c | 34 --
1 file
2017-04-15 6:54 GMT+08:00 Bjorn Helgaas :
> On Mon, Apr 10, 2017 at 07:58:14PM +0800, Yongji Xie wrote:
> > Currently we reassign the alignment by extending resources' size in
> > pci_reassigndev_resource_alignment(). This could potentially break
> > some drivers when t
Hi Yinghai,
On 18 April 2017 at 05:45, Yinghai Lu wrote:
> On Mon, Apr 17, 2017 at 2:36 PM, Bjorn Helgaas wrote:
>> From: Yongji Xie
>>
>> In case that one device's alignment is greater than its size,
>> we may get an incorrect size and alignment for its bus
On 19 April 2017 at 09:47, Michael Ellerman wrote:
> Bjorn Helgaas writes:
>
>> On Mon, Apr 17, 2017 at 4:36 PM, Bjorn Helgaas wrote:
>>> From: Yongji Xie
>>> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c
>>> b/arch/powerpc/platforms/po
ecoding when reassigning the alignment
- Only enable default alignment on PowerNV platform
Changelog v2:
- Ignore enforced alignment to VF BARs on pci_reassigndev_resource_alignment()
Yongji Xie (3):
PCI: Ignore requested alignment for IOV BARs
PCI: Make sure the driver could get correct BAR size f
ff-by: Yongji Xie
Reviewed-by: Gavin Shan
---
drivers/pci/pci.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index a881c0d..220c31e 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -5084,7 +5084,7 @@
nd if we need the allocated
size, resource_size()(or we can introuce a new helper function) can be used
to get it.
Signed-off-by: Yongji Xie
---
drivers/pci/pci.c |1 +
include/linux/pci.h |6 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/
1 - 100 of 191 matches
Mail list logo