[PATCH v3 18/17] powerpc: Emulate load/store floating point as integer word instructions

2017-08-29 Thread Paul Mackerras
This adds emulation for the lfiwax, lfiwzx and stfiwx instructions. This necessitated adding a new flag to indicate whether a floating point or an integer conversion was needed for LOAD_FP and STORE_FP, so this moves the size field in op->type up 4 bits. Signed-off-by: Paul Mackerras --- arch/po

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Peter Zijlstra
On Wed, Aug 30, 2017 at 07:19:30AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2017-08-29 at 13:27 +0200, Peter Zijlstra wrote: > > mpe helped me out and explained that is the PWC hint to TBLIE. > > > > So, you set need_flush_all when you unhook pud/pmd/pte which you then > > use to set PWC. So

Re: Question: handling early hotplug interrupts

2017-08-29 Thread Michael Ellerman
Daniel Henrique Barboza writes: > Hi Ben, > > On 08/29/2017 06:55 PM, Benjamin Herrenschmidt wrote: >> On Tue, 2017-08-29 at 17:43 -0300, Daniel Henrique Barboza wrote: >>> Hi, >>> >>> This is a scenario I've been facing when working in early device >>> hotplugs in QEMU. When a device is added, a

Re: Question: handling early hotplug interrupts

2017-08-29 Thread Michael Ellerman
Daniel Henrique Barboza writes: > Hi, > > This is a scenario I've been facing when working in early device > hotplugs in QEMU. When a device is added, a IRQ pulse is fired to warn > the guest of the event, then the kernel fetches it by calling > 'check_exception' and handles it. If the hotplug

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Peter Zijlstra
On Wed, Aug 30, 2017 at 10:33:50AM +0530, Anshuman Khandual wrote: > diff --git a/mm/filemap.c b/mm/filemap.c > index a497024..08f3042 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -1181,6 +1181,18 @@ int __lock_page_killable(struct page *__page) > int __lock_page_or_retry(struct page *pag

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Anshuman Khandual
On 08/27/2017 05:48 AM, Kirill A. Shutemov wrote: >> +/* Transparent huge pages are not supported. */ >> +if (unlikely(pmd_trans_huge(*pmd))) >> +goto out_walk; > That's looks like a blocker to me. > > Is there any problem with making it supported (besides plain coding)? IIUC

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Anshuman Khandual
On 08/29/2017 07:15 PM, Peter Zijlstra wrote: > On Tue, Aug 29, 2017 at 03:18:25PM +0200, Laurent Dufour wrote: >> On 29/08/2017 14:04, Peter Zijlstra wrote: >>> On Tue, Aug 29, 2017 at 09:59:30AM +0200, Laurent Dufour wrote: On 27/08/2017 02:18, Kirill A. Shutemov wrote: >> + >> +

[PATCH v3 17/17] powerpc: Use instruction emulation infrastructure to handle alignment faults

2017-08-29 Thread Paul Mackerras
This replaces almost all of the instruction emulation code in fix_alignment() with calls to analyse_instr(), emulate_loadstore() and emulate_dcbz(). The only emulation code left is the SPE emulation code; analyse_instr() etc. do not handle SPE instructions at present. One result of this is that w

[PATCH v3 16/17] powerpc: Separate out load/store emulation into its own function

2017-08-29 Thread Paul Mackerras
This moves the parts of emulate_step() that deal with emulating load and store instructions into a new function called emulate_loadstore(). This is to make it possible to reuse this code in the alignment handler. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/sstep.h | 9 ++ arch/

[PATCH v3 15/17] powerpc: Handle opposite-endian processes in emulation code

2017-08-29 Thread Paul Mackerras
This adds code to the load and store emulation code to byte-swap the data appropriately when the process being emulated is set to the opposite endianness to that of the kernel. This also enables the emulation for the multiple-register loads and stores (lmw, stmw, lswi, stswi, lswx, stswx) to work

[PATCH v3 14/17] powerpc: Set regs->dar if memory access fails in emulate_step()

2017-08-29 Thread Paul Mackerras
This adds code to the instruction emulation code to set regs->dar to the address of any memory access that fails. This address is not necessarily the same as the effective address of the instruction, because if the memory access is unaligned, it might cross a page boundary and fault on the second

[PATCH v3 13/17] powerpc: Emulate the dcbz instruction

2017-08-29 Thread Paul Mackerras
This adds code to analyse_instr() and emulate_step() to understand the dcbz (data cache block zero) instruction. The emulate_dcbz() function is made public so it can be used by the alignment handler in future. (The apparently unnecessary cropping of the address to 32 bits is there because it will

[PATCH v3 12/17] powerpc: Emulate load/store floating double pair instructions

2017-08-29 Thread Paul Mackerras
This adds lfdp[x] and stfdp[x] to the set of instructions that analyse_instr() and emulate_step() understand. Signed-off-by: Paul Mackerras --- arch/powerpc/lib/sstep.c | 68 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/arch/pow

[PATCH v3 11/17] powerpc: Emulate vector element load/store instructions

2017-08-29 Thread Paul Mackerras
This adds code to analyse_instr() and emulate_step() to handle the vector element loads and stores: lvebx, lvehx, lvewx, stvebx, stvehx, stvewx. Signed-off-by: Paul Mackerras --- arch/powerpc/lib/sstep.c | 38 -- 1 file changed, 36 insertions(+), 2 deletions(

[PATCH v3 10/17] powerpc: Emulate FP/vector/VSX loads/stores correctly when regs not live

2017-08-29 Thread Paul Mackerras
At present, the analyse_instr/emulate_step code checks for the relevant MSR_FP/VEC/VSX bit being set when a FP/VMX/VSX load or store is decoded, but doesn't recheck the bit before reading or writing the relevant FP/VMX/VSX register in emulate_step(). Since we don't have preemption disabled, it is

[PATCH v3 09/17] powerpc: Make load/store emulation use larger memory accesses

2017-08-29 Thread Paul Mackerras
At the moment, emulation of loads and stores of up to 8 bytes to unaligned addresses on a little-endian system uses a sequence of single-byte loads or stores to memory. This is rather inefficient, and the code is hard to follow because it has many ifdefs. In addition, the Power ISA has requirement

[PATCH v3 08/17] powerpc: Add emulation for the addpcis instruction

2017-08-29 Thread Paul Mackerras
The addpcis instruction puts the sum of the next instruction address plus a constant into a register. Since the result depends on the address of the instruction, it will give an incorrect result if it is single-stepped out of line, which is what the *probes subsystem will currently do if a probe i

[PATCH v3 07/17] powerpc: Don't update CR0 in emulation of popcnt, prty, bpermd instructions

2017-08-29 Thread Paul Mackerras
The architecture shows the least-significant bit of the instruction word as reserved for the popcnt[bwd], prty[wd] and bpermd instructions, that is, these instructions never update CR0. Therefore this changes the emulation of these instructions to skip the CR0 update. Signed-off-by: Paul Mackerras

[PATCH v3 06/17] powerpc: Fix emulation of the isel instruction

2017-08-29 Thread Paul Mackerras
The case added for the isel instruction was added inside a switch statement which uses the 10-bit minor opcode field in the 0x7fe bits of the instruction word. However, for the isel instruction, the minor opcode field is only the 0x3e bits, and the 0x7c0 bits are used for the "BC" field, which ind

[PATCH v3 05/17] powerpc/64: Fix update forms of loads and stores to write 64-bit EA

2017-08-29 Thread Paul Mackerras
When a 64-bit processor is executing in 32-bit mode, the update forms of load and store instructions are required by the architecture to write the full 64-bit effective address into the RA register, though only the bottom 32 bits are used to address memory. Currently, the instruction emulation cod

[PATCH v3 04/17] powerpc: Handle most loads and stores in instruction emulation code

2017-08-29 Thread Paul Mackerras
This extends the instruction emulation infrastructure in sstep.c to handle all the load and store instructions defined in the Power ISA v3.0, except for the atomic memory operations, ldmx (which was never implemented), lfdp/stfdp, and the vector element load/stores. The instructions added are: In

[PATCH v3 01/17] powerpc: Correct instruction code for xxlor instruction

2017-08-29 Thread Paul Mackerras
The instruction code for xxlor that commit 0016a4cf5582 ("powerpc: Emulate most Book I instructions in emulate_step()", 2010-06-15) added is actually the code for xxlnor. It is used in get_vsr() and put_vsr() and the effect of the error is that if emulate_step is used to emulate a VSX load or stor

[PATCH v3 00/17] powerpc: Do alignment fixups using analyse_instr etc.

2017-08-29 Thread Paul Mackerras
This series extends the instruction emulation infrastructure in arch/powerpc/lib/sstep.c and uses it for emulating instructions when we get an alignment interrupt. The advantage of this is that we only have to add the new POWER9 instructions in one place, and it fixes several bugs in alignment int

[PATCH v3 03/17] powerpc: Don't check MSR FP/VMX/VSX enable bits in analyse_instr()

2017-08-29 Thread Paul Mackerras
This removes the checks for the FP/VMX/VSX enable bits in the MSR from analyse_instr() and adds them to emulate_step() instead. The reason for this is that we may want to use analyse_instr() in a situation where the FP/VMX/VSX register values are stored in the current thread_struct and the FP/VMX/

[PATCH v3 02/17] powerpc: Change analyse_instr so it doesn't modify *regs

2017-08-29 Thread Paul Mackerras
The analyse_instr function currently doesn't just work out what an instruction does, it also executes those instructions whose effect is only to update CPU registers that are stored in struct pt_regs. This is undesirable because optprobes uses analyse_instr to work out if an instruction could be su

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Anshuman Khandual
On 08/29/2017 05:34 PM, Peter Zijlstra wrote: > On Tue, Aug 29, 2017 at 09:59:30AM +0200, Laurent Dufour wrote: >> On 27/08/2017 02:18, Kirill A. Shutemov wrote: + + if (unlikely(!vma->anon_vma)) + goto unlock; >>> It deserves a comment. >> You're right I'll add it in the n

[PATCH RFC] Interface to set SPRN_TIDR

2017-08-29 Thread Sukadev Bhattiprolu
We need the SPRN_TIDR to be set for use with fast thread-wakeup (core-to-core wakeup) in VAS. Each user thread that has a receive window setup and expects to be notified when a sender issues a paste needs to have a unique SPRN_TIDR value. The SPRN_TIDR value only needs to unique within the proces

Re: [PATCH] powerpc/pseries: Don't attempt to acquire drc during memory hot add for assigned lmbs

2017-08-29 Thread Michael Ellerman
John Allen writes: > Check if an LMB is assigned before attempting to call dlpar_acquire_drc in > order to avoid any unnecessary rtas calls. This substantially reduces the > running time of memory hot add on lpars with large amounts of memory. > > Signed-off-by: John Allen > --- > diff --git a/a

Re: [PATCH v7 07/11] sparc64: optimized struct page zeroing

2017-08-29 Thread David Miller
From: Pavel Tatashin Date: Mon, 28 Aug 2017 22:02:18 -0400 > Add an optimized mm_zero_struct_page(), so struct page's are zeroed without > calling memset(). We do eight to ten regular stores based on the size of > struct page. Compiler optimizes out the conditions of switch() statement. > > SPAR

Re: [PATCH v7 02/11] sparc64/mm: setting fields in deferred pages

2017-08-29 Thread David Miller
From: Pavel Tatashin Date: Mon, 28 Aug 2017 22:02:13 -0400 > Without deferred struct page feature (CONFIG_DEFERRED_STRUCT_PAGE_INIT), > flags and other fields in "struct page"es are never changed prior to first > initializing struct pages by going through __init_single_page(). > > With deferred

Re: [PATCH v7 04/11] sparc64: simplify vmemmap_populate

2017-08-29 Thread David Miller
From: Pavel Tatashin Date: Mon, 28 Aug 2017 22:02:15 -0400 > Remove duplicating code by using common functions > vmemmap_pud_populate and vmemmap_pgd_populate. > > Signed-off-by: Pavel Tatashin > Reviewed-by: Steven Sistare > Reviewed-by: Daniel Jordan > Reviewed-by: Bob Picco Acked-by: Dav

Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine

2017-08-29 Thread Haren Myneni
On 08/29/2017 02:57 PM, Benjamin Herrenschmidt wrote: > On Tue, 2017-08-29 at 14:54 -0700, Haren Myneni wrote: >> Opening send window for each crypto transform (crypto_alloc, >> compression/decompression, ..., crypto_free) so that does not have to >> wait for the previous copy/paste complete. VAS w

Re: [PATCH 00/13] mmu_notifier kill invalidate_page callback

2017-08-29 Thread Jerome Glisse
On Tue, Aug 29, 2017 at 05:11:24PM -0700, Linus Torvalds wrote: > On Tue, Aug 29, 2017 at 4:54 PM, Jérôme Glisse wrote: > > > > Note this is barely tested. I intend to do more testing of next few days > > but i do not have access to all hardware that make use of the mmu_notifier > > API. > > Than

[PATCH 2/2] powerpc/xmon: revisit SPR support

2017-08-29 Thread Balbir Singh
This patch readjusts the SPR's adds support for IAMR/AMR UAMOR/AMOR based on their supported ISA revisions. There is also support for printing the PIDR/TIDR for ISA 300 and PSSCR and PTCR in ISA 300 hypervisor mode. SPRN_PSSCR_PR is the privileged mode access and is used when we are not in hypervi

[PATCH 1/2] powerpc/xmon: hdec is now 64bits

2017-08-29 Thread Balbir Singh
ISA 300 defines hypervisor decrementer to be 64 bits in length. This patch extends the print format for all archs to be 64 bits Signed-off-by: Balbir Singh --- arch/powerpc/xmon/xmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmo

[PATCH 03/13] powerpc/powernv: update to new mmu_notifier semantic

2017-08-29 Thread Jérôme Glisse
Call to mmu_notifier_invalidate_page() are replaced by call to mmu_notifier_invalidate_range() and thus call are bracketed by call to mmu_notifier_invalidate_range_start()/end() Remove now useless invalidate_page callback. Signed-off-by: Jérôme Glisse Cc: linuxppc-dev@lists.ozlabs.org Cc: Alista

[PATCH 00/13] mmu_notifier kill invalidate_page callback

2017-08-29 Thread Jérôme Glisse
(Sorry for so many list cross-posting and big cc) Please help testing ! The invalidate_page callback suffered from 2 pitfalls. First it used to happen after page table lock was release and thus a new page might have been setup for the virtual address before the call to invalidate_page(). This is

Re: [PATCH 00/13] mmu_notifier kill invalidate_page callback

2017-08-29 Thread Linus Torvalds
On Tue, Aug 29, 2017 at 4:54 PM, Jérôme Glisse wrote: > > Note this is barely tested. I intend to do more testing of next few days > but i do not have access to all hardware that make use of the mmu_notifier > API. Thanks for doing this. > First 2 patches convert existing call of mmu_notifier_in

Re: Question: handling early hotplug interrupts

2017-08-29 Thread Daniel Henrique Barboza
Hi Ben, On 08/29/2017 06:55 PM, Benjamin Herrenschmidt wrote: On Tue, 2017-08-29 at 17:43 -0300, Daniel Henrique Barboza wrote: Hi, This is a scenario I've been facing when working in early device hotplugs in QEMU. When a device is added, a IRQ pulse is fired to warn the guest of the event, th

Applied "ASoC: fsl_dma: remove dma_object path member" to the asoc tree

2017-08-29 Thread Mark Brown
The patch ASoC: fsl_dma: remove dma_object path member has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Li

Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine

2017-08-29 Thread Benjamin Herrenschmidt
On Tue, 2017-08-29 at 14:54 -0700, Haren Myneni wrote: > Opening send window for each crypto transform (crypto_alloc, > compression/decompression, ..., crypto_free) so that does not have to > wait for the previous copy/paste complete. VAS will map send and > receive windows, and can cache in send w

[PATCH RFC] KVM: PPC: Book3S: Add MMIO emulation for VMX instructions

2017-08-29 Thread Jose Ricardo Ziviani
This patch provides the MMIO load/store vector indexed X-Form emulation. Instructions implemented: lvx, stvx Signed-off-by: Jose Ricardo Ziviani --- arch/powerpc/include/asm/kvm_host.h | 2 + arch/powerpc/include/asm/kvm_ppc.h| 4 + arch/powerpc/include/asm/ppc-opcode.h | 6 ++ arch

[PATCH RFC] powerpc: Implements MMIO emulation for lvx/stvx instructions

2017-08-29 Thread Jose Ricardo Ziviani
Hello! This patch implements MMIO emulation for two instructions: lvx and stvx. I started to implement other instructions but I'd like to have this reviewed beforehand because this is my first patch here and I'll certainly have some rework/fixes :-). Note: stvx is only storing 8 bytes, for som

Re: Question: handling early hotplug interrupts

2017-08-29 Thread Benjamin Herrenschmidt
On Tue, 2017-08-29 at 17:43 -0300, Daniel Henrique Barboza wrote: > Hi, > > This is a scenario I've been facing when working in early device > hotplugs in QEMU. When a device is added, a IRQ pulse is fired to warn > the guest of the event, then the kernel fetches it by calling > 'check_exceptio

Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine

2017-08-29 Thread Haren Myneni
On 08/29/2017 02:23 PM, Benjamin Herrenschmidt wrote: > On Tue, 2017-08-29 at 09:58 -0400, Dan Streetman wrote: >>> + >>> + ret = -EINVAL; >>> + if (coproc && coproc->vas.rxwin) { >>> + wmem->txwin = nx842_alloc_txwin(coproc); >> >> this is wrong. the workmem is scratch m

Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine

2017-08-29 Thread Benjamin Herrenschmidt
On Tue, 2017-08-29 at 09:58 -0400, Dan Streetman wrote: > > + > > + ret = -EINVAL; > > + if (coproc && coproc->vas.rxwin) { > > + wmem->txwin = nx842_alloc_txwin(coproc); > > this is wrong. the workmem is scratch memory that's valid only for > the duration of a single op

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Benjamin Herrenschmidt
On Tue, 2017-08-29 at 13:27 +0200, Peter Zijlstra wrote: > mpe helped me out and explained that is the PWC hint to TBLIE. > > So, you set need_flush_all when you unhook pud/pmd/pte which you then > use to set PWC. So free_pgtables() will do the PWC when it unhooks > higher level pages. > > But yo

Question: handling early hotplug interrupts

2017-08-29 Thread Daniel Henrique Barboza
Hi, This is a scenario I've been facing when working in early device hotplugs in QEMU. When a device is added, a IRQ pulse is fired to warn the guest of the event, then the kernel fetches it by calling 'check_exception' and handles it. If the hotplug is done too early (before SLOF, for exampl

Re: [PATCH] i2c: busses: make i2c_adapter_quirks const

2017-08-29 Thread Wolfram Sang
On Mon, Aug 21, 2017 at 05:42:04PM +0530, Bhumika Goyal wrote: > Make these const as they are only stored as a reference in the quirks > field of an i2c_adapter structure, which is const. > > Done using Coccinelle: > @match disable optional_qualifier@ > identifier s; > @@ > static struct i2c_adapt

Re: [PATCH v2 20/20] powerpc/mm: Add speculative page fault

2017-08-29 Thread Laurent Dufour
On 21/08/2017 08:58, Anshuman Khandual wrote: > On 08/18/2017 03:35 AM, Laurent Dufour wrote: >> This patch enable the speculative page fault on the PowerPC >> architecture. >> >> This will try a speculative page fault without holding the mmap_sem, >> if it returns with WM_FAULT_RETRY, the mmap_sem

Re: [PATCH v2 19/20] x86/mm: Add speculative pagefault handling

2017-08-29 Thread Laurent Dufour
On 29/08/2017 16:50, Laurent Dufour wrote: > On 21/08/2017 09:29, Anshuman Khandual wrote: >> On 08/18/2017 03:35 AM, Laurent Dufour wrote: >>> From: Peter Zijlstra >>> >>> Try a speculative fault before acquiring mmap_sem, if it returns with >>> VM_FAULT_RETRY continue with the mmap_sem acquisiti

Re: [PATCH v2 19/20] x86/mm: Add speculative pagefault handling

2017-08-29 Thread Laurent Dufour
On 21/08/2017 09:29, Anshuman Khandual wrote: > On 08/18/2017 03:35 AM, Laurent Dufour wrote: >> From: Peter Zijlstra >> >> Try a speculative fault before acquiring mmap_sem, if it returns with >> VM_FAULT_RETRY continue with the mmap_sem acquisition and do the >> traditional fault. >> >> Signed-o

Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine

2017-08-29 Thread Dan Streetman
On Sat, Jul 22, 2017 at 1:01 AM, Haren Myneni wrote: > > This patch adds P9 NX support for 842 compression engine. Virtual > Accelerator Switchboard (VAS) is used to access 842 engine on P9. > > For each NX engine per chip, setup receive window using > vas_rx_win_open() which configures RxFIFo wit

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Peter Zijlstra
On Tue, Aug 29, 2017 at 03:18:25PM +0200, Laurent Dufour wrote: > On 29/08/2017 14:04, Peter Zijlstra wrote: > > On Tue, Aug 29, 2017 at 09:59:30AM +0200, Laurent Dufour wrote: > >> On 27/08/2017 02:18, Kirill A. Shutemov wrote: > + > +if (unlikely(!vma->anon_vma)) > +

Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine

2017-08-29 Thread Dan Streetman
On Mon, Aug 28, 2017 at 7:25 PM, Michael Ellerman wrote: > Hi Haren, > > Some comments inline ... > > Haren Myneni writes: > >> diff --git a/drivers/crypto/nx/nx-842-powernv.c >> b/drivers/crypto/nx/nx-842-powernv.c >> index c0dd4c7e17d3..13089a0b9dfa 100644 >> --- a/drivers/crypto/nx/nx-842-pow

Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn

2017-08-29 Thread Bryant G. Ly
On 8/29/17 1:20 AM, Sam Bobroff wrote: On Mon, Aug 28, 2017 at 11:05:03AM -0500, Bryant G. Ly wrote: For a PCI device it's pci_dn can be retrieved from pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list. Thus, we should just use the generic function pci_get_pdn_by_devfn to get

Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn

2017-08-29 Thread Bryant G. Ly
On 8/29/17 1:33 AM, Michael Ellerman wrote: "Bryant G. Ly" writes: For a PCI device it's pci_dn can be retrieved from pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list. Thus, we should just use the generic function pci_get_pdn_by_devfn to get the pci_dn. Signed-off-by: Brya

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Laurent Dufour
On 29/08/2017 14:04, Peter Zijlstra wrote: > On Tue, Aug 29, 2017 at 09:59:30AM +0200, Laurent Dufour wrote: >> On 27/08/2017 02:18, Kirill A. Shutemov wrote: + + if (unlikely(!vma->anon_vma)) + goto unlock; >>> >>> It deserves a comment. >> >> You're right I'll add it in t

[PATCH] powerpc/kernel: Change retrieval of pci_dn

2017-08-29 Thread Bryant G. Ly
For a PCI device it's pci_dn can be retrieved from pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list. Thus, we should just use the existing function pci_get_pdn_by_devfn to get the pci_dn. Signed-off-by: Bryant G. Ly Reviewed-by: Sam Bobroff --- arch/powerpc/kernel/rtas_pci.c

Re: [PATCH] powerpc/powernv: Turn on SCSI_AACRAID in powernv_defconfig

2017-08-29 Thread Guilherme G. Piccoli
On 08/29/2017 08:22 AM, Michael Ellerman wrote: > "Guilherme G. Piccoli" writes: > >> On 08/28/2017 02:56 AM, Michael Ellerman wrote: >>> Some Power9 boxes will have this adapter installed, so add it to the >>> defconfig so we can boot on those machines without an initrd. >> >> Michael, not sure

Re: [PATCH v3] sound: aoa: Convert to using %pOF instead of full_name

2017-08-29 Thread Takashi Iwai
On Tue, 29 Aug 2017 14:35:03 +0200, Rob Herring wrote: > > On Mon, Aug 7, 2017 at 6:29 PM, Rob Herring wrote: > > Now that we have a custom printf format specifier, convert users of > > full_name to use %pOF instead. This is preparation to remove storing > > of the full path string for each node.

Re: [alsa-devel] [PATCH v3] ASoC: fsl_dma: remove dma_object path member

2017-08-29 Thread Fabio Estevam
On Tue, Aug 29, 2017 at 9:37 AM, Rob Herring wrote: > dma_object.path is unused, so rather than fix it to work with DT > full_name changes, just remove it. > > Signed-off-by: Rob Herring Reviewed-by: Fabio Estevam

[PATCH v3] ASoC: fsl_dma: remove dma_object path member

2017-08-29 Thread Rob Herring
dma_object.path is unused, so rather than fix it to work with DT full_name changes, just remove it. Signed-off-by: Rob Herring Cc: Timur Tabi Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-de...@alsa-project.o

Re: [PATCH v3] sound: aoa: Convert to using %pOF instead of full_name

2017-08-29 Thread Rob Herring
On Mon, Aug 7, 2017 at 6:29 PM, Rob Herring wrote: > Now that we have a custom printf format specifier, convert users of > full_name to use %pOF instead. This is preparation to remove storing > of the full path string for each node. > > Signed-off-by: Rob Herring > Cc: Johannes Berg > Cc: Jarosl

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Peter Zijlstra
On Tue, Aug 29, 2017 at 09:59:30AM +0200, Laurent Dufour wrote: > On 27/08/2017 02:18, Kirill A. Shutemov wrote: > >> + > >> + if (unlikely(!vma->anon_vma)) > >> + goto unlock; > > > > It deserves a comment. > > You're right I'll add it in the next version. > For the record, the root ca

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Peter Zijlstra
On Tue, Aug 29, 2017 at 10:33:52AM +0200, Peter Zijlstra wrote: > On Tue, Aug 29, 2017 at 07:14:37AM +1000, Benjamin Herrenschmidt wrote: > > We'd have to audit archs closely. Things like the page walk cache > > flushing on power etc... > > If you point me where to look, I'll have a poke around. I

Re: [PATCH] powerpc/powernv: Turn on SCSI_AACRAID in powernv_defconfig

2017-08-29 Thread Michael Ellerman
"Guilherme G. Piccoli" writes: > On 08/28/2017 02:56 AM, Michael Ellerman wrote: >> Some Power9 boxes will have this adapter installed, so add it to the >> defconfig so we can boot on those machines without an initrd. > > Michael, not sure if this affects Petitboot (I know it has its own > defaul

Re: [PATCH v3 2/4] powerpc/64s: idle POWER9 can execute stop without a sync sequence

2017-08-29 Thread Michael Ellerman
Paul Mackerras writes: > On Fri, Aug 25, 2017 at 02:30:34PM +1000, Nicholas Piggin wrote: >> diff --git a/arch/powerpc/kernel/idle_book3s.S >> b/arch/powerpc/kernel/idle_book3s.S >> index 4924647d964d..14e97f442167 100644 >> --- a/arch/powerpc/kernel/idle_book3s.S >> +++ b/arch/powerpc/kernel/idl

Re: [RFC Part1 PATCH v3 16/17] X86/KVM: Provide support to create Guest and HV shared per-CPU variables

2017-08-29 Thread Borislav Petkov
On Mon, Jul 24, 2017 at 02:07:56PM -0500, Brijesh Singh wrote: > Some KVM specific MSR's (steal-time, asyncpf, avic_eio) allocates per-CPU MSRs > variable at compile time and share its physical address with hypervisor. That sentence needs changing - the MSRs don't allocate - f

Re: [RESEND PATCH v5 00/16] eeprom: at24: Add OF device ID table

2017-08-29 Thread Wolfram Sang
> I don't have a DT based system at hand now, but I'll test it again and > let you know probably tomorrow. I will try again today, too. Thanks! signature.asc Description: PGP signature

Re: [RESEND PATCH v5 00/16] eeprom: at24: Add OF device ID table

2017-08-29 Thread Javier Martinez Canillas
Hello Wolfram, On Mon, Aug 28, 2017 at 6:01 PM, Wolfram Sang wrote: > >> > But there is a dependency, no? If I apply the driver patch, >> > non-converted device trees will not find their eeproms anymore. So, I >> >> I don't think that's correct. If you apply this patch before the DTS >> changes,

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Peter Zijlstra
On Tue, Aug 29, 2017 at 07:14:37AM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2017-08-28 at 11:37 +0200, Peter Zijlstra wrote: > > > Doing all this job and just give up because we cannot allocate page tables > > > looks very wasteful to me. > > > > > > Have you considered to look how we can ha

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Peter Zijlstra
On Mon, Aug 28, 2017 at 03:35:11PM -0700, Andi Kleen wrote: > Yes the whole thing is quite risky. Probably will need some > kind of per architecture opt-in scheme? See patch 19/20, that not enough for you?

Re: [PATCH v2 14/20] mm: Provide speculative fault infrastructure

2017-08-29 Thread Laurent Dufour
On 27/08/2017 02:18, Kirill A. Shutemov wrote: > On Fri, Aug 18, 2017 at 12:05:13AM +0200, Laurent Dufour wrote: >> +/* >> + * vm_normal_page() adds some processing which should be done while >> + * hodling the mmap_sem. >> + */ >> +int handle_speculative_fault(struct mm_struct *mm, unsigned long a

[PATCH kernel v2 5/6] powerpc/eeh: Reduce use of pci_dn::node

2017-08-29 Thread Alexey Kardashevskiy
The pci_dn struct caches a OF device node pointer in order to access the "ibm,loc-code" property when EEH is recovering. However, when this happens in eeh_dev_check_failure(), we also have a pci_dev pointer which should have a valid pointer to the device node when pci_dn has one (both pointers are

[PATCH kernel v2 2/6] powerpc/eeh: Reduce to one the number of places where edev is allocated

2017-08-29 Thread Alexey Kardashevskiy
arch/powerpc/kernel/eeh_dev.c:57 is the only legit place where edev is allocated; other 2 places allocate it on stack and in the heap for a very short period of time to use eeh_pe_get() as takes edev. This changes eeh_pe_get() to receive required parameters explicitly. This removes unnecessary te

[PATCH kernel v2 1/6] powerpc/pci: Remove unused parameter from add_one_dev_pci_data()

2017-08-29 Thread Alexey Kardashevskiy
pdev is always NULL, remove it. To make checkpatch.pl happy, this also removes the "out of memory" message. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Andrew Donnellan Acked-by: Russell Currey --- arch/powerpc/kernel/pci_dn.c | 14 ++ 1 file changed, 2 insertions(+), 12 dele

[PATCH kernel v2 0/6] powerpc/eeh: Some cleanups

2017-08-29 Thread Alexey Kardashevskiy
Here are few patches to get rid of some cached pointers across EEH and powernv code as I was struggling to figure out about lifetime of structures and so on. This is based on sha1 98b9f8a45499 Linus Torvalds Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso

[PATCH kernel v2 6/6] powerpc/pci: Remove OF node back pointer from pci_dn

2017-08-29 Thread Alexey Kardashevskiy
The check_req() helper uses pci_get_pdn() to get an OF node pointer. pci_get_pdn() returns a pci_dn pointer which either: 1) from the OF node returned by pci_device_to_OF_node(); 2) from the parent child_list where entries don't have OF node pointers. Since check_req() does not care about 2), it ca

[PATCH kernel v2 4/6] powerpc/eeh: Remove unnecessary config_addr from eeh_dev

2017-08-29 Thread Alexey Kardashevskiy
The eeh_dev struct hold a config space address of an associated node and the very same address is also stored in the pci_dn struct which is always present during the eeh_dev lifetime. This uses bus:devfn directly from pci_dn instead of cached and packed config_addr. Since config_addr is made from

[PATCH kernel v2 3/6] powerpc/eeh: Remove unnecessary pointer to phb from eeh_dev

2017-08-29 Thread Alexey Kardashevskiy
The eeh_dev struct already holds a pointer to pci_dn which it does not exist without and pci_dn itself holds the very same pointer so just use it. Signed-off-by: Alexey Kardashevskiy --- Changelog: v2: * fixed pseries platform --- arch/powerpc/include/asm/eeh.h | 1 - arch/powerpc

[PATCH] powerpc/xmon: convert 0.16x to 0.16lx

2017-08-29 Thread Balbir Singh
Otherwise we lose the top 8 nibbles and effectively print only the last 32 bits. Fixes: e0ddf7a ("powerpc/xmon: Dump ISA 2.07 SPRs") Fixes: 1846193 ("powerpc/xmon: Dump ISA 2.06 SPRs") Signed-off-by: Balbir Singh --- arch/powerpc/xmon/xmon.c | 32 1 file changed