[RFC PATCH] powerpc/64s: interrupt handler remove bad stack branch

2019-01-25 Thread Nicholas Piggin
The bad stack test in interrupt handlers is annoying because it is an always taken branch, which is a fetch bubble and a waste of i-cache. It also requires yet another stack frame setup routine. Remove the test/branch and replace it with a trap. Teach the program check handler to use the

Re: [PATCH v3 2/4] ASoC: add fsl_audmix DT binding documentation

2019-01-25 Thread Nicolin Chen
On Thu, Jan 17, 2019 at 12:46:29PM +, Viorel Suman wrote: > + - dais : Must contain a list of phandles to AUDMIX connected > + DAIs. The current implementation requires two phandles > + to SAI interfaces to be provided, the first SAI in

Re: [PATCH 11/19] KVM: PPC: Book3S HV: add support for the XIVE native exploitation mode hcalls

2019-01-25 Thread Benjamin Herrenschmidt
On Tue, 2019-01-22 at 16:23 +1100, Paul Mackerras wrote: > > Which ones of these could be implemented in QEMU? Are there any that > can't possibly be implemented in QEMU because they need to do things > that require calling internal interfaces that userspace doesn't have > access to?

Re: [PATCH 11/19] KVM: PPC: Book3S HV: add support for the XIVE native exploitation mode hcalls

2019-01-25 Thread Benjamin Herrenschmidt
On Wed, 2019-01-23 at 21:26 +1100, Paul Mackerras wrote: > If H_INT_ESB is only used for LSIs, then is a guest going to be using > it at all? *emulated* LSIs, ie LSIs coming from emulated devices. It will depends in practice of what kind of emulated device you put in your guest. We need that

Re: [PATCH 00/19] KVM: PPC: Book3S HV: add XIVE native exploitation mode

2019-01-25 Thread Benjamin Herrenschmidt
On Wed, 2019-01-23 at 20:07 +0100, Cédric Le Goater wrote: > Event Assignment Structure, a.k.a IVE (Interrupt Virtualization Entry) > > All the names changed somewhere between XIVE v1 and XIVE v2. OPAL and > Linux should be adjusted ... All the names changed between the HW design and the

Re: [PATCH 19/19] KVM: introduce a KVM_DELETE_DEVICE ioctl

2019-01-25 Thread Benjamin Herrenschmidt
On Wed, 2019-01-23 at 19:39 +0100, Cédric Le Goater wrote: > > The reason I ask is that we will have to be much more careful about > > memory allocation lifetimes with this patch. > > yes. bad refcounting will lead the host kernel to a crash. One way to alleviate that is to make sure this is

Re: [PATCH] cxl: Wrap iterations over afu slices inside 'afu_list_lock'

2019-01-25 Thread Frederic Barrat
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index c79ba1c699ad..28c28bceb063 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c @@ -1932,14 +1935,20 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev, * * In slot_reset, free

Re: [PATCH v4 2/3] ASoC: add fsl_audmix DT binding documentation

2019-01-25 Thread Nicolin Chen
On Tue, Jan 22, 2019 at 11:14:27AM +, Viorel Suman wrote: > Add the DT binding documentation for NXP Audio Mixer > CPU DAI driver. > > Signed-off-by: Viorel Suman > --- > .../devicetree/bindings/sound/fsl,audmix.txt | 54 > ++ > 1 file changed, 54 insertions(+) >

Re: [PATCH v2 06/21] memblock: memblock_phys_alloc_try_nid(): don't panic

2019-01-25 Thread Mike Rapoport
On Fri, Jan 25, 2019 at 05:45:02PM +, Catalin Marinas wrote: > On Mon, Jan 21, 2019 at 10:03:53AM +0200, Mike Rapoport wrote: > > diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c > > index ae34e3a..2c61ea4 100644 > > --- a/arch/arm64/mm/numa.c > > +++ b/arch/arm64/mm/numa.c > > @@

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-25 Thread Mike Rapoport
On Fri, Jan 25, 2019 at 11:40:23AM +0100, Michal Hocko wrote: > On Thu 24-01-19 19:51:44, Mike Rapoport wrote: > > On Thu, Jan 24, 2019 at 03:17:27PM +0100, Michal Hocko wrote: > > > a friendly ping for this. Does anybody see any problem with this > > > approach? > > > > FWIW, it looks fine to

Re: [PATCH v2 06/21] memblock: memblock_phys_alloc_try_nid(): don't panic

2019-01-25 Thread Catalin Marinas
On Mon, Jan 21, 2019 at 10:03:53AM +0200, Mike Rapoport wrote: > diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c > index ae34e3a..2c61ea4 100644 > --- a/arch/arm64/mm/numa.c > +++ b/arch/arm64/mm/numa.c > @@ -237,6 +237,10 @@ static void __init setup_node_data(int nid, u64 > start_pfn,

Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved

2019-01-25 Thread Catalin Marinas
On Mon, Jan 14, 2019 at 01:59:01PM +0100, David Hildenbrand wrote: > The crashkernel is reserved via memblock_reserve(). memblock_free_all() > will call free_low_memory_core_early(), which will go over all reserved > memblocks, marking the pages as PG_reserved. > > So manually marking pages as

Re: [PATCH v2 6/9] arm64: kexec: no need to ClearPageReserved()

2019-01-25 Thread Catalin Marinas
On Mon, Jan 14, 2019 at 01:59:00PM +0100, David Hildenbrand wrote: > This will be done by free_reserved_page(). > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Bhupesh Sharma > Cc: James Morse > Cc: Marc Zyngier > Cc: Dave Kleikamp > Cc: Mark Rutland > Cc: Andrew Morton > Cc: Michal Hocko

Re: [PATCH v2 07/29] ARM: add kexec_file_load system call number

2019-01-25 Thread Russell King - ARM Linux admin
On Fri, Jan 25, 2019 at 03:43:59PM +, Catalin Marinas wrote: > On Fri, Jan 18, 2019 at 05:18:13PM +0100, Arnd Bergmann wrote: > > diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl > > index 86de9eb34296..20ed7e026723 100644 > > --- a/arch/arm/tools/syscall.tbl > > +++

Re: [RFC 5/6] powerpc/pci/hotplug: Use common drcinfo parsing

2019-01-25 Thread Michael Bringmann
Adding Nathan Lynch. On 1/24/19 6:29 PM, Tyrel Datwyler wrote: > On 01/14/2019 04:28 PM, Bjorn Helgaas wrote: >> On Fri, Dec 14, 2018 at 02:51:31PM -0600, Michael Bringmann wrote: >>> The implementation of the pseries-specific drc info properties >>> is currently implemented in pseries-specific

Re: [RFC 1/6] powerpc:/drc Define interface to acquire arch-specific drc info

2019-01-25 Thread Michael Bringmann
Adding Nathan Lynch. On 1/24/19 6:10 PM, Tyrel Datwyler wrote: > On 12/14/2018 12:50 PM, Michael Bringmann wrote: >> Define interface to acquire arch-specific drc info to match against >> hotpluggable devices. The current implementation exposes several >> pseries-specific dynamic memory

Re: [RFC 3/6] pseries/drcinfo: Pseries impl of arch_find_drc_info

2019-01-25 Thread Michael Bringmann
Adding Nathan Lynch. Yes. We can amend the title. On 1/24/19 6:04 PM, Tyrel Datwyler wrote: > On 12/14/2018 12:51 PM, Michael Bringmann wrote: >> This patch provides a common interface to parse ibm,drc-indexes, >> ibm,drc-names, ibm,drc-types, ibm,drc-power-domains, or ibm,drc-info. >> The

Re: [RFC 1/6] powerpc:/drc Define interface to acquire arch-specific drc info

2019-01-25 Thread Michael Bringmann
Adding Nathan Lynch On 1/24/19 6:04 PM, Tyrel Datwyler wrote: > On 12/14/2018 12:50 PM, Michael Bringmann wrote: >> Define interface to acquire arch-specific drc info to match against >> hotpluggable devices. The current implementation exposes several >> pseries-specific dynamic memory

Re: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures

2019-01-25 Thread Catalin Marinas
On Fri, Jan 18, 2019 at 05:18:35PM +0100, Arnd Bergmann wrote: > This adds 21 new system calls on each ABI that has 32-bit time_t > today. All of these have the exact same semantics as their existing > counterparts, and the new ones all have macro names that end in 'time64' > for clarification. >

Re: [PATCH v2 25/29] y2038: syscalls: rename y2038 compat syscalls

2019-01-25 Thread Catalin Marinas
On Fri, Jan 18, 2019 at 05:18:31PM +0100, Arnd Bergmann wrote: > A lot of system calls that pass a time_t somewhere have an implementation > using a COMPAT_SYSCALL_DEFINEx() on 64-bit architectures, and have > been reworked so that this implementation can now be used on 32-bit > architectures as

Re: [PATCH v2 07/29] ARM: add kexec_file_load system call number

2019-01-25 Thread Catalin Marinas
On Fri, Jan 18, 2019 at 05:18:13PM +0100, Arnd Bergmann wrote: > diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl > index 86de9eb34296..20ed7e026723 100644 > --- a/arch/arm/tools/syscall.tbl > +++ b/arch/arm/tools/syscall.tbl > @@ -415,3 +415,4 @@ > 398 common rseq

Re: [PATCH v2 06/29] ARM: add migrate_pages() system call

2019-01-25 Thread Catalin Marinas
On Fri, Jan 18, 2019 at 05:18:12PM +0100, Arnd Bergmann wrote: > The migrate_pages system call has an assigned number on all architectures > except ARM. When it got added initially in commit d80ade7b3231 ("ARM: > Fix warning: #warning syscall migrate_pages not implemented"), it was > intentionally

Re: use generic DMA mapping code in powerpc V4

2019-01-25 Thread Christian Zigotzky
Next step just with the first patch: 5c532d07c2f3c3972104de505d06b8d85f403f06 (use powerpc zone selection) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6-debug a git checkout 5c532d07c2f3c3972104de505d06b8d85f403f06 Link to the Git:

[PATCH 10/10] powerpc/book3s32: Reorder _PAGE_XXX flags to simplify TLB handling

2019-01-25 Thread Christophe Leroy
For pages without _PAGE_USER, PP field is 00 For pages with _PAGE_USER, PP field is 10 for RW and 11 for RO. This patch sets _PAGE_USER to 0x002 and _PAGE_RW to 0x001 is order to simplify TLB handling by reducing amount of shifts. The location of _PAGE_PRESENT and _PAGE_HASHPTE doesn't matter as

[PATCH 09/10] powerpc/603: don't handle PAGE_ACCESSED in TLB miss handlers.

2019-01-25 Thread Christophe Leroy
PAGE_ACCESSED is only needed for CONFIG_SWAP. When CONFIG_SWAP is not set, just ignore it. If CONFIG_SWAP is set and PAGE_ACCESSED is not, let's take a minor fault. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 24 +--- 1 file changed, 13 insertions(+),

[PATCH 08/10] powerpc/603: Don't worry about _PAGE_USER in TLB miss handlers

2019-01-25 Thread Christophe Leroy
PP bits take user access into account, so no need to check _PAGE_USER here. A DSI or ISI will be generated if needed. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/head_32.S

[PATCH 07/10] powerpc/603: let's handle PAGE_DIRTY directly

2019-01-25 Thread Christophe Leroy
PAGE_DIRTY corresponds to the C bit. If writing on a page for which the C bit is not set, a DataStoreTLBMiss is generated. No need to check it in DataLoadTLBMiss. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH 06/10] powerpc/603: Don't handle _PAGE_RW and _PAGE_DIRTY on ITLB misses

2019-01-25 Thread Christophe Leroy
_PAGE_RW and _PAGE_DIRTY do not matter for ITLB misses. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 3bbf937ad634..2aec3f91c9f5

[PATCH 05/10] powerpc/603: Don't handle kernel page TLB misses when not need

2019-01-25 Thread Christophe Leroy
ITLB miss on kernel pages only occur with CONFIG_MODULES and CONFIG_DEBUG_PAGEALLOC. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index

[PATCH 04/10] powerpc/hash32: use physical address directly in hash handlers.

2019-01-25 Thread Christophe Leroy
Since commit c62ce9ef97ba ("powerpc: remove remaining bits from CONFIG_APUS"), tophys() has become a pure constant operation. PAGE_OFFSET is known at compile time so the physical address can be builtin directly. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hash_low_32.S | 62

[PATCH 03/10] powerpc/603: use physical address directly in TLB miss handlers.

2019-01-25 Thread Christophe Leroy
Since commit c62ce9ef97ba ("powerpc: remove remaining bits from CONFIG_APUS"), tophys() has become a pure constant operation. PAGE_OFFSET is known at compile time so the physical address can be builtin directly. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 15

[PATCH 02/10] powerpc/603: Store PGDIR physical address in a SPRG

2019-01-25 Thread Christophe Leroy
Use SPRN_SPRG5 to store the current thread PGDIR and avoid reading thread_struct->pgdir at every TLB miss. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/kernel/cpu_setup_6xx.S | 4 arch/powerpc/kernel/head_32.S | 28

[PATCH 00/10] Optimise TLB miss handlers on 603/e300

2019-01-25 Thread Christophe Leroy
The purpose of this serie is to optimise the handling of TLB misses on the 603/e300. Today the TLB miss handlers are implemented by more or less copying the actions performed by the hash page handlers used on processors having HASH pagetable. This serie brings some simplification. Christophe

[PATCH 01/10] powerpc: simplify BDI switch

2019-01-25 Thread Christophe Leroy
There is no reason to re-read each time the pointer at location 0xf0 as it is fixed and known. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu.h | 2 ++ arch/powerpc/kernel/head_32.S | 5 ++--- arch/powerpc/kernel/head_40x.S | 5 ++--- arch/powerpc/kernel/head_8xx.S | 1 +

MSR_FE mask change broke KVM PR MacOS guest

2019-01-25 Thread Mark Cave-Ayland
Hi all, Referencing my bug report over on the kvm-ppc list at https://www.spinics.net/lists/kvm-ppc/msg14971.html, I've been experiencing a hard lockup and panic on a G4 Mac Mini when trying run MacOS X under KVM PR which I've bisected down to the following commit: $ git bisect bad

[PATCH] powerpc/83xx: Also save/restore SPRG4-7 during suspend

2019-01-25 Thread Christophe Leroy
The 83xx has 8 SPRG registers and uses at least SPRG4 for DTLB handling LRU. Fixes: 2319f1239592 ("powerpc/mm: e300c2/c3/c4 TLB errata workaround") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/83xx/suspend-asm.S | 34 --- 1

Re: [PATCH v2 2/3] powerpc/lib: Refactor __patch_instruction() to use __put_user_asm()

2019-01-25 Thread Christophe Leroy
Hi Russel, Le 17/12/2018 à 08:09, Christophe Leroy a écrit : Hi Russel, Le 10/12/2018 à 08:00, Russell Currey a écrit : __patch_instruction() is called in early boot, and uses __put_user_size(), which includes the locks and unlocks for KUAP, which could either be called too early, or in the

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-25 Thread Michal Hocko
On Thu 24-01-19 11:10:50, Dave Hansen wrote: > On 1/24/19 6:17 AM, Michal Hocko wrote: > > and nr_cpus set to 4. The underlying reason is tha the device is bound > > to node 2 which doesn't have any memory and init_cpu_to_node only > > initializes memory-less nodes for possible cpus which nr_cpus

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-25 Thread Michal Hocko
On Thu 24-01-19 19:51:44, Mike Rapoport wrote: > On Thu, Jan 24, 2019 at 03:17:27PM +0100, Michal Hocko wrote: > > a friendly ping for this. Does anybody see any problem with this > > approach? > > FWIW, it looks fine to me. > > It'd just be nice to have a few more words in the changelog about