Re: [patch] VFIO: platform: reset: fix a warning message condition

2015-12-17 Thread Eric Auger
Hi Dan, thanks for pointing this out. Reviewed-by: Eric Auger <eric.au...@linaro.org> I add Thomas in CC since the bug also exists in the native driver I think (drivers/net/ethernet/amd/xgbe/drivers/net/ethernet/amd/xgbe /xgbe-dev.c, xgbe_exit function). Best Regards Eric On 12/17/2015

[PATCH v4 05/13] VFIO: platform: add vfio_platform_set_forwarded

2015-11-19 Thread Eric Auger
This function allows to change the forwarded mode and selects the IRQ handler accordingly. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v3 -> v3: - renamed vfio_platform_set_automasked into vfio_platform_set_forwarded - do not change VFIO_IRQ_INFO_AUTOMASKED setting whe

[PATCH v4 09/13] KVM: arm/arm64: vgic: support irqfd injection of a mapped IRQ

2015-11-19 Thread Eric Auger
Up to now irqfd injection was only possible for unmapped IRQ. This patch adds support for injecting mapped interrupts. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- virt/kvm/arm/vgic.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vg

[PATCH] KVM: arm/arm64: vgic: leave the LR active state on GICD_ICENABLERn access

2015-11-19 Thread Eric Auger
will leave the active LR's. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- virt/kvm/arm/vgic.c | 45 +++-- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 5335383..bc30d93 100644 ---

[PATCH v4 07/13] VFIO: platform: add irq bypass producer management

2015-11-19 Thread Eric Auger
This patch populates the IRQ bypass callacks: - stop/start producer simply consist in disabling/enabling the host irq - add/del consumer: basically set the automasked flag to false/true Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v3 -> v4: - use vfio_platform_set_forwarded

[PATCH v4 12/13] KVM: arm/arm64: vgic: implement clear pending for non shared mapped IRQ

2015-11-19 Thread Eric Auger
. In the opposite, we remove the pending state and deactivate the IRQ. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- virt/kvm/arm/vgic.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 9

[PATCH v4 13/13] KVM: arm/arm64: implement IRQ bypass consumer functions

2015-11-19 Thread Eric Auger
execution and set CONFIG_HAVE_KVM_IRQ_BYPASS for arm/arm64. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v3 -> v4: - kvm_set/unset_forward now takes the virtual IRQ ID as a parameter v2 -> v3: - kvm_arch_irq_bypass_resume renamed into kvm_arch_irq_bypass_start - kvm_vgic_u

[PATCH v4 11/13] KVM: arm/arm64: vgic: implement clear active for non shared mapped IRQ

2015-11-19 Thread Eric Auger
When disabling a non shared mapped IRQs, we must manually deactivate the corresponding physical IRQ on top of removing the active state from the distributor. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- virt/kvm/arm/vgic.c | 22 +- 1 file changed, 21 insertions

[PATCH v4 04/13] VFIO: platform: single handler using function pointer

2015-11-19 Thread Eric Auger
-off-by: Eric Auger <eric.au...@linaro.org> --- v4: creation --- drivers/vfio/platform/vfio_platform_irq.c | 21 +++-- drivers/vfio/platform/vfio_platform_private.h | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/vfio/platform/vfio_platform

[PATCH v4 10/13] KVM: arm/arm64: vgic: forwarding control

2015-11-19 Thread Eric Auger
Implements kvm_vgic_[set|unset]_forward. Handle low-level VGIC programming: physical IRQ/guest IRQ mapping, list register cleanup, VGIC state machine. Also interacts with the irqchip. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v3 -> v4: - use the target vCPU in set/unse

[PATCH v4 08/13] KVM: arm/arm64: vgic: adapt state machine for non shared mapped interrupts

2015-11-19 Thread Eric Auger
y can be sampled when it is pending - when queueing the IRQ (programming the LR), the pending state is removed as for edge sensitive IRQs - queued state is not modelled. Level state is not modelled - its injection with high level always is valid since steming from the HW. Signed-off-by: Eri

[PATCH v4 06/13] VFIO: platform: add vfio_platform_irq_is_active

2015-11-19 Thread Eric Auger
to have false detection. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v3 -> v4: - rename vfio_platform_is_active into vfio_platform_irq_is_active - remove BUG_ON and return the error if irq_get_irqchip_state fails --- drivers/vfio/platform/vfio_platform_irq.c | 19 +

[PATCH v4 01/13] KVM: arm/arm64: select IRQ_BYPASS_MANAGER

2015-11-19 Thread Eric Auger
Select IRQ_BYPASS_MANAGER when CONFIG_KVM is set Signed-off-by: Eric Auger <eric.au...@linaro.org> --- arch/arm/kvm/Kconfig | 2 ++ arch/arm64/kvm/Kconfig | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig index 95a0005..73d7201 100644 ---

[PATCH v4 02/13] VFIO: platform: registration of a dummy IRQ bypass producer

2015-11-19 Thread Eric Auger
Register a dummy producer with void callbacks Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v3 -> v3: - replace WARN_ON by pr_info() in case irq_bypass_register_producer fails v2 -> v3: - rename vfio_platform_irq_bypass_resume into *_start --- drivers/v

[PATCH v4 03/13] VFIO: platform: test forwarded state when selecting the IRQ handler

2015-11-19 Thread Eric Auger
-by: Eric Auger <eric.au...@linaro.org> --- v2: - add a new forwarded flag and do not use irqd_irq_forwarded anymore --- drivers/vfio/platform/vfio_platform_irq.c | 3 ++- drivers/vfio/platform/vfio_platform_private.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/driver

[PATCH v4 00/13] ARM IRQ forward control based on IRQ bypass manager

2015-11-19 Thread Eric Auger
t need them anymore - apply container_of strategy advised by Paolo. Only active field remains and discussions will tell whether we get rid of it. - renamed kvm_arch functions - kvm-vfio v6 -> RFC v1 based on IRQ bypass manager see previous history in https://lkml.org/lkml/2015/4/13/353). Best

[PATCH v6 7/8] vfio: platform: add dev_info on device reset

2015-11-03 Thread Eric Auger
It might be helpful for the end-user to check the device reset function was found by the vfio platform reset framework. Lets store a pointer to the struct device in vfio_platform_device and trace when the reset function is called or not found. Signed-off-by: Eric Auger <eric.au...@linaro.

[PATCH v6 3/8] vfio: platform: introduce module_vfio_reset_handler macro

2015-11-03 Thread Eric Auger
The module_vfio_reset_handler macro - define a module alias - implement module init/exit function which respectively registers and unregisters the reset function. Signed-off-by: Eric Auger <eric.au...@linaro.org> Reviewed-by: Arnd Bergmann <a...@arndb.de> --- v4 -> v5: - add

[PATCH v6 6/8] vfio: platform: use list of registered reset function

2015-11-03 Thread Eric Auger
-by: Eric Auger <eric.au...@linaro.org> Reported-by: Arnd Bergmann <a...@arndb.de> Reviewed-by: Arnd Bergmann <a...@arndb.de> --- v3 -> v4: - add Arnd R-b. - Remove the EXPORT_SYMBOL_GPL(vfio_platform_calxedaxgmac_reset) here v2 -> v3: - remove clear of vfio_platform_devic

[PATCH v6 1/8] vfio: platform: introduce vfio-platform-base module

2015-11-03 Thread Eric Auger
make sure symbols exported by base are available when vfio-platform driver gets probed. The open/release being implemented in the base module, the ref count is applied to the parent module instead. Signed-off-by: Eric Auger <eric.au...@linaro.org> Suggested-by: Arnd Bergmann <a...

[PATCH v6 5/8] vfio: platform: add compat in vfio_platform_device

2015-11-03 Thread Eric Auger
Let's retrieve the compatibility string on probe and store it in the vfio_platform_device struct Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v2 -> v3: - populate compat after vdev check --- drivers/vfio/platform/vfio_platform_common.c | 15 --- drivers/vfio

[PATCH v6 2/8] vfio: platform: add capability to register a reset function

2015-11-03 Thread Eric Auger
In preparation for subsequent changes in reset function lookup, lets introduce a dynamic list of reset combos (compat string, reset module, reset function). The list can be populated/voided with vfio_platform_register/unregister_reset. Those are not yet used in this patch. Signed-off-by: Eric

[PATCH v6 0/8] VFIO platform reset module rework

2015-11-03 Thread Eric Auger
eset by vfio reset module Eric Auger (8): vfio: platform: introduce vfio-platform-base module vfio: platform: add capability to register a reset function vfio: platform: introduce module_vfio_reset_handler macro vfio: platform: reset: calxedaxgmac: add reset function registration v

[PATCH v5] VFIO: platform: reset: AMD xgbe reset module

2015-11-03 Thread Eric Auger
from the native xgbe driver. Signed-off-by: Eric Auger <eric.au...@linaro.org> Reviewed-by: Arnd Bergmann <a...@arndb.de> --- Applies on top of [PATCH v6 0/8] VFIO platform reset module rework v4 -> v5: - fix ioaddr leak iounmap is done in vfio platform driver (vfio_platf

Re: [PATCH] vfio/platform: store mapped memory in region, instead of an on-stack copy

2015-10-30 Thread Eric Auger
Hi, On 10/30/2015 09:51 AM, Baptiste Reynal wrote: > Hi James, > > Thanks for this fix. > > Acked-by: Baptiste Reynal > Tested-by: Baptiste Reynal > > On Thu, Oct 29, 2015 at 5:50 PM, James Morse wrote: >>

[PATCH] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-29 Thread Eric Auger
with PAGE_HOST. Pinning code uses that granularity while iommu driver can use the sub-PAGE_HOST size to map the buffer. Signed-off-by: Eric Auger <eric.au...@linaro.org> Signed-off-by: Alex Williamson <alex.william...@redhat.com> --- This was tested on AMD Seattle with 64kB page host. ARM MMU 4

[PATCH v2] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-29 Thread Eric Auger
with PAGE_SIZE. Pinning code uses that granularity while iommu driver can use the sub-PAGE_SIZE size to map the buffer. Signed-off-by: Eric Auger <eric.au...@linaro.org> Signed-off-by: Alex Williamson <alex.william...@redhat.com> Acked-by: Will Deacon <will.dea...@arm.com> --- This

[PATCH v5 4/7] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-28 Thread Eric Auger
This patch adds the reset function registration/unregistration. This is handled through the module_vfio_reset_handler macro. This latter also defines a MODULE_ALIAS which simplifies the load from vfio-platform. Signed-off-by: Eric Auger <eric.au...@linaro.org> Reviewed-by: Arnd Be

[PATCH v4] VFIO: platform: reset: AMD xgbe reset module

2015-10-28 Thread Eric Auger
from the native xgbe driver. Signed-off-by: Eric Auger <eric.au...@linaro.org> Reviewed-by: Arnd Bergmann <a...@arndb.de> --- Applies on top of [PATCH v5 0/7] VFIO platform reset module rework v3 -> v4: - add Arnd's R-b v2 -> v3: - in Kconfig, add empty line between

[PATCH v5 2/7] vfio: platform: add capability to register a reset function

2015-10-28 Thread Eric Auger
In preparation for subsequent changes in reset function lookup, lets introduce a dynamic list of reset combos (compat string, reset module, reset function). The list can be populated/voided with vfio_platform_register/unregister_reset. Those are not yet used in this patch. Signed-off-by: Eric

[PATCH v5 3/7] vfio: platform: introduce module_vfio_reset_handler macro

2015-10-28 Thread Eric Auger
The module_vfio_reset_handler macro - define a module alias - implement module init/exit function which respectively registers and unregisters the reset function. Signed-off-by: Eric Auger <eric.au...@linaro.org> Reviewed-by: Arnd Bergmann <a...@arndb.de> --- v4 -> v5: - add

[PATCH v5 1/7] vfio: platform: introduce vfio-platform-base module

2015-10-28 Thread Eric Auger
make sure symbols exported by base are available when vfio-platform driver gets probed. The open/release being implemented in the base module, the ref count is applied to the parent module instead. Signed-off-by: Eric Auger <eric.au...@linaro.org> Suggested-by: Arnd Bergmann <a...

[PATCH v5 0/7] VFIO platform reset module rework

2015-10-28 Thread Eric Auger
alxeda xgmac reset module - introduce vfio_platform_reset_private.h - use module_vfio_reset_handler macro - do not export vfio_platform_calxedaxgmac_reset symbol anymore - add a pr_info to show the device is reset by vfio reset module Eric Auger (7): vfio: platform: introduce vfio-platform

[RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Eric Auger
. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- This was tested on AMD Seattle with 64kB page host. ARM MMU 401 currently expose 4kB, 2MB and 1GB page support. With a 64kB page host, the map/unmap check is done against 2MB. Some alignment check fail so VFIO_IOMMU_MAP_DMA fail while we

[PATCH v5 5/7] vfio: platform: add compat in vfio_platform_device

2015-10-28 Thread Eric Auger
Let's retrieve the compatibility string on probe and store it in the vfio_platform_device struct Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v2 -> v3: - populate compat after vdev check --- drivers/vfio/platform/vfio_platform_common.c | 15 --- drivers/vfio

[PATCH v5 7/7] vfio: platform: add dev_info on device reset

2015-10-28 Thread Eric Auger
It might be helpful for the end-user to check the device reset function was found by the vfio platform reset framework. Lets store a pointer to the struct device in vfio_platform_device and trace when the reset function is called or not found. Signed-off-by: Eric Auger <eric.au...@linaro.

[PATCH v5 6/7] vfio: platform: use list of registered reset function

2015-10-28 Thread Eric Auger
-by: Eric Auger <eric.au...@linaro.org> Reported-by: Arnd Bergmann <a...@arndb.de> Reviewed-by: Arnd Bergmann <a...@arndb.de> --- v3 -> v4: - add Arnd R-b. - Remove the EXPORT_SYMBOL_GPL(vfio_platform_calxedaxgmac_reset) here v2 -> v3: - remove clear of vfio_platform_devic

Re: [RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Eric Auger
Hi Alex, On 10/28/2015 05:27 PM, Alex Williamson wrote: > On Wed, 2015-10-28 at 13:12 +0000, Eric Auger wrote: >> Current vfio_pgsize_bitmap code hides the supported IOMMU page >> sizes smaller than PAGE_SIZE. As a result, in case the IOMMU >> does not support PAGE_SIZE page

Re: [RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Eric Auger
On 10/28/2015 06:37 PM, Alex Williamson wrote: > On Wed, 2015-10-28 at 18:10 +0100, Eric Auger wrote: >> Hi Alex, >> On 10/28/2015 05:27 PM, Alex Williamson wrote: >>> On Wed, 2015-10-28 at 13:12 +, Eric Auger wrote: >>>> Current vfio_pgsize_bitmap

Re: [RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Eric Auger
Hi Will, On 10/28/2015 06:14 PM, Will Deacon wrote: > On Wed, Oct 28, 2015 at 10:27:28AM -0600, Alex Williamson wrote: >> On Wed, 2015-10-28 at 13:12 +0000, Eric Auger wrote: >>> diff --git a/drivers/vfio/vfio_iommu_type1.c >>> b/drivers/vfio/vfio_iommu_type1.c >&g

Re: [RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Eric Auger
On 10/28/2015 06:55 PM, Will Deacon wrote: > On Wed, Oct 28, 2015 at 06:48:41PM +0100, Eric Auger wrote: >> On 10/28/2015 06:37 PM, Alex Williamson wrote: >>> Ok, so with hopefully correcting my understand of what this does, isn't >>> this effectively the same: >&g

Re: [RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Eric Auger
Alex, On 10/28/2015 06:28 PM, Alex Williamson wrote: > On Wed, 2015-10-28 at 17:14 +, Will Deacon wrote: >> On Wed, Oct 28, 2015 at 10:27:28AM -0600, Alex Williamson wrote: >>> On Wed, 2015-10-28 at 13:12 +, Eric Auger wrote: >>>> diff --git a/drivers/v

Re: [PATCH v3] VFIO: platform: reset: AMD xgbe reset module

2015-10-26 Thread Eric Auger
to rework the framework. Best Regards Eric On 10/24/2015 10:41 AM, kbuild test robot wrote: > Hi Eric, > > [auto build test ERROR on asm-generic/master -- if it's inappropriate base, > please suggest rules for selecting the more suitable base] > > url: > https://github.com/0

[PATCH v4 2/7] vfio: platform: add capability to register a reset function

2015-10-23 Thread Eric Auger
In preparation for subsequent changes in reset function lookup, lets introduce a dynamic list of reset combos (compat string, reset module, reset function). The list can be populated/voided with vfio_platform_register/unregister_reset. Those are not yet used in this patch. Signed-off-by: Eric

[PATCH v4 4/7] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-23 Thread Eric Auger
This patch adds the reset function registration/unregistration. This is handled through the module_vfio_reset_handler macro. This latter also defines a MODULE_ALIAS which simplifies the load from vfio-platform. Signed-off-by: Eric Auger <eric.au...@linaro.org> Reviewed-by: Arnd Be

[PATCH v4 0/7] VFIO platform reset module rework

2015-10-23 Thread Eric Auger
private.h - use module_vfio_reset_handler macro - do not export vfio_platform_calxedaxgmac_reset symbol anymore - add a pr_info to show the device is reset by vfio reset module Eric Auger (7): vfio: platform: introduce vfio-platform-base module vfio: platform: add capability to registe

[PATCH v4 3/7] vfio: platform: introduce module_vfio_reset_handler macro

2015-10-23 Thread Eric Auger
The module_vfio_reset_handler macro - define a module alias - implement module init/exit function which respectively registers and unregisters the reset function. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v3 -> v4: - pass reset to vfio_platform_unregister_reset v2 -&g

[PATCH v3] VFIO: platform: reset: AMD xgbe reset module

2015-10-23 Thread Eric Auger
from the native xgbe driver. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- Applies on top of [PATCH v3 0/7] VFIO platform reset module rework v2 -> v3: - in Kconfig, add empty line between the 2 options - remove DRIVER_VERSION, DRIVER_AUTHOR and DRIVER_DESC and put str

[PATCH v4 1/7] vfio: platform: introduce vfio-platform-base module

2015-10-23 Thread Eric Auger
make sure symbols exported by base are available when vfio-platform driver gets probed. The open/release being implemented in the base module, the ref count is applied to the parent module instead. Signed-off-by: Eric Auger <eric.au...@linaro.org> Suggested-by: Arnd Bergmann <a...

Re: [PATCH v4 0/7] VFIO platform reset module rework

2015-10-23 Thread Eric Auger
On 10/23/2015 05:47 PM, Eric Auger wrote: > This series fixes the current implementation by getting rid of the > usage of __symbol_get which caused a compilation issue with > CONFIG_MODULES disabled. On top of this, the usage of MODULE_ALIAS makes > possible to add a new reset module w

[PATCH v4 5/7] vfio: platform: add compat in vfio_platform_device

2015-10-23 Thread Eric Auger
Let's retrieve the compatibility string on probe and store it in the vfio_platform_device struct Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v2 -> v3: - populate compat after vdev check --- drivers/vfio/platform/vfio_platform_common.c | 15 --- drivers/vfio

[PATCH v4 6/7] vfio: platform: use list of registered reset function

2015-10-23 Thread Eric Auger
-by: Eric Auger <eric.au...@linaro.org> Reported-by: Arnd Bergmann <a...@arndb.de> Reviewed-by: Arnd Bergmann <a...@arndb.de> --- v3 -> v4: - add Arnd R-b. - Remove the EXPORT_SYMBOL_GPL(vfio_platform_calxedaxgmac_reset) here v2 -> v3: - remove clear of vfio_platform_devic

[PATCH v4 7/7] vfio: platform: add dev_info on device reset

2015-10-23 Thread Eric Auger
It might be helpful for the end-user to check the device reset function was found by the vfio platform reset framework. Lets store a pointer to the struct device in vfio_platform_device and trace when the reset function is called or not found. Signed-off-by: Eric Auger <eric.au...@linaro.

[PATCH v3 7/7] vfio: platform: add dev_info on device reset

2015-10-23 Thread Eric Auger
It might be helpful for the end-user to check the device reset function was found by the vfio platform reset framework. Lets store a pointer to the struct device in vfio_platform_device and trace when the reset function is called or not found. Signed-off-by: Eric Auger <eric.au...@linaro.

[PATCH v3 5/7] vfio: platform: add compat in vfio_platform_device

2015-10-23 Thread Eric Auger
Let's retrieve the compatibility string on probe and store it in the vfio_platform_device struct Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v2 -> v3: - populate compat after vdev check --- drivers/vfio/platform/vfio_platform_common.c | 15 --- drivers/vfio

Re: [PATCH v3 6/7] vfio: platform: use list of registered reset function

2015-10-23 Thread Eric Auger
Hi Arnd, On 10/23/2015 03:12 PM, Arnd Bergmann wrote: > On Friday 23 October 2015 14:37:14 Eric Auger wrote: >> Remove the static lookup table and use the dynamic list of registered >> reset functions instead. Also load the reset module through its alias. >> The reset

Re: [PATCH v3 3/7] vfio: platform: introduce module_vfio_reset_handler macro

2015-10-23 Thread Eric Auger
Hi Arnd, On 10/23/2015 03:09 PM, Arnd Bergmann wrote: > On Friday 23 October 2015 14:37:11 Eric Auger wrote: >> +static int __init reset ## _module_init(void) \ >> +{ \ >> + vfio_platform_

Re: [PATCH v3 2/7] vfio: platform: add capability to register a reset function

2015-10-23 Thread Eric Auger
On 10/23/2015 03:07 PM, Arnd Bergmann wrote: > On Friday 23 October 2015 14:37:10 Eric Auger wrote: >> + >> +void vfio_platform_unregister_reset(const char *compat) >> +{ >> + struct vfio_platform_reset_node *iter, *temp; >> + >> + mutex_lock(_loc

[PATCH v3 1/7] vfio: platform: introduce vfio-platform-base module

2015-10-23 Thread Eric Auger
make sure symbols exported by base are available when vfio-platform driver gets probed. The open/release being implemented in the base module, the ref count is applied to the parent module instead. Signed-off-by: Eric Auger <eric.au...@linaro.org> Suggested-by: Arnd Bergmann <a...

[PATCH v2] VFIO: platform: reset: AMD xgbe reset module

2015-10-23 Thread Eric Auger
from the native xgbe driver. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- Applies on top of [PATCH v3 0/7] VFIO platform reset module rework v1 -> v2: - uses module_vfio_reset_handler macro --- drivers/vfio/platform/reset/Kconfig| 7 ++ drivers/vfio/platform/r

[PATCH v3 3/7] vfio: platform: introduce module_vfio_reset_handler macro

2015-10-23 Thread Eric Auger
The module_vfio_reset_handler macro - define a module alias - implement module init/exit function which respectively registers and unregisters the reset function. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v2 -> v3: - use vfio_platform_register_reset macro v1 ->

[PATCH v3 4/7] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-23 Thread Eric Auger
This patch adds the reset function registration/unregistration. This is handled through the module_vfio_reset_handler macro. This latter also defines a MODULE_ALIAS which simplifies the load from vfio-platform. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v2 -> v3: - do no

[PATCH v3 6/7] vfio: platform: use list of registered reset function

2015-10-23 Thread Eric Auger
-by: Eric Auger <eric.au...@linaro.org> Reported-by: Arnd Bergmann <a...@arndb.de> --- v2 -> v3: - remove clear of vfio_platform_device reset_module and reset in vfio_platform_put_reset - single unlock in vfio_platform_lookup_reset - use driver_lock instead of reset_lock v1 -> v2

[PATCH v3 2/7] vfio: platform: add capability to register a reset function

2015-10-23 Thread Eric Auger
. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v2 -> v3: - use goto out to have a single mutex_unlock - implement vfio_platform_register_reset as a macro (suggested by Arnd) - move reset_node struct declaration back to vfio_platform_private.h - vfio_platform_unregister_reset does not r

[PATCH v3 0/7] VFIO platform reset module rework

2015-10-23 Thread Eric Auger
export vfio_platform_calxedaxgmac_reset symbol anymore - add a pr_info to show the device is reset by vfio reset module Eric Auger (7): vfio: platform: introduce vfio-platform-base module vfio: platform: add capability to register a reset function vfio: platform: introduce module_vfio_reset_handler macro vfio: pl

Re: [PATCH v3 6/7] vfio: platform: use list of registered reset function

2015-10-23 Thread Eric Auger
On 10/23/2015 04:23 PM, Arnd Bergmann wrote: > On Friday 23 October 2015 16:11:08 Eric Auger wrote: >> Hi Arnd, >> On 10/23/2015 03:12 PM, Arnd Bergmann wrote: >>> On Friday 23 October 2015 14:37:14 Eric Auger wrote: >>>> Remove the static lookup table an

Re: [PATCH v2 3/6] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-22 Thread Eric Auger
On 10/22/2015 12:13 PM, Arnd Bergmann wrote: > On Thursday 22 October 2015 11:41:59 Eric Auger wrote: >> This patch adds the reset function registration/unregistration. >> >> Signed-off-by: Eric Auger <eric.au...@linaro.org> > > Looks good, except on

Re: [PATCH v2 5/6] vfio: platform: use list of registered reset function

2015-10-22 Thread Eric Auger
On 10/22/2015 12:19 PM, Arnd Bergmann wrote: > On Thursday 22 October 2015 11:42:01 Eric Auger wrote: >> Remove the static lookup table and use the dynamic list of registered >> reset functions instead. Also load the reset module through its alias. >> The reset struct mod

Re: [PATCH v2 6/6] vfio: platform: move get/put reset at open/release

2015-10-22 Thread Eric Auger
Hi Arnd, On 10/22/2015 12:29 PM, Arnd Bergmann wrote: > On Thursday 22 October 2015 11:42:02 Eric Auger wrote: >> Currently reset lookup is done on probe. This introduces a >> race with new registration mechanism in the case where the >> vfio-platform driver is bound to

[PATCH v2 5/6] vfio: platform: use list of registered reset function

2015-10-22 Thread Eric Auger
-by: Eric Auger <eric.au...@linaro.org> Reported-by: Arnd Bergmann <a...@arndb.de> --- v1 -> v2: - use reset_lock in vfio_platform_lookup_reset - remove vfio_platform_reset_combo declaration - remove struct device *dev parameter in vfio_platform_get_reset - set reset_module and reset

[PATCH v2 4/6] vfio: platform: add compat in vfio_platform_device

2015-10-22 Thread Eric Auger
Let's retrieve the compatibility string on probe and store it in the vfio_platform_device struct Signed-off-by: Eric Auger <eric.au...@linaro.org> --- drivers/vfio/platform/vfio_platform_common.c | 15 --- drivers/vfio/platform/vfio_platform_private.h | 1 + 2 files chan

[PATCH v2 2/6] vfio: platform: reset: add vfio_platform_reset_private.h

2015-10-22 Thread Eric Auger
This header is to be included in all vfio reset modules. It defines the module_vfio_reset_handler macro whose role is - to define a module alias - implement module init/exit function which respectively registers and unregisters the reset function. Signed-off-by: Eric Auger <eric

[PATCH v2 1/6] vfio: platform: add capability to register a reset function

2015-10-22 Thread Eric Auger
. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v1 -> v2: - reset_list becomes static - vfio_platform_register/unregister_reset take a const char * as compat - fix node leak - add reset_lock to protect the reset list manipulation - move vfio_platform_reset_node de

[PATCH v2 0/6] VFIO platform reset module rework

2015-10-22 Thread Eric Auger
add mutex to protect the reset list * in calxeda xgmac reset module - introduce vfio_platform_reset_private.h - use module_vfio_reset_handler macro - do not export vfio_platform_calxedaxgmac_reset symbol anymore - add a pr_info to show the device is reset by vfio reset module Eric Auger

[PATCH v2 3/6] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-22 Thread Eric Auger
This patch adds the reset function registration/unregistration. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- v1 -> v2: - uses the module_vfio_reset_handler macro - add pr_info on vfio reset - do not export vfio_platform_calxedaxgmac_reset symbol anymore --- drivers/vfio/platf

[PATCH v2 6/6] vfio: platform: move get/put reset at open/release

2015-10-22 Thread Eric Auger
for the registration function (vfio_platform_register_reset). The symbol is not yet available hence the lookup fails. In case we do the lookup in the first open we are sure the vfio-platform module is loaded and vfio_platform_register_reset is available. Signed-off-by: Eric Auger <eric

Re: [PATCH v2 6/6] vfio: platform: move get/put reset at open/release

2015-10-22 Thread Eric Auger
On 10/22/2015 04:10 PM, Arnd Bergmann wrote: > On Thursday 22 October 2015 15:26:55 Eric Auger wrote: >>>> @@ -181,6 +182,8 @@ static int vfio_platform_open(void *device_data) >>>> if (ret) >>>&g

Re: [PATCH v2 6/6] vfio: platform: move get/put reset at open/release

2015-10-22 Thread Eric Auger
On 10/22/2015 02:05 PM, Arnd Bergmann wrote: > On Thursday 22 October 2015 13:40:16 Eric Auger wrote: >> On 10/22/2015 12:29 PM, Arnd Bergmann wrote: >>> On Thursday 22 October 2015 11:42:02 Eric Auger wrote: >>>> Currently reset lookup is done on probe. This i

Re: [PATCH v2 3/6] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-22 Thread Eric Auger
On 10/22/2015 02:09 PM, Arnd Bergmann wrote: > On Thursday 22 October 2015 13:54:42 Eric Auger wrote: >> On 10/22/2015 12:13 PM, Arnd Bergmann wrote: >>> On Thursday 22 October 2015 11:41:59 Eric Auger wrote: >>>> This patch adds the reset function registration/unregi

Re: [PATCH v2 6/6] vfio: platform: move get/put reset at open/release

2015-10-22 Thread Eric Auger
On 10/22/2015 12:29 PM, Arnd Bergmann wrote: > On Thursday 22 October 2015 11:42:02 Eric Auger wrote: >> Currently reset lookup is done on probe. This introduces a >> race with new registration mechanism in the case where the >> vfio-platform driver is bound to the dev

Re: [PATCH 3/3] arm/arm64: KVM: Fix disabled distributor operation

2015-10-20 Thread Eric Auger
Hi Christoffer, On 10/17/2015 10:30 PM, Christoffer Dall wrote: > We currently do a single update of the vgic state when the distrbutor distributor > enable/disable control register is accessed and then bypass updating the > state for as long as the distributor remains disabled. > > This is

Re: [PATCH 3/3] arm/arm64: KVM: Fix disabled distributor operation

2015-10-20 Thread Eric Auger
On 10/20/2015 11:44 AM, Christoffer Dall wrote: > On Tue, Oct 20, 2015 at 11:08:44AM +0200, Eric Auger wrote: >> Hi Christoffer, >> On 10/17/2015 10:30 PM, Christoffer Dall wrote: >>> We currently do a single update of the vgic state when the distrbutor >> distribu

Re: [PATCH 1/4] vfio: platform: add capability to register a reset function

2015-10-20 Thread Eric Auger
Hi Alex, On 10/19/2015 09:45 PM, Alex Williamson wrote: > On Sun, 2015-10-18 at 18:00 +0200, Eric Auger wrote: >> In preparation for subsequent changes in reset function lookup, >> lets introduce a dynamic list of reset combos (compat string, >> reset module, reset fu

Re: [PATCH 1/3] arm/arm64: KVM: Fix arch timer behavior for disabled interrupts

2015-10-19 Thread Eric Auger
Hi Christoffer, On 10/17/2015 10:30 PM, Christoffer Dall wrote: > We have an interesting issue when the guest disables the timer interrupt > on the VGIC, which happens when turning VCPUs off using PSCI, for > example. > > The problem is that because the guest disables the virtual interrupt at >

Re: [PATCH 2/4] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-19 Thread Eric Auger
On 10/19/2015 03:25 PM, Arnd Bergmann wrote: > On Monday 19 October 2015 15:17:30 Eric Auger wrote: >> Hi Arnd, >> On 10/19/2015 03:04 PM, Arnd Bergmann wrote: >>> On Sunday 18 October 2015 18:00:13 Eric Auger wrote: >>>> diff --git a/drivers/vfio/platfor

Re: [PATCH 2/4] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-19 Thread Eric Auger
Hi Arnd, On 10/19/2015 03:04 PM, Arnd Bergmann wrote: > On Sunday 18 October 2015 18:00:13 Eric Auger wrote: >> diff --git a/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c >> b/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c >> index 619dc7d..4f76b17 10

Re: [PATCH 1/3] arm/arm64: KVM: Fix arch timer behavior for disabled interrupts

2015-10-19 Thread Eric Auger
On 10/19/2015 03:14 PM, Christoffer Dall wrote: > On Mon, Oct 19, 2015 at 03:07:16PM +0200, Eric Auger wrote: >> Hi Christoffer, >> On 10/17/2015 10:30 PM, Christoffer Dall wrote: >>> We have an interesting issue when the guest disables the timer interrupt >>>

Re: [PATCH 2/3] arm/arm64: KVM: Clear map->active on pend/active clear

2015-10-19 Thread Eric Auger
On 10/19/2015 05:39 PM, Christoffer Dall wrote: > On Mon, Oct 19, 2015 at 05:32:42PM +0200, Eric Auger wrote: >> Hi, >> On 10/17/2015 10:30 PM, Christoffer Dall wrote: >>> When a guest reboots or offlines/onlines CPUs, it is not uncommon for it >>> to cl

Re: [PATCH 2/3] arm/arm64: KVM: Clear map->active on pend/active clear

2015-10-19 Thread Eric Auger
el-triggered device, I do not get this sentence. Besides that Reviewed-by: Eric Auger <eric.au...@linaro.org> Best Regards Eric the guest expects the timer interrupt > to hit even after clearing the pending state. > > We currently do not signal the VGIC when the map->a

[PATCH 1/4] vfio: platform: add capability to register a reset function

2015-10-18 Thread Eric Auger
. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- drivers/vfio/platform/vfio_platform_common.c | 55 +++ drivers/vfio/platform/vfio_platform_private.h | 14 +++ 2 files changed, 69 insertions(+) diff --git a/drivers/vfio/platform/vfio_platform_common.c b/driver

[PATCH 0/4] VFIO platform reset module rework

2015-10-18 Thread Eric Auger
implementation relies on the reset module registering its reset function to the vfio-platform driver. The series is available at https://git.linaro.org/people/eric.auger/linux.git/shortlog/refs/heads/v4.3-rc5-rework-xgbe-v2 Best Regards Eric Eric Auger (4): vfio: platform: add capability to register

[PATCH 4/4] vfio: platform: use list of registered reset function

2015-10-18 Thread Eric Auger
moot, prevented compilation with CONFIG_MODULES disabled. Also usage of MODULE_ALIAS makes possible to add a new reset module without needing to update the framework. This was suggested by Arnd. Signed-off-by: Eric Auger <eric.au...@linaro.org> Reported-by: Arnd Bergmann <a...

[PATCH 2/4] vfio: platform: reset: calxedaxgmac: add reset function registration

2015-10-18 Thread Eric Auger
This patch adds the reset function registration/unregistration. Also a MODULE_ALIAS is added. Signed-off-by: Eric Auger <eric.au...@linaro.org> --- .../platform/reset/vfio_platform_calxedaxgmac.c| 40 -- 1 file changed, 38 insertions(+), 2 deletions(-) diff

[PATCH 3/4] vfio: platform: add compat in vfio_platform_device

2015-10-18 Thread Eric Auger
Let's retrieve the compatibility string on probe and store it in the vfio_platform_device struct Signed-off-by: Eric Auger <eric.au...@linaro.org> --- drivers/vfio/platform/vfio_platform_common.c | 15 --- drivers/vfio/platform/vfio_platform_private.h | 1 + 2 files chan

Re: [RFC PATCH] vfio/type1: Do not support IOMMUs that allow bypass

2015-10-16 Thread Eric Auger
Hi Alex, On 10/15/2015 10:52 PM, Alex Williamson wrote: > We can only provide isolation if DMA is forced through the IOMMU > aperture. Don't allow type1 to be used if this is not the case. > > Signed-off-by: Alex Williamson > --- > > Eric, I see a number of IOMMU

Re: [PATCH] VFIO: platform: AMD xgbe reset module

2015-10-16 Thread Eric Auger
Hi Arnd, On 10/16/2015 03:26 PM, Arnd Bergmann wrote: > On Friday 16 October 2015 15:06:45 Eric Auger wrote: > >> I've since forgotten his answer, but the fact that >>> __symbol_get() is only defined for modules makes it moot, we either need >>> to make symbol_get

Re: [PATCH] VFIO: platform: AMD xgbe reset module

2015-10-16 Thread Eric Auger
Dear all, On 10/15/2015 06:53 PM, Alex Williamson wrote: > On Thu, 2015-10-15 at 16:46 +0200, Eric Auger wrote: >> Hi Arnd, >> On 10/15/2015 03:59 PM, Arnd Bergmann wrote: >>> On Thursday 15 October 2015 14:12:28 Christoffer Dall wrote: >>&

Re: [PATCH] VFIO: platform: AMD xgbe reset module

2015-10-15 Thread Eric Auger
Hi Arnd, On 10/14/2015 05:38 PM, Arnd Bergmann wrote: > On Wednesday 14 October 2015 15:33:12 Eric Auger wrote: >> --- a/drivers/vfio/platform/vfio_platform_common.c >> +++ b/drivers/vfio/platform/vfio_platform_common.c >> @@ -31,6 +31,11 @@ static const struct vfio

Re: [PATCH] VFIO: platform: AMD xgbe reset module

2015-10-15 Thread Eric Auger
Hi Arnd, On 10/15/2015 03:59 PM, Arnd Bergmann wrote: > On Thursday 15 October 2015 14:12:28 Christoffer Dall wrote: >>> >>> enum vfio_platform_op { >>> VFIO_PLATFORM_BIND, >>> VFIO_PLATFORM_UNBIND, >>> VFIO_PLATFORM_RESET, >>> }; >>> >>> struct platform_driver { >>> int

Re: [PATCH] VFIO: platform: AMD xgbe reset module

2015-10-15 Thread Eric Auger
Hi Arnd, On 10/15/2015 02:12 PM, Christoffer Dall wrote: > On Thu, Oct 15, 2015 at 01:21:55PM +0200, Arnd Bergmann wrote: >> On Thursday 15 October 2015 10:08:02 Eric Auger wrote: >>> Hi Arnd, >>> On 10/14/2015 05:38 PM, Arnd Bergmann wrote: >>>> On Wednes

  1   2   3   4   5   6   7   >