Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-22 Thread Konrad Rzeszutek Wilk
> > > -/* On ARM32,64 instructions are always 4 bytes long. */ > > > -#define PATCH_INSN_SIZE 4 > > > > Rather than moving again PATCH_INSN_SIZE in this patch. Can you directly > > move it in patch [1]? > > Sure. The patch [1] changed where it does not have anymore. And because of that (and

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-17 Thread Julien Grall
Hi Konrad, On 17/08/2016 19:57, Konrad Rzeszutek Wilk wrote: +void arch_livepatch_apply_jmp(struct livepatch_func *func) +{ +uint32_t insn; +uint32_t *old_ptr; +uint32_t *new_ptr; + +BUILD_BUG_ON(PATCH_INSN_SIZE > sizeof(func->opaque)); +BUILD_BUG_ON(PATCH_INSN_SIZE !=

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-17 Thread Julien Grall
On 17/08/2016 02:50, Konrad Rzeszutek Wilk wrote: +int arch_livepatch_perform_rela(struct livepatch_elf *elf, +const struct livepatch_elf_sec *base, +const struct livepatch_elf_sec *rela) +{ .. snip.. +switch (

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-17 Thread Konrad Rzeszutek Wilk
> > +void arch_livepatch_apply_jmp(struct livepatch_func *func) > > +{ > > +uint32_t insn; > > +uint32_t *old_ptr; > > +uint32_t *new_ptr; > > + > > +BUILD_BUG_ON(PATCH_INSN_SIZE > sizeof(func->opaque)); > > +BUILD_BUG_ON(PATCH_INSN_SIZE != sizeof(insn)); > > + > > +

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-17 Thread Julien Grall
Hi Konrad, On 15/08/16 00:07, Konrad Rzeszutek Wilk wrote: [...] diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c new file mode 100644 index 000..e348942 --- /dev/null +++ b/xen/arch/arm/arm64/livepatch.c @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2016 Oracle

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-17 Thread Julien Grall
Hi Konrad, On 15/08/16 16:17, Julien Grall wrote: On 15/08/2016 01:07, Konrad Rzeszutek Wilk wrote: +case R_AARCH64_ADR_PREL_PG_HI21: +val = (val & ~0xfff) - ((u64)dest & ~0xfff); +err = reloc_insn_imm(dest, val, 12, 21, AARCH64_INSN_IMM_ADR); +

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-17 Thread Andrew Cooper
>> The only reason apply_alternatives() is named thusly is to match Linux. >> I am not fussed if it changes. > Would this be OK with folks? > > There is a bit of disreprancy - ARM has 'const struct alt_instr *' > where the 'const' gets dropped later on. That can't be done x86 > as

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-16 Thread Konrad Rzeszutek Wilk
On Mon, Aug 15, 2016 at 04:27:12PM +0100, Andrew Cooper wrote: > On 15/08/16 16:25, Julien Grall wrote: > > > > > > On 15/08/2016 17:17, Konrad Rzeszutek Wilk wrote: > >> On Mon, Aug 15, 2016 at 04:57:26PM +0200, Julien Grall wrote: > >>> Hi Jan and Konrad, > >>> > >>> On 15/08/2016 16:23, Jan

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-16 Thread Konrad Rzeszutek Wilk
> > +int arch_livepatch_perform_rela(struct livepatch_elf *elf, > > +const struct livepatch_elf_sec *base, > > +const struct livepatch_elf_sec *rela) > > +{ .. snip.. > > +switch ( ELF64_R_TYPE(r->r_info) ) { > > +/*

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-15 Thread Andrew Cooper
On 15/08/16 16:25, Julien Grall wrote: > > > On 15/08/2016 17:17, Konrad Rzeszutek Wilk wrote: >> On Mon, Aug 15, 2016 at 04:57:26PM +0200, Julien Grall wrote: >>> Hi Jan and Konrad, >>> >>> On 15/08/2016 16:23, Jan Beulich wrote: >>> On 15.08.16 at 16:09, wrote: >

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-15 Thread Julien Grall
On 15/08/2016 17:17, Konrad Rzeszutek Wilk wrote: On Mon, Aug 15, 2016 at 04:57:26PM +0200, Julien Grall wrote: Hi Jan and Konrad, On 15/08/2016 16:23, Jan Beulich wrote: On 15.08.16 at 16:09, wrote: On Mon, Aug 15, 2016 at 02:21:48AM -0600, Jan Beulich wrote: On

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-15 Thread Julien Grall
Hi Konrad, On 15/08/2016 01:07, Konrad Rzeszutek Wilk wrote: [...] diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile index b20db64..5966de0 100644 --- a/xen/arch/arm/arm32/Makefile +++ b/xen/arch/arm/arm32/Makefile @@ -4,8 +4,8 @@ obj-$(EARLY_PRINTK) += debug.o obj-y +=

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-15 Thread Konrad Rzeszutek Wilk
On Mon, Aug 15, 2016 at 04:57:26PM +0200, Julien Grall wrote: > Hi Jan and Konrad, > > On 15/08/2016 16:23, Jan Beulich wrote: > > > > > On 15.08.16 at 16:09, wrote: > > > On Mon, Aug 15, 2016 at 02:21:48AM -0600, Jan Beulich wrote: > > > > > > > On 15.08.16 at 01:07,

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-15 Thread Julien Grall
Hi Jan and Konrad, On 15/08/2016 16:23, Jan Beulich wrote: On 15.08.16 at 16:09, wrote: On Mon, Aug 15, 2016 at 02:21:48AM -0600, Jan Beulich wrote: On 15.08.16 at 01:07, wrote: @@ -711,9 +711,15 @@ static int prepare_payload(struct payload

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-15 Thread Jan Beulich
>>> On 15.08.16 at 16:09, wrote: > On Mon, Aug 15, 2016 at 02:21:48AM -0600, Jan Beulich wrote: >> >>> On 15.08.16 at 01:07, wrote: >> > @@ -711,9 +711,15 @@ static int prepare_payload(struct payload *payload, >> > return -EINVAL;

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-15 Thread Konrad Rzeszutek Wilk
On Mon, Aug 15, 2016 at 02:21:48AM -0600, Jan Beulich wrote: > >>> On 15.08.16 at 01:07, wrote: > > --- a/xen/common/Kconfig > > +++ b/xen/common/Kconfig > > @@ -222,7 +222,7 @@ endmenu > > config LIVEPATCH > > bool "Live patching support (TECH PREVIEW)" > >

Re: [Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-15 Thread Jan Beulich
>>> On 15.08.16 at 01:07, wrote: > --- a/xen/common/Kconfig > +++ b/xen/common/Kconfig > @@ -222,7 +222,7 @@ endmenu > config LIVEPATCH > bool "Live patching support (TECH PREVIEW)" > default n > - depends on X86 && HAS_BUILD_ID = "y" > + depends on

[Xen-devel] [PATCH v1 6/9] livepatch: Initial ARM64 support.

2016-08-14 Thread Konrad Rzeszutek Wilk
As compared to x86 the va of the hypervisor .text is locked down - we cannot modify the running pagetables to have the .ro flag unset. We borrow the same idea that alternative patching has - which is to vmap the entire .text region and use the alternative virtual address for patching. Since we