Re: [PATCH v2] powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs

2023-05-21 Thread Alexey Kardashevskiy
Hi Gaurav, Sorry I missed this. Please share the link to the your fix, I do not see it in my mail. In general, the problem can probably be solved by using huge pages (anything more than 64K) only for 1:1 mapping. On 03/05/2023 13:25, Gaurav Batra wrote: Hello Alexey, I recently joined

Re: Probing nvme disks fails on Upstream kernels on powerpc Maxconfig

2023-04-13 Thread Alexey Kardashevskiy
On 05/04/2023 15:45, Michael Ellerman wrote: "Linux regression tracking (Thorsten Leemhuis)" writes: [CCing the regression list, as it should be in the loop for regressions: https://docs.kernel.org/admin-guide/reporting-regressions.html] On 23.03.23 10:53, Srikar Dronamraju wrote: I am

Re: [PATCH v2 0/4] Reenable VFIO support on POWER systems

2023-03-06 Thread Alexey Kardashevskiy
controller on a POWER9 Blackbird host. Alexey Kardashevskiy (3): powerpc/iommu: Add "borrowing" iommu_table_group_ops powerpc/pci_64: Init pcibios subsys a bit later powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains Timothy Pearson (1):

Re: [PATCH kernel v2 0/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-10-27 Thread Alexey Kardashevskiy
Michael, Fred, ping? On 20/09/2022 23:04, Alexey Kardashevskiy wrote: Here is another take on iommu_ops on POWER to make VFIO work again on POWERPC64. Tested on PPC, kudos to Fred! The tree with all prerequisites is here: https://github.com/aik/linux/tree/kvm-fixes-wip The previous

[PATCH kernel v2 3/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-09-20 Thread Alexey Kardashevskiy
Cc: Robin Murphy Cc: Jason Gunthorpe Cc: Alex Williamson Cc: Daniel Henrique Barboza Cc: Fabiano Rosas Cc: Murilo Opsfelder Araujo Cc: Nicholas Piggin Signed-off-by: Alexey Kardashevskiy --- Changes: v2: * replaced a default domain with blocked --- arch/powerpc/include/asm/pci-bridge.h |

[PATCH kernel v2 0/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-09-20 Thread Alexey Kardashevskiy
fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi". Please comment. Thanks. Alexey Kardashevskiy (3): powerpc/iommu: Add "borrowing" iommu_table_group_ops powerpc/pci_64: Init pcibios subsys a bit later powerpc/iommu: Add iommu_ops to report capabilities and allow

[PATCH kernel v2 1/3] powerpc/iommu: Add "borrowing" iommu_table_group_ops

2022-09-20 Thread Alexey Kardashevskiy
way. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h | 6 +- arch/powerpc/kernel/iommu.c | 98 ++- arch/powerpc/platforms/powernv/pci-ioda.c | 6 +- arch/powerpc/platforms/pseries/iommu.c| 3 + drivers/vfio/vfio_iommu_spapr_tc

[PATCH kernel v2 2/3] powerpc/pci_64: Init pcibios subsys a bit later

2022-09-20 Thread Alexey Kardashevskiy
The following patches are going to add dependency/use of iommu_ops which is initialized in subsys_initcall as well. This moves pciobios_init() to the next initcall level. This should not cause behavioral change. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kernel/pci_64.c | 2 +- 1

Re: [PATCH kernel] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE platform dependent

2022-09-13 Thread Alexey Kardashevskiy
Ping? It's been a while and probably got lost :-/ On 18/05/2022 16:27, Alexey Kardashevskiy wrote: On 5/4/22 17:48, Alexey Kardashevskiy wrote: When introduced, IRQFD resampling worked on POWER8 with XICS. However KVM on POWER9 has never implemented it - the compatibility mode code ("

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-28 Thread Alexey Kardashevskiy
On 29/07/2022 13:10, Tian, Kevin wrote: From: Oliver O'Halloran Sent: Friday, July 29, 2022 10:53 AM On Fri, Jul 29, 2022 at 12:21 PM Alexey Kardashevskiy wrote: *snip* About this. If a platform has a concept of explicit DMA windows (2 or more), is it one domain with 2 windows or 2

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-28 Thread Alexey Kardashevskiy
On 08/07/2022 17:32, Tian, Kevin wrote: From: Alexey Kardashevskiy Sent: Friday, July 8, 2022 2:35 PM On 7/8/22 15:00, Alexey Kardashevskiy wrote: On 7/8/22 01:10, Jason Gunthorpe wrote: On Thu, Jul 07, 2022 at 11:55:52PM +1000, Alexey Kardashevskiy wrote: Historically PPC64 managed

Re: [PATCH kernel 3/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-18 Thread Alexey Kardashevskiy
On 19/07/2022 04:09, Jason Gunthorpe wrote: On Thu, Jul 14, 2022 at 06:18:22PM +1000, Alexey Kardashevskiy wrote: +/* + * A simple iommu_ops to allow less cruft in generic VFIO code. + */ +static bool spapr_tce_iommu_capable(enum iommu_cap cap) +{ + switch (cap) { + case

[PATCH kernel 3/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-14 Thread Alexey Kardashevskiy
Barboza Cc: Fabiano Rosas Cc: Murilo Opsfelder Araujo Cc: Nicholas Piggin Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/pci-bridge.h | 7 + arch/powerpc/platforms/pseries/pseries.h | 5 + arch/powerpc/kernel/iommu.c | 159 +- arch/power

[PATCH kernel 2/3] powerpc/pci_64: Init pcibios subsys a bit later

2022-07-14 Thread Alexey Kardashevskiy
The following patches are going to add dependency/use of iommu_ops which is initialized in subsys_initcall as well. This moves pciobios_init() to the next initcall level. This should not cause behavioral change. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kernel/pci_64.c | 2 +- 1

[PATCH kernel 1/3] powerpc/iommu: Add "borrowing" iommu_table_group_ops

2022-07-14 Thread Alexey Kardashevskiy
way. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h | 6 +- arch/powerpc/kernel/iommu.c | 98 ++- arch/powerpc/platforms/powernv/pci-ioda.c | 6 +- arch/powerpc/platforms/pseries/iommu.c| 3 + drivers/vfio/vfio_iommu_spapr_tc

[PATCH kernel 0/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-14 Thread Alexey Kardashevskiy
-...@ozlabs.ru/ https://patchwork.ozlabs.org/project/kvm-ppc/patch/20220701061751.1955857-1-...@ozlabs.ru/ Please comment. Thanks. Alexey Kardashevskiy (3): powerpc/iommu: Add "borrowing" iommu_table_group_ops powerpc/pci_64: Init pcibios subsys a bit later powerpc/iommu: Add iommu_ops

[PATCH kernel] powerpc/iommu: Fix iommu_table_in_use for a small default DMA window case

2022-07-14 Thread Alexey Kardashevskiy
not been seen before. This fixes the bug by adding a special case for no MMIO32 reservation. Fixes: 3c33066a2190 ("powerpc/kernel/iommu: Add new iommu_table_in_use() helper") Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kernel/iommu.c | 5 + 1 file changed, 5 insertion

[PATCH kernel] powerpc/ioda/iommu/debugfs: Generate unique debugfs entries

2022-07-14 Thread Alexey Kardashevskiy
without CONFIG_IOMMU_DEBUGFS. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/pci-ioda.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index c8cf2728031a..9de9b2fb163d 100644

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-11 Thread Alexey Kardashevskiy
On 7/12/22 04:46, Jason Gunthorpe wrote: On Mon, Jul 11, 2022 at 11:24:32PM +1000, Alexey Kardashevskiy wrote: I really think that for 5.19 we should really move this blocked domain business to Type1 like this: https://github.com/aik/linux/commit/96f80c8db03b181398ad355f6f90e574c3ada4bf

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-11 Thread Alexey Kardashevskiy
On 10/07/2022 22:32, Alexey Kardashevskiy wrote: On 10/07/2022 16:29, Jason Gunthorpe wrote: On Sat, Jul 09, 2022 at 12:58:00PM +1000, Alexey Kardashevskiy wrote: driver->ops->attach_group on POWER attaches a group so VFIO claims ownership over a group, not devices. Underlyi

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-10 Thread Alexey Kardashevskiy
On 10/07/2022 16:29, Jason Gunthorpe wrote: On Sat, Jul 09, 2022 at 12:58:00PM +1000, Alexey Kardashevskiy wrote: driver->ops->attach_group on POWER attaches a group so VFIO claims ownership over a group, not devices. Underlying API (pnv_ioda2_take_ownership()) does not need to keep

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 08/07/2022 21:55, Jason Gunthorpe wrote: On Fri, Jul 08, 2022 at 04:34:55PM +1000, Alexey Kardashevskiy wrote: For now I'll add a comment in spapr_tce_iommu_attach_dev() that it is fine to do nothing as tce_iommu_take_ownership() and tce_iommu_take_ownership_ddw() take care of not having

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 08/07/2022 23:19, Jason Gunthorpe wrote: On Fri, Jul 08, 2022 at 11:10:07PM +1000, Alexey Kardashevskiy wrote: On 08/07/2022 21:55, Jason Gunthorpe wrote: On Fri, Jul 08, 2022 at 04:34:55PM +1000, Alexey Kardashevskiy wrote: For now I'll add a comment in spapr_tce_iommu_attach_dev

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 08/07/2022 21:55, Jason Gunthorpe wrote: On Fri, Jul 08, 2022 at 04:34:55PM +1000, Alexey Kardashevskiy wrote: For now I'll add a comment in spapr_tce_iommu_attach_dev() that it is fine to do nothing as tce_iommu_take_ownership() and tce_iommu_take_ownership_ddw() take care of not having

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 08/07/2022 17:32, Tian, Kevin wrote: From: Alexey Kardashevskiy Sent: Friday, July 8, 2022 2:35 PM On 7/8/22 15:00, Alexey Kardashevskiy wrote: On 7/8/22 01:10, Jason Gunthorpe wrote: On Thu, Jul 07, 2022 at 11:55:52PM +1000, Alexey Kardashevskiy wrote: Historically PPC64 managed

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 7/8/22 15:00, Alexey Kardashevskiy wrote: On 7/8/22 01:10, Jason Gunthorpe wrote: On Thu, Jul 07, 2022 at 11:55:52PM +1000, Alexey Kardashevskiy wrote: Historically PPC64 managed to avoid using iommu_ops. The VFIO driver uses a SPAPR TCE sub-driver and all iommu_ops uses were kept

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-07 Thread Alexey Kardashevskiy
On 7/8/22 01:10, Jason Gunthorpe wrote: On Thu, Jul 07, 2022 at 11:55:52PM +1000, Alexey Kardashevskiy wrote: Historically PPC64 managed to avoid using iommu_ops. The VFIO driver uses a SPAPR TCE sub-driver and all iommu_ops uses were kept in the Type1 VFIO driver. Recent development though

[PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-07 Thread Alexey Kardashevskiy
Cc: Daniel Henrique Barboza Cc: Fabiano Rosas Cc: Murilo Opsfelder Araujo Cc: Nicholas Piggin Signed-off-by: Alexey Kardashevskiy --- does it make sense to have this many callbacks, or the generic IOMMU code can safely operate without some (given I add some more checks for !NULL)? thanks, ---

[PATCH kernel] powerpc/iommu: Add simple iommu_ops to report capabilities

2022-07-05 Thread Alexey Kardashevskiy
-...@ozlabs.ru/ Fixes: e8ae0e140c05 ("vfio: Require that devices support DMA cache coherence") Fixes: 70693f470848 ("vfio: Set DMA ownership for VFIO devices") Signed-off-by: Alexey Kardashevskiy --- I have not looked into the domains for ages, what is missing here? With thi

[PATCH llvm v2] powerpc/llvm/lto: Allow LLVM LTO builds

2022-06-29 Thread Alexey Kardashevskiy
rted by LTO builds but this is not POWERPC-specific. This makes the copy routines slower on POWER6 as this partially reverts a4e22f02f5b6 ("powerpc: Update 64bit__copy_tofrom_user() using CPU_FTR_UNALIGNED_LD_STD") Signed-off-by: Alexey Kardashevskiy --- Changes: v2: * dropped FTR sect

[PATCH kernel v2] pseries/iommu/ddw: Fix kdump to work in absence of ibm,dma-window

2022-06-29 Thread Alexey Kardashevskiy
uot;powerpc/pseries/iommu: Make use of DDW for indirect mapping") Signed-off-by: Alexey Kardashevskiy --- Looks like SYSCALL(kexec_file_load) never supported DMA. so it could be: Fixes: a0458284f062 ("powerpc: Add support code for kexec_file_load()") --- Changes: v2: * reworke

[PATCH kernel] KVM: PPC: Do not warn when userspace asked for too big TCE table

2022-06-28 Thread Alexey Kardashevskiy
via ioctl() on kvmfd and the userspace can trigger WARN_ON_ONCE_GFP(order >= MAX_ORDER, gfp) in mm/page_alloc.c and flood dmesg. This adds __GFP_NOWARN. Signed-off-by: Alexey Kardashevskiy --- We could probably switch to vmalloc() to allow even bigger emulated tables which we do not really w

Re: [PATCH kernel] pseries/iommu/ddw: Fix kdump to work in absence of ibm,dma-window

2022-06-27 Thread Alexey Kardashevskiy
On 6/27/22 14:10, Russell Currey wrote: On Thu, 2022-06-16 at 17:59 +1000, Alexey Kardashevskiy wrote: The pseries platform uses 32bit default DMA window (always 4K pages) and optional 64bit DMA window available via DDW ("Dynamic DMA Windows"), 64K or 2M pages. For ages the d

[PATCH kernel] KVM: PPC: Book3s: Fix warning about xics_rm_h_xirr_x

2022-06-21 Thread Alexey Kardashevskiy
hcalls handlers") Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kvm/book3s_xics.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/book3s_xics.h b/arch/powerpc/kvm/book3s_xics.h index 8e4c79e2fcd8..08fb0843faf5 100644 --- a/arch/powerpc/kvm/book3s_xics.h +++ b/arch/power

Re: [PATCH v2 4/4] watchdog/pseries-wdt: initial support for H_WATCHDOG-based watchdog timers

2022-06-20 Thread Alexey Kardashevskiy
at device registration time. Signed-off-by: Scott Cheloha Besides the patch ordering and 0444 vs. 0644 (which is up to the PPC maintainer to decide anyway :) ), looks good to me. Reviewed-by: Alexey Kardashevskiy --- .../watchdog/watchdog-parameters.rst | 12 + driver

[PATCH kernel] pseries/iommu/ddw: Fix kdump to work in absence of ibm,dma-window

2022-06-16 Thread Alexey Kardashevskiy
ose IO pages as used) but it is bad for kexec which clears it thinking it is a smaller default window rather than a bigger DDW window. This removes the "ibm,dma-window" property from the device tree after a bigger window is created and the crash kernel setup picks it up. Signed-off-by: Alexey Ka

Re: [PATCH v1 4/4] watchdog/pseries-wdt: initial support for PAPR H_WATCHDOG timers

2022-06-01 Thread Alexey Kardashevskiy
On 6/2/22 00:48, Scott Cheloha wrote: On Wed, May 25, 2022 at 04:35:11PM +1000, Alexey Kardashevskiy wrote: On 5/21/22 04:35, Scott Cheloha wrote: PAPR v2.12 defines a new hypercall, H_WATCHDOG. The hypercall permits guest control of one or more virtual watchdog timers. The timers have

[PATCH kernel] powerpc/pseries/iommu: Print ibm,query-pe-dma-windows parameters

2022-05-31 Thread Alexey Kardashevskiy
PowerVM has a stricter policy about allocating TCEs for LPARs and often there is not enough TCEs for 1:1 mapping, this adds the supported numbers into dev_info() to help analyzing bugreports. Signed-off-by: Alexey Kardashevskiy --- A PowerVM admin can enable "enlarged IO capacity" fo

Re: [PATCH v1 4/4] watchdog/pseries-wdt: initial support for PAPR H_WATCHDOG timers

2022-05-25 Thread Alexey Kardashevskiy
ruct platform_device *pdev) +{ + struct watchdog_device *wd = platform_get_drvdata(pdev); + + if (watchdog_active(wd)) + return pseries_wdt_start(wd); + return 0; +} + +static const struct platform_device_id pseries_wdt_id[] = { + { .name = "pseries-wdt&qu

Re: [PATCH kernel] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE platform dependent

2022-05-18 Thread Alexey Kardashevskiy
On 5/4/22 17:48, Alexey Kardashevskiy wrote: When introduced, IRQFD resampling worked on POWER8 with XICS. However KVM on POWER9 has never implemented it - the compatibility mode code ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native XIVE mode does not handle I

Re: [PATCH kernel] KVM: PPC: Book3s: Remove real mode interrupt controller hcalls handlers

2022-05-10 Thread Alexey Kardashevskiy
On 5/11/22 03:58, Cédric Le Goater wrote: Hello Alexey, On 5/9/22 09:11, Alexey Kardashevskiy wrote: Currently we have 2 sets of interrupt controller hypercalls handlers for real and virtual modes, this is from POWER8 times when switching MMU on was considered an expensive operation

Re: [PATCH 2/2] powerpc/vdso: Link with ld.lld when requested

2022-05-10 Thread Alexey Kardashevskiy
, Tested-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy CC32FLAGS := -Wl,-soname=linux-vdso32.so.1 -m32 AS32FLAGS := -D__VDSO32__ -s

Re: [PATCH 1/2] powerpc/vdso: Remove unused ENTRY in linker scripts

2022-05-10 Thread Alexey Kardashevskiy
dbg Entry point address: 0x0 Remove ENTRY to remove the warning, as it is unnecessary for the vDSO to function correctly. Sounds more like a bugfix to me - _start is simply not defined, I wonder why ld is not complaining. Tested-by: Alexey Kardashevskiy Reviewed-by: Alexey K

Re: [PATCH kernel] powerpc/llvm/lto: Allow LLVM LTO builds

2022-05-09 Thread Alexey Kardashevskiy
On 5/9/22 15:18, Alexey Kardashevskiy wrote: On 5/4/22 07:21, Nick Desaulniers wrote: On Thu, Apr 28, 2022 at 11:46 PM Alexey Kardashevskiy wrote: This enables LTO_CLANG builds on POWER with the upstream version of LLVM. LTO optimizes the output vmlinux binary and this may affect

[PATCH kernel] KVM: PPC: Book3s: Remove real mode interrupt controller hcalls handlers

2022-05-09 Thread Alexey Kardashevskiy
. The default implemented hcalls list already contains XICS hcalls so no change there. This should not cause any behavioral change. Signed-off-by: Alexey Kardashevskiy --- Minus 153 lines nevertheless. --- arch/powerpc/kvm/Makefile | 2 +- arch/powerpc/include/asm/kvm_ppc.h

Re: [PATCH kernel] powerpc/llvm/lto: Allow LLVM LTO builds

2022-05-08 Thread Alexey Kardashevskiy
On 5/4/22 07:21, Nick Desaulniers wrote: On Thu, Apr 28, 2022 at 11:46 PM Alexey Kardashevskiy wrote: This enables LTO_CLANG builds on POWER with the upstream version of LLVM. LTO optimizes the output vmlinux binary and this may affect the FTP alternative section if alt branches use &qu

[PATCH kernel] KVM: PPC: Book3s: PR: Enable default TCE hypercalls

2022-05-06 Thread Alexey Kardashevskiy
the checks in ifdef CONFIG_SPAPR_TCE_IOMMU just like HV KVM. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kvm/book3s_pr_papr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kvm/book3s_pr_papr.c b/arch/powerpc/kvm/book3s_pr_papr.c index dc4f51ac84bc..a1f2978b2a86

[PATCH kernel v2] KVM: PPC: Book3s: Retire H_PUT_TCE/etc real mode handlers

2022-05-05 Thread Alexey Kardashevskiy
from KVM and related code from the powernv platform. This updates the list of implemented hcalls in KVM-HV as the realmode handlers are removed. This changes ABI - kvmppc_h_get_tce() moves to the KVM module and kvmppc_find_table() is static now. Signed-off-by: Alexey Kardashevskiy --- Changes: v2

Re: [PATCH kernel] powerpc/llvm/lto: Allow LLVM LTO builds

2022-05-04 Thread Alexey Kardashevskiy
On 04/05/2022 17:11, Alexey Kardashevskiy wrote: On 5/4/22 07:21, Nick Desaulniers wrote: On Thu, Apr 28, 2022 at 11:46 PM Alexey Kardashevskiy wrote: This enables LTO_CLANG builds on POWER with the upstream version of LLVM. LTO optimizes the output vmlinux binary and this may affect

[PATCH kernel] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE platform dependent

2022-05-04 Thread Alexey Kardashevskiy
ty support advertising to platforms and stops advertising it on XIVE, i.e. POWER9 and later. Signed-off-by: Alexey Kardashevskiy --- Or I could move this one together with KVM_CAP_IRQFD. Thoughts? --- arch/arm64/kvm/arm.c | 3 +++ arch/mips/kvm/mips.c | 3 +++ arch/powerpc/kvm/pow

Re: [PATCH kernel] powerpc/llvm/lto: Allow LLVM LTO builds

2022-05-04 Thread Alexey Kardashevskiy
On 5/4/22 07:21, Nick Desaulniers wrote: On Thu, Apr 28, 2022 at 11:46 PM Alexey Kardashevskiy wrote: This enables LTO_CLANG builds on POWER with the upstream version of LLVM. LTO optimizes the output vmlinux binary and this may affect the FTP alternative section if alt branches use &qu

Re: [PATCH kernel] powerpc/llvm/lto: Allow LLVM LTO builds

2022-05-03 Thread Alexey Kardashevskiy
On 5/4/22 07:24, Nick Desaulniers wrote: On Thu, Apr 28, 2022 at 11:46 PM Alexey Kardashevskiy wrote: diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index b66dd6f775a4..5b783bd51260 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch

[PATCH kernel] powerpc/llvm/lto: Allow LLVM LTO builds

2022-04-29 Thread Alexey Kardashevskiy
rted by LTO builds but this is not POWERPC-specific. Signed-off-by: Alexey Kardashevskiy --- Note 1: This is further development of https://lore.kernel.org/all/20220211023125.1790960-1-...@ozlabs.ru/T/ Note 2: CONFIG_ZSTD_COMPRESS and CONFIG_ZSTD_DECOMPRESS must be both "m" or "y&quo

[PATCH kernel] KVM: PPC: Book3s: Retire H_PUT_TCE/etc real mode handlers

2022-04-28 Thread Alexey Kardashevskiy
from KVM and related code from the powernv platform. This changes ABI - kvmppc_h_get_tce() moves to the KVM module and kvmppc_find_table() is static now. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kvm/Makefile | 3 - arch/powerpc/include/asm/iommu.h

[PATCH kernel] powerpc/perf: Fix 32bit compile

2022-04-20 Thread Alexey Kardashevskiy
The "read_bhrb" global symbol is only called under CONFIG_PPC64 of arch/powerpc/perf/core-book3s.c but it is compiled for both 32 and 64 bit anyway (and LLVM fails to link this on 32bit). This fixes it by moving bhrb.o to obj64 targets. Signed-off-by: Alexey Kardashevskiy --- arch/po

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

2022-04-19 Thread Alexey Kardashevskiy
("KVM: PPC: Book3S: Allow backing bigger guest IOMMU pages with smaller physical pages") Reviewed-by: Frederic Barrat Reviewed-by: David Gibson Tested-by: David Gibson Signed-off-by: Alexey Kardashevskiy --- Changes: v2: * reworded the first paragraph of the commit log --- arch

[PATCH kernel v3] powerpc/boot: Stop using RELACOUNT

2022-04-06 Thread Alexey Kardashevskiy
ect/commit/da0e5b885b25cf4 Signed-off-by: Alexey Kardashevskiy --- Changes: v3: * s/divd/divdu/ for ppc64 v2: * s/divd/divwu/ for ppc32 * updated the commit log * named all new labels instead of numbering them (s/101f/.Lcheck_for_relaent/ and so on) --- arch/powerpc/boot/c

Re: [PATCH kernel v2] powerpc/boot: Stop using RELACOUNT

2022-04-06 Thread Alexey Kardashevskiy
On 4/6/22 14:58, Gabriel Paubert wrote: On Wed, Apr 06, 2022 at 02:01:48PM +1000, Alexey Kardashevskiy wrote: So far the RELACOUNT tag from the ELF header was containing the exact number of R_PPC_RELATIVE/R_PPC64_RELATIVE relocations. However the LLVM's recent change [1] make it equal

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

2022-04-05 Thread Alexey Kardashevskiy
by 64K hardware pages so it is one write to the "TCE Kill" per 256 updates which is not that bad considering the size of the cache (1024 TCEs or so). Fixes: ca1fc489cfa0 ("KVM: PPC: Book3S: Allow backing bigger guest IOMMU pages with smaller physical pages") Signed-off-by: Alexe

[PATCH kernel v2] powerpc/boot: Stop using RELACOUNT

2022-04-05 Thread Alexey Kardashevskiy
ect/commit/da0e5b885b25cf4 Signed-off-by: Alexey Kardashevskiy --- Changes: v2: * s/divd/divwu/ for ppc32 * updated the commit log * named all new labels instead of numbering them (s/101f/.Lcheck_for_relaent/ and so on) --- arch/powerpc/boot/crt0.S | 45 ++-- 1 file c

Re: [PATCH kernel] powerpc/boot: Stop using RELACOUNT

2022-03-22 Thread Alexey Kardashevskiy
On 3/22/22 13:12, Michael Ellerman wrote: Alexey Kardashevskiy writes: So far the RELACOUNT tag from the ELF header was containing the exact number of R_PPC_RELATIVE/R_PPC64_RELATIVE relocations. However the LLVM's recent change [1] make it equal-or-less than the actual number which makes

[PATCH kernel] powerpc/boot: Stop using RELACOUNT

2022-03-21 Thread Alexey Kardashevskiy
those in arch-specific zImage. [1] https://github.com/llvm/llvm-project/commit/da0e5b885b25cf4 [2] https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=next=d799769188529a Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/boot/crt0.S | 43

Re: [PATCH] powerpc: Replace ppc64 DT_RELACOUNT usage with DT_RELASZ/24

2022-03-10 Thread Alexey Kardashevskiy
On 3/11/22 15:15, Michael Ellerman wrote: Fāng-ruì Sòng writes: On Thu, Mar 10, 2022 at 11:48 AM Nick Desaulniers wrote: On Tue, Mar 8, 2022 at 9:53 PM Fangrui Song wrote: DT_RELACOUNT is an ELF dynamic tag inherited from SunOS indicating the number of R_*_RELATIVE relocations. It is

[PATCH kernel v4] powerpc/64: Add UADDR64 relocation support

2022-03-08 Thread Alexey Kardashevskiy
support for UADDR64 for 64bit. This reuses __dynamic_symtab from the 32bit which supports more relocation types already. Because RELACOUNT includes only R_PPC64_RELATIVE, this replaces it with RELASZ which is the size of all relocation records. Signed-off-by: Alexey Kardashevskiy --- Changes: v4: * fixe

[PATCH kernel v3] powerpc/64: Add UADDR64 relocation support

2022-02-24 Thread Alexey Kardashevskiy
support for UADDR64 for 64bit. This reuses __dynamic_symtab from the 32bit which supports more relocation types already. Because RELACOUNT includes only R_PPC64_RELATIVE, this replaces it with RELASZ which is the size of all relocation records. Signed-off-by: Alexey Kardashevskiy --- Changes: v3: * nam

Re: [PATCH kernel 2/3] powerpc/llvm: Sample config for LLVM LTO

2022-02-15 Thread Alexey Kardashevskiy
On 2/12/22 11:05, Nick Desaulniers wrote: On Thu, Feb 10, 2022 at 6:31 PM Alexey Kardashevskiy wrote: The config is a copy of ppc64_defconfig with a few tweaks. This could be a smaller config to merge into ppc64_defconfig but unfortunately merger does not allow disabling already enabled

[PATCH kernel 3/3] powerpc/llvm/lto: Workaround conditional branches in FTR_SECTION_ELSE

2022-02-10 Thread Alexey Kardashevskiy
0: 00 00 82 40 bc 4,eq,30 <__ftr_alt_97+0x30> f0: 00 00 82 40 bc 4,eq,f0 <__ftr_alt_97+0xf0> The change in copyuser_64.S is needed even when building default configs, the other two changes are needed if the kernel config grows. Signed-off-by: Alexey Kardashe

[PATCH kernel 2/3] powerpc/llvm: Sample config for LLVM LTO

2022-02-10 Thread Alexey Kardashevskiy
ions (like DYNAMIC_FTRACE/FUNCTION_TRACER), this converts FTRACE_MCOUNT_USE_RECORDMCOUNT from def_bool to bool. Note that even with this config there is a good chance that LTO is going to fail linking vmlinux because of the "bc" problem. Signed-off-by: Alexey Kardashevskiy --- a

[PATCH kernel 1/3] powerpc/64: Allow LLVM LTO builds

2022-02-10 Thread Alexey Kardashevskiy
The upstream LLVM supports now LTO on PPC, enable it. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index b779603978e1..91c14f83 100644 --- a/arch/powerpc/Kconfig +++ b/arch

[PATCH kernel 0/3] powerpc/llvm/lto: Enable CONFIG_LTO_CLANG_THIN=y

2022-02-10 Thread Alexey Kardashevskiy
This is based on sha1 1b43a74f255c Michael Ellerman "Automatic merge of 'master' into merge (2022-02-01 10:41)". Please comment. Thanks. Alexey Kardashevskiy (3): powerpc/64: Allow LLVM LTO builds powerpc/llvm: Sample config for LLVM LTO powerpc/llvm/lto: Workaround c

[PATCH kernel v2] powerpc/64: Add UADDR64 relocation support

2022-02-03 Thread Alexey Kardashevskiy
support for UADDR64 for 64bit. This reuses __dynamic_symtab from the 32bit which supports more relocation types already. Because RELACOUNT includes only R_PPC64_RELATIVE, this replaces it with RELASZ which is the size of all relocation records. Signed-off-by: Alexey Kardashevskiy --- Changes: v2: *

Re: [PATCH 2/2] KVM: selftests: Add support for ppc64le

2022-01-31 Thread Alexey Kardashevskiy
ks good and works well and we have another test for instruction emilation on top of this which highlighted a bug so this is useful stuff. Reviewed-by: Alexey Kardashevskiy + */ + +#define _GNU_SOURCE +//#define DEBUG + +#include "kvm_util.h" +#include "../kvm_util_internal.h"

Re: [PATCH kernel] powerpc/64: Add UADDR64 relocation support

2022-01-31 Thread Alexey Kardashevskiy
On 1/31/22 17:38, Christophe Leroy wrote: Le 31/01/2022 à 05:14, Alexey Kardashevskiy a écrit : When ld detects unaligned relocations, it emits R_PPC64_UADDR64 relocations instead of R_PPC64_RELATIVE. Currently R_PPC64_UADDR64 are detected by arch/powerpc/tools/relocs_check.sh and expected

[PATCH kernel] powerpc/64: Add UADDR64 relocation support

2022-01-30 Thread Alexey Kardashevskiy
for the number of relocations as the DT_RELACOUNT ELF Dynamic Array Tag does not include relocations other than R_PPC64_RELATIVE. This instead iterates over the entire .rela.dyn section. Signed-off-by: Alexey Kardashevskiy --- Tested via qemu gdb stub (the kernel is loaded at 0x4

[PATCH kernel v5] KVM: PPC: Merge powerpc's debugfs entry content into generic entry

2022-01-10 Thread Alexey Kardashevskiy
s directories"). Suggested-by: Fabiano Rosas Signed-off-by: Alexey Kardashevskiy --- Changes: v5: * fixed e500mc2 v4: * added "kvm-xive-%p" v3: * reworked commit log, especially, the bit about removing vcpus v2: * handled powerpc-booke * s/kvm/vm/ in arch hooks --- arch/powerp

Re: [PATCH v3 5/6] KVM: PPC: mmio: Return to guest after emulation failure

2022-01-10 Thread Alexey Kardashevskiy
gned-off-by: Fabiano Rosas Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/kvm/powerpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 6daeea4a7de1..56b0faab7a5f 100644 --- a/arch/powerpc/kvm/powerpc.c ++

Re: [PATCH v3 4/6] KVM: PPC: mmio: Queue interrupt at kvmppc_emulate_mmio

2022-01-09 Thread Alexey Kardashevskiy
of responsibilities. Signed-off-by: Fabiano Rosas Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/kvm/emulate_loadstore.c | 8 +--- arch/powerpc/kvm/powerpc.c | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kvm/emulate_loadstore.c b/arch

Re: [PATCH v2 6/7] KVM: PPC: mmio: Return to guest after emulation failure

2022-01-06 Thread Alexey Kardashevskiy
and later the commit d69614a295ae ("KVM: PPC: Separate loadstore emulation from priv emulation") added the Program interrupt injection but in another file, so I'm assuming it was missed that this block needed to be altered. Signed-off-by: Fabiano Rosas Looks right. Reviewed-by:

Re: [PATCH v2 3/7] KVM: PPC: Fix mmio length message

2022-01-06 Thread Alexey Kardashevskiy
On 07/01/2022 07:03, Fabiano Rosas wrote: We check against 'bytes' but print 'run->mmio.len' which at that point has an old value. e.g. 16-byte load: before: __kvmppc_handle_load: bad MMIO length: 8 now: __kvmppc_handle_load: bad MMIO length: 16 Signed-off-by: Fabiano Rosas ---

Re: [PATCH 2/3] KVM: PPC: Fix vmx/vsx mixup in mmio emulation

2022-01-04 Thread Alexey Kardashevskiy
On 28/12/2021 04:28, Fabiano Rosas wrote: Nicholas Piggin writes: Excerpts from Fabiano Rosas's message of December 24, 2021 7:15 am: The MMIO emulation code for vector instructions is duplicated between VSX and VMX. When emulating VMX we should check the VMX copy size instead of the VSX

[PATCH llvm 6/6] powerpc/mm/book3s64/hash: Switch pre 2.06 tlbiel to .long

2021-12-20 Thread Alexey Kardashevskiy
The llvm integrated assembler does not recognise the ISA 2.05 tlbiel version. Work around it by switching to .long when an old arch level detected. Signed-off-by: Daniel Axtens [aik: did "Eventually do this more smartly"] Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/inclu

[PATCH llvm 5/6] powerpc/mm: Switch obsolete dssall to .long

2021-12-20 Thread Alexey Kardashevskiy
The dssall ("Data Stream Stop All") instruction is obsolete altogether with other Data Cache Instructions since ISA 2.03 (year 2006). LLVM IAS does not support it but PPC970 seems to be using it. This switches dssall to .long as there is no much point in fixing LLVM. Signed-off-

[PATCH llvm 4/6] powerpc/64/asm: Do not reassign labels

2021-12-20 Thread Alexey Kardashevskiy
' {.head.text.real_vectors section} make[3]: *** [/home/aik/p/kernels-llvm/llvm/scripts/Makefile.build:388: arch/powerpc/kernel/head_64.o] Error 1 Signed-off-by: Daniel Axtens Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/head-64.h | 12 +-- arch/powerpc/kernel/exceptions-64s.S

[PATCH llvm 3/6] powerpc/64/asm: Inline BRANCH_TO_C000

2021-12-20 Thread Alexey Kardashevskiy
It is used just once and does not really help with readability, remove it. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kernel/exceptions-64s.S | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc

[PATCH llvm 2/6] powerpc: check for support for -Wa,-m{power4,any}

2021-12-20 Thread Alexey Kardashevskiy
From: Daniel Axtens LLVM's integrated assembler does not like either -Wa,-mpower4 or -Wa,-many. So just don't pass them if they're not supported. Signed-off-by: Daniel Axtens Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH llvm 1/6] powerpc/toc: PowerPC64 future proof kernel toc, revised for lld

2021-12-20 Thread Alexey Kardashevskiy
4 check] [aik: because of llvm-as, kernel_toc_addr() uses "mr" instead of global register variable] Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/Makefile | 5 +++-- arch/powerpc/include/asm/sections.h | 14 +++--- arch/powerpc/boot/crt0.S|

[PATCH kernel 0/6] powerpc: Build with LLVM_IAS=1

2021-12-20 Thread Alexey Kardashevskiy
owerpc/toc: PowerPC64 future proof kernel toc, revised for lld Alexey Kardashevskiy (3): powerpc/64/asm: Inline BRANCH_TO_C000 powerpc/mm: Switch obsolete dssall to .long powerpc/mm/book3s64/hash: Switch pre 2.06 tlbiel to .long Daniel Axtens (2): powerpc: check for support for -Wa,-m{power4,any}

Re: [PATCH kernel v4] KVM: PPC: Merge powerpc's debugfs entry content into generic entry

2021-12-20 Thread Alexey Kardashevskiy
On 12/20/21 18:29, Cédric Le Goater wrote: > On 12/20/21 02:23, Alexey Kardashevskiy wrote: >> At the moment KVM on PPC creates 4 types of entries under the kvm debugfs: >> 1) "%pid-%fd" per a KVM instance (for all platforms); >> 2) "vm%pid" (for PPC

[PATCH kernel v4] KVM: PPC: Merge powerpc's debugfs entry content into generic entry

2021-12-19 Thread Alexey Kardashevskiy
s directories"). Suggested-by: Fabiano Rosas Signed-off-by: Alexey Kardashevskiy --- Changes: v4: * added "kvm-xive-%p" v3: * reworked commit log, especially, the bit about removing vcpus v2: * handled powerpc-booke * s/kvm/vm/ in arch hooks --- arch/powerpc/include/asm/kvm_host.

Re: [PATCH kernel v3] KVM: PPC: Merge powerpc's debugfs entry content into generic entry

2021-12-16 Thread Alexey Kardashevskiy
On 12/16/21 05:11, Cédric Le Goater wrote: > On 12/15/21 02:33, Alexey Kardashevskiy wrote: >> At the moment KVM on PPC creates 3 types of entries under the kvm debugfs: >> 1) "%pid-%fd" per a KVM instance (for all platforms); >> 2) "vm%pid" (for PPC

[PATCH kernel v3] KVM: PPC: Merge powerpc's debugfs entry content into generic entry

2021-12-14 Thread Alexey Kardashevskiy
cts. This stops removing vcpu entries as once created vcpus stay around for the entire life of a VM and removed when the KVM instance is closed, see commit d56f5136b010 ("KVM: let kvm_destroy_vm_debugfs clean up vCPU debugfs directories"). Suggested-by: Fabiano Rosas Signed-off-b

[PATCH kernel 3/3] powerpc/pseries/ddw: Do not try direct mapping with persistent memory and one window

2021-11-07 Thread Alexey Kardashevskiy
huge DMA window for persistent memory") to return the actual amount RAM in ddw_memory_hotplug_max() (posted separately). Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/pseries/iommu.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc

[PATCH kernel 2/3] powerpc/pseries/ddw: simplify enable_ddw()

2021-11-07 Thread Alexey Kardashevskiy
This drops rather useless ddw_enabled flag as direct_mapping implies it anyway. While at this, fix indents in enable_ddw(). This should not cause any behavioral change. Signed-off-by: Alexey Kardashevskiy --- This replaces "powerpc/pseries/iommu: Fix indentations" --- arch/powerpc

[PATCH kernel 1/3] powerpc/pseries/ddw: Revert "Extend upper limit for huge DMA window for persistent memory"

2021-11-07 Thread Alexey Kardashevskiy
This reverts commit 54fc3c681ded9437e4548e2501dc1136b23cfa9a which does not allow 1:1 mapping even for the system RAM which is usually possible. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/pseries/iommu.c | 9 - 1 file changed, 9 deletions(-) diff --git a/arch

[PATCH kernel 0/3] powerpc/pseries/ddw: Fixes for persistent memory case

2021-11-07 Thread Alexey Kardashevskiy
This is based on sha1 f855455dee0b Michael Ellerman "Automatic merge of 'next' into merge (2021-11-05 22:19)". Please comment. Thanks. Alexey Kardashevskiy (3): powerpc/pseries/ddw: Revert "Extend upper limit for huge DMA window for persistent memory" powerpc/p

Re: [PATCH] powerpc: Enhance pmem DMA bypass handling

2021-10-28 Thread Alexey Kardashevskiy
On 28/10/2021 08:30, Brian King wrote: On 10/26/21 12:39 AM, Alexey Kardashevskiy wrote: On 10/26/21 01:40, Brian King wrote: On 10/23/21 7:18 AM, Alexey Kardashevskiy wrote: On 23/10/2021 07:18, Brian King wrote: On 10/22/21 7:24 AM, Alexey Kardashevskiy wrote: On 22/10/2021 04:44

Re: [PATCH] powerpc: Enhance pmem DMA bypass handling

2021-10-25 Thread Alexey Kardashevskiy
On 10/26/21 01:40, Brian King wrote: > On 10/23/21 7:18 AM, Alexey Kardashevskiy wrote: >> >> >> On 23/10/2021 07:18, Brian King wrote: >>> On 10/22/21 7:24 AM, Alexey Kardashevskiy wrote: >>>> >>>> >>>> On 22/10/2021 04:44,

Re: [PATCH] powerpc: Enhance pmem DMA bypass handling

2021-10-23 Thread Alexey Kardashevskiy
On 23/10/2021 07:18, Brian King wrote: On 10/22/21 7:24 AM, Alexey Kardashevskiy wrote: On 22/10/2021 04:44, Brian King wrote: If ibm,pmemory is installed in the system, it can appear anywhere in the address space. This patch enhances how we handle DMA for devices when ibm,pmemory

Re: [PATCH] powerpc: Enhance pmem DMA bypass handling

2021-10-22 Thread Alexey Kardashevskiy
On 22/10/2021 04:44, Brian King wrote: If ibm,pmemory is installed in the system, it can appear anywhere in the address space. This patch enhances how we handle DMA for devices when ibm,pmemory is present. In the case where we have enough DMA space to direct map all of RAM, but not

[PATCH kernel 4/4] powerpc/pseries/iommu: Create huge DMA window if no MMIO32 is present

2021-10-20 Thread Alexey Kardashevskiy
and initializes the table with zero range if no MMIO32 is detected. Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/pseries/iommu.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletion

  1   2   3   4   5   6   7   8   9   10   >