On 16.03.2016 16:12, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier <lvivier@xxxxxxxxxx> > --- > 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 <alloc.h> > #include <asm/setup.h> > #include <asm/page.h> > +#include <asm/ppc_asm.h> > +#include <asm/hcall.h> > > 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 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html