Re: [PATCH v2] cxl: Fix null pointer dereference in cxl_get_fd

2024-01-15 Thread Frederic Barrat
edump generation when cxl_get_fd() is used") Signed-off-by: Kunwu Chan Cc: Kunwu Chan Suggested-by: Frederic Barrat --- Thanks! Acked-by: Frederic Barrat Fred v2: Deal with error path --- drivers/misc/cxl/api.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-)

Re: [PATCH] cxl: Fix null pointer dereference in cxl_get_fd

2023-12-04 Thread Frederic Barrat
On 04/12/2023 03:07, Kunwu Chan wrote: kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: bdecf76e319a ("cxl: Fix coredump generation when cxl_get_fd() is used") Signed-off-by: Kunwu Chan --- drivers/misc/cxl/api.c | 4 1 file

Re: [PATCH] misc: ocxl: link: Remove unnecessary (void*) conversions

2023-11-14 Thread Frederic Barrat
On 13/11/2023 02:45, Li zeming wrote: The link pointer does not need to cast the type. Signed-off-by: Li zeming --- Acked-by: Frederic Barrat Fred drivers/misc/ocxl/link.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/misc/ocxl

Re: [PATCH] misc: ocxl: afu_irq: Remove unnecessary (void*) conversions

2023-11-14 Thread Frederic Barrat
On 13/11/2023 02:22, Li zeming wrote: The irq pointer does not need to cast the type. Signed-off-by: Li zeming --- Acked-by: Frederic Barrat Fred drivers/misc/ocxl/afu_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ocxl/afu_irq.c b

Re: [PATCH] misc: ocxl: context: Remove unnecessary (void*) conversions

2023-11-14 Thread Frederic Barrat
On 13/11/2023 02:15, Li zeming wrote: The ctx pointer does not need to cast the type. Signed-off-by: Li zeming --- Indeed, it's useless. Acked-by: Frederic Barrat drivers/misc/ocxl/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ocxl

Re: [PATCH] ocxl: make ocxl_class constant

2023-10-25 Thread Frederic Barrat
Barrat Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman --- Thanks! Acked-by: Frederic Barrat Fred drivers/misc/ocxl/file.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git

Re: [PATCH] cxl: make cxl_class constant

2023-10-25 Thread Frederic Barrat
Barrat Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman --- Thanks! Acked-by: Frederic Barrat Fred drivers/misc/cxl/file.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/misc

Re: [PATCH] ocxl: Use pci_dev_id() to simplify the code

2023-08-11 Thread Frederic Barrat
On 11/08/2023 12:20, Zheng Zengkai wrote: PCI core API pci_dev_id() can be used to get the BDF number for a pci device. We don't need to compose it mannually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Zheng Zengkai --- LGTM Acked-by: Frederic Barrat Fred

Re: [PATCH] powerpc/powernv/pci: use pci_dev_id() to simplify the code

2023-08-04 Thread Frederic Barrat
On 04/08/2023 10:04, Xiongfeng Wang wrote: PCI core API pci_dev_id() can be used to get the BDF number for a pci device. We don't need to compose it mannually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Xiongfeng Wang --- LGTM Reviewed-by: Frederic Barrat Fred

Re: [PATCH] cxl/ocxl: Possible repeated word

2023-06-20 Thread Frederic Barrat
Hello, While the correction in the comment is of course ok, the patch was sent as html. You may want to check/fix how it was submitted. Fred On 18/06/2023 17:08, zhumao...@208suo.com wrote: Delete repeated word in comment. Signed-off-by: Zhu Mao  208suo. com> ---

[PATCH] powerpc/powernv/ioda: Skip unallocated resources when mapping to PE

2023-01-20 Thread Frederic Barrat
ources, as the address of the resource is checked to be within the range of the 64-bit mmio window. See pnv_ioda_reserve_dev_m64_pe() and pnv_pci_is_m64(). Reported-by: Andrew Jeffery Fixes: 23e79425fe7c ("powerpc/powernv: Simplify pnv_ioda_setup_pe_seg()") Signed-off-by: Frederic B

Re: [PATCH] cxl: Remove unnecessary cxl_pci_window_alignment()

2022-12-05 Thread Frederic Barrat
to returning 1 if the function pointer is NULL, which is the same was what cxl_pci_window_alignment() does. cxl_pci_window_alignment() is unnecessary, so remove it. No functional change intended. Signed-off-by: Bjorn Helgaas --- Thanks! Acked-by: Frederic Barrat Fred drivers/misc/cxl/vphb.c

Re: [PATCH v2] ocxl: fix pci device refcount leak when calling get_function_0()

2022-11-24 Thread Frederic Barrat
Yingliang --- Thanks for fixing it! Acked-by: Frederic Barrat Fred v1 -> v2: Add comment above get_dvsec_vendor0(). Get reference where dev is function 0, and call pci_dev_put() unconditionally in callers. --- drivers/misc/ocxl/config.c | 20 +++- 1 fil

Re: [PATCH 2/2] cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()

2022-11-16 Thread Frederic Barrat
f-by: Yang Yingliang --- Acked-by: Frederic Barrat Fred drivers/misc/cxl/pci.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 3de0aea62ade..6d495d641c95 100644 --- a/drivers/misc/cxl/pci.c +++

Re: [PATCH 1/2] cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()

2022-11-16 Thread Frederic Barrat
to see how frequently it changed. I can now rest easy :-) Acked-by: Frederic Barrat Fred drivers/misc/cxl/guest.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c index 375f692ae9d6..fb

Re: [PATCH] misc: ocxl: fix possible name leak in ocxl_file_register_afu()

2022-11-14 Thread Frederic Barrat
On 14/11/2022 12:46, Yang Yingliang wrote: Hi, On 2022/11/14 19:23, Frederic Barrat wrote: On 11/11/2022 15:59, Yang Yingliang wrote: If device_register() returns error in ocxl_file_register_afu(), the name allocated by dev_set_name() need be freed. As comment of device_register() says

Re: [PATCH] misc: ocxl: fix possible name leak in ocxl_file_register_afu()

2022-11-14 Thread Frederic Barrat
On 11/11/2022 15:59, Yang Yingliang wrote: If device_register() returns error in ocxl_file_register_afu(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling

Re: [PATCH v3] powerpc/pseries/vas: Add VAS IRQ primary handler

2022-10-11 Thread Frederic Barrat
to bottom half if this flag is set. Signed-off-by: Haren Myneni --- That version looks good to me. Reviewed-by: Frederic Barrat Fred v3: Update pending_faults usage in changelog v2: Use the pending_faults counter for the second interrupt and process it with the previous interrupt handling

Re: [PATCH] misc: ocxl: fix possible refcount leak in afu_ioctl()

2022-08-24 Thread Frederic Barrat
GTM Acked-by: Frederic Barrat Fred drivers/misc/ocxl/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index 6777c419a8da..d46dba2df5a1 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c @@ -257,6 +257,8 @@ s

Re: [PATCH] cxl: Fix refcount leak in cxl_calc_capp_routing

2022-06-07 Thread Frederic Barrat
refcount leak. Fixes: f24be42aab37 ("cxl: Add psl9 specific code") Signed-off-by: Miaoqian Lin Indeed. Thanks! Acked-by: Frederic Barrat Fred --- drivers/misc/cxl/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 3d

Re: [PATCH] misc: ocxl: fix possible double free in ocxl_file_register_afu

2022-04-21 Thread Frederic Barrat
On 21/04/2022 00:54, Michael Ellerman wrote: Hangyu Hua writes: info_release() will be called in device_unregister() when info->dev's reference count is 0. So there is no need to call ocxl_afu_put() and kfree() again. Double frees are often exploitable. But it looks to me like this error

Re: [PATCH] misc: ocxl: fix possible double free in ocxl_file_register_afu

2022-04-19 Thread Frederic Barrat
n any case: Acked-by: Frederic Barrat Fred drivers/misc/ocxl/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index d881f5e40ad9..6777c419a8da 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c @@ -55

Re: [PATCH kernel] KVM: PPC: Fix TCE handling for VFIO

2022-04-06 Thread Frederic Barrat
ith smaller physical pages") Signed-off-by: Alexey Kardashevskiy --- FWIW: Reviewed-by: Frederic Barrat arch/powerpc/kvm/book3s_64_vio.c| 45 +++-- arch/powerpc/kvm/book3s_64_vio_hv.c | 44 ++-- 2 files changed, 45 insertions(+), 4

Re: [PATCH] cxl/ocxl: Prepare cleanup of powerpc's asm/prom.h

2022-04-06 Thread Frederic Barrat
On 02/04/2022 11:52, Christophe Leroy wrote: powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy --- LGTM Acked-by: Frederic Barrat drivers/misc/cxl/api.c

Re: [PATCH] ocxl: Make use of the helper macro LIST_HEAD()

2022-02-09 Thread Frederic Barrat
On 09/02/2022 04:24, Cai Huoqing wrote: Replace "struct list_head head = LIST_HEAD_INIT(head)" with "LIST_HEAD(head)" to simplify the code. Signed-off-by: Cai Huoqing --- Thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/link.c | 2 +- 1 file changed, 1 inse

Re: [PATCH kernel 0/4] Fixes for powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-11-17 Thread Frederic Barrat
On 17/11/2021 11:19, Frederic Barrat wrote: On 02/11/2021 03:43, Michael Ellerman wrote: On Thu, 21 Oct 2021 00:23:11 +1100, Alexey Kardashevskiy wrote: Found some issues on SRIOV enabled PHYP. It probably should be one patch, or not? Please comment. Thanks. [...] Patches 2-4

Re: [PATCH kernel 0/4] Fixes for powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-11-17 Thread Frederic Barrat
On 02/11/2021 03:43, Michael Ellerman wrote: On Thu, 21 Oct 2021 00:23:11 +1100, Alexey Kardashevskiy wrote: Found some issues on SRIOV enabled PHYP. It probably should be one patch, or not? Please comment. Thanks. [...] Patches 2-4 applied to powerpc/fixes. Any reason why patch 1

Re: [PATCH v5 10/11] PCI: Replace pci_dev::driver usage by pci_dev::dev.driver

2021-09-30 Thread Frederic Barrat
On 29/09/2021 17:44, Andrew Donnellan wrote: On 29/9/21 11:43 pm, Uwe Kleine-König wrote:> I'm not a huge fan either, I used it to keep the control flow as is and without introducing several calls to to_pci_driver. The whole code looks as follows: list_for_each_entry(afu_dev,

Re: [PATCH kernel] powerps/pseries/dma: Add support for 2M IOMMU page size

2021-09-29 Thread Frederic Barrat
s the loop to not assume that shift[] is sorted. Signed-off-by: Alexey Kardashevskiy --- Looks ok to me Reviewed-by: Frederic Barrat This might not work if PHYP keeps rejecting new window requests for less than 32768 TCEs. This is needed: https://github.com/aik/li

Re: [PATCH 7/7] ocxl: Use pci core's DVSEC functionality

2021-09-22 Thread Frederic Barrat
On 22/09/2021 02:44, Dan Williams wrote: On Tue, Sep 21, 2021 at 3:05 PM Ben Widawsky wrote: Reduce maintenance burden of DVSEC query implementation by using the centralized PCI core implementation. Cc: linuxppc-dev@lists.ozlabs.org Cc: Frederic Barrat Cc: Andrew Donnellan Signed-off

Re: [PATCH 5/7] PCI: Add pci_find_dvsec_capability to find designated VSEC

2021-09-22 Thread Frederic Barrat
@lists.ozlabs.org Cc: Frederic Barrat Cc: Andrew Donnellan Signed-off-by: Ben Widawsky --- LGTM Reviewed-by: Frederic Barrat drivers/pci/pci.c | 32 include/linux/pci.h | 1 + 2 files changed, 33 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c

Re: [PATCH v6 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-08-27 Thread Frederic Barrat
perty name DMA64_PROPNAME "linux,dma64-ddr-window-info" was created to represent a DDW that does not allow direct mapping. Signed-off-by: Leonardo Bras --- I think it looks ok now as it was mostly me who was misunderstanding one part of the previous iteration. Reviewed-by: Fre

Re: [PATCH v6 08/11] powerpc/pseries/iommu: Update remove_dma_window() to accept property name

2021-08-27 Thread Frederic Barrat
check if the property was found while removing the active DDW. This allows skipping the remaining property names while reducing the impact of multiple property names. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- Reviewed-by: Frederic Barrat arch/powerpc/platforms

Re: [PATCH v6 06/11] powerpc/pseries/iommu: Add ddw_property_create() and refactor enable_ddw()

2021-08-27 Thread Frederic Barrat
lper clean_dma_window() was needed to clean anything that could left if walk_system_ram_range() fails. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- Thanks for fixing the error paths Reviewed-by: Frederic Barrat arch/powerpc/platforms/pseries/iommu.c |

Re: [PATCH v6 02/11] powerpc/kernel/iommu: Add new iommu_table_in_use() helper

2021-08-27 Thread Frederic Barrat
it in the new helper. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- Looks ok to me now, thanks! Reviewed-by: Frederic Barrat arch/powerpc/include/asm/iommu.h | 1 + arch/powerpc/kernel/iommu.c | 61 2 files changed, 32 insertions

Re: [PATCH v5 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-07-21 Thread Frederic Barrat
On 21/07/2021 05:32, Alexey Kardashevskiy wrote: +    struct iommu_table *newtbl; +    int i; + +    for (i = 0; i < ARRAY_SIZE(pci->phb->mem_resources); i++) { +    const unsigned long mask = IORESOURCE_MEM_64 | IORESOURCE_MEM; + +    /* Look for MMIO32 */ + 

Re: [PATCH v5 11/11] powerpc/pseries/iommu: Rename "direct window" to "dma window"

2021-07-20 Thread Frederic Barrat
to rename all names and debug/info messages to reflect that it can be used for both kinds of mapping. This should cause no behavioural change, just adjust naming. Signed-off-by: Leonardo Bras --- LGTM: Reviewed-by: Frederic Barrat arch/powerpc/platforms/pseries/iommu.c | 91

Re: [PATCH v5 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-07-20 Thread Frederic Barrat
On 16/07/2021 10:27, Leonardo Bras wrote: So far it's assumed possible to map the guest RAM 1:1 to the bus, which works with a small number of devices. SRIOV changes it as the user can configure hundreds VFs and since phyp preallocates TCEs and does not allow IOMMU pages bigger than 64K, it

Re: [PATCH v5 09/11] powerpc/pseries/iommu: Find existing DDW with given property name

2021-07-20 Thread Frederic Barrat
-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- Reviewed-by: Frederic Barrat arch/powerpc/platforms/pseries/iommu.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc

Re: [PATCH v5 08/11] powerpc/pseries/iommu: Update remove_dma_window() to accept property name

2021-07-20 Thread Frederic Barrat
On 16/07/2021 10:27, Leonardo Bras wrote: Update remove_dma_window() so it can be used to remove DDW with a given property name. This enables the creation of new property names for DDW, so we can have different usage for it, like indirect mapping. Signed-off-by: Leonardo Bras Reviewed-by:

Re: [PATCH v5 07/11] powerpc/pseries/iommu: Reorganize iommu_table_setparms*() with new helper

2021-07-20 Thread Frederic Barrat
we need the iommu_table_ops to be declared before used, declare iommu_table_lpar_multi_ops and iommu_table_pseries_ops to before their respective iommu_table_setparms*(). Signed-off-by: Leonardo Bras --- Looks good Reviewed-by: Frederic Barrat arch/powerpc/platforms/pseries/iommu.c |

Re: [PATCH v5 06/11] powerpc/pseries/iommu: Add ddw_property_create() and refactor enable_ddw()

2021-07-20 Thread Frederic Barrat
On 16/07/2021 10:27, Leonardo Bras wrote: Code used to create a ddw property that was previously scattered in enable_ddw() is now gathered in ddw_property_create(), which deals with allocation and filling the property, letting it ready for of_property_add(), which now occurs in sequence.

Re: [PATCH v5 05/11] powerpc/pseries/iommu: Allow DDW windows starting at 0x00

2021-07-20 Thread Frederic Barrat
-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- Looks good to me Reviewed-by: Frederic Barrat arch/powerpc/platforms/pseries/iommu.c | 36 +- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch

Re: [PATCH v5 04/11] powerpc/pseries/iommu: Add ddw_list_new_entry() helper

2021-07-19 Thread Frederic Barrat
-by: Frederic Barrat arch/powerpc/platforms/pseries/iommu.c | 32 +- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 33d82865d6e6..712d1667144a 100644 --- a/arch/powerpc

Re: [PATCH v5 03/11] powerpc/pseries/iommu: Add iommu_pseries_alloc_table() helper

2021-07-19 Thread Frederic Barrat
c_table(node); + if (table_group->tables[0]) + return table_group; Nitpick: for readability, we'd usually expect the error path to be detected with the if statement and keep going on the good path, and here the code does the opposite. No big deal though, so Reviewed-by:

Re: [PATCH v5 02/11] powerpc/kernel/iommu: Add new iommu_table_in_use() helper

2021-07-19 Thread Frederic Barrat
On 16/07/2021 10:27, Leonardo Bras wrote: @@ -1099,18 +1105,13 @@ int iommu_take_ownership(struct iommu_table *tbl) for (i = 0; i < tbl->nr_pools; i++) spin_lock_nest_lock(>pools[i].lock, >large_pool.lock); - iommu_table_release_pages(tbl); - - if

Re: [PATCH v5 01/11] powerpc/pseries/iommu: Replace hard-coded page shift

2021-07-19 Thread Frederic Barrat
wed-by: Frederic Barrat arch/powerpc/include/asm/tce.h | 8 -- arch/powerpc/platforms/pseries/iommu.c | 39 +++--- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/include/asm/tce.h b/arch/powerpc/include/asm/tce.h index db5fc2f22

Re: [PATCH] Revert "powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE() to save TCEs"

2021-05-27 Thread Frederic Barrat
On 27/05/2021 04:13, Alexey Kardashevskiy wrote: On 27/05/2021 00:45, Frederic Barrat wrote: This reverts commit 3c0468d4451eb6b4f6604370639f163f9637a479. That commit was breaking alignment guarantees for the DMA address when allocating coherent mappings, as described in Documentation/core

[PATCH] Revert "powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE() to save TCEs"

2021-05-26 Thread Frederic Barrat
:00.0: mlx5_frag_buf_alloc_node:146:(pid 13402): unexpected map alignment: 0x08c61000, page_shift=16 [ 1515.763635] mlx5_core c002:01:00.0: mlx5_cqwq_create:181:(pid 13402): mlx5_frag_buf_alloc_node() failed, -12 Signed-off-by: Frederic Barrat --- arch/powerpc/kernel/iommu.c | 11

Re: [PATCH] cxl: don't manipulate the mm.mm_users field directly

2021-03-10 Thread Frederic Barrat
On 10/03/2021 18:44, Laurent Dufour wrote: It is better to rely on the API provided by the MM layer instead of directly manipulating the mm_users field. Signed-off-by: Laurent Dufour --- Thanks! Acked-by: Frederic Barrat drivers/misc/cxl/fault.c | 2 +- 1 file changed, 1

Re: [PATCH kernel] powerpc/iommu: Annotate nested lock for lockdep

2021-02-18 Thread Frederic Barrat
On 16/02/2021 04:20, Alexey Kardashevskiy wrote: The IOMMU table is divided into pools for concurrent mappings and each pool has a separate spinlock. When taking the ownership of an IOMMU group to pass through a device to a VM, we lock these spinlocks which triggers a false negative warning

Re: [PATCH] cxl: Simplify bool conversion

2021-01-29 Thread Frederic Barrat
On 29/01/2021 09:25, Yang Li wrote: Fix the following coccicheck warning: ./drivers/misc/cxl/sysfs.c:181:48-53: WARNING: conversion to bool not needed here Reported-by: Abaci Robot Signed-off-by: Yang Li --- Thanks! Acked-by: Frederic Barrat drivers/misc/cxl/sysfs.c | 2 +- 1

Re: [PATCH] selftests/powerpc: make the test check in eeh-basic.sh posix compliant

2021-01-04 Thread Frederic Barrat
this posix compatibility issue. Fixes: 996f9e0f93f162 ("selftests/powerpc: Fix eeh-basic.sh exit codes") Signed-off-by: Po-Hsu Lin --- With the above, Reviewed-by: Frederic Barrat Thanks! tools/testing/selftests/powerpc/eeh/eeh-basic.sh | 2 +- 1 file changed, 1 insertion(+), 1 del

Re: [PATCH v2 -next] misc: ocxl: use DEFINE_MUTEX() for mutex lock

2021-01-04 Thread Frederic Barrat
On 24/12/2020 14:24, Zheng Yongjun wrote: mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun --- Thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/file.c | 3 +-- 1 file changed, 1 insertion

Re: [PATCH kernel v3] powerpc/pci: Remove LSI mappings on device teardown

2020-12-02 Thread Frederic Barrat
s tracking of virq to unmap them only when the last user is gone. Signed-off-by: Oliver O'Halloran [aik: added refcounter] Signed-off-by: Alexey Kardashevskiy --- Looks ok to me. Reviewed-by: Frederic Barrat Changes: v3: * free @vi on error path v2: * added refcounter --- arch/powerpc/

Re: [PATCH kernel v2] powerpc/pci: Remove LSI mappings on device teardown

2020-12-01 Thread Frederic Barrat
On 01/12/2020 08:39, Alexey Kardashevskiy wrote: From: Oliver O'Halloran When a passthrough IO adapter is removed from a pseries machine using hash MMU and the XIVE interrupt mode, the POWER hypervisor expects the guest OS to clear all page table entries related to the adapter. If some are

[PATCH] powerpc/pseries: Define PCI bus speed for Gen4 and Gen5

2020-11-30 Thread Frederic Barrat
Update bus speed definition for PCI Gen4 and 5. Signed-off-by: Frederic Barrat --- arch/powerpc/platforms/pseries/pci.c | 51 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c

Re: [PATCH V4 2/5] ocxl: Initiate a TLB invalidate command

2020-11-26 Thread Frederic Barrat
command. 3. Poll the MMIO ATSD status register to determine when the TLB Invalidate has been completed. Signed-off-by: Christophe Lombard --- Thanks! Acked-by: Frederic Barrat arch/powerpc/include/asm/pnv-ocxl.h | 51 arch/powerpc/platforms/powernv/ocxl.c | 69

Re: [PATCH V3 5/5] ocxl: Add new kernel traces

2020-11-25 Thread Frederic Barrat
On 24/11/2020 10:58, Christophe Lombard wrote: Add specific kernel traces which provide information on mmu notifier and on pages range. Signed-off-by: Christophe Lombard --- Acked-by: Frederic Barrat drivers/misc/ocxl/link.c | 4 +++ drivers/misc/ocxl/trace.h | 64

Re: [PATCH V3 4/5] ocxl: Add mmu notifier

2020-11-25 Thread Frederic Barrat
to be configured in the Process Element Entry. The PEE must be set up to match the BDF/PASID of the AFU. Signed-off-by: Christophe Lombard --- That looks ok too. Acked-by: Frederic Barrat drivers/misc/ocxl/link.c | 62 +++- 1 file changed, 61 insertions(+), 1

Re: [PATCH V3 3/5] ocxl: Update the Process Element Entry

2020-11-25 Thread Frederic Barrat
Reserved 5 Reserved 6 Signed-off-by: Christophe Lombard --- LGTM Acked-by: Frederic Barrat drivers/misc/ocxl/context.c | 4 +++- drivers/misc/ocxl/link.c | 4 +++- drivers/misc/ocxl/ocxl_internal.h | 9

Re: [PATCH V3 2/5] ocxl: Initiate a TLB invalidate command

2020-11-25 Thread Frederic Barrat
On 24/11/2020 10:58, Christophe Lombard wrote: When a TLB Invalidate is required for the Logical Partition, the following sequence has to be performed: 1. Load MMIO ATSD AVA register with the necessary value, if required. 2. Write the MMIO ATSD launch register to initiate the TLB Invalidate

Re: [PATCH V3 1/5] ocxl: Assign a register set to a Logical Partition

2020-11-25 Thread Frederic Barrat
MMIO ATSDx LPARID/AVA/launch/status register). For the time being, the ATSD0 set of registers is used by default. Signed-off-by: Christophe Lombard --- Looks good, thanks for the updates! Acked-by: Frederic Barrat arch/powerpc/include/asm/pnv-ocxl.h | 3 ++ arch/powerpc/platforms/powe

Re: [PATCH 3/3] selftests/powerpc: Add VF recovery tests

2020-11-24 Thread Frederic Barrat
On 03/11/2020 05:45, Oliver O'Halloran wrote: --- a/tools/testing/selftests/powerpc/eeh/eeh-functions.sh +++ b/tools/testing/selftests/powerpc/eeh/eeh-functions.sh @@ -135,3 +135,111 @@ eeh_one_dev() { return 0; } +eeh_has_driver() { + test -e

Re: [PATCH V2 4/5] ocxl: Add mmu notifier

2020-11-23 Thread Frederic Barrat
On 20/11/2020 18:32, Christophe Lombard wrote: Add invalidate_range mmu notifier, when required (ATSD access of MMIO registers is available), to initiate TLB invalidation commands. For the time being, the ATSD0 set of registers is used by default. The pasid and bdf values have to be

Re: [PATCH V2 3/5] ocxl: Update the Process Element Entry

2020-11-23 Thread Frederic Barrat
On 20/11/2020 18:32, Christophe Lombard wrote: To complete the MMIO based mechanism, the fields: PASID, bus, device and function of the Process Element Entry have to be filled. (See OpenCAPI Power Platform Architecture document) Hypervisor Process Element Entry Word

Re: [PATCH V2 2/5] ocxl: Initiate a TLB invalidate command

2020-11-23 Thread Frederic Barrat
On 20/11/2020 18:32, Christophe Lombard wrote: When a TLB Invalidate is required for the Logical Partition, the following sequence has to be performed: 1. Load MMIO ATSD AVA register with the necessary value, if required. 2. Write the MMIO ATSD launch register to initiate the TLB Invalidate

Re: [PATCH V2 1/5] ocxl: Assign a register set to a Logical Partition

2020-11-23 Thread Frederic Barrat
On 20/11/2020 18:32, Christophe Lombard wrote: Platform specific function to assign a register set to a Logical Partition. The "ibm,mmio-atsd" property, provided by the firmware, contains the 16 base ATSD physical addresses (ATSD0 through ATSD15) of the set of MMIO registers (XTS MMIO ATSDx

Re: [PATCH] ocxl: Mmio invalidation support

2020-11-16 Thread Frederic Barrat
On 13/11/2020 16:33, Christophe Lombard wrote: OpenCAPI 4.0/5.0 with TLBI/SLBI Snooping, is not used due to performance problems caused by the PAU having to process all incoming TLBI/SLBI commands which will cause them to back up on the PowerBus. When the Address Translation Mode requires

Re: [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description

2020-11-02 Thread Frederic Barrat
' description in 'get_function_0' Cc: Frederic Barrat Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Lee Jones --- Thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH v2 20/39] docs: ABI: testing: make the files compatible with ReST output

2020-10-30 Thread Frederic Barrat
/sysfs-class-ocxl| 3 + Patches 20, 28 and 31 look good for cxl and ocxl. Acked-by: Frederic Barrat Fred

Re: [PATCH -next] ocxl: simplify the return expression of free_function_dev()

2020-09-21 Thread Frederic Barrat
Le 21/09/2020 à 15:10, Qinglang Miao a écrit : Simplify the return expression. Signed-off-by: Qinglang Miao --- Thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/core.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/misc/ocxl/core.c b/drivers

Re: [PATCH AUTOSEL 5.4 101/330] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-09-21 Thread Frederic Barrat
Le 19/09/2020 à 20:10, Sasha Levin a écrit : On Fri, Sep 18, 2020 at 08:35:06AM +0200, Frederic Barrat wrote: Le 18/09/2020 à 03:57, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] This patch is not desirable for stable

Re: [PATCH] ocxl: fix kconfig dependency warning for OCXL

2020-09-18 Thread Frederic Barrat
Fazil Yildiran --- OK, that makes sense, thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/ocxl/Kconfig b/drivers/misc/ocxl/Kconfig index 6551007a066c..947294f6d7f4 100644 --- a/drivers/misc

Re: [PATCH AUTOSEL 5.4 101/330] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-09-18 Thread Frederic Barrat
Le 18/09/2020 à 03:57, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] This patch is not desirable for stable, for 5.4 and 4.19 (it was already flagged by autosel back in April. Not sure why it's showing again now) Fred

Re: [PATCH] powerpc/powernv/pci: Fix typo when releasing DMA resources

2020-08-20 Thread Frederic Barrat
Le 20/08/2020 à 06:18, Michael Ellerman a écrit : I changed the subject to: powerpc/powernv/pci: Fix possible crash when releasing DMA resources Much better, thanks! Fred

Re: [PATCH] powerpc/powernv/pci: Fix typo when releasing DMA resources

2020-08-19 Thread Frederic Barrat
Le 19/08/2020 à 15:15, Oliver O'Halloran a écrit : On Wed, Aug 19, 2020 at 11:07 PM Frederic Barrat wrote: Fix typo introduced during recent code cleanup, which could lead to silently not freeing resources or oops message (on PCI hotplug or CAPI reset). oof Did you actually hit

[PATCH] powerpc/powernv/pci: Fix typo when releasing DMA resources

2020-08-19 Thread Frederic Barrat
state") Signed-off-by: Frederic Barrat --- arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index c9c25fb0783c..023a4f987bb2 100644 --- a/arch/powerpc

Re: [PATCH 2/2 v2] powerpc/powernv: Enable and setup PCI P2P

2020-08-11 Thread Frederic Barrat
Le 03/08/2020 à 09:35, Oliver O'Halloran a écrit : On Thu, Apr 30, 2020 at 11:15 PM Max Gurtovoy wrote: diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 57d3a6a..9ecc576 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++

[PATCH v5] ocxl: control via sysfs whether the FPGA is reloaded on a link reset

2020-06-19 Thread Frederic Barrat
From: Philippe Bergheaud Some opencapi FPGA images allow to control if the FPGA should be reloaded on the next adapter reset. If it is supported, the image specifies it through a Vendor Specific DVSEC in the config space of function 0. Signed-off-by: Philippe Bergheaud Signed-off-by: Frederic

Re: [PATCH v2 02/12] ocxl: Change type of pasid to unsigned int

2020-06-18 Thread Frederic Barrat
Le 18/06/2020 à 17:37, Fenghua Yu a écrit : The first 3 patches clean up pasid and flag defitions to prepare for following patches. If you think this patch can be dropped, we will drop it. Yes, I think that's the case. Thanks, Fred

Re: [PATCH v2 02/12] ocxl: Change type of pasid to unsigned int

2020-06-18 Thread Frederic Barrat
Le 13/06/2020 à 02:41, Fenghua Yu a écrit : PASID is defined as "int" although it's a 20-bit value and shouldn't be negative int. To be consistent with type defined in iommu, define PASID as "unsigned int". It looks like this patch was considered because of the use of 'pasid' in variable

Re: [PATCH] cxl: Fix kobject memleak

2020-06-02 Thread Frederic Barrat
: b087e6190ddc ("cxl: Export optional AFU configuration record in sysfs") Reported-by: Hulk Robot Signed-off-by: Wang Hai Indeed, a call to kobject_put() is needed when the init fails. Thanks! Acked-by: Frederic Barrat --- drivers/misc/cxl/sysfs.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH v2] cxl: Remove dead Kconfig option

2020-06-02 Thread Frederic Barrat
Le 02/06/2020 à 09:05, Andrew Donnellan a écrit : The CXL_AFU_DRIVER_OPS Kconfig option was added to coordinate merging of new features. It no longer serves any purpose, so remove it. Signed-off-by: Andrew Donnellan Acked-by: Frederic Barrat --- v1->v2: - keep CXL_LIB for

Re: [PATCH 2/8] fs: extract simple_pin/release_fs to separate files

2020-04-21 Thread Frederic Barrat
diff --git a/drivers/misc/cxl/Kconfig b/drivers/misc/cxl/Kconfig index 39eec9031487..a62795079d9c 100644 --- a/drivers/misc/cxl/Kconfig +++ b/drivers/misc/cxl/Kconfig @@ -19,6 +19,7 @@ config CXL select CXL_BASE select CXL_AFU_DRIVER_OPS select CXL_LIB + select

Re: [PATCH AUTOSEL 5.5 71/75] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-04-21 Thread Frederic Barrat
Le 18/04/2020 à 16:09, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] Like for other stable kernels, patches 71, 72, 73 of this series are not desirable for stable. Fred The pci_dn structure used to store a pointer

Re: [PATCH AUTOSEL 4.19 41/47] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-04-21 Thread Frederic Barrat
Le 18/04/2020 à 16:42, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] Like for kernel 5.4, the patches 41, 42, 43 of this series are not desirable for stable. Fred The pci_dn structure used to store a pointer to the struct

Re: [PATCH AUTOSEL 5.4 71/78] ocxl: Add PCI hotplug dependency to Kconfig

2020-04-21 Thread Frederic Barrat
Le 18/04/2020 à 16:40, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 49ce94b8677c7d7a15c4d7cbbb9ff1cd8387827b ] This shouldn't be backported to stable. Fred The PCI hotplug framework is used to update the devices when a new image is written to the FPGA. Reviewed

Re: [PATCH AUTOSEL 5.4 70/78] pci/hotplug/pnv-php: Remove erroneous warning

2020-04-21 Thread Frederic Barrat
Le 18/04/2020 à 16:40, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 658ab186dd22060408d94f5c5a6d02d809baba44 ] This doesn't need to be backported to stable. Fred On powernv, when removing a device through hotplug, the following warning is logged: Invalid

Re: [PATCH AUTOSEL 5.4 69/78] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-04-21 Thread Frederic Barrat
Le 18/04/2020 à 16:40, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] This shouldn't be backported to stable. Fred The pci_dn structure used to store a pointer to the struct pci_dev, so taking a reference on the device

Re: [PATCH] cxl: Rework error message for incompatible slots

2020-04-08 Thread Frederic Barrat
Le 08/04/2020 à 04:13, Andrew Donnellan a écrit : On 7/4/20 9:56 pm, Frederic Barrat wrote: Improve the error message shown if a capi adapter is plugged on a capi-incompatible slot directly under the PHB (no intermediate switch). Fixes: 5632874311db ("cxl: Add support for POWER9 DD2

[PATCH] cxl: Rework error message for incompatible slots

2020-04-07 Thread Frederic Barrat
Improve the error message shown if a capi adapter is plugged on a capi-incompatible slot directly under the PHB (no intermediate switch). Fixes: 5632874311db ("cxl: Add support for POWER9 DD2") Cc: sta...@vger.kernel.org # 4.14+ Signed-off-by: Frederic Barrat --- drivers/misc/cxl

[PATCH v2 0/4] ocxl: Cleanup AFU interrupt allocation

2020-04-03 Thread Frederic Barrat
the interrupt has been mapped, but that is not a problem with the way the code is using it. No functional change. Changelog: v2: Fix error path in patch 1 All other patches unchanged Frederic Barrat (4): scsi: cxlflash: Access interrupt trigger page from xive directly

[PATCH v2 1/4] scsi: cxlflash: Access interrupt trigger page from xive directly

2020-04-03 Thread Frederic Barrat
xive is already mapping the trigger page in kernel space and it can be accessed through standard APIs, so let's reuse it and simplify the code. Signed-off-by: Frederic Barrat --- Changelog: v2: Define rc = -ENXIO on the error path (Matt) drivers/scsi/cxlflash/ocxl_hw.c | 18

[PATCH v2 2/4] ocxl: Access interrupt trigger page from xive directly

2020-04-03 Thread Frederic Barrat
We can access the trigger page through standard APIs so let's use it and avoid saving it when allocating the interrupt. It will also allow to simplify allocation in a later patch. Reviewed-by: Cédric Le Goater Acked-by: Andrew Donnellan Reviewed-by: Greg Kurz Signed-off-by: Frederic Barrat

[PATCH v2 3/4] ocxl: Don't return trigger page when allocating an interrupt

2020-04-03 Thread Frederic Barrat
of its custom service. Reviewed-by: Cédric Le Goater Reviewed-by: Greg Kurz Signed-off-by: Frederic Barrat --- drivers/misc/ocxl/Kconfig | 2 +- drivers/misc/ocxl/afu_irq.c | 4 +--- drivers/misc/ocxl/link.c| 15 +++ drivers/scsi/cxlflash/ocxl_hw.c | 3 +-- include

[PATCH v2 4/4] ocxl: Remove custom service to allocate interrupts

2020-04-03 Thread Frederic Barrat
We now allocate interrupts through xive directly. Reviewed-by: Cédric Le Goater Reviewed-by: Greg Kurz Signed-off-by: Frederic Barrat --- arch/powerpc/include/asm/pnv-ocxl.h | 3 --- arch/powerpc/platforms/powernv/ocxl.c | 30 --- 2 files changed, 33 deletions

[PATCH 1/4] scsi: cxlflash: Access interrupt trigger page from xive directly

2020-04-02 Thread Frederic Barrat
xive is already mapping the trigger page in kernel space and it can be accessed through standard APIs, so let's reuse it and simplify the code. Signed-off-by: Frederic Barrat --- drivers/scsi/cxlflash/ocxl_hw.c | 17 +++-- drivers/scsi/cxlflash/ocxl_hw.h | 1 - 2 files changed, 7

[PATCH 2/4] ocxl: Access interrupt trigger page from xive directly

2020-04-02 Thread Frederic Barrat
We can access the trigger page through standard APIs so let's use it and avoid saving it when allocating the interrupt. It will also allow to simplify allocation in a later patch. Signed-off-by: Frederic Barrat --- drivers/misc/ocxl/afu_irq.c | 8 ++-- 1 file changed, 6 insertions(+), 2

[PATCH 4/4] ocxl: Remove custom service to allocate interrupts

2020-04-02 Thread Frederic Barrat
We now allocate interrupts through xive directly. Signed-off-by: Frederic Barrat --- arch/powerpc/include/asm/pnv-ocxl.h | 3 --- arch/powerpc/platforms/powernv/ocxl.c | 30 --- 2 files changed, 33 deletions(-) diff --git a/arch/powerpc/include/asm/pnv-ocxl.h b/arch

  1   2   3   4   5   6   7   8   >