Re: [PATCH] watchdog: mpc8xxx: use the core worker function

2017-11-07 Thread Christophe LEROY
Le 07/11/2017 à 23:56, Guenter Roeck a écrit : On Tue, Nov 07, 2017 at 05:23:56PM +0100, Christophe Leroy wrote: The watchdog core includes a worker function which pings the watchdog until user app starts pinging it and which also pings it if the HW require more frequent pings. Use that functio

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Florian Weimer
On 11/08/2017 07:08 AM, Michael Ellerman wrote: "Kirill A. Shutemov" writes: On Tue, Nov 07, 2017 at 02:05:42PM +0100, Florian Weimer wrote: On 11/07/2017 12:44 PM, Kirill A. Shutemov wrote: On Tue, Nov 07, 2017 at 12:26:12PM +0100, Florian Weimer wrote: On 11/07/2017 12:15 PM, Kirill A. Sh

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Michael Ellerman
"Kirill A. Shutemov" writes: > On Tue, Nov 07, 2017 at 02:05:42PM +0100, Florian Weimer wrote: >> On 11/07/2017 12:44 PM, Kirill A. Shutemov wrote: >> > On Tue, Nov 07, 2017 at 12:26:12PM +0100, Florian Weimer wrote: >> > > On 11/07/2017 12:15 PM, Kirill A. Shutemov wrote: >> > > >> > > > > Firs

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: >> >> If it is decided to keep these kind of heuristics, can we get just a >> small but reasonably precise description of each change to the >> interface and ways for using the new functionality, such that would be >> suitable for the man page? I couldn't fix powerpc b

[PATCH v3 18/18] powerpc/vas: Add support for user receive window

2017-11-07 Thread Sukadev Bhattiprolu
Add support for user space receive window (for the Fast thread-wakeup coprocessor type) Signed-off-by: Sukadev Bhattiprolu --- Changelog[v3] - [Nick Piggin] Drop CP_ABORT since set_thread_uses_vas() does that now (in earlier patch) and add a check for return value. --- arch/pow

[PATCH v3 16/18] powerpc/vas: Define vas_win_paste_addr()

2017-11-07 Thread Sukadev Bhattiprolu
Define an interface that the NX drivers can use to find the physical paste address of a send window. This interface is expected to be used with the mmap() operation of the NX driver's device. i.e the user space process can use driver's mmap() operation to map the send window's paste address into th

[PATCH v3 17/18] powerpc/vas: Define vas_win_id()

2017-11-07 Thread Sukadev Bhattiprolu
Define an interface to return a system-wide unique id for a given VAS window. The vas_win_id() will be used in a follow-on patch to generate an unique handle for a user space receive window. Applications can use this handle to pair send and receive windows for fast thread-wakeup. The hardware ref

[PATCH v3 15/18] powerpc: Emulate paste instruction

2017-11-07 Thread Sukadev Bhattiprolu
From: Michael Neuling On POWER9 DD2.1 and below there are issues when the paste instruction generates an error. If an error occurs when thread reconfiguration happens (ie another thread in the core goes into/out of powersave) the core may hang. To avoid this a special sequence is required which

[PATCH v3 14/18] powerpc: Define set_thread_uses_vas()

2017-11-07 Thread Sukadev Bhattiprolu
A CP_ABORT instruction is required in processes that have mapped a VAS "paste address" with the intention of using COPY/PASTE instructions. But since CP_ABORT is expensive, we want to restrict it to only processes that use/intend to use COPY/PASTE. Define an interface, set_thread_uses_vas(), that

[PATCH v3 13/18] powerpc: Add support for setting SPRN_TIDR

2017-11-07 Thread Sukadev Bhattiprolu
We need the SPRN_TIDR to be set for use with fast thread-wakeup (core- to-core wakeup) and also with CAPI. Each thread in a process needs to have a unique id within the process. But as explained below, for now, we assign globally unique thread ids to all threads in the system. Signed-off-by: Suka

[PATCH v3 12/18] powerpc: have copy depend on CONFIG_BOOK3S_64

2017-11-07 Thread Sukadev Bhattiprolu
Have the COPY/PASTE instructions depend on CONFIG_BOOK3S_64 rather than CONFIG_PPC_STD_MMU_64. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/kernel/process.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process

[PATCH v3 11/18] powerpc/vas: Export HVWC to debugfs

2017-11-07 Thread Sukadev Bhattiprolu
Export the VAS Window context information to debugfs. We need to hold a mutex when closing the window to prevent a race with the debugfs read(). Rather than introduce a per-instance mutex, we use the global vas_mutex for now, since it is not heavily contended. The window->cop field is only releva

[PATCH v3 10/18] powerpc/vas, nx-842: Define and use chip_to_vas_id()

2017-11-07 Thread Sukadev Bhattiprolu
Define a helper, chip_to_vas_id() to map a given chip id to corresponding vas id. Normally, callers of vas_rx_win_open() and vas_tx_win_open() want the VAS window to be on the same chip where the calling thread is executing. These callers can pass in -1 for the VAS id. This interface will be usef

[PATCH v3 09/18] powerpc/vas: Create cpu to vas id mapping

2017-11-07 Thread Sukadev Bhattiprolu
Create a cpu to vasid mapping so callers can specify -1 instead of trying to find a VAS id. Changelog[v2] [Michael Ellerman] Use per-cpu variables to simplify code. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas.c | 14 +- 1 file changed, 13 insert

[PATCH v3 08/18] powerpc/vas: poll for return of window credits

2017-11-07 Thread Sukadev Bhattiprolu
Normally, the NX driver waits for the CRBs to be processed before closing the window. But it is better to ensure that the credits are returned before the window gets reassigned later. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas-window.c | 45

[PATCH v3 07/18] powerpc/vas: Save configured window credits

2017-11-07 Thread Sukadev Bhattiprolu
Save the configured max window credits for a window in the vas_window structure. We will need this when polling for return of window credits. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas-window.c | 6 -- arch/powerpc/platforms/powernv/vas.h| 1 + 2 files

[PATCH v3 06/18] powerpc/vas: Reduce polling interval for busy state

2017-11-07 Thread Sukadev Bhattiprolu
A VAS window is normally in "busy" state for only a short duration. Reduce the time we wait for the window to go to "not-busy" state to speed-up vas_win_close() a bit. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas-window.c | 10 ++ 1 file changed, 6 insertions

[PATCH v3 04/18] powerpc/vas: Drop poll_window_cast_out().

2017-11-07 Thread Sukadev Bhattiprolu
Polling for window cast out is listed in the spec, but turns out that it is not strictly necessary and slows down window close. Making it a stub for now. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas-window.c | 34 ++--- 1 file changed, 17 inse

[PATCH v3 05/18] powerpc/vas: Use helper to unpin/close window

2017-11-07 Thread Sukadev Bhattiprolu
Use a helper to have the hardware unpin and mark a window closed. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas-window.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/pow

[PATCH v3 03/18] powerpc/vas: Cleanup some debug code

2017-11-07 Thread Sukadev Bhattiprolu
Clean up vas.h and the debug code around ifdef vas_debug. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v3] - Minor tweak to a debug message --- arch/powerpc/platforms/powernv/vas-window.c | 8 +++-- arch/powerpc/platforms/powernv/vas.h| 54 ++--- 2 f

[PATCH v3 02/18] powerpc/vas: Validate window credits

2017-11-07 Thread Sukadev Bhattiprolu
NX-842, the only user of VAS, sets the window credits to default values but VAS should check the credits against the possible max values. The VAS_WCREDS_MIN is not needed and can be dropped. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas-window.c | 6 ++ arch/powe

[PATCH v3 01/18] powerpc/vas: init missing fields from [rt]xattr

2017-11-07 Thread Sukadev Bhattiprolu
Initialize a few missing window context fields from the window attributes specified by the caller. These fields are currently set to their default values by the caller (NX-842), but would be good to apply them anyway. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas-wind

[PATCH v3 00/18] powerpc/vas: Add support for FTW

2017-11-07 Thread Sukadev Bhattiprolu
The first 10 patches in this set sanitize cpu/chip id to VAS id mapping, improve vas_win_close() performance, add a check for return of credits and cleans up some code. Patch 11 adds debugfs support for the VAS window contexts. Patches 12-18 add support for user space aka Fast thread-wakeup windo

Re: [PATCH v9 00/51] powerpc, mm: Memory Protection Keys

2017-11-07 Thread Ram Pai
On Tue, Nov 07, 2017 at 02:47:10PM -0800, Dave Hansen wrote: > On 11/07/2017 02:39 PM, Ram Pai wrote: > > > > As per the current semantics of sys_pkey_free(); the way I understand it, > > the calling thread is saying disassociate me from this key. > > No. It is saying: "this *process* no longer

Re: KVM: PPC: Book3S HV: Handle host system reset in guest mode

2017-11-07 Thread Michael Ellerman
On Sun, 2017-11-05 at 12:33:55 UTC, Nicholas Piggin wrote: > If the host takes a system reset interrupt while a guest is running, > the CPU must exit the guest before processing the host exception > handler. > > After this patch, taking a sysrq+x with a CPU running in a guest > gives a trace like

Re: powerpc: eeh: stop using do_gettimeofday()

2017-11-07 Thread Michael Ellerman
On Sat, 2017-11-04 at 21:26:52 UTC, Arnd Bergmann wrote: > This interface is inefficient and deprecated because of the y2038 > overflow. > > ktime_get_seconds() is an appropriate replacement here, since it > has sufficient granularity but is more efficient and uses monotonic > time. > > Signed-of

Re: [v3,1/3] powerpc: add POWER9_DD20 feature

2017-11-07 Thread Michael Ellerman
On Fri, 2017-11-03 at 04:13:19 UTC, Nicholas Piggin wrote: > Cc: Michael Neuling > Signed-off-by: Nicholas Piggin Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/b6b3755e9bec9c686a34ec81eacced cheers

Re: powerpc/mm: Add a CONFIG option to choose if radix is used by default

2017-11-07 Thread Michael Ellerman
On Tue, 2017-10-24 at 15:48:49 UTC, Michael Ellerman wrote: > Currently if the hardware supports the radix MMU we will use > it, *unless* "disable_radix" is passed on the kernel command line. > > However some users would like the reverse semantics. ie. The kernel > uses the hash MMU by default, un

Re: [v5, 01/10] mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()

2017-11-07 Thread Michael Ellerman
On Fri, 2017-11-03 at 02:41:37 UTC, Cyril Bur wrote: > BUG_ON() should be reserved in situations where we can not longer > guarantee the integrity of the system. In the case where > powernv_flash_async_op() receives an impossible op, we can still > guarantee the integrity of the system. > > Signed

Re: [v3,1/4] powerpc: Don't enable FP/Altivec if not checkpointed

2017-11-07 Thread Michael Ellerman
On Thu, 2017-11-02 at 03:09:03 UTC, Cyril Bur wrote: > Lazy save and restore of FP/Altivec means that a userspace process can > be sent to userspace with FP or Altivec disabled and loaded only as > required (by way of an FP/Altivec unavailable exception). Transactional > Memory complicates this sit

Re: [v2, 3/3] powerpc/64s/radix: Fix process table entry cache invalidation

2017-11-07 Thread Michael Ellerman
On Tue, 2017-10-24 at 13:06:54 UTC, Nicholas Piggin wrote: > According to the architecture, the process table entry cache must be > flushed with tlbie RIC=2. > > Currently the process table entry is set to invalid right before the > PID is returned to the allocator, with no invalidation. This work

Re: powerpc/64s: Replace CONFIG_PPC_STD_MMU_64 with CONFIG_PPC_BOOK3S_64

2017-11-07 Thread Michael Ellerman
On Thu, 2017-10-19 at 04:08:43 UTC, Michael Ellerman wrote: > CONFIG_PPC_STD_MMU_64 indicates support for the "standard" powerpc MMU > on 64-bit CPUs. The "standard" MMU refers to the hash page table MMU > found in "server" processors, from IBM mainly. > > Currently CONFIG_PPC_STD_MMU_64 is == CON

Re: [v2,2/3] powerpc/64s/radix: tlbie improve preempt handling

2017-11-07 Thread Michael Ellerman
On Tue, 2017-10-24 at 13:06:53 UTC, Nicholas Piggin wrote: > Preempt should be consistently disabled for mm_is_thread_local tests, > so bring the rest of these under preempt_disable(). > > Preempt does not need to be disabled for the mm->context.id tests, > which allows simplification and removal

Re: powerpc/64: Fix latency tracing for lazy irq replay

2017-11-07 Thread Michael Ellerman
On Sat, 2017-10-21 at 07:56:06 UTC, Nicholas Piggin wrote: > When returning from an exception to a soft-enabled context, pending > IRQs are replayed but IRQ tracing is not reset, so a number of them > can get chained together into the same IRQ-disabled trace. > > Fix this by having __check_irq_rep

Re: [1/3] powerpc/book3s: use label for FIXUP_ENDIAN macro branch

2017-11-07 Thread Michael Ellerman
On Mon, 2017-10-23 at 07:08:13 UTC, Nicholas Piggin wrote: > Signed-off-by: Nicholas Piggin Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/f848ea7f5960ec2684c3bd1c0692e6 cheers

Re: powerpc/64: Free up CPU_FTR_ICSWX

2017-11-07 Thread Michael Ellerman
On Thu, 2017-10-19 at 04:08:19 UTC, Michael Ellerman wrote: > The last user of CPU_FTR_ICSWX was removed in commit > 6ff4d3e96652 ("powerpc: Remove old unused icswx based coprocessor > support"), so free the bit up for future use. > > Signed-off-by: Michael Ellerman Applied to powerpc next. htt

Re: powerpc: ipic - fix status get and status clear

2017-11-07 Thread Michael Ellerman
On Wed, 2017-10-18 at 09:16:47 UTC, Christophe Leroy wrote: > IPIC Status is provided by register IPIC_SERSR and not by IPIC_SERMR > which is the mask register. > > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/6b148a7ce72a7f87c81cbcde48af01

Re: powerpc/tm: Don't check for WARN in TM Bad Thing handling

2017-11-07 Thread Michael Ellerman
On Thu, 2017-10-12 at 04:45:25 UTC, Michael Ellerman wrote: > Currently when we take a TM Bad Thing program check exception, we > search the bug table to see if the program check was generated by a > WARN/WARN_ON etc. > > That makes no sense, the WARN macros use trap instructions, which > should n

Re: powerpc/mm/hash: Add pr_fmt() to hash_utils64.c

2017-11-07 Thread Michael Ellerman
On Mon, 2017-10-16 at 07:01:40 UTC, "Aneesh Kumar K.V" wrote: > Make the printks look a bit nicer by adding a prefix. > > Radix config now do > radix-mmu: Page sizes from device-tree: > radix-mmu: Page size shift = 12 AP=0x0 > radix-mmu: Page size shift = 16 AP=0x5 > radix-mmu: Page size shift

Re: cxl: Rework the implementation of cxl_stop_trace_psl9()

2017-11-07 Thread Michael Ellerman
On Wed, 2017-10-11 at 12:30:20 UTC, Vaibhav Jain wrote: > Presently the PSL9 specific cxl_stop_trace_psl9() only stops the RX0 > traces on the CXL adapter when a PSL error irq is triggered. The patch > updates the function to stop all the traces arrays and move them to > the FIN state. The implemen

Re: powerpc/vio: dispose of virq mapping on vdevice unregister

2017-11-07 Thread Michael Ellerman
On Fri, 2017-09-29 at 00:19:20 UTC, Tyrel Datwyler wrote: > When a vdevice is DLPAR removed from the system the vio subsystem doesn't > bother unmapping the virq from the irq_domain. As a result we have a virq > mapped to a hardware irq that is no longer valid for the irq_domain. A side > effect is

Re: [kernel, v2] powerpc/powernv: Reserve a hole which appears after enabling IOV

2017-11-07 Thread Michael Ellerman
On Wed, 2017-09-27 at 06:52:31 UTC, Alexey Kardashevskiy wrote: > In order to make generic IOV code work, the physical function IOV BAR > should start from offset of the first VF. Since M64 segments share > PE number space across PHB, and some PEs may be in use at the time > when IOV is enabled, th

Re: powerpc/opal: Fix EBUSY bug in acquiring tokens

2017-11-07 Thread Michael Ellerman
On Fri, 2017-09-22 at 23:58:00 UTC, "William A. Kennington III" wrote: > The current code checks the completion map to look for the first token > that is complete. In some cases, a completion can come in but the token > can still be on lease to the caller processing the completion. If this > comple

Re: [1/1] bpf: take advantage of stack_depth tracking in powerpc JIT

2017-11-07 Thread Michael Ellerman
On Fri, 2017-09-01 at 18:53:01 UTC, Sandipan Das wrote: > Take advantage of stack_depth tracking, originally introduced for > x64, in powerpc JIT as well. Round up allocated stack by 16 bytes > to make sure it stays aligned for functions called from JITed bpf > program. > > Signed-off-by: Sandipan

Re: [PATCH] watchdog: mpc8xxx: use the core worker function

2017-11-07 Thread Guenter Roeck
On Tue, Nov 07, 2017 at 05:23:56PM +0100, Christophe Leroy wrote: > The watchdog core includes a worker function which pings the > watchdog until user app starts pinging it and which also > pings it if the HW require more frequent pings. > Use that function instead of the dedicated timer. > In the

Re: [PATCH v9 00/51] powerpc, mm: Memory Protection Keys

2017-11-07 Thread Dave Hansen
On 11/07/2017 02:39 PM, Ram Pai wrote: > > As per the current semantics of sys_pkey_free(); the way I understand it, > the calling thread is saying disassociate me from this key. No. It is saying: "this *process* no longer has any uses of this key, it can be reused".

Re: [PATCH v9 00/51] powerpc, mm: Memory Protection Keys

2017-11-07 Thread Ram Pai
On Tue, Nov 07, 2017 at 08:32:16AM +0100, Florian Weimer wrote: > * Ram Pai: > > > On Mon, Nov 06, 2017 at 10:28:41PM +0100, Florian Weimer wrote: > >> * Ram Pai: > >> > >> > Testing: > >> > --- > >> > This patch series has passed all the protection key > >> > tests available in the selftest

linux-next: manual merge of the powerpc tree with Linus' tree

2017-11-07 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the powerpc tree got a conflict in: arch/powerpc/mm/tlb-radix.c between commit: 26e53d5ebe2e ("powerpc/64s/radix: Fix preempt imbalance in TLB flush") from Linus' tree and commit: dffe8449c5dd ("powerpc/64s/radix: Improve preempt handling in TLB code"

[PATCH] watchdog: mpc8xxx: use the core worker function

2017-11-07 Thread Christophe Leroy
The watchdog core includes a worker function which pings the watchdog until user app starts pinging it and which also pings it if the HW require more frequent pings. Use that function instead of the dedicated timer. In the mean time, we can allow the user to change the timeout. Then change the tim

Re: [PATCH v3] kernel/module_64.c: Add REL24 relocation support of livepatch symbols

2017-11-07 Thread Josh Poimboeuf
On Tue, Nov 07, 2017 at 12:31:05PM +0100, Torsten Duwe wrote: > On Tue, Nov 07, 2017 at 07:34:29PM +1100, Michael Ellerman wrote: > > > So, just brainstorming a bit, here are the possible solutions I can > > > think of: > > > > > > a) Create a special klp stub for such calls (as in Kamalesh's patch

[PATCH] fbdev: controlfb: Add missing modes to fix out of bounds access

2017-11-07 Thread Geert Uytterhoeven
Dan's static analysis says: drivers/video/fbdev/controlfb.c:560 control_setup() error: buffer overflow 'control_mac_modes' 20 <= 21 Indeed, control_mac_modes[] has only 20 elements, while VMODE_MAX is 22, which may lead to an out of bounds read when parsing vmode commandline options. The

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Kirill A. Shutemov
On Tue, Nov 07, 2017 at 07:15:58PM +0530, Aneesh Kumar K.V wrote: > > > > > If it is decided to keep these kind of heuristics, can we get just a > > small but reasonably precise description of each change to the > > interface and ways for using the new functionality, such that would be > > suitab

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Aneesh Kumar K.V
If it is decided to keep these kind of heuristics, can we get just a small but reasonably precise description of each change to the interface and ways for using the new functionality, such that would be suitable for the man page? I couldn't fix powerpc because nothing matches and even Aneesh an

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Nicholas Piggin
On Tue, 7 Nov 2017 15:28:25 +0300 "Kirill A. Shutemov" wrote: > On Tue, Nov 07, 2017 at 10:56:36PM +1100, Nicholas Piggin wrote: > > > No, it won't. You will hit stack first. > > > > I guess so. Florian's bug didn't crash there for some reason, okay > > but I suppose my point about brk is not

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Kirill A. Shutemov
On Tue, Nov 07, 2017 at 02:05:42PM +0100, Florian Weimer wrote: > On 11/07/2017 12:44 PM, Kirill A. Shutemov wrote: > > On Tue, Nov 07, 2017 at 12:26:12PM +0100, Florian Weimer wrote: > > > On 11/07/2017 12:15 PM, Kirill A. Shutemov wrote: > > > > > > > > First of all, using addr and MAP_FIXED to

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Florian Weimer
On 11/07/2017 12:44 PM, Kirill A. Shutemov wrote: On Tue, Nov 07, 2017 at 12:26:12PM +0100, Florian Weimer wrote: On 11/07/2017 12:15 PM, Kirill A. Shutemov wrote: First of all, using addr and MAP_FIXED to develop our heuristic can never really give unchanged ABI. It's an in-band signal. brk()

Re: [PATCH v1] powerpc/pci: convert to use for_each_pci_bridge() helper

2017-11-07 Thread Andy Shevchenko
On Tue, 2017-10-31 at 20:40 +0200, Andy Shevchenko wrote: > On Tue, 2017-10-31 at 13:33 -0500, Bjorn Helgaas wrote: > > On Tue, Oct 31, 2017 at 10:12 AM, Andy Shevchenko > > wrote: > > > On Fri, 2017-10-13 at 19:52 +0300, Andy Shevchenko wrote: > > > > ...which makes code slightly cleaner. > > >

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Kirill A. Shutemov
On Tue, Nov 07, 2017 at 10:56:36PM +1100, Nicholas Piggin wrote: > > No, it won't. You will hit stack first. > > I guess so. Florian's bug didn't crash there for some reason, okay > but I suppose my point about brk is not exactly where the standard > heap is, but the pattern of allocations. An all

Re: [PATCH v2 11/18] powerpc/vas: Export HVWC to debugfs

2017-11-07 Thread Michael Ellerman
Sukadev Bhattiprolu writes: > diff --git a/arch/powerpc/platforms/powernv/vas-window.c > b/arch/powerpc/platforms/powernv/vas-window.c > index 23c13a7..088ce56 100644 > --- a/arch/powerpc/platforms/powernv/vas-window.c > +++ b/arch/powerpc/platforms/powernv/vas-window.c > @@ -145,24 +145,42 @@ s

Re: [PATCH v2] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2017-11-07 Thread Anju T Sudhakar
Hi mpe, On Wednesday 01 November 2017 06:20 AM, Michael Ellerman wrote: Anju T Sudhakar writes: Add ldbar spr to sysfs. The spr will hold thread level In-Memory Collection (IMC) counter configuration data. This is missing any justification for why we would want to expose this, and in parti

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Nicholas Piggin
On Tue, 7 Nov 2017 14:15:43 +0300 "Kirill A. Shutemov" wrote: > On Tue, Nov 07, 2017 at 04:07:05PM +1100, Nicholas Piggin wrote: > > C'ing everyone who was on the x86 56-bit user virtual address patch. > > > > I think we need more time to discuss this behaviour, in light of the > > regression Fl

Re: [linux-next][0692229e] next-20171106 fails to boot on Power 7

2017-11-07 Thread Michal Hocko
On Tue 07-11-17 11:28:54, Michal Hocko wrote: > On Tue 07-11-17 15:20:29, Abdul Haleem wrote: > > Hi, > > > > Today's next kernel fails to boot on Power 7 Machine with below errors > > in boot log messages. > > > > 'Uhuuh, elf segement at 1004 requested but the memory is > > mapped al

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Kirill A. Shutemov
On Tue, Nov 07, 2017 at 12:26:12PM +0100, Florian Weimer wrote: > On 11/07/2017 12:15 PM, Kirill A. Shutemov wrote: > > > > First of all, using addr and MAP_FIXED to develop our heuristic can > > > never really give unchanged ABI. It's an in-band signal. brk() is a > > > good example that steadily

Re: [PATCH v3] kernel/module_64.c: Add REL24 relocation support of livepatch symbols

2017-11-07 Thread Torsten Duwe
On Tue, Nov 07, 2017 at 07:34:29PM +1100, Michael Ellerman wrote: > Josh Poimboeuf writes: > > > On Tue, Oct 31, 2017 at 07:39:59PM +0100, Torsten Duwe wrote: > >> On Tue, Oct 31, 2017 at 09:53:16PM +0530, Naveen N . Rao wrote: > >> > On 2017/10/31 03:30PM, Torsten Duwe wrote: > >> > > > >> > >

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Florian Weimer
On 11/07/2017 12:15 PM, Kirill A. Shutemov wrote: First of all, using addr and MAP_FIXED to develop our heuristic can never really give unchanged ABI. It's an in-band signal. brk() is a good example that steadily keeps incrementing address, so depending on malloc usage and address space randomiz

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Kirill A. Shutemov
On Tue, Nov 07, 2017 at 09:15:21AM +0100, Florian Weimer wrote: > MAP_FIXED is near-impossible to use correctly. I hope you don't expect > applications to do that. If you want address-based opt in, it should work > without MAP_FIXED. Sure, in obscure cases, applications might still see > out-of-

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Kirill A. Shutemov
On Tue, Nov 07, 2017 at 04:07:05PM +1100, Nicholas Piggin wrote: > C'ing everyone who was on the x86 56-bit user virtual address patch. > > I think we need more time to discuss this behaviour, in light of the > regression Florian uncovered. I would propose we turn off the 56-bit > user virtual add

Re: [linux-next][0692229e] next-20171106 fails to boot on Power 7

2017-11-07 Thread Michal Hocko
On Tue 07-11-17 15:20:29, Abdul Haleem wrote: > Hi, > > Today's next kernel fails to boot on Power 7 Machine with below errors > in boot log messages. > > 'Uhuuh, elf segement at 1004 requested but the memory is > mapped already' > > It was introduced with commit: > > 0692229e : fs/

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Nicholas Piggin
On Tue, 7 Nov 2017 09:15:21 +0100 Florian Weimer wrote: > On 11/07/2017 06:07 AM, Nicholas Piggin wrote: > > > First of all, using addr and MAP_FIXED to develop our heuristic can > > never really give unchanged ABI. It's an in-band signal. brk() is a > > good example that steadily keeps incremen

Re: [PATCH v3] kernel/module_64.c: Add REL24 relocation support of livepatch symbols

2017-11-07 Thread Michael Ellerman
Josh Poimboeuf writes: > On Tue, Oct 31, 2017 at 07:39:59PM +0100, Torsten Duwe wrote: >> On Tue, Oct 31, 2017 at 09:53:16PM +0530, Naveen N . Rao wrote: >> > On 2017/10/31 03:30PM, Torsten Duwe wrote: >> > > >> > > Maybe I failed to express my views properly; I find the whole approach >> [...]

Re: POWER: Unexpected fault when writing to brk-allocated memory

2017-11-07 Thread Florian Weimer
On 11/07/2017 06:07 AM, Nicholas Piggin wrote: First of all, using addr and MAP_FIXED to develop our heuristic can never really give unchanged ABI. It's an in-band signal. brk() is a good example that steadily keeps incrementing address, so depending on malloc usage and address space randomizati

[PATCH v2 7/7] powerpc/64s/radix: Improve TLB flushing for page table freeing

2017-11-07 Thread Nicholas Piggin
Unmaps that free page tables always flush the entire PID, which is sub-optimal. Provide TLB range flushing with an additional PWC flush that can be use for va range invalidations with PWC flush. Time to munmap N pages of memory including last level page table teardown (after mmap, touch)

[PATCH v2 6/7] powerpc/64s/radix: Introduce local single page ceiling for TLB range flush

2017-11-07 Thread Nicholas Piggin
The single page flush ceiling is the cut-off point at which we switch from invalidating individual pages, to invalidating the entire process address space in response to a range flush. Introduce a local variant of this heuristic because local and global tlbie have significantly different propertie

[PATCH v2 5/7] powerpc/64s/radix: Optimize flush_tlb_range

2017-11-07 Thread Nicholas Piggin
Currently for radix, flush_tlb_range flushes the entire PID, because the Linux mm code does not tell us about page size here for THP vs regular pages. This is quite sub-optimal for small mremap / mprotect / change_protection. So implement va range flushes with two flush passes, one for each page s

[PATCH v2 4/7] powerpc/64s/radix: Implement _tlbie(l)_va_range flush functions

2017-11-07 Thread Nicholas Piggin
Move the barriers and range iteration down into the _tlbie* level, which improves readability. Signed-off-by: Nicholas Piggin --- arch/powerpc/mm/tlb-radix.c | 71 ++--- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/mm/tlb-ra

[PATCH v2 3/7] powerpc/64s/radix: optimize TLB range flush barriers

2017-11-07 Thread Nicholas Piggin
Short range flushes issue a sequences of tlbie(l) instructions for individual effective addresses. These do not all require individual barrier sequences, only one covering all tlbie(l) instructions. Commit f7327e0ba3 ("powerpc/mm/radix: Remove unnecessary ptesync") made a similar optimization for