Re: [PATCH] KVM: PPC: Book3S PR: Enable MSR_DR for switch_mmu_context()

2022-05-10 Thread Matt Evans
ot accessible > from real mode though. > > So to keep calling the function, let's turn on MSR_DR while we call it. > That way, all pointer references to the stack are handled virtually. > > Reported-by: Matt Evans > Fixes: 863771a28e27 ("powerpc/32s: Convert switch_mm

Re: [PATCH] powerpc: Clear branch trap (MSR.BE) before delivering SIGTRAP

2018-03-29 Thread Matt Evans
Hi Michael, > On 28 Mar 2018, at 11:36, Matt Evans wrote: > > Howdy Michael, > >> On 28 Mar 2018, at 06:54, Michael Ellerman wrote: >> >> Matt Evans writes: >> >>> When using SIG_DBG_BRANCH_TRACING, MSR.BE is left enabled in the >>>

Re: [PATCH] powerpc: Clear branch trap (MSR.BE) before delivering SIGTRAP

2018-03-28 Thread Matt Evans
Howdy Michael, > On 28 Mar 2018, at 06:54, Michael Ellerman wrote: > > Matt Evans writes: > >> When using SIG_DBG_BRANCH_TRACING, MSR.BE is left enabled in the >> user context when single_step_exception() prepares the SIGTRAP >> delivery. The resulting branch-t

[PATCH] powerpc: Clear branch trap (MSR.BE) before delivering SIGTRAP

2018-03-26 Thread Matt Evans
ned-off-by: Matt Evans --- arch/powerpc/kernel/traps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 1e48d157196a..5eaab234e747 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -46

Re: [RESEND PATCH 2/2] ppc: bpf_jit: support MOD operation

2013-09-22 Thread Matt Evans
Hi Vladimir, On 21 Sep 2013, at 17:25, Vladimir Murzin wrote: > commit b6069a9570 (filter: add MOD operation) added generic > support for modulus operation in BPF. > > This patch brings JIT support for PPC64 > > Signed-off-by: Vladimir Murzin > Acked-by: Matt Evans Not

Re: [PATCH] ppc: bpf_jit: support MOD operation

2013-09-11 Thread Matt Evans
(r_scratch1 + 1) >>> + PPC_LI32(r_scratch2, K); >>> + PPC_DIVWU(r_scratch1, r_A, r_scratch2); >>> + PPC_MUL(r_scratch1, r_scratch2, r_scratch1); >>>

Re: [PATCH] powerpc: net: filter: fix DIVWU instruction opcode

2013-09-11 Thread Matt Evans
> > This looks like it's in only used in the BPF JIT code. > > Matt, any chance you an ACK/NACK this? Sure, that looks sensible, thanks Vladimir. Acked-by: Matt Evans > > Mikey > >> >> Signed-off-by: Vladimir Murzin >> --- >> a

[PATCH] PPC: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64

2011-12-07 Thread Matt Evans
t, if defined, int-ll64.h is included instead. Signed-off-by: Matt Evans --- arch/powerpc/include/asm/types.h |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index 8947b98..d82e94e 100644 --- a

[PATCH v3] net: filter: BPF 'JIT' compiler for PPC64

2011-07-20 Thread Matt Evans
ame way as x86-64: echo 1 > /proc/sys/net/core/bpf_jit_enable Or, enabled with extra debug output: echo 2 > /proc/sys/net/core/bpf_jit_enable Signed-off-by: Matt Evans --- V3: Added BUILD_BUG_ON to assert PACA CPU ID is 16bits, made a comment (in LD_MSH) a bit clearer

Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64

2011-07-19 Thread Matt Evans
On 19/07/11 17:17, Kumar Gala wrote: > > On Jul 19, 2011, at 2:06 AM, Matt Evans wrote: > >> On 19/07/11 16:59, Kumar Gala wrote: >>> >>> On Jul 18, 2011, at 9:13 PM, Matt Evans wrote: >>> >>>> [snip] >>>> >>>> V2: Re

Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64

2011-07-19 Thread Matt Evans
On 19/07/11 16:59, Kumar Gala wrote: > > On Jul 18, 2011, at 9:13 PM, Matt Evans wrote: > >> An implementation of a code generator for BPF programs to speed up packet >> filtering on PPC64, inspired by Eric Dumazet's x86-64 version. >> >> Filter code is gen

[PATCH v2] net: filter: BPF 'JIT' compiler for PPC64

2011-07-18 Thread Matt Evans
ame way as x86-64: echo 1 > /proc/sys/net/core/bpf_jit_enable Or, enabled with extra debug output: echo 2 > /proc/sys/net/core/bpf_jit_enable Signed-off-by: Matt Evans --- V2: Removed some cut/paste woe in setting SEEN_X even on writes. Merci for le review, Eric! arch

Re: [PATCH] net: filter: BPF 'JIT' compiler for PPC64

2011-07-18 Thread Matt Evans
On 19/07/11 05:42, David Miller wrote: > From: Eric Dumazet > Date: Mon, 18 Jul 2011 10:39:35 +0200 > >> So in PPC SEEN_XREG only is to be set of X is read, not if written. >> >> So you dont have to set SEEN_XREG bit in this part : > > Matt, do you want to integrate changes based upon Eric's fee

[PATCH] net: filter: BPF 'JIT' compiler for PPC64

2011-07-18 Thread Matt Evans
ame way as x86-64: echo 1 > /proc/sys/net/core/bpf_jit_enable Or, enabled with extra debug output: echo 2 > /proc/sys/net/core/bpf_jit_enable Signed-off-by: Matt Evans --- Since the RFC post, this has incorporated the bugfixes/tidies from review plus a couple more found in fu

Re: [RFC PATCH 1/1] BPF JIT for PPC64

2011-07-11 Thread Matt Evans
Hi Eric, On 25/06/11 17:49, Eric Dumazet wrote: > Le samedi 25 juin 2011 à 09:33 +0200, Andreas Schwab a écrit : >> Matt Evans writes: >> >>> + stdur1, -128(r1); \ >> >>> + addir5, r1, 128+BPF_PPC_STACK_BASIC+

Re: [RFC PATCH 1/1] BPF JIT for PPC64

2011-07-10 Thread Matt Evans
On 25/06/11 17:33, Andreas Schwab wrote: > Matt Evans writes: > >> +stdur1, -128(r1); \ > >> +addir5, r1, 128+BPF_PPC_STACK_BASIC+(2*8); \ > >

Re: [RFC PATCH 1/1] BPF JIT for PPC64

2011-07-10 Thread Matt Evans
On 25/06/11 11:58, Ben Hutchings wrote: > On Fri, 2011-06-24 at 16:02 +1000, Matt Evans wrote: > [...] >> +case BPF_S_ALU_ADD_K: /* A += K; */ >> +if (!K) >> +break; >> +

[RFC PATCH 1/1] BPF JIT for PPC64

2011-06-23 Thread Matt Evans
+obj-$(CONFIG_BPF_JIT) += bpf_jit.o bpf_jit_comp.o diff --git a/arch/powerpc/net/bpf_jit.S b/arch/powerpc/net/bpf_jit.S new file mode 100644 index 000..ce2225e --- /dev/null +++ b/arch/powerpc/net/bpf_jit.S @@ -0,0 +1,138 @@ +/* bpf_jit.S: Packet/header access helper functions + * for PPC64 BPF compi

[RFC PATCH 0/1] BPF JIT for PPC64

2011-06-23 Thread Matt Evans
Hi, Inspired by Eric Dumazet's x86-64 compiler for Berkeley Packet Filter programs, I've written a BPF compiler for 64-bit PowerPC. Although it hasn't finished its strenuous testing regime, I'll have intermittent net access for a couple of weeks so thought I'd post it for feedback now and submit

[PATCH] powerpc: Replace boot_cpu_count with spinning_secondaries, fix off-by-one cpu wait

2011-05-25 Thread Matt Evans
smp_release_cpus() waits for all cpus (including the bootcpu) due to an off-by-one count on boot_cpu_count (which is all CPUs). This patch replaces that with spinning_secondaries (which is all secondary CPUs). Signed-off-by: Matt Evans --- arch/powerpc/include/asm/smp.h |2 +- arch/powerpc

Re: [PATCH] powerpc: Free up some CPU feature bits by moving out MMU-related features

2011-04-07 Thread Matt Evans
On 07/04/11 17:06, Kumar Gala wrote: > > On Apr 7, 2011, at 12:48 AM, Matt Evans wrote: > >> diff --git a/arch/powerpc/include/asm/cputable.h >> b/arch/powerpc/include/asm/cputable.h >> index be3cdf9..7b0fe7c 100644 >> --- a/arch/powerpc/include/asm/cputable.h

[PATCH] powerpc: Free up some CPU feature bits by moving out MMU-related features

2011-04-06 Thread Matt Evans
Some of the 64bit PPC CPU features are MMU-related, so this patch moves them to MMU_FTR_ bits. All cpu_has_feature()-style tests are moved to mmu_has_feature(), and seven feature bits are freed as a result. Signed-off-by: Matt Evans --- Boot-tested on pseries and G5. arch/powerpc/include/asm

Re: [PATCH v2 5/5] xhci: Remove recursive call to xhci_handle_event

2011-03-30 Thread Matt Evans
On 30/03/11 07:00, Dmitry Torokhov wrote: > On Sunday, March 27, 2011 09:53:00 pm Matt Evans wrote: >> @@ -2282,7 +2284,7 @@ hw_died: >> /* FIXME this should be a delayed service routine >> * that clears the EHB. >> */ >> -xhci_

[PATCH v3 4/4] xhci: Remove recursive call to xhci_handle_event

2011-03-28 Thread Matt Evans
Make the caller loop while there are events to handle, instead. Signed-off-by: Matt Evans --- Added a comment on the return value, defining <0 to be 'bad'. drivers/usb/host/xhci-ring.c | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dri

[PATCH v3 3/4] xhci: Add an assertion to check for virt_dev=0 bug.

2011-03-28 Thread Matt Evans
During a "plug-unplug" stress test on an NEC xHCI card, a null pointer dereference was observed. xhci_address_device() dereferenced a null virt_dev (possibly an erroneous udev->slot_id?); this patch adds a WARN_ON & message to aid debug if it can be recreated. Signed-o

[PATCH v3 2/4] xhci: Add rmb() between reading event validity & event data access.

2011-03-28 Thread Matt Evans
On weakly-ordered systems, the reading of an event's content must occur after reading the event's validity. Signed-off-by: Matt Evans --- drivers/usb/host/xhci-ring.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/driver

[PATCH v3 0/4] xhci: Make xHCI driver endian-safe

2011-03-28 Thread Matt Evans
Hi Sarah, Reposting the whole set, since there're 4 instead of 5 having dropped the 'add debug' patch in the middle and I thought differing 'vN a/b' subjects may get confusing otherwise. (Two of the patches haven't changed. :/ ) These remove the scratty temp variables and comment the return val

Re: [PATCH 2/5] xhci: Extend debug messages

2011-03-28 Thread Matt Evans
Hi, On 29/03/11 09:19, Sarah Sharp wrote: > On Fri, Mar 25, 2011 at 06:43:59PM +1100, Matt Evans wrote: >> Add more debug to print queued transfers, show control intentions and >> modify an existing message to hexify address output. > > Are these new debug messages really ne

Re: [PATCH 0/5] Make xHCI driver endian-safe, add a barrier, some debug

2011-03-28 Thread Matt Evans
On 29/03/11 09:16, Sarah Sharp wrote: > On Fri, Mar 25, 2011 at 06:43:44PM +1100, Matt Evans wrote: >> Hi Sarah, >> >> >> This series addresses the endian issues with the xHCI driver, and has brought >> lovely USB 3 to PPC. :-) I've tested various types

[PATCH v2 5/5] xhci: Remove recursive call to xhci_handle_event

2011-03-27 Thread Matt Evans
Make the caller loop while there are events to handle, instead. Signed-off-by: Matt Evans --- 1 byte smaller after Sergei's suggestion. drivers/usb/host/xhci-ring.c | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/dr

[PATCH v2 3/5] xhci: Add rmb() between reading event validity & event data access.

2011-03-27 Thread Matt Evans
On weakly-ordered systems, the reading of an event's content must occur after reading the event's validity. Signed-off-by: Matt Evans --- Segher, thanks for the comment; explanation added. drivers/usb/host/xhci-ring.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) di

[PATCH 5/5] xhci: Remove recursive call to xhci_handle_event

2011-03-25 Thread Matt Evans
Make the caller loop while there are events to handle, instead. Signed-off-by: Matt Evans --- drivers/usb/host/xhci-ring.c | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index b46efd9..97bedd6

[PATCH 4/5] xhci: Add an assertion to check for virt_dev=0 bug.

2011-03-25 Thread Matt Evans
During a "plug-unplug" stress test on an NEC xHCI card, a null pointer dereference was observed. xhci_address_device() dereferenced a null virt_dev (possibly an erroneous udev->slot_id?); this patch adds a WARN_ON & message to aid debug if it can be recreated. Signed-o

[PATCH 3/5] xhci: Add rmb() between reading event validity & event data access.

2011-03-25 Thread Matt Evans
On weakly-ordered systems, the reading of an event's content must occur after reading the event's validity. Signed-off-by: Matt Evans --- drivers/usb/host/xhci-ring.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb

[PATCH 2/5] xhci: Extend debug messages

2011-03-25 Thread Matt Evans
Add more debug to print queued transfers, show control intentions and modify an existing message to hexify address output. Signed-off-by: Matt Evans --- drivers/usb/host/xhci-dbg.c |2 +- drivers/usb/host/xhci-hub.c |3 +++ drivers/usb/host/xhci-ring.c |5 + 3 files changed, 9

[PATCH 0/5] Make xHCI driver endian-safe, add a barrier, some debug

2011-03-25 Thread Matt Evans
Hi Sarah, This series addresses the endian issues with the xHCI driver, and has brought lovely USB 3 to PPC. :-) I've tested various types of traffic on ppc4xx and POWER7 and (some sound driver bugs notwithstanding) all seems fine. Also addresses an ordering problem we found and the recursive n

[PATCH] powerpc: Initialise paca->kstack before early_setup_secondary

2010-08-12 Thread Matt Evans
f secondaries. Signed-off-by: Matt Evans Cc: stable --- arch/powerpc/kernel/head_64.S |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 844a44b..4d6681d 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/

Re: [PATCH] powerpc/kdump: Stop all other CPUs before running crash handlers

2010-08-03 Thread Matt Evans
; > Signed-off-by: Anton Blanchard Looks like a sensible idea! Acked-by: Matt Evans > --- > > Index: powerpc.git/arch/powerpc/kernel/crash.c > === > --- powerpc.git.orig/arch/powerpc/kernel/crash.c 2010-

[PATCH 2/2] powerpc/kexec: Fix orphaned offline CPUs across kexec

2010-07-29 Thread Matt Evans
ons in the subsequent kernel. Now, the behaviour is that all available CPUs that were offlined are now online & usable after the kexec. This mimics the behaviour of a full reboot (on which all CPUs will be restarted). Signed-off-by: Matt Evans --- arch/powerpc/kernel/machine_kex

[PATCH 1/2] powerpc/kexec: Add to and tidy debug/comments in machine_kexec64.c

2010-07-29 Thread Matt Evans
Tidies some typos, KERN_INFO-ise an info msg, and add a debug msg showing when the final sequence starts. Also adds a comment to kexec_prepare_cpus_wait() to make note of a possible problem; the need for kexec to deal with CPUs that failed to originally start up. Signed-off-by: Matt Evans

[PATCH 0/2] powerpc/kexec: Fix orphaned offline CPUs, add comments/debug

2010-07-29 Thread Matt Evans
Separated tidyup comments & debug away from the fix of restarting offline available CPUs before waiting for them on kexec. Matt Evans (2): powerpc/kexec: Add to and tidy debug/comments in machine_kexec64.c powerpc/kexec: Fix orphaned offline CPUs across kexec arch/powerpc/ke

Re: [PATCH v2] powerpc/kexec: Fix orphaned offline CPUs across kexec

2010-07-29 Thread Matt Evans
Michael Neuling wrote: > In message <4c511216.30...@ozlabs.org> you wrote: >> When CPU hotplug is used, some CPUs may be offline at the time a kexec is >> performed. The subsequent kernel may expect these CPUs to be already running > , >> and will declare them stuck. On pseries, there's also a so

[PATCH v2] powerpc/kexec: Fix orphaned offline CPUs across kexec

2010-07-28 Thread Matt Evans
s the kexeced kernel may ask RTAS if they're online -- and RTAS would say they are. Again, stuck. This patch kicks each present offline CPU awake before the kexec, so that none are lost to these assumptions in the subsequent kernel. Signed-off-by: Matt Evans --- v2: Added FIXME commen

[PATCH] powerpc/kexec: Fix orphaned offline CPUs across kexec

2010-07-27 Thread Matt Evans
s the kexeced kernel may ask RTAS if they're online -- and RTAS would say they are. Again, stuck. This patch kicks each present offline CPU awake before the kexec, so that none are lost to these assumptions in the subsequent kernel. Signed-off-by: Matt Evans --- arch/powerpc/kernel/machine_

[PATCH v2] powerpc/kexec: Switch to a static PACA on the way out

2010-07-08 Thread Matt Evans
With dynamic PACAs, the kexecing CPU's PACA won't lie within the kernel static data and there is a chance that something may stomp it when preparing to kexec. This patch switches this final CPU to a static PACA just before we pull the switch. Signed-off-by: Matt Evans --- v2: Ch

[PATCH] kexec/ppc64: Switch to a static PACA on the way out

2010-07-07 Thread Matt Evans
With dynamic PACAs, the kexecing CPU's PACA won't lie within the kernel static data and there is a chance that something may stomp it when preparing to kexec. This patch switches this final CPU to a static PACA just before we pull the switch. Signed-off-by: Matt Evans --- arch/powe

[PATCH] perf_event: Fix for power_pmu_disable()

2010-07-05 Thread Matt Evans
heavy test: perf record -e L1-dcache-load-misses -e L1-dcache-store-misses ./misstest Signed-off-by: Matt Evans --- arch/powerpc/kernel/perf_event.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c ind

Re: [PATCH 18/26] KVM: PPC: KVM PV guest stubs

2010-06-27 Thread Matt Evans
Howdy Alex! Alexander Graf wrote: > We will soon start and replace instructions from the text section with > other, paravirtualized versions. To ease the readability of those patches > I split out the generic looping and magic page mapping code out. > > This patch still only contains stubs. But a

[PATCH] kexec, ppc64: Wait for online/possible CPUs only.

2010-06-08 Thread Matt Evans
ult. This patch iterates for_each_online_cpu so stays within the bounds of paca[] -- and every CPU is now 'possible'. Signed-off-by: Matt Evans --- arch/powerpc/kernel/machine_kexec_64.c | 18 +- 1 files changed, 1 insertions(+), 17 deletions(-) diff --git a

Re: [PATCH] powerpc: Emulate most Book I instructions in emulate_step()

2010-06-02 Thread Matt Evans
Paul Mackerras wrote: > [snip] > The second alternative -- emulating the lwarx/stwcx and all the > instructions in between -- sounds complicated but turns out to be > pretty straightforward in fact, since the code for each instruction is > pretty small, easy to verify that it's correct, and has lit

[PATCH v2] kexec-tools, ppc64: Fix segfault parsing DR memory property

2010-05-13 Thread Matt Evans
fixed-sized arrays from add_dyn_reconf_usable_mem_property() and add_usable_mem_property(), in lieu of malloc/realloc/free. Signed-off-by: Matt Evans --- kexec/arch/ppc64/fs2dt.c | 82 +++--- 1 files changed, 70 insertions(+), 12 deletions(-) diff --git a

[PATCH] kexec-tools, ppc64: Fix segfault parsing DR memory property

2010-05-11 Thread Matt Evans
ff-by: Matt Evans --- kexec/arch/ppc64/fs2dt.c | 66 + 1 files changed, 54 insertions(+), 12 deletions(-) diff --git a/kexec/arch/ppc64/fs2dt.c b/kexec/arch/ppc64/fs2dt.c index 762bf04..7470132 100644 --- a/kexec/arch/ppc64/fs2dt.c +++ b/kexec/arch/