[PATCH kernel] powerpc/dma: Fallback to dma_ops when persistent memory present

2020-07-13 Thread Alexey Kardashevskiy
So far we have been using huge DMA windows to map all the RAM available. The RAM is normally mapped to the VM address space contiguously, and there is always a reasonable upper limit for possible future hot plugged RAM which makes it easy to map all RAM via IOMMU. Now there is persistent memory

Re: [PATCH 2/2] powerpc/powernv: Move pnv_ioda_setup_bus_dma under CONFIG_IOMMU_API

2020-07-13 Thread Alexey Kardashevskiy
On 05/07/2020 23:35, Oliver O'Halloran wrote: > pnv_ioda_setup_bus_dma() is only used when a passed through PE is > returned to the host. If the kernel is built without IOMMU support > this is dead code. True. Reviewed-by: Alexey Kardashevskiy > Move it under the #ifdef with the rest of

Re: [PATCH 04/14] powerpc/pseries: Stop using pdn->pe_number

2020-07-13 Thread Alexey Kardashevskiy
On 06/07/2020 11:36, Oliver O'Halloran wrote: > The pci_dn->pe_number field is mainly used to track the IODA PE number of a > device on PowerNV. At some point it grew a user in the pseries SR-IOV > support which muddies the waters a bit, so remove it. > > Signed-off-by: Oliver O'Halloran

Re: [PATCH 06/14] powerpc/eeh: Remove VF config space restoration

2020-07-13 Thread Alexey Kardashevskiy
On 13/07/2020 20:55, Oliver O'Halloran wrote: > On Mon, Jul 13, 2020 at 8:32 PM Alexey Kardashevskiy wrote: >> >>> #ifdef CONFIG_PCI_IOV >>> int pseries_send_allow_unfreeze(struct pci_dn *pdn, >>> u16 *vf_pe_array, int cur_vfs) >>> @@ -848,7 +824,7 @@ static

Re: [PATCH 02/15] powerpc/powernv/pci: Always tear down DMA windows on PE release

2020-07-13 Thread Alexey Kardashevskiy
On 10/07/2020 15:23, Oliver O'Halloran wrote: > Currently we have these two functions: > > pnv_pci_ioda2_release_dma_pe(), and > pnv_pci_ioda2_release_pe_dma() > > The first is used when tearing down VF PEs and the other is used for normal > devices. There's very little difference

Re: [PATCH 06/14] powerpc/eeh: Remove VF config space restoration

2020-07-13 Thread Oliver O'Halloran
On Mon, Jul 13, 2020 at 8:32 PM Alexey Kardashevskiy wrote: > > > #ifdef CONFIG_PCI_IOV > > int pseries_send_allow_unfreeze(struct pci_dn *pdn, > > u16 *vf_pe_array, int cur_vfs) > > @@ -848,7 +824,7 @@ static struct eeh_ops pseries_eeh_ops = { > >

Re: [PATCH 05/14] powerpc/eeh: Kill off eeh_ops->get_pe_addr()

2020-07-13 Thread Alexey Kardashevskiy
On 06/07/2020 11:36, Oliver O'Halloran wrote: > This is used in precisely one place which is in pseries specific platform > code. There's no need to have the callback in eeh_ops since the platform > chooses the EEH PE addresses anyway. The PowerNV implementation has always > been a stub too so

Re: [PATCH v3 4/6] powerpc/pseries/iommu: Remove default DMA window before creating DDW

2020-07-13 Thread Alexey Kardashevskiy
On 03/07/2020 16:18, Leonardo Bras wrote: > On LoPAR "DMA Window Manipulation Calls", it's recommended to remove the > default DMA window for the device, before attempting to configure a DDW, > in order to make the maximum resources available for the next DDW to be > created. > > This is a

Re: [PATCH 13/20] Documentation: mips/ingenic-tcu: eliminate duplicated word

2020-07-13 Thread Thomas Bogendoerfer
On Tue, Jul 07, 2020 at 11:04:07AM -0700, Randy Dunlap wrote: > Drop the doubled word "to". > > Signed-off-by: Randy Dunlap > Cc: Jonathan Corbet > Cc: linux-...@vger.kernel.org > Cc: Paul Cercueil > Cc: Thomas Bogendoerfer > Cc: linux-m...@vger.kernel.org > --- >

Re: [PATCH 01/15] powernv/pci: Add pci_bus_to_pnvhb() helper

2020-07-13 Thread Alexey Kardashevskiy
On 10/07/2020 15:23, Oliver O'Halloran wrote: > Add a helper to go from a pci_bus structure to the pnv_phb that hosts that > bus. There's a lot of instances of the following pattern: > > struct pci_controller *hose = pci_bus_to_host(pdev->bus); > struct pnv_phb *phb =

Re: [PATCH 03/14] powerpc/eeh: Move vf_index out of pci_dn and into eeh_dev

2020-07-13 Thread Alexey Kardashevskiy
On 06/07/2020 11:36, Oliver O'Halloran wrote: > Drivers that do not support the PCI error handling callbacks are handled by > tearing down the device and re-probing them. If the device to be removed is > a virtual function we need to know the index of the index of the VF so that Too many

Re: [v3 4/5] KVM: PPC: Book3S HV: retry page migration before erroring-out H_SVM_PAGE_IN

2020-07-13 Thread Bharata B Rao
On Sat, Jul 11, 2020 at 02:13:46AM -0700, Ram Pai wrote: > The page requested for page-in; sometimes, can have transient > references, and hence cannot migrate immediately. Retry a few times > before returning error. As I noted in the previous patch, we need to understand what are these transient

Re: [PATCH 06/14] powerpc/eeh: Remove VF config space restoration

2020-07-13 Thread Alexey Kardashevskiy
On 06/07/2020 11:36, Oliver O'Halloran wrote: > There's a bunch of strange things about this code. First up is that none of > the fields being written to are functional for a VF. The SR-IOV > specification lists then as "Reserved, but OS should preserve" so writing > new values to them doesn't

[PATCH] powerpc: Add cputime_to_nsecs()

2020-07-13 Thread Anton Blanchard
Generic code has a wrapper to implement cputime_to_nsecs() on top of cputime_to_usecs() but we can easily return the full nanosecond resolution directly. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/cputime.h | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [PATCH v2 0/3] Power10 basic energy management

2020-07-13 Thread Pratik Sampat
Thank you for your comments, On 13/07/20 10:53 am, Nicholas Piggin wrote: Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: Changelog v1 --> v2: 1. Save-restore DAWR and DAWRX unconditionally as they are lost in shallow idle states too 2. Rename pnv_first_spr_loss_level to

Re: [PATCH 05/14] powerpc/eeh: Kill off eeh_ops->get_pe_addr()

2020-07-13 Thread Oliver O'Halloran
On Mon, Jul 13, 2020 at 7:54 PM Alexey Kardashevskiy wrote: > > > > On 06/07/2020 11:36, Oliver O'Halloran wrote: > > This is used in precisely one place which is in pseries specific platform > > code. There's no need to have the callback in eeh_ops since the platform > > chooses the EEH PE

[PATCH] powerpc/boot: add DTB to 'targets'

2020-07-13 Thread Masahiro Yamada
PowerPC always re-builds DTB even if nothing has been changed. As for other architectures, arch/*/boot/dts/Makefile builds DTB by using the dtb-y syntax. In contrast, arch/powerpc/boot/dts/(fsl/)Makefile does nothing unless CONFIG_OF_ALL_DTBS is defined. Instead, arch/powerpc/boot/Makefile

Re: [PATCH 03/14] powerpc/eeh: Move vf_index out of pci_dn and into eeh_dev

2020-07-13 Thread Oliver O'Halloran
On Mon, Jul 13, 2020 at 6:56 PM Alexey Kardashevskiy wrote: > > > > On 06/07/2020 11:36, Oliver O'Halloran wrote: > > Drivers that do not support the PCI error handling callbacks are handled by > > tearing down the device and re-probing them. If the device to be removed is > > a virtual function

Re: [v3 3/5] KVM: PPC: Book3S HV: migrate remaining normal-GFNs to secure-GFNs in H_SVM_INIT_DONE

2020-07-13 Thread Bharata B Rao
On Sat, Jul 11, 2020 at 02:13:45AM -0700, Ram Pai wrote: > The Ultravisor is expected to explicitly call H_SVM_PAGE_IN for all the pages > of the SVM before calling H_SVM_INIT_DONE. This causes a huge delay in > tranistioning the VM to SVM. The Ultravisor is interested in the pages that > contain

Re: [PATCH v5] ima: move APPRAISE_BOOTPARAM dependency on ARCH_POLICY to runtime

2020-07-13 Thread Bruno Meneguele
On Fri, Jul 10, 2020 at 04:25:16PM -0300, Bruno Meneguele wrote: > On Fri, Jul 10, 2020 at 02:54:48PM -0400, Mimi Zohar wrote: > > On Fri, 2020-07-10 at 15:34 -0300, Bruno Meneguele wrote: > > > On Fri, Jul 10, 2020 at 03:03:38PM -0300, Bruno Meneguele wrote: > > > > On Fri, Jul 10, 2020 at

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-13 Thread Andy Lutomirski
On Mon, Jul 13, 2020 at 7:13 AM Mathieu Desnoyers wrote: > > - On Jul 13, 2020, at 9:47 AM, Nicholas Piggin npig...@gmail.com wrote: > > > Excerpts from Nicholas Piggin's message of July 13, 2020 2:45 pm: > >> Excerpts from Andy Lutomirski's message of July 11, 2020 3:04 am: > >>> Also, as it

Re: [PATCH v2 0/3] Power10 basic energy management

2020-07-13 Thread Gautham R Shenoy
On Mon, Jul 13, 2020 at 03:23:21PM +1000, Nicholas Piggin wrote: > Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: > > Changelog v1 --> v2: > > 1. Save-restore DAWR and DAWRX unconditionally as they are lost in > > shallow idle states too > > 2. Rename

[RFC PATCH 27/35] powerpc: Tidy Success/Failure checks

2020-07-13 Thread Saheed O. Bolarinwa
Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 26/35 arch/powerpc/platforms/powernv/eeh-powernv.c | 4 ++-- arch/powerpc/platforms/pseries/eeh_pseries.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

Re: [PATCH v2 09/10] tools/perf: Add perf tools support for extended register capability in powerpc

2020-07-13 Thread Michael Ellerman
Athira Rajeev writes: >> On 08-Jul-2020, at 5:34 PM, Michael Ellerman wrote: >> >> Athira Rajeev > > writes: >>> From: Anju T Sudhakar >>> >>> Add extended regs to sample_reg_mask in the tool side to use >>> with `-I?` option. Perf tools side uses extended

[RFC PATCH 26/35] powerpc: Change PCIBIOS_SUCCESSFUL to 0

2020-07-13 Thread Saheed O. Bolarinwa
In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/powerpc/kernel/rtas_pci.c | 4 ++-- arch/powerpc/platforms/4xx/pci.c

Re: [PATCH 00/20] Documentation: eliminate duplicated words

2020-07-13 Thread Jonathan Corbet
On Tue, 7 Jul 2020 11:03:54 -0700 Randy Dunlap wrote: > Documentation/admin-guide/mm/numaperf.rst |2 +- > Documentation/block/pr.rst|2 +- > Documentation/core-api/printk-basics.rst |2 +- > Documentation/dev-tools/kgdb.rst

Re: [PATCH 18/20] Documentation: security/keys: eliminate duplicated word

2020-07-13 Thread Mimi Zohar
On Tue, 2020-07-07 at 11:04 -0700, Randy Dunlap wrote: > Drop the doubled word "in". > > Signed-off-by: Randy Dunlap Reviewed-by: Mimi Zohar

[PATCH 1/2] powerpc/hugetlb/cma: Allocate gigantic hugetlb pages using CMA

2020-07-13 Thread Aneesh Kumar K.V
commit: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma") added support for allocating gigantic hugepages using CMA. This patch enables the same for powerpc Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/hugetlb.h | 7 +++

[RFC PATCH 00/35] Move all PCIBIOS* definitions into arch/x86

2020-07-13 Thread Saheed O. Bolarinwa
This goal of these series is to move the definition of *all* PCIBIOS* from include/linux/pci.h to arch/x86 and limit their use within there. All other tree specific definition will be left for intact. Maybe they can be renamed. PCIBIOS* is an x86 concept as defined by the PCI spec. The

Re: [RFC PATCH 7/7] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-07-13 Thread Andy Lutomirski
On Thu, Jul 9, 2020 at 6:57 PM Nicholas Piggin wrote: > > On big systems, the mm refcount can become highly contented when doing > a lot of context switching with threaded applications (particularly > switching between the idle thread and an application thread). > > Abandoning lazy tlb slows

Re: [PATCH] powerpc/boot: add DTB to 'targets'

2020-07-13 Thread Michael Ellerman
Masahiro Yamada writes: > PowerPC always re-builds DTB even if nothing has been changed. > > As for other architectures, arch/*/boot/dts/Makefile builds DTB by > using the dtb-y syntax. > > In contrast, arch/powerpc/boot/dts/(fsl/)Makefile does nothing unless > CONFIG_OF_ALL_DTBS is defined.

Re: [PATCH v2 01/10] powerpc/perf: Add support for ISA3.1 PMU SPRs

2020-07-13 Thread Michael Ellerman
Athira Rajeev writes: >> On 08-Jul-2020, at 4:32 PM, Michael Ellerman wrote: >> >> Athira Rajeev writes: >> ... >>> diff --git a/arch/powerpc/perf/core-book3s.c >>> b/arch/powerpc/perf/core-book3s.c >>> index cd6a742..5c64bd3 100644 >>> --- a/arch/powerpc/perf/core-book3s.c >>> +++

[PATCH v2] powerpc/perf: Add kernel support for new MSR[HV PR] bits in trace-imc

2020-07-13 Thread Madhavan Srinivasan
From: Anju T Sudhakar IMC trace-mode record has MSR[HV PR] bits added in the third DW. These bits can be used to set the cpumode for the instruction pointer captured in each sample. Add support in kernel to use these bits to set the cpumode for each sample. Signed-off-by: Anju T Sudhakar

[RFC PATCH 13/35] cxl: Change PCIBIOS_SUCCESSFUL to 0

2020-07-13 Thread Saheed O. Bolarinwa
In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. There scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/misc/cxl/vphb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-13 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of July 13, 2020 2:45 pm: > Excerpts from Andy Lutomirski's message of July 11, 2020 3:04 am: >> Also, as it stands, I can easily see in_irq() ceasing to promise to >> serialize. There are older kernels for which it does not promise to >> serialize. And I

Re: [RFC PATCH 00/35] Move all PCIBIOS* definitions into arch/x86

2020-07-13 Thread Arnd Bergmann
On Mon, Jul 13, 2020 at 3:22 PM Saheed O. Bolarinwa wrote: > This goal of these series is to move the definition of *all* PCIBIOS* from > include/linux/pci.h to arch/x86 and limit their use within there. > All other tree specific definition will be left for intact. Maybe they can > be renamed. >

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-13 Thread Mathieu Desnoyers
- On Jul 13, 2020, at 9:47 AM, Nicholas Piggin npig...@gmail.com wrote: > Excerpts from Nicholas Piggin's message of July 13, 2020 2:45 pm: >> Excerpts from Andy Lutomirski's message of July 11, 2020 3:04 am: >>> Also, as it stands, I can easily see in_irq() ceasing to promise to >>>

[PATCH 2/2] powerpc/kvm/cma: Improve kernel log during boot

2020-07-13 Thread Aneesh Kumar K.V
Current kernel gives: [0.00] cma: Reserved 26224 MiB at 0x00795900 [0.00] hugetlb_cma: reserve 65536 MiB, up to 16384 MiB per node [0.00] cma: Reserved 16384 MiB at 0x0018 With the fix [0.00] kvm_cma_reserve: reserving 26214 MiB for global

[PATCH v3 00/12] ppc64: enable kdump support for kexec_file_load syscall

2020-07-13 Thread Hari Bathini
This patch series enables kdump support for kexec_file_load system call (kexec -s -p) on PPC64. The changes are inspired from kexec-tools code but heavily modified for kernel consumption. There is scope to expand purgatory to verify sha256 digest along with other improvements in purgatory code.

[PATCH v3 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-13 Thread Hari Bathini
crashkernel region could have an overlap with special memory regions like opal, rtas, tce-table & such. These regions are referred to as exclude memory ranges. Setup this ranges during image probe in order to avoid them while finding the buffer for different kdump segments. Override

Re: [PATCH v2 0/3] Power10 basic energy management

2020-07-13 Thread Nicholas Piggin
Excerpts from Pratik Sampat's message of July 13, 2020 8:02 pm: > Thank you for your comments, > > On 13/07/20 10:53 am, Nicholas Piggin wrote: >> Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: >>> Changelog v1 --> v2: >>> 1. Save-restore DAWR and DAWRX unconditionally as

Re: [PATCH v2 0/3] Power10 basic energy management

2020-07-13 Thread Nicholas Piggin
Excerpts from Gautham R Shenoy's message of July 13, 2020 8:48 pm: > On Mon, Jul 13, 2020 at 03:23:21PM +1000, Nicholas Piggin wrote: >> Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: >> > Changelog v1 --> v2: >> > 1. Save-restore DAWR and DAWRX unconditionally as they are

[PATCH v3 02/12] powerpc/kexec_file: mark PPC64 specific code

2020-07-13 Thread Hari Bathini
Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 specific code from kexec/file_load.c to kexec/file_load_64.c. Also, rename purgatory/trampoline.S to purgatory/trampoline_64.S in the same spirit. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- v2 -> v3: * Unchanged.

[PATCH v3 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-13 Thread Hari Bathini
Though kdump kernel boots from loaded address, the first 64K bytes of it is copied down to real 0. So, setup a backup region to copy the first 64K bytes of crashed kernel, in purgatory, before booting into kdump kernel. Also, update reserve map with backup region and crashed kernel's memory to

[PATCH v3 12/12] ppc64/kexec_file: fix kexec load failure with lack of memory hole

2020-07-13 Thread Hari Bathini
The kexec purgatory has to run in real mode. Only the first memory block maybe accessible in real mode. And, unlike the case with panic kernel, no memory is set aside for regular kexec load. Another thing to note is, the memory for crashkernel is reserved at an offset of 128MB. So, when

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-13 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of July 14, 2020 1:48 am: > On Mon, Jul 13, 2020 at 7:13 AM Mathieu Desnoyers > wrote: >> >> - On Jul 13, 2020, at 9:47 AM, Nicholas Piggin npig...@gmail.com wrote: >> >> > Excerpts from Nicholas Piggin's message of July 13, 2020 2:45 pm: >> >> Excerpts

Re: [RFC PATCH 7/7] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-07-13 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of July 14, 2020 1:59 am: > On Thu, Jul 9, 2020 at 6:57 PM Nicholas Piggin wrote: >> >> On big systems, the mm refcount can become highly contented when doing >> a lot of context switching with threaded applications (particularly >> switching between the

[PATCH v3 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-13 Thread Hari Bathini
Right now purgatory implementation is only minimal. But if purgatory code is to be enhanced to copy memory to the backup region and verify sha256 digest, relocations may have to be applied to the purgatory. So, add support to relocate purgatory in kexec_file_load system call by setting up TOC

[PATCH v3 08/12] ppc64/kexec_file: setup the stack for purgatory

2020-07-13 Thread Hari Bathini
To avoid any weird errors, the purgatory should run with its own stack. Set one up by adding the stack buffer to .data section of the purgatory. Also, setup opal base & entry values in r8 & r9 registers to help early OPAL debugging. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- v2 ->

[PATCH v3 11/12] ppc64/kexec_file: add appropriate regions for memory reserve map

2020-07-13 Thread Hari Bathini
While initrd, elfcorehdr and backup regions are already added to the reserve map, there are a few missing regions that need to be added to the memory reserve map. Add them here. And now that all the changes to load panic kernel are in place, claim likewise. Signed-off-by: Hari Bathini Tested-by:

Re: [RFC PATCH 7/7] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-07-13 Thread Andy Lutomirski
> On Jul 13, 2020, at 9:48 AM, Nicholas Piggin wrote: > > Excerpts from Andy Lutomirski's message of July 14, 2020 1:59 am: >>> On Thu, Jul 9, 2020 at 6:57 PM Nicholas Piggin wrote: >>> >>> On big systems, the mm refcount can become highly contented when doing >>> a lot of context switching

Re: /sys/kernel/debug/kmemleak empty despite kmemleak reports

2020-07-13 Thread Catalin Marinas
On Thu, Jul 09, 2020 at 11:08:52PM +0200, Paul Menzel wrote: > Am 09.07.20 um 19:57 schrieb Catalin Marinas: > > On Thu, Jul 09, 2020 at 04:37:10PM +0200, Paul Menzel wrote: > > > Despite Linux 5.8-rc4 reporting memory leaks on the IBM POWER 8 S822LC, > > > the > > > file does not contain more

[PATCH 12/14 v3] PCI/AER: Check the return value of pcie_capability_read_*()

2020-07-13 Thread Saheed O. Bolarinwa
From: Bolarinwa Olayemi Saheed On failure pcie_capability_read_dword() sets it's last parameter, val to 0. However, with Patch 14/14, it is possible that val is set to ~0 on failure. This would introduce a bug because (x & x) == (~0 & x). This bug can be avoided if the return value of

[PATCH v3 01/12] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-13 Thread Hari Bathini
Some architectures may have special memory regions, within the given memory range, which can't be used for the buffer in a kexec segment. Implement weak arch_kexec_locate_mem_hole() definition which arch code may override, to take care of special regions, while trying to locate a memory hole.

[PATCH v3 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-13 Thread Hari Bathini
Prepare elf headers for the crashing kernel's core file using crash_prepare_elf64_headers() and pass on this info to kdump kernel by updating its command line with elfcorehdr parameter. Also, add elfcorehdr location to reserve map to avoid it from being stomped on while booting. Signed-off-by:

Re: [PATCH v2 0/3] Power10 basic energy management

2020-07-13 Thread Pratik Sampat
On 13/07/20 10:20 pm, Nicholas Piggin wrote: Excerpts from Pratik Sampat's message of July 13, 2020 8:02 pm: Thank you for your comments, On 13/07/20 10:53 am, Nicholas Piggin wrote: Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: Changelog v1 --> v2: 1.

[PATCH v6] ima: move APPRAISE_BOOTPARAM dependency on ARCH_POLICY to runtime

2020-07-13 Thread Bruno Meneguele
The IMA_APPRAISE_BOOTPARAM config allows enabling different "ima_appraise=" modes - log, fix, enforce - at run time, but not when IMA architecture specific policies are enabled.  This prevents properly labeling the filesystem on systems where secure boot is supported, but not enabled on the

[PATCH v3 00/12] ppc64: enable kdump support for kexec_file_load syscall

2020-07-13 Thread Hari Bathini
This patch series enables kdump support for kexec_file_load system call (kexec -s -p) on PPC64. The changes are inspired from kexec-tools code but heavily modified for kernel consumption. There is scope to expand purgatory to verify sha256 digest along with other improvements in purgatory code.

[PATCH v3 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-13 Thread Hari Bathini
In kexec case, the kernel to be loaded uses the same memory layout as the running kernel. So, passing on the DT of the running kernel would be good enough. But in case of kdump, different memory ranges are needed to manage loading the kdump kernel, booting into it and exporting the elfcore of the

[PATCH 1/1 V4] : PCIE PHB reset

2020-07-13 Thread wenxiong
From: Wen Xiong Several device drivers hit EEH(Extended Error handling) when triggering kdump on Pseries PowerVM. This patch implemented a reset of the PHBs in pci general code when triggering kdump. PHB reset stop all PCI transactions from normal kernel. We have tested the patch in several

[PATCH v3 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-13 Thread Hari Bathini
Kdump kernel, used for capturing the kernel core image, is supposed to use only specific memory regions to avoid corrupting the image to be captured. The regions are crashkernel range - the memory reserved explicitly for kdump kernel, memory used for the tce-table, the OPAL region and RTAS region

[PATCH v3 05/12] powerpc/drmem: make lmb walk a bit more flexible

2020-07-13 Thread Hari Bathini
Currently, numa & prom are the users of drmem lmb walk code. Loading kdump with kexec_file also needs to walk the drmem LMBs to setup the usable memory ranges for kdump kernel. But there are couple of issues in using the code as is. One, walk_drmem_lmb() code is built into the .init section

[PATCH 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper

2020-07-13 Thread Jarkko Sakkinen
Rename module_alloc() to text_alloc() and module_memfree() to text_memfree(), and move them to kernel/text.c, which is unconditionally compiled to the kernel proper. This allows kprobes, ftrace and bpf to allocate space for executable code without requiring to compile the modules support

Re: [PATCH 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper

2020-07-13 Thread Ard Biesheuvel
On Mon, 13 Jul 2020 at 21:21, Jarkko Sakkinen wrote: > > Rename module_alloc() to text_alloc() and module_memfree() to > text_memfree(), and move them to kernel/text.c, which is unconditionally > compiled to the kernel proper. This allows kprobes, ftrace and bpf to > allocate space for executable

[PATCH] selftests: Replace HTTP links with HTTPS ones

2020-07-13 Thread Alexander A. Klimov
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:

Re: [V2 PATCH 1/3] Refactoring powerpc code for carrying over IMA measurement logs, to move non architecture specific code to security/ima.

2020-07-13 Thread Prakhar Srivastava
On 6/19/20 5:19 PM, Thiago Jung Bauermann wrote: Prakhar Srivastava writes: Powerpc has support to carry over the IMA measurement logs. Refatoring the non-architecture specific code out of arch/powerpc and into security/ima. The code adds support for reserving and freeing up of memory

[PATCH] powerpc/Kconfig: Replace HTTP links with HTTPS ones

2020-07-13 Thread Alexander A. Klimov
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:

Re: [RFC PATCH 00/35] Move all PCIBIOS* definitions into arch/x86

2020-07-13 Thread Bjorn Helgaas
On Mon, Jul 13, 2020 at 02:22:12PM +0200, Saheed O. Bolarinwa wrote: > This goal of these series is to move the definition of *all* PCIBIOS* from > include/linux/pci.h to arch/x86 and limit their use within there. > All other tree specific definition will be left for intact. Maybe they can > be

Re: [PATCH 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper

2020-07-13 Thread Russell King - ARM Linux admin
On Mon, Jul 13, 2020 at 09:19:37PM +0300, Jarkko Sakkinen wrote: > Rename module_alloc() to text_alloc() and module_memfree() to > text_memfree(), and move them to kernel/text.c, which is unconditionally > compiled to the kernel proper. This allows kprobes, ftrace and bpf to > allocate space for

Re: [PATCH] ocxl: Replace HTTP links with HTTPS ones

2020-07-13 Thread Andrew Donnellan
On 14/7/20 3:55 am, Alexander A. Klimov wrote: Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`:

Re: [V2 PATCH 2/3] dt-bindings: chosen: Document ima-kexec-buffer

2020-07-13 Thread Prakhar Srivastava
On 6/19/20 5:41 PM, Thiago Jung Bauermann wrote: Prakhar Srivastava writes: Integrity measurement architecture(IMA) validates if files have been accidentally or maliciously altered, both remotely and locally, appraise a file's measurement against a "good" value stored as an extended

[PATCH] ocxl: Replace HTTP links with HTTPS ones

2020-07-13 Thread Alexander A. Klimov
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:

Re: [PATCH 14/14] powerpc/eeh: Move PE tree setup into the platform

2020-07-13 Thread Alexey Kardashevskiy
On 06/07/2020 11:36, Oliver O'Halloran wrote: > The EEH core has a concept of a "PE tree" to support PowerNV. The PE tree > follows the PCI bus structures because a reset asserted on an upstream > bridge will be propagated to the downstream bridges. On pseries there's a > 1-1 correspondence

Re: [PATCH v3 4/6] powerpc/pseries/iommu: Remove default DMA window before creating DDW

2020-07-13 Thread Leonardo Bras
Thank you for this feedback Alexey! On Mon, 2020-07-13 at 17:33 +1000, Alexey Kardashevskiy wrote: > [...] > > - int len, ret; > > + int len, ret, reset_win_ext; > > Make it "reset_token". Oh, it's not a token here, it just checks if the reset_win extension exists. The token would be

[PATCH 09/11] Powerpc/smp: Create coregroup domain

2020-07-13 Thread Srikar Dronamraju
Add percpu coregroup maps and masks to create coregroup domain. If a coregroup doesn't exist, the coregroup domain will be degenerated in favour of SMT/CACHE domain. Cc: linuxppc-dev Cc: Michael Ellerman Cc: Nick Piggin Cc: Oliver OHalloran Cc: Nathan Lynch Cc: Michael Neuling Cc: Anton

[PATCH 08/11] powerpc/smp: Allocate cpumask only after searching thread group

2020-07-13 Thread Srikar Dronamraju
If allocated earlier and the search fails, then cpumask need to be freed. However cpu_l1_cache_map can be allocated after we search thread group. Cc: linuxppc-dev Cc: Michael Ellerman Cc: Nick Piggin Cc: Oliver OHalloran Cc: Nathan Lynch Cc: Michael Neuling Cc: Anton Blanchard Cc: Gautham

Re: [PATCH v3 4/6] powerpc/pseries/iommu: Remove default DMA window before creating DDW

2020-07-13 Thread Alexey Kardashevskiy
On 14/07/2020 12:40, Leonardo Bras wrote: > Thank you for this feedback Alexey! > > On Mon, 2020-07-13 at 17:33 +1000, Alexey Kardashevskiy wrote: >> [...] >>> - int len, ret; >>> + int len, ret, reset_win_ext; >> >> Make it "reset_token". > > Oh, it's not a token here, it just checks if

Re: [PATCH 00/11] Support for grouping cores

2020-07-13 Thread Srikar Dronamraju
* Srikar Dronamraju [2020-07-14 10:06:13]: > > On Power 9 (with device-tree enablement to show coregroups). > --- With help of Gautham, I tried to kexec into a newer kernel with a modified dtb. However when passing with the dtb option,

Re: [PATCH 05/11] powerpc/smp: Dont assume l2-cache to be superset of sibling

2020-07-13 Thread Oliver O'Halloran
On Tue, Jul 14, 2020 at 2:45 PM Srikar Dronamraju wrote: > > Current code assumes that cpumask of cpus sharing a l2-cache mask will > always be a superset of cpu_sibling_mask. > > Lets stop that assumption. It's been a while since I looked, but I'm pretty sure the scheduler requires child

[PATCH 00/11] Support for grouping cores

2020-07-13 Thread Srikar Dronamraju
Cleanup of existing powerpc topologies and add support for grouping cores. Patch 7 of this patch series: "Powerpc/numa: Detect support for coregroup" depends on https://lore.kernel.org/linuxppc-dev/20200707140644.7241-1-sri...@linux.vnet.ibm.com/t/#u However it should be easy to rebase the patch

[PATCH 06/11] powerpc/smp: Generalize 2nd sched domain

2020-07-13 Thread Srikar Dronamraju
Currently "CACHE" domain happens to be the 2nd sched domain as per powerpc_topology. This domain will collapse if cpumask of l2-cache is same as SMT domain. However we could generalize this domain such that it could mean either be a "CACHE" domain or a "BIGCORE" domain. While setting up the

[PATCH 11/11] powerpc/smp: Provide an ability to disable coregroup

2020-07-13 Thread Srikar Dronamraju
If user wants to enable coregroup sched_domain then they can boot with kernel parameter "coregroup_support=on" Cc: linuxppc-dev Cc: Michael Ellerman Cc: Nick Piggin Cc: Oliver OHalloran Cc: Nathan Lynch Cc: Michael Neuling Cc: Anton Blanchard Cc: Gautham R Shenoy Cc: Vaidyanathan

[PATCH 10/11] powerpc/smp: Implement cpu_to_coregroup_id

2020-07-13 Thread Srikar Dronamraju
Lookup the coregroup id from the associativity array. If unable to detect the coregroup id, fallback on the core id. This way, ensure sched_domain degenerates and an extra sched domain is not created. Ideally this function should have been implemented in arch/powerpc/kernel/smp.c. However if its

Re: [PATCH 03/15] powerpc/powernv/pci: Add explicit tracking of the DMA setup state

2020-07-13 Thread Oliver O'Halloran
On Tue, Jul 14, 2020 at 3:37 PM Alexey Kardashevskiy wrote: > > On 10/07/2020 15:23, Oliver O'Halloran wrote: > > There's an optimisation in the PE setup which skips performing DMA > > setup for a PE if we only have bridges in a PE. The assumption being > > that only "real" devices will DMA to

Re: [PATCH 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper

2020-07-13 Thread Steven Rostedt
On Mon, 13 Jul 2020 22:49:48 +0300 Ard Biesheuvel wrote: > On arm64, we no longer use module_alloc for bpf or kprobes, to avoid > wasting va space on code that does not need to be loaded close to the > kernel. Also, module_alloc() allocates kasan shadow, which is > unnecessary for kprobes or bpf

[PATCH 01/11] powerpc/smp: Cache node for reuse

2020-07-13 Thread Srikar Dronamraju
While cpu_to_node is inline function with access to per_cpu variable. However when using repeatedly, it may be cleaner to cache it in a local variable. Also fix a build error in a some weird config. "error: _numa_cpu_lookup_table_ undeclared" No functional change Cc: linuxppc-dev Cc: Michael

[PATCH 07/11] Powerpc/numa: Detect support for coregroup

2020-07-13 Thread Srikar Dronamraju
Add support for grouping cores based on the device-tree classification. - The last domain in the associativity domains always refers to the core. - If primary reference domain happens to be the penultimate domain in the associativity domains device-tree property, then there are no coregroups.

[PATCH 02/11] powerpc/smp: Merge Power9 topology with Power topology

2020-07-13 Thread Srikar Dronamraju
A new sched_domain_topology_level was added just for Power9. However the same can be achieved by merging powerpc_topology with power9_topology and makes the code more simpler especially when adding a new sched domain. Cc: linuxppc-dev Cc: Michael Ellerman Cc: Nick Piggin Cc: Oliver OHalloran

Re: [RFC PATCH 7/7] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-07-13 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of July 14, 2020 4:18 am: > >> On Jul 13, 2020, at 9:48 AM, Nicholas Piggin wrote: >> >> Excerpts from Andy Lutomirski's message of July 14, 2020 1:59 am: On Thu, Jul 9, 2020 at 6:57 PM Nicholas Piggin wrote: On big systems, the mm

[PATCH 03/11] powerpc/smp: Move powerpc_topology above

2020-07-13 Thread Srikar Dronamraju
Just moving the powerpc_topology description above. This will help in using functions in this file and avoid declarations. No other functional changes Cc: linuxppc-dev Cc: Michael Ellerman Cc: Nick Piggin Cc: Oliver OHalloran Cc: Nathan Lynch Cc: Michael Neuling Cc: Anton Blanchard Cc:

Re: [PATCH 03/15] powerpc/powernv/pci: Add explicit tracking of the DMA setup state

2020-07-13 Thread Alexey Kardashevskiy
On 10/07/2020 15:23, Oliver O'Halloran wrote: > There's an optimisation in the PE setup which skips performing DMA > setup for a PE if we only have bridges in a PE. The assumption being > that only "real" devices will DMA to system memory, which is probably > fair. However, if we start off with

Re: [PATCH 14/14] powerpc/eeh: Move PE tree setup into the platform

2020-07-13 Thread Oliver O'Halloran
On Tue, Jul 14, 2020 at 11:50 AM Alexey Kardashevskiy wrote: > > On 06/07/2020 11:36, Oliver O'Halloran wrote: > > /** > > * eeh_pe_tree_insert - Add EEH device to parent PE > > * @edev: EEH device > > + * @new_pe_parent: PE to create additional PEs under > > * > > - * Add EEH device to

[PATCH 04/11] powerpc/smp: Enable small core scheduling sooner

2020-07-13 Thread Srikar Dronamraju
Enable small core scheduling as soon as we detect that we are in a system that supports thread group. Doing so would avoid a redundant check. Cc: linuxppc-dev Cc: Michael Ellerman Cc: Nick Piggin Cc: Oliver OHalloran Cc: Nathan Lynch Cc: Michael Neuling Cc: Anton Blanchard Cc: Gautham R

[PATCH 05/11] powerpc/smp: Dont assume l2-cache to be superset of sibling

2020-07-13 Thread Srikar Dronamraju
Current code assumes that cpumask of cpus sharing a l2-cache mask will always be a superset of cpu_sibling_mask. Lets stop that assumption. Cc: linuxppc-dev Cc: Michael Ellerman Cc: Nick Piggin Cc: Oliver OHalloran Cc: Nathan Lynch Cc: Michael Neuling Cc: Anton Blanchard Cc: Gautham R

Re: [RFC PATCH v0 2/2] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2020-07-13 Thread Bharata B Rao
On Thu, Jul 09, 2020 at 08:07:11PM +1000, Paul Mackerras wrote: > On Thu, Jul 09, 2020 at 02:38:51PM +0530, Bharata B Rao wrote: > > On Thu, Jul 09, 2020 at 03:18:03PM +1000, Paul Mackerras wrote: > > > On Fri, Jul 03, 2020 at 04:14:20PM +0530, Bharata B Rao wrote: > > > > In the nested KVM case,