Re: [PATCH] PCI: Move pci_dev_is/assign_added() to pci.h

2021-07-20 Thread Niklas Schnelle
On Tue, 2021-07-20 at 10:34 +0200, Niklas Schnelle wrote: > On Mon, 2021-07-19 at 14:11 +0200, Niklas Schnelle wrote: > > The helper function pci_dev_is_added() from drivers/pci/pci.h is used in > > PCI arch code of both s390 and powerpc leading to awkward relative > > includes. Move it to the

[PATCH v2] PCI: Move pci_dev_is/assign_added() to pci.h

2021-07-20 Thread Niklas Schnelle
The helper function pci_dev_is_added() from drivers/pci/pci.h is used in PCI arch code of both s390 and powerpc leading to awkward relative includes. Move it to the global include/linux/pci.h and get rid of these includes just for that one function. Signed-off-by: Niklas Schnelle --- Since v1: -

Re: [PATCH] PCI: Move pci_dev_is/assign_added() to pci.h

2021-07-20 Thread Niklas Schnelle
On Mon, 2021-07-19 at 14:11 +0200, Niklas Schnelle wrote: > The helper function pci_dev_is_added() from drivers/pci/pci.h is used in > PCI arch code of both s390 and powerpc leading to awkward relative > includes. Move it to the global include/linux/pci.h and get rid of these > includes just for

Re: [PATCH] powerpc: use IRQF_NO_DEBUG for IPIs

2021-07-20 Thread Thomas Gleixner
On Mon, Jul 19 2021 at 15:06, Cédric Le Goater wrote: > There is no need to use the lockup detector ("noirqdebug") for IPIs. > The ipistorm benchmark measures a ~10% improvement on high systems > when this flag is set. > > Cc: Thomas Gleixner > Signed-off-by: Cédric Le Goater Reviewed-by:

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

2021-07-20 Thread Alexey Kardashevskiy
On 20/07/2021 15:38, Leonardo Brás wrote: Hello Fred, thanks for this feedback! Sorry if I miss anything, this snippet was written for v1 over an year ago, and I have not taken a look at it ever since. On Mon, 2021-07-19 at 15:53 +0200, Frederic Barrat wrote: On 16/07/2021 10:27,

Re: [PATCH 0/2] Fix arm64 boot regression in 5.14

2021-07-20 Thread Marc Zyngier
On 2021-07-20 13:35, Will Deacon wrote: Hi folks, Jonathan reports [1] that commit c742199a014d ("mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge") breaks the boot on arm64 when huge mappings are used to map the kernel linear map but the VA size is configured such that PUDs are folded.

Re: [PATCH 0/2] Fix arm64 boot regression in 5.14

2021-07-20 Thread Ard Biesheuvel
On Tue, 20 Jul 2021 at 14:35, Will Deacon wrote: > > Hi folks, > > Jonathan reports [1] that commit c742199a014d ("mm/pgtable: add stubs > for {pmd/pub}_{set/clear}_huge") breaks the boot on arm64 when huge > mappings are used to map the kernel linear map but the VA size is > configured such that

Re: [PATCH v2] PCI: Move pci_dev_is/assign_added() to pci.h

2021-07-20 Thread kernel test robot
Hi Niklas, I love your patch! Yet something to improve: [auto build test ERROR on pci/next] [also build test ERROR on powerpc/next s390/features pm/linux-next v5.14-rc2 next-20210720] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest

[PATCH 0/2] KVM: PPC: Book3S HV: XIVE: Improve guest entries and exits

2021-07-20 Thread Cédric Le Goater
The XIVE interrupt controller on P10 can automatically save and restore the state of the interrupt registers under the internal NVP structure representing the VCPU. This saves a costly store/load in guest entries and exits. Thanks, C. Cédric Le Goater (2): KVM: PPC: Book3S HV: XIVE: Add a

Re: [PATCH v2] PCI: Move pci_dev_is/assign_added() to pci.h

2021-07-20 Thread Niklas Schnelle
On Tue, 2021-07-20 at 11:58 +0200, Niklas Schnelle wrote: > The helper function pci_dev_is_added() from drivers/pci/pci.h is used in > PCI arch code of both s390 and powerpc leading to awkward relative > includes. Move it to the global include/linux/pci.h and get rid of these > includes just for

Re: [PATCH v6 1/1] powerpc/pseries: Interface to represent PAPR firmware attributes

2021-07-20 Thread Pratik Sampat
On 20/07/21 7:02 pm, kajoljain wrote: On 7/20/21 11:04 AM, Pratik R. Sampat wrote: Adds a generic interface to represent the energy and frequency related PAPR attributes on the system using the new H_CALL "H_GET_ENERGY_SCALE_INFO". H_GET_EM_PARMS H_CALL was previously responsible for

[PATCH 0/2] Fix arm64 boot regression in 5.14

2021-07-20 Thread Will Deacon
Hi folks, Jonathan reports [1] that commit c742199a014d ("mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge") breaks the boot on arm64 when huge mappings are used to map the kernel linear map but the VA size is configured such that PUDs are folded. This is because the non-functional

Re: [PATCH v6 1/1] powerpc/pseries: Interface to represent PAPR firmware attributes

2021-07-20 Thread kajoljain
On 7/20/21 11:04 AM, Pratik R. Sampat wrote: > Adds a generic interface to represent the energy and frequency related > PAPR attributes on the system using the new H_CALL > "H_GET_ENERGY_SCALE_INFO". > > H_GET_EM_PARMS H_CALL was previously responsible for exporting this > information in the

[PATCH 2/2] Revert "mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge"

2021-07-20 Thread Will Deacon
From: Jonathan Marek This reverts commit c742199a014de23ee92055c2473d91fe5561ffdf. c742199a014d ("mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge") breaks arm64 in at least two ways for configurations where PUD or PMD folding occur: 1. We no longer install huge-vmap mappings and

[PATCH 1/2] Revert "powerpc/8xx: add support for huge pages on VMAP and VMALLOC"

2021-07-20 Thread Will Deacon
This reverts commit a6a8f7c4aa7eb50304b5c4e68eccd24313f3a785. Commit c742199a014d ("mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge") breaks the boot for arm64 when block mappings are used to create the linear map, as this relies on a working implementation of pXd_set_huge() even if the

[PATCH 2/2] KVM: PPC: Book3S HV: XIVE: Add support for automatic save-restore

2021-07-20 Thread Cédric Le Goater
On P10, the feature doing an automatic "save & restore" of a VCPU interrupt context is set by default in OPAL. When a VP context is pulled out, the state of the interrupt registers are saved by the XIVE interrupt controller under the internal NVP structure representing the VP. This saves a costly

[PATCH 1/2] KVM: PPC: Book3S HV: XIVE: Add a 'flags' field

2021-07-20 Thread Cédric Le Goater
Use it to hold platform specific features. P9 DD2 introduced single-escalation support. P10 will add others. Signed-off-by: Cédric Le Goater --- arch/powerpc/kvm/book3s_xive.h| 9 - arch/powerpc/kvm/book3s_xive.c| 19 ++-

[PATCH] powerpc/64s/perf: Always use SIAR for kernel interrupts

2021-07-20 Thread Nicholas Piggin
If an interrupt is taken in kernel mode, always use SIAR for it rather than looking at regs_sipr. This prevents samples piling up around interrupt enable (hard enable or interrupt replay via soft enable) in PMUs / modes where the PR sample indication is not in synch with SIAR. This results in

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 09/11] powerpc/pseries/iommu: Find existing DDW with given property name

2021-07-20 Thread Frederic Barrat
On 16/07/2021 10:27, Leonardo Bras wrote: At the moment pseries stores information about created directly mapped DDW window in DIRECT64_PROPNAME. With the objective of implementing indirect DMA mapping with DDW, it's necessary to have another propriety name to make sure kexec'ing into older

Re: [PATCH 1/2] Revert "powerpc/8xx: add support for huge pages on VMAP and VMALLOC"

2021-07-20 Thread Christophe Leroy
Will Deacon a écrit : This reverts commit a6a8f7c4aa7eb50304b5c4e68eccd24313f3a785. Commit c742199a014d ("mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge") breaks the boot for arm64 when block mappings are used to create the linear map, as this relies on a working implementation of

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

2021-07-20 Thread Frederic Barrat
On 16/07/2021 10:27, Leonardo Bras wrote: Add a new helper _iommu_table_setparms(), and use it in iommu_table_setparms() and iommu_table_setparms_lpar() to avoid duplicated code. Also, setting tbl->it_ops was happening outsite iommu_table_setparms*(), so move it to the new helper. Since we

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:

[PATCH v3] PCI: Move pci_dev_is/assign_added() to pci.h

2021-07-20 Thread Niklas Schnelle
The helper function pci_dev_is_added() from drivers/pci/pci.h is used in PCI arch code of both s390 and powerpc leading to awkward relative includes. Move it to the global include/linux/pci.h and get rid of these includes just for that one function. Signed-off-by: Niklas Schnelle --- Since v1

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

2021-07-20 Thread Frederic Barrat
On 16/07/2021 10:27, Leonardo Bras wrote: enable_ddw() currently returns the address of the DMA window, which is considered invalid if has the value 0x00. Also, it only considers valid an address returned from find_existing_ddw if it's not 0x00. Changing this behavior makes sense, given the

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

2021-07-20 Thread Frederic Barrat
On 16/07/2021 10:27, Leonardo Bras wrote: A previous change introduced the usage of DDW as a bigger indirect DMA mapping when the DDW available size does not map the whole partition. As most of the code that manipulates direct mappings was reused for indirect mappings, it's necessary to

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 0/2] Fix arm64 boot regression in 5.14

2021-07-20 Thread Christophe Leroy
Will Deacon a écrit : Hi folks, Jonathan reports [1] that commit c742199a014d ("mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge") breaks the boot on arm64 when huge mappings are used to map the kernel linear map but the VA size is configured such that PUDs are folded. This is because the

[Bug 213803] New: G5 kernel build (v5.14-rc2) fails at linking stage - ld: arch/powerpc/mm/pgtable.o: in function `.__ptep_set_access_flags': /usr/src/linux-stable/./arch/powerpc/include/asm/book3s/64

2021-07-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=213803 Bug ID: 213803 Summary: G5 kernel build (v5.14-rc2) fails at linking stage - ld: arch/powerpc/mm/pgtable.o: in function `.__ptep_set_access_flags':

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

2021-07-20 Thread Alexey Kardashevskiy
On 21/07/2021 04:12, Frederic Barrat wrote: 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

Re: [PATCH v4 5/5] bus: Make remove callback return void

2021-07-20 Thread Wolfram Sang
On Tue, Jul 13, 2021 at 09:35:22PM +0200, Uwe Kleine-König wrote: > The driver core ignores the return value of this callback because there > is only little it can do when a device disappears. > > This is the final bit of a long lasting cleanup quest where several > buses were converted to also

[PATCH V4 1/1] powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC

2021-07-20 Thread Athira Rajeev
Running perf fuzzer showed below in dmesg logs: "Can't find PMC that caused IRQ" This means a PMU exception happened, but none of the PMC's (Performance Monitor Counter) were found to be overflown. There are some corner cases that clears the PMCs after PMI gets masked. In such cases, the perf

[PATCH V4 0/1] powerpc/perf: Clear pending PMI in ppmu callbacks

2021-07-20 Thread Athira Rajeev
Running perf fuzzer testsuite popped up below messages in the dmesg logs: "Can't find PMC that caused IRQ" This means a PMU exception happened, but none of the PMC's (Performance Monitor Counter) were found to be overflown. Perf interrupt handler checks the PMC's to see which PMC has overflown

[RFC v2 1/2] ppc/fpu: Add generic FPU api similar to x86

2021-07-20 Thread Anson Jacob
- Add kernel_fpu_begin & kernel_fpu_end API as x86 - Add logic similar to x86 to ensure fpu begin/end call correctness - Add kernel_fpu_enabled to know if FPU is enabled v2: - Added asm/fpu/api.h powerpc variant with kernel_fpu_begin/end() and kernel_fpu_enabled() declarations - Updated

[RFC v2 2/2] drm/amd/display: Use PPC FPU functions

2021-07-20 Thread Anson Jacob
Use kernel_fpu_begin & kernel_fpu_end for PPC Depends on "ppc/fpu: Add generic FPU api similar to x86" v2: - Got rid of macro switch for PPC as header file with same name as x86 is added by previous patch in the series Signed-off-by: Anson Jacob CC: Christoph Hellwig CC: Rodrigo Siqueira

[RFC v2 0/2] PPC: Add generic FPU api similar to x86

2021-07-20 Thread Anson Jacob
This is an attempt to have generic FPU enable/disable calls similar to x86. So that we can simplify gpu/drm/amd/display/dc/os_types.h Also adds FPU correctness logic seen in x86. v2: - Added asm/fpu/api.h powerpc variant with kernel_fpu_begin/end() and kernel_fpu_enabled() declarations -

Re: [PATCH V4 1/1] powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC

2021-07-20 Thread Nageswara Sastry
On 21/07/21 11:18 am, Athira Rajeev wrote: Running perf fuzzer showed below in dmesg logs: "Can't find PMC that caused IRQ" This means a PMU exception happened, but none of the PMC's (Performance Monitor Counter) were found to be overflown. There are some corner cases that clears the PMCs

Re: [PATCH] powerpc/64s/perf: Always use SIAR for kernel interrupts

2021-07-20 Thread Athira Rajeev
> On 20-Jul-2021, at 7:45 PM, Nicholas Piggin wrote: > > If an interrupt is taken in kernel mode, always use SIAR for it rather than > looking at regs_sipr. This prevents samples piling up around interrupt > enable (hard enable or interrupt replay via soft enable) in PMUs / modes > where the

Re: [RFC 1/2] ppc/fpu: Add generic FPU api similar to x86

2021-07-20 Thread Christoph Hellwig
On Mon, Jul 19, 2021 at 03:52:10PM -0400, Anson Jacob wrote: > - Add kernel_fpu_begin & kernel_fpu_end API as x86 > - Add logic similar to x86 to ensure fpu > begin/end call correctness > - Add kernel_fpu_enabled to know if FPU is enabled > > Signed-off-by: Anson Jacob All the x86 FPU support

Re: [RFC 2/2] drm/amd/display: Use PPC FPU functions

2021-07-20 Thread Christoph Hellwig
> #define DC_FP_END() kernel_fpu_end() > #elif defined(CONFIG_PPC64) > #include > +#define DC_FP_START() kernel_fpu_begin() > +#define DC_FP_END() kernel_fpu_end() > #endif Please use the same header as x86 in your first patch and then kill this ifdefered and the DC_FP_START/DC_FP_END

Re: [RFC 0/2] Add generic FPU api similar to x86

2021-07-20 Thread Christian König
While you already CCed a bunch of people stuff like that needs to go to the appropriate mailing list and not just amd-gfx. Especially LKML so that other core devs can take a look as well. Regards, Christian. Am 19.07.21 um 21:52 schrieb Anson Jacob: This is an attempt to have generic FPU

Re: [PATCH 3/3] powerpc/smp: Use existing L2 cache_map cpumask to find L3 cache siblings

2021-07-20 Thread Gautham R Shenoy
Hi Parth, Sorry for the late review. On Tue, Jun 15, 2021 at 12:38:04PM +0530, Parth Shah wrote: > On POWER10 systems, the "ibm,thread-groups" property "2" indicates the cpus > in thread-group share both L2 and L3 caches. Hence, use cache_property = 2 > itself to find both the L2 and L3 cache