Re: [PATCH V15] mm/debug: Add tests validating architecture page table helpers

2020-03-06 Thread Christophe Leroy
Le 07/03/2020 à 01:56, Anshuman Khandual a écrit : On 03/07/2020 06:04 AM, Qian Cai wrote: On Mar 6, 2020, at 7:03 PM, Anshuman Khandual wrote: Hmm, set_pte_at() function is not preferred here for these tests. The idea is to avoid or atleast minimize TLB/cache flushes triggered from th

Re: [PATCH v3 07/14] powerpc/32: drop get_pteptr()

2020-03-06 Thread Andrew Morton
On Thu, 27 Feb 2020 10:46:01 +0200 Mike Rapoport wrote: > Commit 8d30c14cab30 ("powerpc/mm: Rework I$/D$ coherency (v3)") and > commit 90ac19a8b21b ("[POWERPC] Abolish iopa(), mm_ptov(), > io_block_mapping() from arch/powerpc") removed the use of get_pteptr() > outside of mm/pgtable_32.c > > In

Re: [PATCH v4 1/8] ASoC: dt-bindings: fsl_asrc: Change asrc-width to asrc-format

2020-03-06 Thread Shengjiu Wang
Hi On Tue, Mar 3, 2020 at 8:47 PM Mark Brown wrote: > > On Tue, Mar 03, 2020 at 11:59:30AM +0800, Shengjiu Wang wrote: > > On Tue, Mar 3, 2020 at 9:43 AM Rob Herring wrote: > > > > > - - fsl,asrc-width : Defines a mutual sample width used by DPCM Back > > > > Ends. > > > > + - fsl,asrc-for

[PATCH] powerpc/pseries: fix of_read_drc_info_cell() to point at next record

2020-03-06 Thread Tyrel Datwyler
The expectation is that when calling of_read_drc_info_cell() repeatedly to parse multiple drc-info records that the in/out curval parameter points at the start of the next record on return. However, the current behavior has curval still pointing at the final value of the record just parsed. The res

[PATCH v5 01/11] PCI: designware-ep: Add multiple PFs support for DWC

2020-03-06 Thread Xiaowei Bao
Add multiple PFs support for DWC, due to different PF have different config space, we use func_conf_select callback function to access the different PF's config space, the different chip company need to implement this callback function when use the DWC IP core and intend to support multiple PFs fea

[PATCH v5 03/11] PCI: designware-ep: Move the function of getting MSI capability forward

2020-03-06 Thread Xiaowei Bao
Move the function of getting MSI capability to the front of init function, because the init function of the EP platform driver will use the return value by the function of getting MSI capability. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - No change. v3: - No change. v4: -

[PATCH v5 11/11] misc: pci_endpoint_test: Add LS1088a in pci_device_id table

2020-03-06 Thread Xiaowei Bao
Add LS1088a in pci_device_id table so that pci-epf-test can be used for testing PCIe EP in LS1088a. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - No change. v3: - No change. v4: - Use a maco to define the LS1088a device ID. v5: - No change. drivers/misc/pci_endpoint_test

[PATCH v5 02/11] PCI: designware-ep: Add the doorbell mode of MSI-X in EP mode

2020-03-06 Thread Xiaowei Bao
Add the doorbell mode of MSI-X in DWC EP driver. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - Remove the macro of no used. v3: - No change. v4: - Modify the commit message. v5: - No change. drivers/pci/controller/dwc/pcie-designware-ep.c | 14 ++ drivers/pci/

[PATCH v5 04/11] PCI: designware-ep: Modify MSI and MSIX CAP way of finding

2020-03-06 Thread Xiaowei Bao
Each PF of EP device should have it's own MSI or MSIX capabitily struct, so create a dw_pcie_ep_func struct and remove the msi_cap and msix_cap to this struct from dw_pcie_ep, and manage the PFs with a list. Signed-off-by: Xiaowei Bao --- v3: - This is a new patch, to fix the issue of MSI and MS

[PATCH v5 06/11] PCI: layerscape: Fix some format issue of the code

2020-03-06 Thread Xiaowei Bao
Fix some format issue of the code in EP driver. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - No change. v3: - No change. v4: - No change. v5: - No change. drivers/pci/controller/dwc/pci-layerscape-ep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v4 00/11] Add the multiple PF support for DWC and Layerscape

2020-03-06 Thread Xiaowei Bao
Add the PCIe EP multiple PF support for DWC and Layerscape, add the doorbell MSIX function for DWC, use list to manage the PF of one PCIe controller, and refactor the Layerscape EP driver due to some platforms difference. Xiaowei Bao (11): PCI: designware-ep: Add multiple PFs support for DWC P

[PATCH v5 05/11] dt-bindings: pci: layerscape-pci: Add compatible strings for ls1088a and ls2088a

2020-03-06 Thread Xiaowei Bao
Add compatible strings for ls1088a and ls2088a. Signed-off-by: Xiaowei Bao Acked-by: Rob Herring --- v2: - No change. v3: - Use one valid combination of compatible strings. v4: - Add the comma between the two compatible. v5: - No change. Documentation/devicetree/bindings/pci/layerscape-pci

[PATCH v5 10/11] arm64: dts: layerscape: Add PCIe EP node for ls1088a

2020-03-06 Thread Xiaowei Bao
Add PCIe EP node for ls1088a to support EP mode. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - Remove the pf-offset proparty. v3: - No change. v4: - No change. v5: - No change. arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 31 ++ 1 file changed

[PATCH v5 07/11] PCI: layerscape: Modify the way of getting capability with different PEX

2020-03-06 Thread Xiaowei Bao
The different PCIe controller in one board may be have different capability of MSI or MSIX, so change the way of getting the MSI capability, make it more flexible. Signed-off-by: Xiaowei Bao --- v2: - Remove the repeated assignment code. v3: - Use ep_func msi_cap and msix_cap to decide the msi_

[PATCH v5 09/11] PCI: layerscape: Add EP mode support for ls1088a and ls2088a

2020-03-06 Thread Xiaowei Bao
Add PCIe EP mode support for ls1088a and ls2088a, there are some difference between LS1 and LS2 platform, so refactor the code of the EP driver. Signed-off-by: Xiaowei Bao --- v2: - This is a new patch for supporting the ls1088a and ls2088a platform. v3: - Adjust the some struct assignment ord

[PATCH v5 08/11] PCI: layerscape: Modify the MSIX to the doorbell mode

2020-03-06 Thread Xiaowei Bao
dw_pcie_ep_raise_msix_irq was never called in the exisitng driver before, because the ls1046a platform don't support the MSIX feature and msix_capable was always set to false. Now that add the ls1088a platform with MSIX support, use the doorbell method to support the MSIX feature. Signed-off-by: X

Re: [PATCH v3] powerpc: setup_64: set up PACA earlier to avoid kcov problems

2020-03-06 Thread Nicholas Piggin
Daniel Axtens's on March 6, 2020 5:30 pm: > kcov instrumentation is collected the __sanitizer_cov_trace_pc hook in > kernel/kcov.c. The compiler inserts these hooks into every basic block > unless kcov is disabled for that file. > > We then have a deep call-chain: > - __sanitizer_cov_trace_pc cal

Re: [PATCH V15] mm/debug: Add tests validating architecture page table helpers

2020-03-06 Thread Qian Cai
> On Mar 6, 2020, at 7:56 PM, Anshuman Khandual > wrote: > > > > On 03/07/2020 06:04 AM, Qian Cai wrote: >> >> >>> On Mar 6, 2020, at 7:03 PM, Anshuman Khandual >>> wrote: >>> >>> Hmm, set_pte_at() function is not preferred here for these tests. The idea >>> is to avoid or atleast mini

Re: [PATCH] powerpc/64: BE option to use ELFv2 ABI for big endian kernels

2020-03-06 Thread Nicholas Piggin
Segher Boessenkool's on March 5, 2020 8:55 pm: > On Thu, Mar 05, 2020 at 01:34:22PM +1000, Nicholas Piggin wrote: >> Segher Boessenkool's on March 4, 2020 9:09 am: >> >> +override flavour := linux-ppc64v2 >> > >> > That isn't a good name, heh. This isn't "v2" of anything... Spell out >> > the na

Re: [PATCH V15] mm/debug: Add tests validating architecture page table helpers

2020-03-06 Thread Anshuman Khandual
On 03/07/2020 06:04 AM, Qian Cai wrote: > > >> On Mar 6, 2020, at 7:03 PM, Anshuman Khandual >> wrote: >> >> Hmm, set_pte_at() function is not preferred here for these tests. The idea >> is to avoid or atleast minimize TLB/cache flushes triggered from these sort >> of 'static' tests. set_pte

[PATCH] Fix powerpc/64: system call zero volatile registers when returning

2020-03-06 Thread Nicholas Piggin
Here's an incremental fix that can be folded into the patch. Segher Boessenkool's on February 26, 2020 7:20 am: > Hi! > > On Wed, Feb 26, 2020 at 03:35:35AM +1000, Nicholas Piggin wrote: >> Kernel addresses and potentially other sensitive data could be leaked >> in volatile registers after a sysc

[PATCH v3 9/9] Documentation/powerpc: VAS API

2020-03-06 Thread Haren Myneni
Power9 introduced Virtual Accelerator Switchboard (VAS) which allows userspace to communicate with Nest Accelerator (NX) directly. But kernel has to establish channel to NX for userspace. This document describes user space API that application can use to establish communication channel. Signed-o

[PATCH v3 8/9] crypto/nx: Remove 'pid' in vas_tx_win_attr struct

2020-03-06 Thread Haren Myneni
When window is opened, pid reference is taken for user space windows. Not needed for kernel windows. So remove 'pid' in vas_tx_win_attr struct. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h| 1 - drivers/crypto/nx/nx-common-powernv.c | 1 - 2 files changed, 2 deletions

[PATCH v3 7/9] crypto/nx: Enable and setup GZIP compresstion type

2020-03-06 Thread Haren Myneni
Changes to probe GZIP device-tree nodes, open RX windows and setup GZIP compression type. No plans to provide GZIP usage in kernel right now, but this patch enables GZIP for user space usage. Signed-off-by: Haren Myneni --- drivers/crypto/nx/nx-common-powernv.c | 43 +++

[PATCH v3 6/9] crypto/NX: Make enable code generic to add new GZIP compression type

2020-03-06 Thread Haren Myneni
Make setup and enable code generic to support new GZIP compression type. Changed nx842 reference to nx and moved some code to new functions. Functionality is not changed except sparse warning fix - setting NULL instead of 0 for per_cpu send window in nx_delete_coprocs(). Signed-off-by: Haren Myn

Re: [PATCH V15] mm/debug: Add tests validating architecture page table helpers

2020-03-06 Thread Qian Cai
> On Mar 6, 2020, at 7:03 PM, Anshuman Khandual > wrote: > > Hmm, set_pte_at() function is not preferred here for these tests. The idea > is to avoid or atleast minimize TLB/cache flushes triggered from these sort > of 'static' tests. set_pte_at() is platform provided and could/might trigger

[PATCH v3 5/9] crypto/nx: Rename nx-842-powernv file name to nx-common-powernv

2020-03-06 Thread Haren Myneni
Rename nx-842-powernv.c to nx-common-powernv.c to add code for setup and enable new GZIP compression type. The actual functionality is not changed in this patch. Signed-off-by: Haren Myneni --- drivers/crypto/nx/Makefile|2 +- drivers/crypto/nx/nx-842-powernv.c| 1062 --

[PATCH v3 4/9] crypto/nx: Initialize coproc entry with kzalloc

2020-03-06 Thread Haren Myneni
coproc entry is initialized during NX probe on power9, but not on P8. nx842_delete_coprocs() is used for both and frees receive window if it is allocated. Getting crash for rmmod on P8 since coproc->vas.rxwin is not initialized. This patch replaces kmalloc with kzalloc in nx842_powernv_probe()

[PATCH v3 3/9] powerpc/vas: Add VAS user space API

2020-03-06 Thread Haren Myneni
On power9, userspace can send GZIP compression requests directly to NX once kernel establishes NX channel / window with VAS. This patch provides user space API which allows user space to establish channel using open VAS_TX_WIN_OPEN ioctl, mmap and close operations. Each window corresponds to fil

[PATCH v3 2/9] powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API

2020-03-06 Thread Haren Myneni
Define the VAS_TX_WIN_OPEN ioctl interface for NX GZIP access from user space. This interface is used to open GZIP send window and mmap region which can be used by userspace to send requests to NX directly with copy/paste instructions. Signed-off-by: Haren Myneni --- Documentation/userspace-ap

[PATCH v3 1/9] powerpc/vas: Initialize window attributes for GZIP coprocessor type

2020-03-06 Thread Haren Myneni
Initialize send and receive window attributes for GZIP high and normal priority types. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/platforms/powernv/vas-window.c

[PATCH v3 0/9] crypto/nx: Enable GZIP engine and provide userpace API

2020-03-06 Thread Haren Myneni
Power9 processor supports Virtual Accelerator Switchboard (VAS) which allows kernel and userspace to send compression requests to Nest Accelerator (NX) directly. The NX unit comprises of 2 842 compression engines and 1 GZIP engine. Linux kernel already has 842 compression support on kernel. This

Re: [PATCH] Add OPAL_GET_SYMBOL / OPAL_LOOKUP_SYMBOL

2020-03-06 Thread Nicholas Piggin
Oliver O'Halloran's on March 6, 2020 12:42 pm: > On Fri, Feb 28, 2020 at 2:09 PM Nicholas Piggin wrote: >> >> These calls can be used by Linux to annotate BUG addresses with symbols, >> look up symbol addresses in xmon, etc. >> >> This is preferable over having Linux parse the OPAL symbol map itse

Re: [PATCH V15] mm/debug: Add tests validating architecture page table helpers

2020-03-06 Thread Anshuman Khandual
On 03/07/2020 02:14 AM, Qian Cai wrote: > On Fri, 2020-03-06 at 05:27 +0530, Anshuman Khandual wrote: >> This adds tests which will validate architecture page table helpers and >> other accessors in their compliance with expected generic MM semantics. >> This will help various architectures in v

Re: [PATCH V15] mm/debug: Add tests validating architecture page table helpers

2020-03-06 Thread Qian Cai
On Fri, 2020-03-06 at 05:27 +0530, Anshuman Khandual wrote: > This adds tests which will validate architecture page table helpers and > other accessors in their compliance with expected generic MM semantics. > This will help various architectures in validating changes to existing > page table helpe

[PATCH 3/4] powerpc/xmon: Add source flags to output of XIVE interrupts

2020-03-06 Thread Cédric Le Goater
Some firmwares or hypervisors can advertise different source characteristics. Track their value under XMON. What we are mostly interested in is the StoreEOI flag. Signed-off-by: Cédric Le Goater --- arch/powerpc/sysdev/xive/common.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH V7 13/14] powerpc/vas: Display process stuck message

2020-03-06 Thread Haren Myneni
Process can not close send window until all requests are processed. Means wait until window state is not busy and send credits are returned. Display debug messages in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 28 ++

[PATCH V7 14/14] powerpc/vas: Free send window in VAS instance after credits returned

2020-03-06 Thread Haren Myneni
NX may be processing requests while trying to close window. Wait until all credits are returned and then free send window from VAS instance. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/

[PATCH V7 12/14] powerpc/vas: Return credits after handling fault

2020-03-06 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 9 + arch/powerpc/platforms/powernv/vas-w

[PATCH V7 11/14] powerpc/vas: Do not use default credits for receive window

2020-03-06 Thread Haren Myneni
System checkstops if RxFIFO overruns with more requests than the maximum possible number of CRBs allowed in FIFO at any time. So max credits value (rxattr.wcreds_max) is set and is passed to vas_rx_win_open() by the the driver. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas

[PATCH V7 10/14] powerpc/vas: Print CRB and FIFO values

2020-03-06 Thread Haren Myneni
Dump FIFO entries if could not find send window and print CRB for debugging. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 41 ++ 1 file changed, 41 insertions(+) diff --git a/arch/powerpc/platforms

[PATCH V7 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2020-03-06 Thread Haren Myneni
For each fault CRB, update fault address in CRB (fault_storage_addr) and translation error status in CSB so that user space can touch the fault address and resend the request. If the user space passed invalid CSB address send signal to process with SIGSEGV. Signed-off-by: Sukadev Bhattiprolu Si

[PATCH V7 08/14] powerpc/vas: Take reference to PID and mm for user space windows

2020-03-06 Thread Haren Myneni
Process close windows after its requests are completed. In multi-thread applications, child can open a window but release FD will not be called upon its exit. Parent thread will be closing it later upon its exit. The parent can also send NX requests with this window and NX can generate page faul

[PATCH V7 07/14] powerpc/vas: Register NX with fault window ID and IRQ port value

2020-03-06 Thread Haren Myneni
For each user space send window, register NX with fault window ID and port value so that NX paste CRBs in this fault FIFO when it sees fault on the request buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 15 +

[PATCH V7 06/14] powerpc/vas: Setup thread IRQ handler per VAS instance

2020-03-06 Thread Haren Myneni
Setup thread IRQ handler per each VAS instance. When NX sees a fault on CRB, kernel gets an interrupt and vas_fault_handler will be executed to process fault CRBs. Read all valid CRBs from fault FIFO, determine the corresponding send window from CRB and process fault requests. Signed-off-by: Suk

[PATCH V7 05/14] powerpc/vas: Setup fault window per VAS instance

2020-03-06 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets a fault on request buffer, write fault CRBs in the corresponding fault FIFO and then sends an interrupt to the OS. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2 +- arc

[PATCH V7 04/14] powerpc/vas: Alloc and setup IRQ and trigger port address

2020-03-06 Thread Haren Myneni
Alloc IRQ and get trigger port address for each VAS instance. Kernel register this IRQ per VAS instance and sets this port for each send window. NX interrupts the kernel when it sees page fault. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas.c | 34 +

[PATCH V7 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2020-03-06 Thread Haren Myneni
Kernel sets fault address and status in CRB for NX page fault on user space address after processing page fault. User space gets the signal and handles the fault mentioned in CRB by bringing the page in to memory and send NX request again. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren

[PATCH V7 02/14] powerpc/xive: Define xive_native_alloc_get_irq_info()

2020-03-06 Thread Haren Myneni
pnv_ocxl_alloc_xive_irq() in ocxl.c allocates IRQ and gets trigger port address. VAS also needs this function, but based on chip ID. So moved this common function to xive/native.c. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/xive.h | 2 ++ arch/powerpc/platforms/powernv/ocx

[PATCH V7 01/14] powerpc/xive: Define xive_native_alloc_irq_on_chip()

2020-03-06 Thread Haren Myneni
This function allocates IRQ on a specific chip. VAS needs per chip IRQ allocation and will have IRQ handler per VAS instance. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/xive.h | 9 - arch/powerpc/sysdev/xive/native.c | 6 +++--- 2 files changed, 11 insertions(+), 4 dele

[PATCH V7 00/14] powerpc/vas: Page fault handling for user space NX requests

2020-03-06 Thread Haren Myneni
On power9, Virtual Accelerator Switchboard (VAS) allows user space or kernel to communicate with Nest Accelerator (NX) directly using COPY/PASTE instructions. NX provides various functionalities such as compression, encryption and etc. But only compression (842 and GZIP formats) is supported in L

[PATCH 2/4] powerpc/xive: Fix xmon support on the PowerNV platform

2020-03-06 Thread Cédric Le Goater
The PowerNV platform has multiple IRQ chips and the xmon command dumping the state of the XIVE interrupt should only operate on the XIVE IRQ chip. Fixes: 5896163f7f91 ("powerpc/xmon: Improve output of XIVE interrupts") Cc: sta...@vger.kernel.org # v5.4+ Signed-off-by: Cédric Le Goater --- arch/p

Re: [PATCHv3 1/2] powerpc/of: split out new_property() for reusing

2020-03-06 Thread Nathan Lynch
Hi, Pingfan Liu writes: > Splitting out new_property() for coming reusing and moving it to > of_helpers.c. [...] > +struct property *new_property(const char *name, const int length, > + const unsigned char *value, struct property *last) > +{ > + struct property *new = kzalloc(si

Re: [PATCH] selftests/powerpc: Add a test of sigreturn vs VDSO

2020-03-06 Thread Nathan Lynch
Nathan Lynch writes: > Michael Ellerman writes: > >> +static int search_proc_maps(char *needle, unsigned long *low, unsigned long >> *high) > >^^ const? > >> +{ >> +unsigned long start, end; >> +static char buf[4096]; >> +

Re: [PATCH] selftests/powerpc: Add a test of sigreturn vs VDSO

2020-03-06 Thread Nathan Lynch
Michael Ellerman writes: > +static int search_proc_maps(char *needle, unsigned long *low, unsigned long > *high) ^^ const? > +{ > + unsigned long start, end; > + static char buf[4096]; > + char name[128]; > + FILE *f

Re: [PATCH v3] ima: add a new CONFIG for loading arch-specific policies

2020-03-06 Thread Nayna
Oops,  Please ignore this patch. By mistake I posted the wrong version. I am sorry for the confusion,  I will resend the right version. Thanks & Regards, - Nayna On 3/6/20 12:39 PM, Nayna Jain wrote: Every time a new architecture defines the IMA architecture specific functions - arch_i

[PATCH v3] ima: add a new CONFIG for loading arch-specific policies

2020-03-06 Thread Nayna Jain
Every time a new architecture defines the IMA architecture specific functions - arch_ima_get_secureboot() and arch_ima_get_policy(), the IMA include file needs to be updated. To avoid this "noise", this patch defines a new IMA Kconfig IMA_SECURE_AND_OR_TRUSTED_BOOT option, allowing the different ar

Re: [PATCH v2 4/5] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2020-03-06 Thread Naveen N. Rao
Nathan Lynch wrote: "Naveen N. Rao" writes: Gautham R Shenoy wrote: On Fri, Feb 21, 2020 at 10:50:12AM -0600, Nathan Lynch wrote: It's regrettable that we have to wake up potentially idle CPUs in order to derive correct idle statistics for them, but I suppose the main user (lparstat) of these

[PATCH v4 7/7] mm/memremap: Set caching mode for PCI P2PDMA memory to WC

2020-03-06 Thread Logan Gunthorpe
PCI BAR IO memory should never be mapped as WB, however prior to this the PAT bits were set WB and it was typically overridden by MTRR registers set by the firmware. Set PCI P2PDMA memory to be UC as this is what it currently, typically, ends up being mapped as on x86 after the MTRR registers over

[PATCH v4 2/7] mm/memory_hotplug: Rename mhp_restrictions to mhp_params

2020-03-06 Thread Logan Gunthorpe
The mhp_restrictions struct really doesn't specify anything resembling a restriction anymore so rename it to be mhp_params as it is a list of extended parameters. Signed-off-by: Logan Gunthorpe Reviewed-by: David Hildenbrand Reviewed-by: Dan Williams Acked-by: Michal Hocko --- arch/arm64/mm/m

[PATCH v4 6/7] mm/memory_hotplug: Add pgprot_t to mhp_params

2020-03-06 Thread Logan Gunthorpe
devm_memremap_pages() is currently used by the PCI P2PDMA code to create struct page mappings for IO memory. At present, these mappings are created with PAGE_KERNEL which implies setting the PAT bits to be WB. However, on x86, an mtrr register will typically override this and force the cache type t

[PATCH v4 4/7] x86/mm: Introduce __set_memory_prot()

2020-03-06 Thread Logan Gunthorpe
For use in the 32bit arch_add_memory() to set the pgprot type of the memory to add. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: x...@kernel.org Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Signed-off-by: Logan Gunthorpe Reviewed-by: Dan Willia

[PATCH v4 5/7] powerpc/mm: Thread pgprot_t through create_section_mapping()

2020-03-06 Thread Logan Gunthorpe
In prepartion to support a pgprot_t argument for arch_add_memory(). Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Signed-off-by: Logan Gunthorpe --- arch/powerpc/include/asm/book3s/64/hash.h | 3 ++- arch/powerpc/include/asm/book3s/64/radix.h | 3 ++- arch/powerpc/incl

[PATCH v4 3/7] x86/mm: Thread pgprot_t through init_memory_mapping()

2020-03-06 Thread Logan Gunthorpe
In prepartion to support a pgprot_t argument for arch_add_memory(). It's required to move the prototype of init_memory_mapping() seeing the original location came before the definition of pgprot_t. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: x...@kernel.or

[PATCH v4 1/7] mm/memory_hotplug: Drop the flags field from struct mhp_restrictions

2020-03-06 Thread Logan Gunthorpe
This variable is not used anywhere and should therefore be removed from the structure. Signed-off-by: Logan Gunthorpe Reviewed-by: David Hildenbrand Reviewed-by: Dan Williams Acked-by: Michal Hocko --- include/linux/memory_hotplug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include

[PATCH v4 0/7] Allow setting caching mode in arch_add_memory() for P2PDMA

2020-03-06 Thread Logan Gunthorpe
Hi, This is v4 of the patchset which cleans up a number of minor issues from the feedback of v3 and rebases onto v5.6-rc4. Additional feedback is welcome. Also worth noting, is that the kernel test robot reports[1] that Patch 3 in this series improves will-it-scale.per_process_ops by 36%. Though,

Re: [PATCH v2 1/5] powerpc: Move idle_loop_prolog()/epilog() functions to header file

2020-03-06 Thread Nathan Lynch
Gautham R Shenoy writes: > On Fri, Feb 21, 2020 at 09:03:16AM -0600, Nathan Lynch wrote: >> Looks fine and correct as a cleanup, but asm/include/idle.h and >> idle_loop_prolog, idle_loop_epilog, strike me as too generic for >> pseries-specific code. > > Should it be prefixed with pseries , i.e pse

Re: [PATCH v2 4/5] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2020-03-06 Thread Nathan Lynch
"Naveen N. Rao" writes: > Gautham R Shenoy wrote: >> On Fri, Feb 21, 2020 at 10:50:12AM -0600, Nathan Lynch wrote: >>> It's regrettable that we have to wake up potentially idle CPUs in order >>> to derive correct idle statistics for them, but I suppose the main user >>> (lparstat) of these interfa

[PATCH v3] powerpc/kasan: Fix shadow memory protection with CONFIG_KASAN_VMALLOC

2020-03-06 Thread Christophe Leroy
With CONFIG_KASAN_VMALLOC, new page tables are created at the time shadow memory for vmalloc area in unmapped. If some parts of the page table still has entries to the zero page shadow memory, the entries are wrongly marked RW. With CONFIG_KASAN_VMALLOC, almost the entire kernel address space is m

[PATCH 4/4] powerpc/xive: Add a debugfs file to dump internal XIVE state

2020-03-06 Thread Cédric Le Goater
As does XMON, the debugfs file /sys/kernel/debug/powerpc/xive exposes the XIVE internal state of the machine CPUs and interrupts. Available on the PowerNV and sPAPR platforms. Signed-off-by: Cédric Le Goater --- arch/powerpc/sysdev/xive/xive-internal.h | 2 + arch/powerpc/sysdev/xive/common.c

[PATCH 1/4] powerpc/xive: Use XIVE_BAD_IRQ instead of zero to catch non configured IPIs

2020-03-06 Thread Cédric Le Goater
When a CPU is brought up, an IPI number is allocated and recorded under the XIVE CPU structure. Invalid IPI numbers are tracked with interrupt number 0x0. On the PowerNV platform, the interrupt number space starts at 0x10 and this works fine. However, on the sPAPR platform, it is possible to alloc

[PATCH v2] powerpc/kasan: Fix shadow memory protection with CONFIG_KASAN_VMALLOC

2020-03-06 Thread Christophe Leroy
With CONFIG_KASAN_VMALLOC, new page tables are created at the time shadow memory for vmalloc area in unmapped. If some parts of the page table still has entries to the zero page shadow memory, the entries are wrongly marked RW. With CONFIG_KASAN_VMALLOC, almost the entire kernel address space is m

[PATCH] powerpc/kasan: Fix kasan_remap_early_shadow_ro()

2020-03-06 Thread Christophe Leroy
At the moment kasan_remap_early_shadow_ro() does nothing, because k_end is 0 and k_cur < 0 is always true. Change the test to k_cur != k_end, as done in kasan_init_shadow_page_tables() Signed-off-by: Christophe Leroy Fixes: cbd18991e24f ("powerpc/mm: Fix an Oops in kasan_mmu_init()") Cc: sta...@

[PATCH 0/4] powerpc/xive: fixes and debug extensions

2020-03-06 Thread Cédric Le Goater
Hello, First two patches are fixes for non-critical issues. I checked that they applied on stable. Last two are debug extensions, one for xmon and the other to dump XIVE internal state under debugfs, which is easier than xmon. Cheers, C. Cédric Le Goater (4): powerpc/xive: Use XIVE_BAD_IRQ i

[PATCH v8 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support

2020-03-06 Thread Daniel Axtens
Implement a limited form of KASAN for Book3S 64-bit machines running under the Radix MMU: - Set aside the last 1/8th of the first contiguous block of physical memory to provide writable shadow for the linear map. For annoying reasons documented below, the memory size must be specified at co

[PATCH v8 3/4] powerpc/mm/kasan: rename kasan_init_32.c to init_32.c

2020-03-06 Thread Daniel Axtens
kasan is already implied by the directory name, we don't need to repeat it. Suggested-by: Christophe Leroy Signed-off-by: Daniel Axtens --- arch/powerpc/mm/kasan/Makefile | 2 +- arch/powerpc/mm/kasan/{kasan_init_32.c => init_32.c} | 0 2 files changed, 1 insertion(+), 1 d

[PATCH v8 2/4] kasan: Document support on 32-bit powerpc

2020-03-06 Thread Daniel Axtens
KASAN is supported on 32-bit powerpc and the docs should reflect this. Document s390 support while we're at it. Suggested-by: Christophe Leroy Reviewed-by: Christophe Leroy Signed-off-by: Daniel Axtens --- Changes since v5: - rebase - riscv has now got support. - document s390 support whil

[PATCH v8 1/4] kasan: define and use MAX_PTRS_PER_* for early shadow tables

2020-03-06 Thread Daniel Axtens
powerpc has a variable number of PTRS_PER_*, set at runtime based on the MMU that the kernel is booted under. This means the PTRS_PER_* are no longer constants, and therefore breaks the build. Define default MAX_PTRS_PER_*s in the same style as MAX_PTRS_PER_P4D. As KASAN is the only user at the m

[PATCH v8 0/4] KASAN for powerpc64 radix

2020-03-06 Thread Daniel Axtens
Building on the work of Christophe, Aneesh and Balbir, I've ported KASAN to 64-bit Book3S kernels running on the Radix MMU. This provides full inline instrumentation on radix, but does require that you be able to specify the amount of physically contiguous memory on the system at compile time. Mor

Re: [PATCH v3] powerpc: setup_64: set up PACA earlier to avoid kcov problems

2020-03-06 Thread Daniel Axtens
Andrew Donnellan writes: > On 6/3/20 6:30 pm, Daniel Axtens wrote: >> kcov instrumentation is collected the __sanitizer_cov_trace_pc hook in >> kernel/kcov.c. The compiler inserts these hooks into every basic block >> unless kcov is disabled for that file. >> >> We then have a deep call-chain: >

Re: [PATCH v7 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support

2020-03-06 Thread Daniel Axtens
Christophe Leroy writes: > Le 13/02/2020 à 01:47, Daniel Axtens a écrit : >> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig >> index 497b7d0b2d7e..f1c54c08a88e 100644 >> --- a/arch/powerpc/Kconfig >> +++ b/arch/powerpc/Kconfig >> @@ -169,7 +169,9 @@ config PPC >> select HAVE_ARCH_H

[PATCH] Fixes: 227942809b52 ("cpufreq: powernv: Restore cpu frequency to policy->cur on unthrottling")

2020-03-06 Thread Pratik Rajesh Sampat
The patch avoids allocating cpufreq_policy on stack hence fixing frame size overflow in 'powernv_cpufreq_work_fn' Signed-off-by: Pratik Rajesh Sampat --- drivers/cpufreq/powernv-cpufreq.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/powernv-cp

[Bug 206695] kmemleak reports leaks in drivers/macintosh/windfarm

2020-03-06 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206695 --- Comment #6 from Erhard F. (erhar...@mailbox.org) --- (In reply to mpe from comment #5) > Can you try this one instead, it changes the order of operations to make > the code flow a bit nicer. 2nd patch works equally well. -- You are receiving

Re: [PATCH v3] powerpc: setup_64: set up PACA earlier to avoid kcov problems

2020-03-06 Thread Andrew Donnellan
On 6/3/20 6:30 pm, Daniel Axtens wrote: kcov instrumentation is collected the __sanitizer_cov_trace_pc hook in kernel/kcov.c. The compiler inserts these hooks into every basic block unless kcov is disabled for that file. We then have a deep call-chain: - __sanitizer_cov_trace_pc calls to check