From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Date: Fri, 18 Mar 2016 09:42:57 +0000 Subject: Re: [kvm-unit-tests PATCH 1/5] powerpc: add exception handler Message-Id: <56EBCDA1.6070309@redhat.com> List-Id: References: <1458141183-27207-1-git-send-email-lvivier@redhat.com> <1458141183-27207-2-git-send-email-lvivier@redhat.com> In-Reply-To: <1458141183-27207-2-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Laurent Vivier , kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: drjones@redhat.com, dgibson@redhat.com, pbonzini@redhat.com On 16.03.2016 16:12, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier > --- > lib/powerpc/asm/hcall.h | 1 + > lib/powerpc/asm/ppc_asm.h | 5 ++ > lib/powerpc/asm/processor.h | 11 ++++ > lib/powerpc/processor.c | 38 +++++++++++++ > lib/powerpc/setup.c | 19 +++++++ > lib/ppc64/asm-offsets.c | 42 ++++++++++++++ > lib/ppc64/asm/processor.h | 1 + > lib/ppc64/asm/ptrace.h | 24 ++++++++ > powerpc/Makefile.common | 1 + > powerpc/cstart64.S | 136 ++++++++++++++++++++++++++++++++++++++++++++ > 10 files changed, 278 insertions(+) > create mode 100644 lib/powerpc/asm/processor.h > create mode 100644 lib/powerpc/processor.c > create mode 100644 lib/ppc64/asm/processor.h > create mode 100644 lib/ppc64/asm/ptrace.h ... > diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c > index 0c0c882..afe7fbc 100644 > --- a/lib/powerpc/setup.c > +++ b/lib/powerpc/setup.c > @@ -16,6 +16,8 @@ > #include > #include > #include > +#include > +#include > > extern unsigned long stacktop; > extern void io_init(void); > @@ -33,6 +35,10 @@ struct cpu_set_params { > unsigned dcache_bytes; > }; > > +#define EXCEPTION_STACK_SIZE (32*1024) /* 32kB */ > + > +static char exception_stack[NR_CPUS][EXCEPTION_STACK_SIZE]; > + > static void cpu_set(int fdtnode, u32 regval, void *info) > { > static bool read_common_info = false; > @@ -46,6 +52,11 @@ static void cpu_set(int fdtnode, u32 regval, void *info) > } > cpus[cpu] = regval; > > + /* set exception stack address for this CPU (in SPGR0) */ > + > + asm volatile ("mtsprg0 %[addr]" :: > + [addr] "r" (exception_stack + cpu + 1)); Maybe use "exception_stack[cpu + 1]" instead? That's easier to read. Thomas From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Subject: Re: [kvm-unit-tests PATCH 1/5] powerpc: add exception handler Date: Fri, 18 Mar 2016 10:42:57 +0100 Message-ID: <56EBCDA1.6070309@redhat.com> References: <1458141183-27207-1-git-send-email-lvivier@redhat.com> <1458141183-27207-2-git-send-email-lvivier@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: drjones@redhat.com, dgibson@redhat.com, pbonzini@redhat.com To: Laurent Vivier , kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46007 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754729AbcCRJnA (ORCPT ); Fri, 18 Mar 2016 05:43:00 -0400 In-Reply-To: <1458141183-27207-2-git-send-email-lvivier@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 16.03.2016 16:12, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier > --- > lib/powerpc/asm/hcall.h | 1 + > lib/powerpc/asm/ppc_asm.h | 5 ++ > lib/powerpc/asm/processor.h | 11 ++++ > lib/powerpc/processor.c | 38 +++++++++++++ > lib/powerpc/setup.c | 19 +++++++ > lib/ppc64/asm-offsets.c | 42 ++++++++++++++ > lib/ppc64/asm/processor.h | 1 + > lib/ppc64/asm/ptrace.h | 24 ++++++++ > powerpc/Makefile.common | 1 + > powerpc/cstart64.S | 136 ++++++++++++++++++++++++++++++++++++++++++++ > 10 files changed, 278 insertions(+) > create mode 100644 lib/powerpc/asm/processor.h > create mode 100644 lib/powerpc/processor.c > create mode 100644 lib/ppc64/asm/processor.h > create mode 100644 lib/ppc64/asm/ptrace.h ... > diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c > index 0c0c882..afe7fbc 100644 > --- a/lib/powerpc/setup.c > +++ b/lib/powerpc/setup.c > @@ -16,6 +16,8 @@ > #include > #include > #include > +#include > +#include > > extern unsigned long stacktop; > extern void io_init(void); > @@ -33,6 +35,10 @@ struct cpu_set_params { > unsigned dcache_bytes; > }; > > +#define EXCEPTION_STACK_SIZE (32*1024) /* 32kB */ > + > +static char exception_stack[NR_CPUS][EXCEPTION_STACK_SIZE]; > + > static void cpu_set(int fdtnode, u32 regval, void *info) > { > static bool read_common_info = false; > @@ -46,6 +52,11 @@ static void cpu_set(int fdtnode, u32 regval, void *info) > } > cpus[cpu] = regval; > > + /* set exception stack address for this CPU (in SPGR0) */ > + > + asm volatile ("mtsprg0 %[addr]" :: > + [addr] "r" (exception_stack + cpu + 1)); Maybe use "exception_stack[cpu + 1]" instead? That's easier to read. Thomas