[PATCHv4] powerpc/timer - large decrementer support

2016-06-23 Thread Oliver O'Halloran
Power ISAv3 adds a large decrementer (LD) mode which increases the size of the decrementer register. The size of the enlarged decrementer register is between 32 and 64 bits with the exact size being dependent on the implementation. When in LD mode, reads are sign extended to 64 bits and a decrement

Re: [PATCHv4] powerpc/timer - large decrementer support

2016-06-23 Thread Denis Kirjanov
On 6/23/16, Oliver O'Halloran wrote: > Power ISAv3 adds a large decrementer (LD) mode which increases the size > of the decrementer register. The size of the enlarged decrementer > register is between 32 and 64 bits with the exact size being dependent > on the implementation. When in LD mode, read

Re: [PATCHv4] powerpc/timer - large decrementer support

2016-06-23 Thread oliver
On Thu, Jun 23, 2016 at 6:02 PM, Denis Kirjanov wrote: > On 6/23/16, Oliver O'Halloran wrote: >> +static void __init set_decrementer_max(void) >> +{ >> + struct device_node *cpu; >> + const __be32 *fp; >> + u64 bits = 32; >> + >> + /* Prior to ISAv3 the decrementer is always 32 bi

Re: powerpc/mm/hash: Don't add memory coherence if cache inhibited is set

2016-06-23 Thread Michael Ellerman
On Fri, 2016-17-06 at 06:02:00 UTC, "Aneesh Kumar K.V" wrote: > H_ENTER hcall handling in qemu had assumptions that a cache inhibited > hpte entry won't have memory conference set. Also older kernel > mentioned that some version of pHyp required this (the code removed > by the below commit says: >

Re: powerpc/eeh: Fix invalid cached PE primary bus

2016-06-23 Thread Michael Ellerman
On Fri, 2016-17-06 at 03:05:11 UTC, Gavin Shan wrote: > The PE primary bus cannot be got from its child devices when having > full hotplug in error recovery. The PE primary bus is cached, which > is done in commit <05ba75f84864> ("powerpc/eeh: Fix stale cached primary > bus"). In eeh_reset_device()

Re: [PATCHv2,1/7] ppc bpf/jit: Disable classic BPF JIT on ppc64le

2016-06-23 Thread Michael Ellerman
On Wed, 2016-22-06 at 16:25:01 UTC, "Naveen N. Rao" wrote: > Classic BPF JIT was never ported completely to work on little endian > powerpc. However, it can be enabled and will crash the system when used. > As such, disable use of BPF JIT on ppc64le. > > Reported-by: Thadeu Lima de Souza Cascardo

Re: powerpc: Fix faults caused by radix patching of SLB miss handler

2016-06-23 Thread Michael Ellerman
On Tue, 2016-21-06 at 10:36:19 UTC, Michael Ellerman wrote: > As part of the Radix MMU support we added some feature sections in the > SLB miss handler. These are intended to catch the case that we > incorrectly take an SLB miss when Radix is enabled, and instead of > crashing weirdly they bail out

Re: [V2] powerpc/mm/radix: Update Radix tree size as per ISA 3.0

2016-06-23 Thread Michael Ellerman
On Fri, 2016-17-06 at 06:10:36 UTC, "Aneesh Kumar K.V" wrote: > ISA 3.0 updated it to be encoded as Radix tree size = 2^(RTS + 31). We > have it encoded as 2^(RTS + 28). Add a helper with the correct encoding > and use it instead of opencoding. > > Fixes commit 2bfd65e45e87 ("powerpc/mm/radix: Add

Re: [PATCH] cpuidle/powernv: Fix snooze timeout

2016-06-23 Thread Balbir Singh
On 23/06/16 14:58, Shreyas B Prabhu wrote: > > > On 06/23/2016 05:18 AM, Balbir Singh wrote: >> >> >> On 23/06/16 05:36, Shreyas B. Prabhu wrote: >>> Snooze is a poll idle state in powernv and pseries platforms. Snooze >>> has a timeout so that if a cpu stays in snooze for more than target >>>

Re: [PATCH] cpuidle/powernv: Fix snooze timeout

2016-06-23 Thread Shreyas B Prabhu
On 06/23/2016 02:58 PM, Balbir Singh wrote: > > > On 23/06/16 14:58, Shreyas B Prabhu wrote: >> >> >> On 06/23/2016 05:18 AM, Balbir Singh wrote: >>> >>> >>> On 23/06/16 05:36, Shreyas B. Prabhu wrote: Snooze is a poll idle state in powernv and pseries platforms. Snooze has a timeout

Re: [PATCH] cpuidle/powernv: Fix snooze timeout

2016-06-23 Thread Balbir Singh
>> This is still a rounding error but at a different site. I see we saved >> a division by doing a >> 10, but we added it right back by doing a /20 >> later in the platform code. > > While a >> 10 is done at every idle exit, div by 20 is done once during > boot, so this doesn't negate the previous

Re: [PATCH] cpuidle/powernv: Fix snooze timeout

2016-06-23 Thread Daniel Lezcano
On 06/23/2016 11:28 AM, Balbir Singh wrote: [ ... ] cpuidle_enter_state() { [...] time_start = local_clock(); [enter idle state] time_end = local_clock(); /* * local_clock() returns the time in nanosecond, let's shift * by 10 (divide b

[v7, 1/2] cxl: Add mechanism for delivering AFU driver specific events

2016-06-23 Thread Philippe Bergheaud
This adds an afu_driver_ops structure with fetch_event() and event_delivered() callbacks. An AFU driver such as cxlflash can fill this out and associate it with a context to enable passing custom AFU specific events to userspace. This also adds a new kernel API function cxl_context_pending_events(

[v6,2/2] cxl: Add set and get private data to context struct

2016-06-23 Thread Philippe Bergheaud
From: Michael Neuling This provides AFU drivers a means to associate private data with a cxl context. This is particularly intended for make the new callbacks for driver specific events easier for AFU drivers to use, as they can easily get back to any private data structures they may use. Signed

Re: [PATCH] cpuidle/powernv: Fix snooze timeout

2016-06-23 Thread Shreyas B Prabhu
On 06/23/2016 03:31 PM, Daniel Lezcano wrote: > On 06/23/2016 11:28 AM, Balbir Singh wrote: > > [ ... ] > >>> cpuidle_enter_state() >>> { >>> [...] >>> time_start = local_clock(); >>> [enter idle state] >>> time_end = local_clock(); >>> /* >>> * local_clock() retur

Re: [PATCH] cpuidle/powernv: Fix snooze timeout

2016-06-23 Thread Daniel Lezcano
On 06/23/2016 03:35 PM, Shreyas B Prabhu wrote: On 06/23/2016 03:31 PM, Daniel Lezcano wrote: On 06/23/2016 11:28 AM, Balbir Singh wrote: [ ... ] cpuidle_enter_state() { [...] time_start = local_clock(); [enter idle state] time_end = local_clock(); /* * l

Re: [PATCH v3 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-06-23 Thread Thiago Jung Bauermann
Am Donnerstag, 23 Juni 2016, 01:44:07 schrieb Dave Young: > Hmm, hold on. For declaring a struct in a header file, comment should be > just after each fields, like below, your format is for a function instead: > struct pci_slot { > struct pci_bus *bus;/* The bus this slot is on

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-06-23 Thread Josh Poimboeuf
On Wed, Jun 22, 2016 at 05:09:11PM -0700, Andy Lutomirski wrote: > On Wed, Jun 22, 2016 at 9:30 AM, Josh Poimboeuf wrote: > > Andy, > > > > So I got a chance to look at this some more. I'm thinking that to make > > this feature more consistently useful, we shouldn't only annotate > > pt_regs fram

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-06-23 Thread Josh Poimboeuf
On Wed, Jun 22, 2016 at 12:17:25PM -0700, Andy Lutomirski wrote: > On Wed, Jun 22, 2016 at 11:40 AM, Josh Poimboeuf wrote: > > On Wed, Jun 22, 2016 at 11:26:21AM -0700, Andy Lutomirski wrote: > >> > > >> > So are you suggesting something like: > >> > > >> > .macro ENTRY_CALL func pt_regs_o

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-06-23 Thread Andy Lutomirski
On Thu, Jun 23, 2016 at 9:19 AM, Josh Poimboeuf wrote: > On Wed, Jun 22, 2016 at 12:17:25PM -0700, Andy Lutomirski wrote: >> On Wed, Jun 22, 2016 at 11:40 AM, Josh Poimboeuf wrote: >> > On Wed, Jun 22, 2016 at 11:26:21AM -0700, Andy Lutomirski wrote: >> >> > >> >> > So are you suggesting somethin

[PATCH] powerpc/mm: update arch_{add,remove}_memory() for radix

2016-06-23 Thread Reza Arbab
These functions are making direct calls to the hash table APIs, leading to a BUG() on systems using radix. Switch them to the vmemmap_{create,remove}_mapping() wrappers, and move to the __meminit section. Signed-off-by: Reza Arbab --- arch/powerpc/mm/mem.c | 8 1 file changed, 4 insert

Re: [PATCH v3 0/9] kexec_file_load implementation for PowerPC

2016-06-23 Thread Thiago Jung Bauermann
Am Donnerstag, 23 Juni 2016, 09:57:51 schrieb Balbir Singh: > On 23/06/16 03:02, Thiago Jung Bauermann wrote: > >>> 3. have IMA pass-on its event log (where integrity measurements are > >>> > >>>registered) accross kexec to the second kernel, so that the event > >>>history is preserved. >

[PATCH] powerpc/powernv: spelling mistake: "Retrived" -> "Retrieved"

2016-06-23 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in pr_debug message Signed-off-by: Colin Ian King --- arch/powerpc/platforms/powernv/opal-memory-errors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/opal-memory-errors.c b/arch/powerpc

Re: [PATCH] powerpc/mm: update arch_{add,remove}_memory() for radix

2016-06-23 Thread Aneesh Kumar K.V
Reza Arbab writes: > These functions are making direct calls to the hash table APIs, > leading to a BUG() on systems using radix. > > Switch them to the vmemmap_{create,remove}_mapping() wrappers, and > move to the __meminit section. They are really not the same. They can possibly end up using

Re: [PATCH] powerpc/mm: update arch_{add,remove}_memory() for radix

2016-06-23 Thread Nathan Fontenot
On 06/23/2016 12:17 PM, Aneesh Kumar K.V wrote: > Reza Arbab writes: > >> These functions are making direct calls to the hash table APIs, >> leading to a BUG() on systems using radix. >> >> Switch them to the vmemmap_{create,remove}_mapping() wrappers, and >> move to the __meminit section. > >

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-06-23 Thread Josh Poimboeuf
On Thu, Jun 23, 2016 at 09:35:29AM -0700, Andy Lutomirski wrote: > > So which is the least-bad option? To summarize: > > > > 1) task flag(s) for preemption and page faults > > > > 2) turn pt_regs into a stack frame > > > > 3) annotate all calls from entry code in a table > > > > 4) encode

Re: [PATCH] powerpc/mm: update arch_{add,remove}_memory() for radix

2016-06-23 Thread Reza Arbab
On Thu, Jun 23, 2016 at 10:47:20PM +0530, Aneesh Kumar K.V wrote: Reza Arbab writes: These functions are making direct calls to the hash table APIs, leading to a BUG() on systems using radix. Switch them to the vmemmap_{create,remove}_mapping() wrappers, and move to the __meminit section. Th

Re: [PATCH] powerpc/mm: update arch_{add,remove}_memory() for radix

2016-06-23 Thread Reza Arbab
On Thu, Jun 23, 2016 at 02:37:39PM -0500, Reza Arbab wrote: Could it be that the functions just need to be renamed hash__create_mapping()/radix__create_mapping() and moved out of #ifdef SPARSEMEM_VMEMMAP? Or vice-versa, maybe the callers should have been wrapped in the first place: arch_add

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-06-23 Thread Josh Poimboeuf
On Thu, Jun 23, 2016 at 01:31:32PM -0500, Josh Poimboeuf wrote: > On Thu, Jun 23, 2016 at 09:35:29AM -0700, Andy Lutomirski wrote: > > > So which is the least-bad option? To summarize: > > > > > > 1) task flag(s) for preemption and page faults > > > > > > 2) turn pt_regs into a stack frame > >

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-06-23 Thread Andy Lutomirski
On Thu, Jun 23, 2016 at 1:40 PM, Josh Poimboeuf wrote: > On Thu, Jun 23, 2016 at 01:31:32PM -0500, Josh Poimboeuf wrote: >> On Thu, Jun 23, 2016 at 09:35:29AM -0700, Andy Lutomirski wrote: >> > > So which is the least-bad option? To summarize: >> > > >> > > 1) task flag(s) for preemption and pa

Re: [PATCH v3 0/9] kexec_file_load implementation for PowerPC

2016-06-23 Thread Balbir Singh
On 24/06/16 02:44, Thiago Jung Bauermann wrote: > Am Donnerstag, 23 Juni 2016, 09:57:51 schrieb Balbir Singh: >> On 23/06/16 03:02, Thiago Jung Bauermann wrote: > 3. have IMA pass-on its event log (where integrity measurements are > >registered) accross kexec to the second kernel,

Re: [PATCH v3 0/9] kexec_file_load implementation for PowerPC

2016-06-23 Thread Thiago Jung Bauermann
Am Freitag, 24 Juni 2016, 08:33:24 schrieb Balbir Singh: > On 24/06/16 02:44, Thiago Jung Bauermann wrote: > > Sorry, I still don't understand your concern. What kind of cheating? > > Which values? If it's the values in the event log, there's no need to > > trust the old kernel. The new kernel know

[PATCH v5] powerpc/timer - large decrementer support

2016-06-23 Thread Oliver O'Halloran
Power ISAv3 adds a large decrementer (LD) mode which increases the size of the decrementer register. The size of the enlarged decrementer register is between 32 and 64 bits with the exact size being dependent on the implementation. When in LD mode, reads are sign extended to 64 bits and a decrement

Re: [PATCH] powerpc/mm: update arch_{add,remove}_memory() for radix

2016-06-23 Thread Balbir Singh
On 24/06/16 03:17, Aneesh Kumar K.V wrote: > Reza Arbab writes: > >> These functions are making direct calls to the hash table APIs, >> leading to a BUG() on systems using radix. >> >> Switch them to the vmemmap_{create,remove}_mapping() wrappers, and >> move to the __meminit section. > > > T

[PATCH] powerpc/eeh: Fix wrong argument passed to eeh_rmv_device()

2016-06-23 Thread Gavin Shan
When calling eeh_rmv_device() in eeh_reset_device() for partial hotplug case, @rmv_data instead of its address is the proper argument. Otherwise, the stack frame is corrupted when writing to @rmv_data (actually its address) in eeh_rmv_device(). It results in kernel crash as observed. This fixes th

Re: [v2,1/2] refactor code parsing size based on memory range

2016-06-23 Thread Michael Ellerman
On Wed, 2016-22-06 at 19:25:26 UTC, Hari Bathini wrote: > Currently, crashkernel parameter supports the below syntax to parse size > based on memory range: > > crashkernel=:[,:,...] > > While such parsing is implemented for crashkernel parameter, it applies to > other parameters with simila

Re: [PATCH] powerpc/pseries: Auto online hotplugged memory

2016-06-23 Thread Michael Ellerman
On Mon, 2016-06-20 at 21:14 -0500, Nathan Fontenot wrote: > On 06/20/2016 07:57 PM, Michael Ellerman wrote: > > On Mon, 2016-06-20 at 08:51 -0500, Nathan Fontenot wrote: > > > > > Auto online hotplugged memory > > > > > > A recent update (commit id 31bc3858ea3) to the core mm hotplug code > > > i

[PATCH] powerpc/eeh: fix pr_debug()s in eeh_cache.c

2016-06-23 Thread Andrew Donnellan
eeh_cache.c doesn't build cleanly with -DDEBUG when CONFIG_PHYS_ADDR_T_64BIT is set, as a couple of pr_debug()s use "%lx" for resource_size_t parameters. Use "%pap" instead, as it's the correct format specifier for types deriving from phys_addr_t. Signed-off-by: Andrew Donnellan Cc: Russell Curr

Re: [PATCH] powerpc/eeh: fix pr_debug()s in eeh_cache.c

2016-06-23 Thread Gavin Shan
On Fri, Jun 24, 2016 at 03:54:22PM +1000, Andrew Donnellan wrote: >eeh_cache.c doesn't build cleanly with -DDEBUG when >CONFIG_PHYS_ADDR_T_64BIT is set, as a couple of pr_debug()s use "%lx" for >resource_size_t parameters. > >Use "%pap" instead, as it's the correct format specifier for types derivi

Re: [PATCH] powerpc/pci: Reduce log level of PCI I/O space warning

2016-06-23 Thread Gavin Shan
On Wed, Jun 22, 2016 at 05:23:07PM +1000, Benjamin Herrenschmidt wrote: >If a PHB has no I/O space, there's no need to make it look like >something bad happened, a pr_debug() is plenty enough since this >is the case of all our modern POWER chips. > >Signed-off-by: Benjamin Herrenschmidt Reviewed-

[PATCH] powerpc/powernv: Call opal_pci_poll() if needed

2016-06-23 Thread Gavin Shan
When issuing PHB reset, OPAL API opal_pci_poll() is called to drive the state machine in OPAL forward. However, we needn't always call the function under some circumstances like reset deassert. This avoids calling opal_pci_poll() when OPAL_SUCCESS is returned from opal_pci_reset(). Except the over

[RESEND v7,2/2] cxl: Add set and get private data to context struct

2016-06-23 Thread Philippe Bergheaud
From: Michael Neuling This provides AFU drivers a means to associate private data with a cxl context. This is particularly intended for make the new callbacks for driver specific events easier for AFU drivers to use, as they can easily get back to any private data structures they may use. Signed