[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #33 from Erhard F. (erhar...@mailbox.org) --- On Fri, 16 Aug 2019 08:22:31 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #32 from Christophe Leroy

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

2019-08-16 Thread Xiaowei Bao
> -Original Message- > From: Andrew Murray > Sent: 2019年8月16日 17:45 > To: Xiaowei Bao > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > mark.rutl...@arm.com; shawn...@kernel.org; Leo Li > ; kis...@ti.com; lorenzo.pieral...@arm.com; > a...@arndb.de;

Re: [PATCH] ASoC: imx-audmux: Add driver suspend and resume to support MEGA Fast

2019-08-16 Thread Mark Brown
On Fri, Aug 16, 2019 at 01:03:14AM -0400, Shengjiu Wang wrote: > + for (i = 0; i < reg_max; i++) > + regcache[i] = readl(audmux_base + i * 4); If only there were some framework which provided a register cache! :P signature.asc Description: PGP signature

[PATCH] powerpc/vdso32: inline __get_datapage()

2019-08-16 Thread Christophe Leroy
__get_datapage() is only a few instructions to retrieve the address of the page where the kernel stores data to the VDSO. By inlining this function into its users, a bl/blr pair and a mflr/mtlr pair is avoided, plus a few reg moves. The improvement is noticeable (about 55 nsec/call on an 8xx)

Re: Oops in blk_mq_get_request() (was Re: ppc64le kernel panic on 5.2.9-rc1)

2019-08-16 Thread Ming Lei
On Fri, Aug 16, 2019 at 7:15 PM Michael Ellerman wrote: > > Major Hayden writes: > > Hello there, > > > > The CKI Project just found a kernel panic while running the blktests > > test suite on stable 5.2.9-rc1[0]. Michael Ellerman requested for this > > list to be copied on these ppc64le

[PATCH] powerpc: Set right value of Speculation_Store_Bypass in /proc//status

2019-08-16 Thread Gustavo Walbon
The issue has showed the value of status of Speculation_Store_Bypass in the /proc//status as `unknown` for PowerPC systems. The patch fix the checking of the mitigation status of Speculation, and can be reported as "not vulnerable", "globally mitigated" or "vulnerable". Link:

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

2019-08-16 Thread Xiaowei Bao
> -Original Message- > From: Andrew Murray > Sent: 2019年8月16日 20:35 > To: Xiaowei Bao > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > mark.rutl...@arm.com; shawn...@kernel.org; Leo Li > ; kis...@ti.com; lorenzo.pieral...@arm.com; > a...@arndb.de;

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

2019-08-16 Thread Kishon Vijay Abraham I
Hi, On 16/08/19 8:28 AM, Xiaowei Bao wrote: > > >> -Original Message- >> From: Andrew Murray >> Sent: 2019年8月15日 19:54 >> To: Xiaowei Bao >> Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; >> bhelg...@google.com; robh...@kernel.org; mark.rutl...@arm.com; >>

[PATCH v2] powerpc/32: Add VDSO version of getcpu

2019-08-16 Thread Christophe Leroy
Commit 18ad51dd342a ("powerpc: Add VDSO version of getcpu") added getcpu() for PPC64 only, by making use of a user readable general purpose SPR. PPC32 doesn't have any such SPR, a full system call can still be avoided by implementing a fast system call which reads the CPU id in the task struct

Applied "ASoC: imx-audmux: Add driver suspend and resume to support MEGA Fast" to the asoc tree

2019-08-16 Thread Mark Brown
The patch ASoC: imx-audmux: Add driver suspend and resume to support MEGA Fast has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3 All being well this means that it will be integrated into the linux-next tree (usually sometime in

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #35 from Christophe Leroy (christophe.le...@c-s.fr) --- Le 16/08/2019 à 16:38, bugzilla-dae...@bugzilla.kernel.org a écrit : > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #34 from Erhard F.

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

2019-08-16 Thread Xiaowei Bao
> -Original Message- > From: Andrew Murray > Sent: 2019年8月16日 18:20 > To: Xiaowei Bao > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > bhelg...@google.com; robh...@kernel.org; mark.rutl...@arm.com; > shawn...@kernel.org; Leo Li ; kis...@ti.com; > lorenzo.pieral...@arm.com;

RE: [PATCH 05/10] PCI: layerscape: Modify the way of getting capability with different PEX

2019-08-16 Thread Xiaowei Bao
> -Original Message- > From: Andrew Murray > Sent: 2019年8月16日 18:26 > To: Xiaowei Bao > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > bhelg...@google.com; robh...@kernel.org; mark.rutl...@arm.com; > shawn...@kernel.org; Leo Li ; kis...@ti.com; > lorenzo.pieral...@arm.com;

Oops in blk_mq_get_request() (was Re: ppc64le kernel panic on 5.2.9-rc1)

2019-08-16 Thread Michael Ellerman
Major Hayden writes: > Hello there, > > The CKI Project just found a kernel panic while running the blktests > test suite on stable 5.2.9-rc1[0]. Michael Ellerman requested for this > list to be copied on these ppc64le failures. > > We have some logs[1] for these failures and they start with >

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

2019-08-16 Thread Andrew Murray
On Fri, Aug 16, 2019 at 11:00:01AM +, Xiaowei Bao wrote: > > > > -Original Message- > > From: Andrew Murray > > Sent: 2019年8月16日 17:45 > > To: Xiaowei Bao > > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > > mark.rutl...@arm.com; shawn...@kernel.org; Leo Li > > ;

[PATCH] powerpc/vdso32: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2019-08-16 Thread Christophe Leroy
This is copied and adapted from commit 5c929885f1bb ("powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE") from Santosh Sivaraj Benchmark from vdsotest: clock-gettime-realtime: syscall: 3601 nsec/call clock-gettime-realtime:libc: 1072 nsec/call clock-gettime-realtime:vdso:

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #34 from Erhard F. (erhar...@mailbox.org) --- On Fri, 16 Aug 2019 08:22:31 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #32 from Christophe Leroy

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

2019-08-16 Thread Xiaowei Bao
> -Original Message- > From: Kishon Vijay Abraham I > Sent: 2019年8月16日 18:50 > To: Xiaowei Bao ; Andrew Murray > > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > bhelg...@google.com; robh...@kernel.org; mark.rutl...@arm.com; > shawn...@kernel.org; Leo Li ; >

[PATCH] crypto: vmx/xts - use fallback for ciphertext stealing

2019-08-16 Thread Ard Biesheuvel
For correctness and compliance with the XTS-AES specification, we are adding support for ciphertext stealing to XTS implementations, even though no use cases are known that will be enabled by this. Since the Power8 implementation already has a fallback skcipher standby for other purposes, let's

Re: 5.2.7 kernel doesn't boot on G5

2019-08-16 Thread Andreas Schwab
On Aug 16 2019, Christian Marillat wrote: > On 15 août 2019 19:50, christophe leroy wrote: > > [...] > >> Can you test with latest stable version, ie 5.2.8 ? > > Built from my G5 with make-kpkg and still doesn't boot : FWIW, 5.2.0 is working fine on my G5 (PowerMac7,3). Andreas. -- Andreas

Re: 5.2.7 kernel doesn't boot on G5

2019-08-16 Thread Christian Marillat
On 16 août 2019 16:05, Andreas Schwab wrote: > On Aug 16 2019, Christian Marillat wrote: > >> On 15 août 2019 19:50, christophe leroy wrote: >> >> [...] >> >>> Can you test with latest stable version, ie 5.2.8 ? >> >> Built from my G5 with make-kpkg and still doesn't boot : > > FWIW, 5.2.0 is

[PATCH] powerpc/32: Add VDSO version of getcpu

2019-08-16 Thread Christophe Leroy
Commit 18ad51dd342a ("powerpc: Add VDSO version of getcpu") added getcpu() for PPC64 only, by making use of a user readable general purpose SPR. PPC32 doesn't have any such SPR, a full system call can still be avoided by implementing a fast system call which reads the CPU id in the task struct

Re: [PATCH] powerpc/futex: fix warning: 'oldval' may be used uninitialized in this function

2019-08-16 Thread Michael Ellerman
Christophe Leroy writes: > CC kernel/futex.o > kernel/futex.c: In function 'do_futex': > kernel/futex.c:1676:17: warning: 'oldval' may be used uninitialized in this > function [-Wmaybe-uninitialized] >return oldval == cmparg; > ^ > kernel/futex.c:1651:6: note:

Re: 5.2.7 kernel doesn't boot on G5

2019-08-16 Thread Christian Marillat
On 15 août 2019 19:50, christophe leroy wrote: [...] > Can you test with latest stable version, ie 5.2.8 ? Built from my G5 with make-kpkg and still doesn't boot : https://www.deb-multimedia.org/tests/20190816_142333.jpg Christian

Re: [PATCH] powerpc/vdso32: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2019-08-16 Thread Segher Boessenkool
On Fri, Aug 16, 2019 at 01:01:50PM +, Christophe Leroy wrote: > - add r3,r3,r5 > +78: add r3,r3,r5 You can use actual names for the labels as well... .Lsomething if you want it to stay a local symbol only. Segher

[PATCH v5 03/23] PCI: hotplug: Add a flag for the movable BARs feature

2019-08-16 Thread Sergey Miroshnichenko
When hot-adding a device, the bridge may have windows not big enough (or fragmented too much) for newly requested BARs to fit in. And expanding these bridge windows may be impossible because blocked by "neighboring" BARs and bridge windows. Still, it may be possible to allocate a memory region

[PATCH v5 07/23] PCI: hotplug: movable BARs: Don't allow added devices to steal resources

2019-08-16 Thread Sergey Miroshnichenko
When movable BARs are enabled, the PCI subsystem at first releases all the bridge windows and then attempts to assign resources both to previously working devices and to the newly hotplugged ones, with the same priority. If a hotplugged device gets its BARs first, this may lead to lack of space

[PATCH v5 12/23] PCI: hotplug: movable BARs: Compute limits for relocated bridge windows

2019-08-16 Thread Sergey Miroshnichenko
With enabled movable BARs, bridge windows are recalculated during each pci rescan. Some of the BARs below the bridge may be fixed/immovable: these areas are represented by the .immovable_range field in struct pci_bus. If a bridge window size is equal to its immovable range, it can only be

[PATCH v5 15/23] PCI: hotplug: movable BARs: Assign fixed and immovable BARs before others

2019-08-16 Thread Sergey Miroshnichenko
Reassign resources during rescan in two steps: first the fixed/immovable BARs and bridge windows that have fixed areas, so the movable ones will not steal these reserved areas; then the rest - so the movable BARs will divide the rest of the space. With this change, pci_assign_resource() is now

Re: [PATCH v4 1/3] kasan: support backing vmalloc space with real shadow memory

2019-08-16 Thread Mark Rutland
Hi Christophe, On Fri, Aug 16, 2019 at 09:47:00AM +0200, Christophe Leroy wrote: > Le 15/08/2019 à 02:16, Daniel Axtens a écrit : > > Hook into vmalloc and vmap, and dynamically allocate real shadow > > memory to back the mappings. > > > > Most mappings in vmalloc space are small, requiring less

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #36 from Erhard F. (erhar...@mailbox.org) --- On Fri, 16 Aug 2019 15:20:47 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #35 from Christophe Leroy

[PATCH v6 3/5] powerpc/pci: Create pci_dn on demand

2019-08-16 Thread Sergey Miroshnichenko
If a struct pci_dn hasn't yet been created for the PCIe device (there was no DT node for it), allocate this structure and fill with info read from the device directly. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 88 ++-- 1 file

[PATCH v5 04/23] PCI: Define PCI-specific version of the release_child_resources()

2019-08-16 Thread Sergey Miroshnichenko
If release the bridge resources with standard release_child_resources(), it drops the .start field of children's BARs to zero, but with the STARTALIGN flag remaining set, which makes the resource invalid for reassignment. Some resources must preserve their offset and size: those marked with the

[PATCH v5 10/23] PCI: hotplug: movable BARs: Try to assign unassigned resources only once

2019-08-16 Thread Sergey Miroshnichenko
With enabled BAR movement, BARs and bridge windows can only be assigned to their direct parents, so there can be only one variant of resource tree, thus every retry within the pci_assign_unassigned_root_bus_resources() will result in the same tree, and it is enough to try just once. In case of

[PATCH v5 14/23] PCI: Fix assigning the fixed prefetchable resources

2019-08-16 Thread Sergey Miroshnichenko
Allow matching IORESOURCE_PCI_FIXED prefetchable BARs to non-prefetchable windows, so they follow the same rules as immovable BARs. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/setup-bus.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git

[PATCH v5 23/23] PCI: pciehp: movable BARs: Trigger a domain rescan on hp events

2019-08-16 Thread Sergey Miroshnichenko
With movable BARs, adding a hotplugged device is not local to its bridge anymore, but it affects the whole domain: BARs, bridge windows and bus numbers can be substantially rearranged. So instead of trying to fit the new devices into preallocated reserved gaps, initiate a full domain rescan. The

Re: [PATCH 6/6] arm64: document the choice of page attributes for pgprot_dmacoherent

2019-08-16 Thread Will Deacon
On Fri, Aug 16, 2019 at 07:59:42PM +0200, Christoph Hellwig wrote: > On Fri, Aug 16, 2019 at 06:31:18PM +0100, Will Deacon wrote: > > Mind if I tweak the second sentence to be: > > > > This is different from "Device-nGnR[nE]" memory which is intended for MMIO > > and thus forbids speculation,

Re: [PATCH 3/6] powerpc: Convert flush_icache_range & friends to C

2019-08-16 Thread Christophe Leroy
Le 15/08/2019 à 09:29, christophe leroy a écrit : Le 15/08/2019 à 06:10, Alastair D'Silva a écrit : From: Alastair D'Silva Similar to commit 22e9c88d486a ("powerpc/64: reuse PPC32 static inline flush_dcache_range()") this patch converts flush_icache_range() to C, and reimplements the

[PATCH v6 1/5] powerpc/pci: Access PCI config space directly w/o pci_dn

2019-08-16 Thread Sergey Miroshnichenko
To fetch an updated DT for the newly hotplugged device, OS must explicitly request it from the firmware via the pnv_php driver. If pnv_php wasn't triggered/loaded, it is still possible to discover new devices if PCIe I/O will not stop in absence of the pci_dn structure. Reviewed-by: Oliver

[PATCH v5 20/23] PCI: hotplug: movable BARs: Enable the feature by default

2019-08-16 Thread Sergey Miroshnichenko
This is the last patch in the series which implements the essentials of the Movable BARs feature, so it is turned by default now. Tested on: - x86_64 with "pci=realloc,assign-busses,use_crs,pcie_bus_peer2peer" command line argument; - POWER8 PowerNV+PHB3 ppc64le with

[PATCH v5 22/23] PCI/portdrv: Declare support of movable BARs

2019-08-16 Thread Sergey Miroshnichenko
Switch's BARs are not used by the portdrv driver, but they are still considered as immovable until the .rescan_prepare() and .rescan_done() hooks are added. Add these hooks to increase chances to allocate new BARs. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/pcie/portdrv_pci.c | 11

Re: [PATCH 6/6] arm64: document the choice of page attributes for pgprot_dmacoherent

2019-08-16 Thread Will Deacon
Hi Christoph, Thanks for spinning this into a patch. On Fri, Aug 16, 2019 at 09:07:54AM +0200, Christoph Hellwig wrote: > Based on an email from Will Deacon. > > Signed-off-by: Christoph Hellwig > --- > arch/arm64/include/asm/pgtable.h | 8 > 1 file changed, 8 insertions(+) > > diff

[PATCH v5 08/23] PCI: Include fixed and immovable BARs into the bus size calculating

2019-08-16 Thread Sergey Miroshnichenko
The only difference between the fixed/immovable and movable BARs is a size and offset preservation after they are released (the corresponding struct resource* detached from a bridge window for a while during a bus rescan). Include fixed/immovable BARs into result of pbus_size_mem() and prohibit

[PATCH v5 13/23] PCI: Make sure bridge windows include their fixed BARs

2019-08-16 Thread Sergey Miroshnichenko
When the time comes to select a start address for the bridge window during the root bus rescan, it should be not just a lowest possible address: this window must cover all the underlying fixed and immovable BARs. The lowest address that satisfies this requirement is the .realloc_range field of

Re: [PATCH 6/6] arm64: document the choice of page attributes for pgprot_dmacoherent

2019-08-16 Thread Mark Rutland
On Fri, Aug 16, 2019 at 06:31:18PM +0100, Will Deacon wrote: > Hi Christoph, > > Thanks for spinning this into a patch. > > On Fri, Aug 16, 2019 at 09:07:54AM +0200, Christoph Hellwig wrote: > > Based on an email from Will Deacon. > > > > Signed-off-by: Christoph Hellwig > > --- > >

[PATCH v6 4/5] powerpc/powernv/pci: Hook up the writes to PCI_SECONDARY_BUS register

2019-08-16 Thread Sergey Miroshnichenko
Writing a new value to the PCI_SECONDARY_BUS register of the bridge means that its children will become addressable on another address (new B in BDF) or even un-addressable if the secondary bus is set to zero. On PowerNV, device PEs are heavily BDF-dependent, so they must be updated on every such

[PATCH v5 05/23] PCI: hotplug: movable BARs: Fix reassigning the released bridge windows

2019-08-16 Thread Sergey Miroshnichenko
When a bridge window is temporarily released during the rescan, its old size is not relevant anymore - it will be recreated from pbus_size_*(), so it's start value should be zero. If such window can't be reassigned, don't apply reset_resource(), so the next retry may succeed. Signed-off-by:

[PATCH v5 18/23] powerpc/pci: Handle BAR movement

2019-08-16 Thread Sergey Miroshnichenko
Add pcibios_rescan_prepare()/_done() hooks for the powerpc platform. Now if the device's driver supports movable BARs, pcibios_rescan_prepare() will be called after the device is stopped, and pcibios_rescan_done() - before it resumes. There are no memory requests to this device between the hooks,

[PATCH v6 0/5] powerpc/powernv/pci: Make hotplug self-sufficient, independent of FW and DT

2019-08-16 Thread Sergey Miroshnichenko
Allow switching from the pnv_php module to the standard pciehp driver for PowerNV, if the platform supports it: it can be a server working on top of the skiboot with the [1] patchset applied. Add the ability to discover hot-added devices which weren't added to the Device Tree (by the pnv_php via

[PATCH v6 5/5] powerpc/pci: Enable assigning bus numbers instead of reading them from DT

2019-08-16 Thread Sergey Miroshnichenko
If the firmware indicates support of reassigning bus numbers via the PHB's "ibm,supported-movable-bdfs" property in DT, PowerNV will not depend on PCI topology info from DT anymore. This makes possible to re-enumerate the fabric, assign the new bus numbers and switch from the pnv_php module to

[PATCH v5 01/23] PCI: Fix race condition in pci_enable/disable_device()

2019-08-16 Thread Sergey Miroshnichenko
This is a yet another approach to fix an old [1-2] concurrency issue, when: - two or more devices are being hot-added into a bridge which was initially empty; - a bridge with two or more devices is being hot-added; - during boot, if BIOS/bootloader/firmware doesn't pre-enable bridges. The

[PATCH v5 06/23] PCI: hotplug: movable BARs: Recalculate all bridge windows during rescan

2019-08-16 Thread Sergey Miroshnichenko
When the movable BARs feature is enabled and a rescan has been requested, release all the bridge windows and recalculate them from scratch, taking into account all kinds for BARs: fixed, immovable, movable, new. This increases the chances to find a memory space to fit BARs for newly hotplugged

[PATCH v5 09/23] PCI: Prohibit assigning BARs and bridge windows to non-direct parents

2019-08-16 Thread Sergey Miroshnichenko
When movable BARs are enabled, the feature of resource relocating from commit 2bbc6942273b5 ("PCI : ability to relocate assigned pci-resources") is not used. Instead, inability to assign a resource is used as a signal to retry BAR assignment with other configuration of bridge windows.

[PATCH v5 16/23] PCI: hotplug: movable BARs: Don't reserve IO/mem bus space

2019-08-16 Thread Sergey Miroshnichenko
A hotplugged bridge with many hotplug-capable ports may request reserving more IO space than the machine has. This could be overridden with the "hpiosize=" kernel argument though. But when BARs are movable, there are no need to reserve space anymore: new BARs are allocated not from reserved gaps,

[RFC PATCH] powerpc: Convert ____flush_dcache_icache_phys() to C

2019-08-16 Thread Christophe Leroy
Resulting code (8xx with 16 bytes per cacheline and 16k pages) 016c <__flush_dcache_icache_phys>: 16c: 54 63 00 22 rlwinm r3,r3,0,0,17 170: 7d 20 00 a6 mfmsr r9 174: 39 40 04 00 li r10,1024 178: 55 28 07 34 rlwinm r8,r9,0,28,26 17c: 7c 67 1b 78 mr

[PATCH v6 2/5] powerpc/powernv/pci: Suppress an EEH error when reading an empty slot

2019-08-16 Thread Sergey Miroshnichenko
Reading an empty slot returns all ones, which triggers a false EEH error event on PowerNV. This patch unfreezes the bus where it has happened. Reviewed-by: Oliver O'Halloran Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/include/asm/ppc-pci.h | 1 + arch/powerpc/kernel/pci_dn.c

[PATCH v5 02/23] PCI: Enable bridge's I/O and MEM access for hotplugged devices

2019-08-16 Thread Sergey Miroshnichenko
The PCI_COMMAND_IO and PCI_COMMAND_MEMORY bits of the bridge must be updated not only when enabling the bridge for the first time, but also if a hotplugged device requests these types of resources. Originally these bits were set by the pci_enable_device_flags() only, which exits early if the

[PATCH v5 17/23] powerpc/pci: Fix crash with enabled movable BARs

2019-08-16 Thread Sergey Miroshnichenko
Add a check for the UNSET resource flag to skip the released BARs CC: Alexey Kardashevskiy Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c

[PATCH v5 19/23] PCI: hotplug: Configure MPS for hot-added bridges during bus rescan

2019-08-16 Thread Sergey Miroshnichenko
Assure that MPS settings are set up for bridges which are discovered during manually triggered rescan via sysfs. This sequence of bridge init (using pci_rescan_bus()) will be used for pciehp hot-add events when BARs are movable. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/probe.c | 5

Re: [PATCH 6/6] arm64: document the choice of page attributes for pgprot_dmacoherent

2019-08-16 Thread Christoph Hellwig
On Fri, Aug 16, 2019 at 06:31:18PM +0100, Will Deacon wrote: > Mind if I tweak the second sentence to be: > > This is different from "Device-nGnR[nE]" memory which is intended for MMIO > and thus forbids speculation, preserves access size, requires strict > alignment and can also force

[PATCH v5 00/23] PCI: Allow BAR movement during hotplug

2019-08-16 Thread Sergey Miroshnichenko
If the firmware or kernel has arranged memory for PCIe devices in a way that doesn't provide enough space for BARs of a new hotplugged device, the kernel can pause the drivers of the "obstructing" devices and move their BARs, so the new BARs can fit into the freed spaces. To rearrange the BARs

[PATCH v5 11/23] PCI: hotplug: movable BARs: Calculate immovable parts of bridge windows

2019-08-16 Thread Sergey Miroshnichenko
When movable BARs are enabled, and if a bridge contains a device with fixed (IORESOURCE_PCI_FIXED) or immovable BARs, the corresponing windows can't be moved too far away from their original positions - they must still contain all the fixed/immovable BARs, like that: 1) Window position before a

[PATCH v5 21/23] nvme-pci: Handle movable BARs

2019-08-16 Thread Sergey Miroshnichenko
Hotplugged devices can affect the existing ones by moving their BARs. The PCI subsystem will inform the NVME driver about this by invoking the .rescan_prepare() and .rescan_done() hooks, so the BARs can by re-mapped. Tested under the "randrw" mode of the fio tool. Before the hotplugging: %

Re: [PATCH v4 1/3] kasan: support backing vmalloc space with real shadow memory

2019-08-16 Thread Andy Lutomirski
On Fri, Aug 16, 2019 at 10:08 AM Mark Rutland wrote: > > Hi Christophe, > > On Fri, Aug 16, 2019 at 09:47:00AM +0200, Christophe Leroy wrote: > > Le 15/08/2019 à 02:16, Daniel Axtens a écrit : > > > Hook into vmalloc and vmap, and dynamically allocate real shadow > > > memory to back the

Re: [PATCH v2 09/44] powerpc/64s/pseries: machine check convert to use common event code

2019-08-16 Thread Michael Ellerman
kbuild test robot writes: > Hi Nicholas, > > I love your patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [cannot apply to v5.3-rc3 next-20190807] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: >

Re: [PATCH v4 22/25] powernv/fadump: Warn before processing partial crashdump

2019-08-16 Thread Mahesh J Salgaonkar
On 2019-07-16 17:04:38 Tue, Hari Bathini wrote: > If not all kernel boot memory regions are registered for MPIPL before > system crashes, try processing the partial crashdump but warn the user > before proceeding. > > Signed-off-by: Hari Bathini > --- >

[PATCH 1/6] usb: don't create dma pools for HCDs with a localmem_pool

2019-08-16 Thread Christoph Hellwig
If the HCD provides a localmem pool we will never use the DMA pools, so don't create them. Fixes: b0310c2f09bb ("USB: use genalloc for USB HCs with local memory") Signed-off-by: Christoph Hellwig --- drivers/usb/core/buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 4/6] usb/max3421: remove the dummy {un, }map_urb_for_dma methods

2019-08-16 Thread Christoph Hellwig
Now that we have an explicit HCD_DMA flag, there is not need to override these methods. Signed-off-by: Christoph Hellwig --- drivers/usb/host/max3421-hcd.c | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c index

[PATCH 6/6] driver core: initialize a default DMA mask for platform device

2019-08-16 Thread Christoph Hellwig
We still treat devices without a DMA mask as defaulting to 32-bits for both mask, but a few releases ago we've started warning about such cases, as they require special cases to work around this sloppyness. Add a dma_mask field to struct platform_device so that we can initialize the dma_mask

[PATCH 3/6] arm-nommu: remove the unused pgprot_dmacoherent define

2019-08-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/pgtable-nommu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h index 0b1f6799a32e..d0de24f06724 100644 --- a/arch/arm/include/asm/pgtable-nommu.h +++

Re: [PATCH v4 1/3] kasan: support backing vmalloc space with real shadow memory

2019-08-16 Thread Christophe Leroy
Le 15/08/2019 à 02:16, Daniel Axtens a écrit : Hook into vmalloc and vmap, and dynamically allocate real shadow memory to back the mappings. Most mappings in vmalloc space are small, requiring less than a full page of shadow space. Allocating a full shadow page per mapping would therefore be

Re: 5.2.7 kernel doesn't boot on G5

2019-08-16 Thread Christian Marillat
On 15 août 2019 19:50, christophe leroy wrote: > Le 15/08/2019 à 19:48, Christian Marillat a écrit : >> On 15 août 2019 19:29, christophe leroy wrote: >> >>> Le 15/08/2019 à 19:05, Mathieu Malaterre a écrit : Does that ring a bell to anyone here ? Thanks >>> >>> Apparently that's 5.2.0,

[PATCH 3/6] usb: add a HCD_DMA flag instead of guestimating DMA capabilities

2019-08-16 Thread Christoph Hellwig
The usb core is the only major place in the kernel that checks for a non-NULL device dma_mask to see if a device is DMA capable. This is generally a bad idea, as all major busses always set up a DMA mask, even if the device is not DMA capable - in fact bus layers like PCI can't even know if a

[PATCH 5/6] dma-mapping: remove is_device_dma_capable

2019-08-16 Thread Christoph Hellwig
No users left. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 5 - 1 file changed, 5 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index f7d1eea32c78..14702e2d6fa8 100644 --- a/include/linux/dma-mapping.h +++

[PATCH 1/6] MIPS: remove support for DMA_ATTR_WRITE_COMBINE

2019-08-16 Thread Christoph Hellwig
Mips uses the KSEG1 kernel memory segment do map dma coherent allocations for non-coherent devices as uncachable, and does not have any kind of special support for DMA_ATTR_WRITE_COMBINE in the allocation path. Thus supporting DMA_ATTR_WRITE_COMBINE in dma_mmap_attrs will lead to multiple

Re: [PATCH] powerpc: Allow flush_(inval_)dcache_range to work across ranges >4GB

2019-08-16 Thread Greg Kroah-Hartman
On Fri, Aug 16, 2019 at 11:42:22AM +1000, Michael Ellerman wrote: > Greg Kroah-Hartman writes: > > On Thu, Aug 15, 2019 at 02:55:42PM +1000, Alastair D'Silva wrote: > >> From: Alastair D'Silva > >> > >> Heads Up: This patch cannot be submitted to Linus's tree, as the affected > >> assembler

[PATCH 4/6] dma-mapping: remove arch_dma_mmap_pgprot

2019-08-16 Thread Christoph Hellwig
arch_dma_mmap_pgprot is used for two things: 1) to override the "normal" uncached page attributes for mapping memory coherent to devices that can't snoop the CPU caches 2) to provide the special DMA_ATTR_WRITE_COMBINE semantics on older arm systems Replace one with the

Re: [PATCH 4/6] dma-mapping: remove arch_dma_mmap_pgprot

2019-08-16 Thread Geert Uytterhoeven
On Fri, Aug 16, 2019 at 9:19 AM Christoph Hellwig wrote: > arch_dma_mmap_pgprot is used for two things: > > 1) to override the "normal" uncached page attributes for mapping > memory coherent to devices that can't snoop the CPU caches > 2) to provide the special DMA_ATTR_WRITE_COMBINE

next take at setting up a dma mask by default for platform devices v2

2019-08-16 Thread Christoph Hellwig
Hi all, this is another attempt to make sure the dma_mask pointer is always initialized for platform devices. Not doing so lead to lots of boilerplate code, and makes platform devices different from all our major busses like PCI where we always set up a dma_mask. In the long run this should

[PATCH 2/6] usb: add a hcd_uses_dma helper

2019-08-16 Thread Christoph Hellwig
The USB buffer allocation code is the only place in the usb core (and in fact the whole kernel) that uses is_device_dma_capable, while the URB mapping code uses the uses_dma flag in struct usb_bus. Switch the buffer allocation to use the uses_dma flag used by the rest of the USB code, and create

cleanup the dma_pgprot handling

2019-08-16 Thread Christoph Hellwig
Hi all, this series replaced the arch_dma_mmap_pgprot hooks with the simpler pgprot_dmacoherent as used by the arm code already and cleans up various bits around that area. I'd still like to hear a confirmation from the mips folks how the write combibe attribute can or can't work with the KSEG1

[PATCH 2/6] unicore32: remove the unused pgprot_dmacoherent define

2019-08-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/unicore32/include/asm/pgtable.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/unicore32/include/asm/pgtable.h b/arch/unicore32/include/asm/pgtable.h index 9492aa304f03..126e961a8cb0 100644 --- a/arch/unicore32/include/asm/pgtable.h +++

[PATCH 5/6] dma-mapping: make dma_atomic_pool_init self-contained

2019-08-16 Thread Christoph Hellwig
The memory allocated for the atomic pool needs to have the same mapping attributes that we use for remapping, so use pgprot_dmacoherent instead of open coding it. Also deduct a suitable zone to allocate the memory from based on the presence of the DMA zones. Signed-off-by: Christoph Hellwig ---

[PATCH 6/6] arm64: document the choice of page attributes for pgprot_dmacoherent

2019-08-16 Thread Christoph Hellwig
Based on an email from Will Deacon. Signed-off-by: Christoph Hellwig --- arch/arm64/include/asm/pgtable.h | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 6700371227d1..6ff221d9a631 100644 ---

Re: [PATCH 6/6] driver core: initialize a default DMA mask for platform device

2019-08-16 Thread Geert Uytterhoeven
Hi Christoph, On Fri, Aug 16, 2019 at 8:30 AM Christoph Hellwig wrote: > We still treat devices without a DMA mask as defaulting to 32-bits for > both mask, but a few releases ago we've started warning about such > cases, as they require special cases to work around this sloppyness. > Add a

[PATCH] powerpc/32: Add warning on misaligned copy_page() or clear_page()

2019-08-16 Thread Christophe Leroy
copy_page() and clear_page() expect page aligned destination, and use dcbz instruction to clear entire cache lines based on the assumption that the destination is cache aligned. As shown during analysis of a bug in BTRFS filesystem, a misaligned copy_page() can create bugs that are difficult to

Re: [PATCH] ASoC: imx-audmux: Add driver suspend and resume to support MEGA Fast

2019-08-16 Thread S.j. Wang
Hi Mark > > On Fri, Aug 16, 2019 at 01:03:14AM -0400, Shengjiu Wang wrote: > > > + for (i = 0; i < reg_max; i++) > > + regcache[i] = readl(audmux_base + i * 4); > > If only there were some framework which provided a register cache!  Yes, next step I can refine this driver to use

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #37 from Erhard F. (erhar...@mailbox.org) --- On Fri, 16 Aug 2019 15:20:47 + bugzilla-dae...@bugzilla.kernel.org wrote: Ok, tested the G5 + patch now. It boots from a btrfs partition with SLUB debugging + btrfs debug & selftests

Re: [PATCH 0/6] drm+dma: cache support for arm, etc

2019-08-16 Thread Rob Clark
On Thu, Aug 15, 2019 at 10:53 AM Christoph Hellwig wrote: > > On Thu, Aug 15, 2019 at 06:54:39AM -0700, Rob Clark wrote: > > On Wed, Aug 14, 2019 at 11:51 PM Christoph Hellwig wrote: > > > > > > As said before I don't think these low-level helpers are the > > > right API to export, but even if

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

2019-08-16 Thread Andrew Murray
On Fri, Aug 16, 2019 at 02:55:41AM +, Xiaowei Bao wrote: > > > > -Original Message- > > From: Andrew Murray > > Sent: 2019年8月15日 19:32 > > To: Xiaowei Bao > > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > > bhelg...@google.com; robh...@kernel.org; mark.rutl...@arm.com;

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

2019-08-16 Thread Andrew Murray
On Fri, Aug 16, 2019 at 02:58:31AM +, Xiaowei Bao wrote: > > > > -Original Message- > > From: Andrew Murray > > Sent: 2019年8月15日 19:54 > > To: Xiaowei Bao > > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > > bhelg...@google.com; robh...@kernel.org; mark.rutl...@arm.com;

Re: [PATCH 05/10] PCI: layerscape: Modify the way of getting capability with different PEX

2019-08-16 Thread Andrew Murray
On Fri, Aug 16, 2019 at 03:00:00AM +, Xiaowei Bao wrote: > > > > -Original Message- > > From: Andrew Murray > > Sent: 2019年8月15日 20:51 > > To: Xiaowei Bao > > Cc: jingooh...@gmail.com; gustavo.pimen...@synopsys.com; > > bhelg...@google.com; robh...@kernel.org; mark.rutl...@arm.com;

Re: [PATCH v4 3/3] x86/kasan: support KASAN_VMALLOC

2019-08-16 Thread Christophe Leroy
Le 15/08/2019 à 02:16, Daniel Axtens a écrit : In the case where KASAN directly allocates memory to back vmalloc space, don't map the early shadow page over it. If early shadow page is not mapped, any bad memory access will Oops on the shadow access instead of Oopsing on the real bad

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #32 from Christophe Leroy (christophe.le...@c-s.fr) --- I think first thing is to fix test_add_free_space_entry() : - replace the map = kzalloc(...) by map = (void *)get_zeroed_page(...) like in other places. - replace the kfree(map);