Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-07 Thread Konrad Rzeszutek Wilk
On Wed, Sep 07, 2016 at 11:43:27AM +0100, Julien Grall wrote: > > > On 07/09/2016 04:33, Konrad Rzeszutek Wilk wrote: > > > ...snip.. > > > > > +case R_AARCH64_ABS32: > > > > > +ovf = reloc_data(RELOC_OP_ABS, dest, val, 32); > > > > > +break; > > > > > > > > I hav

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-07 Thread Julien Grall
On 07/09/2016 04:33, Konrad Rzeszutek Wilk wrote: ...snip.. +case R_AARCH64_ABS32: +ovf = reloc_data(RELOC_OP_ABS, dest, val, 32); +break; I have noticed that not all the relocations are implemented (e.g R_AARCH64_ABS16, R_AARCH64_MOVW_*...). I don't think the

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-07 Thread Julien Grall
Hi Konrad, On 07/09/2016 01:31, 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 != sizeof

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-06 Thread Konrad Rzeszutek Wilk
> ...snip.. > > > +case R_AARCH64_ABS32: > > > +ovf = reloc_data(RELOC_OP_ABS, dest, val, 32); > > > +break; > > > > I have noticed that not all the relocations are implemented (e.g > > R_AARCH64_ABS16, R_AARCH64_MOVW_*...). I don't think there is anything > > preve

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-06 Thread Konrad Rzeszutek Wilk
On Thu, Aug 25, 2016 at 09:02:48AM -0600, Jan Beulich wrote: > >>> On 25.08.16 at 15:37, wrote: > > --- a/xen/include/xen/types.h > > +++ b/xen/include/xen/types.h > > @@ -14,6 +14,12 @@ > > #define NULL ((void*)0) > > #endif > > > > +#define U16_MAX ((u16)~0U) > > +#define S16_MAX

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-06 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)); > > + > > +ASSERT(v

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-01 Thread Julien Grall
Hi Konrad, On 25/08/16 14:37, Konrad Rzeszutek Wilk wrote: 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 u

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-08-25 Thread Jan Beulich
>>> On 25.08.16 at 15:37, wrote: > --- a/xen/include/xen/types.h > +++ b/xen/include/xen/types.h > @@ -14,6 +14,12 @@ > #define NULL ((void*)0) > #endif > > +#define U16_MAX ((u16)~0U) > +#define S16_MAX ((s16)(U16_MAX>>1)) > +#define S16_MIN ((s16)(-S16_MAX - 1)) > +#d

[Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-08-25 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 are