From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: sstabellini@kernel.org, ross.lagerwall@citrix.com,
Andrew Cooper <andrew.cooper3@citrix.com>,
julien.grall@arm.com, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v1 6/9] livepatch: Initial ARM64 support.
Date: Mon, 15 Aug 2016 10:09:34 -0400 [thread overview]
Message-ID: <20160815140934.GE26970@char.us.oracle.com> (raw)
In-Reply-To: <57B197BC0200007800105CCA@prv-mh.provo.novell.com>
On Mon, Aug 15, 2016 at 02:21:48AM -0600, Jan Beulich wrote:
> >>> On 15.08.16 at 01:07, <konrad.wilk@oracle.com> 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 (X86 || ARM_64) && HAS_BUILD_ID = "y"
>
> Would this better become a black list?
OK, that would make it easier.
>
> > @@ -711,9 +711,15 @@ static int prepare_payload(struct payload *payload,
> > return -EINVAL;
> > }
> > }
> > +#ifndef CONFIG_ARM
> > apply_alternatives_nocheck(start, end);
> > +#else
> > + apply_alternatives(start, sec->sec->sh_size);
> > +#endif
>
> Conditionals like this are ugly - can't this be properly abstracted?
Yes, I can introduce an apply_alternatives_nocheck on ARM that will
hava the same set of arguments on x86.
Or I can make a new function name?
>
> > --- a/xen/include/xen/elfstructs.h
> > +++ b/xen/include/xen/elfstructs.h
> > @@ -103,6 +103,15 @@ typedef uint64_t Elf64_Xword;
> > (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
> > (ehdr).e_ident[EI_MAG3] == ELFMAG3)
> >
> > +/* e_flags */
> > +#define EF_ARM_EABI_MASK 0xff000000
> > +#define EF_ARM_EABI_UNKNOWN 0x00000000
> > +#define EF_ARM_EABI_VER1 0x01000000
> > +#define EF_ARM_EABI_VER2 0x02000000
> > +#define EF_ARM_EABI_VER3 0x03000000
> > +#define EF_ARM_EABI_VER4 0x04000000
> > +#define EF_ARM_EABI_VER5 0x05000000
>
> Aren't these ARM32 definitions, which should be unneeded for
> ARM64 support?
Correct. Let me move that and also the arch/arm/arm32/livepatch:arch_livepatch_verify_elf
code out of this patch.
>
> > @@ -171,6 +180,7 @@ typedef struct {
> > #define EM_PPC 20 /* PowerPC */
> > #define EM_PPC64 21 /* PowerPC 64-bit */
> > #define EM_ARM 40 /* Advanced RISC Machines ARM */
> > +#define EM_AARCH64 183 /* ARM 64-bit */
> > #define EM_ALPHA 41 /* DEC ALPHA */
> > #define EM_SPARCV9 43 /* SPARC version 9 */
> > #define EM_ALPHA_EXP 0x9026 /* DEC ALPHA */
>
> I think this tries to be sorted by number.
>
> > +/*
> > + * S - address of symbol.
> > + * A - addend for relocation (r_addend)
> > + * P - address of the dest being relocated (derieved from r_offset)
> > + * NC - No check for overflow.
> > + *
> > + * The defines also use _PREL for PC-relative address, and _NC is No Check.
> > + */
> > +#define R_AARCH64_ABS64 257 /* Direct 64 bit. S+A, NC*/
> > +#define R_AARCH64_ABS32 258 /* Direct 32 bit. S+A */
> > +#define R_AARCH64_PREL64 260 /* S+A-P, NC */
> > +#define R_AARCH64_PREL32 261 /* S+A-P */
> > +
> > +#define R_AARCH64_ADR_PREL_LO21 274 /* ADR imm, [20:0]. S+A-P */
> > +#define R_AARCH64_ADR_PREL_PG_HI21 275 /* ADRP imm, [32:12]. Page(S+A) - Page(P).*/
> > +#define R_AARCH64_ADD_ABS_LO12_NC 277 /* ADD imm. [11:0]. S+A, NC */
> > +
> > +#define R_AARCH64_CONDBR19 280 /* Bits 20:2, S+A-P */
> > +#define R_AARCH64_JUMP26 282 /* Bits 27:2, S+A-P */
> > +#define R_AARCH64_CALL26 283 /* Bits 27:2, S+A-P */
>
> No R_AARCH64_TSTBR14?
>
> > +#define R_AARCH64_LDST16_ABS_LO12_NC 284 /* LD/ST to bits 11:1, S+A, NC */
> > +#define R_AARCH64_LDST32_ABS_LO12_NC 285 /* LD/ST to bits 11:2, S+A, NC */
> > +#define R_AARCH64_LDST64_ABS_LO12_NC 286 /* LD/ST to bits 11:3, S+A, NC */
> > +#define R_AARCH64_LDST8_ABS_LO12_NC 278 /* LD/ST to bits 11:0, S+A, NC */
>
> What about R_AARCH64_LDST128_ABS_LO12_NC?
I didnt' see it in the ELF of xen-syms or the livepatch tests cases so I omitted them.
But then I added some that weren't in the ELF files either: LDST16 and LDST8.
I will add the two missing ones and also sort this.
Thanks!
>
> Jan
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-15 14:09 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-14 23:07 [PATCH v1] Livepatch ARM 64 implementation Konrad Rzeszutek Wilk
2016-08-14 23:07 ` [PATCH v1 1/9] livepatch: Bubble up sanity checks on Elf relocs Konrad Rzeszutek Wilk
2016-08-17 11:56 ` Jan Beulich
2016-08-14 23:07 ` [PATCH v1 2/9] x86/arm: Make 'make debug' work properly Konrad Rzeszutek Wilk
2016-08-17 12:00 ` Jan Beulich
2016-08-22 17:05 ` Konrad Rzeszutek Wilk
2016-08-14 23:07 ` [PATCH v1 3/9] x86/arm64: Move the ALT_[ORIG|REPL]_PTR macros to header files Konrad Rzeszutek Wilk
2016-08-17 12:15 ` Jan Beulich
2016-08-17 16:26 ` Julien Grall
2016-08-14 23:07 ` [PATCH v1 4/9] arm/mm: Introduce modify_xen_mappings Konrad Rzeszutek Wilk
2016-08-17 16:54 ` Julien Grall
2016-08-14 23:07 ` [PATCH v1 5/9] arm64/insn: introduce aarch64_insn_gen_{nop|branch_imm}() helper functions Konrad Rzeszutek Wilk
2016-08-14 23:07 ` [PATCH v1 6/9] livepatch: Initial ARM64 support Konrad Rzeszutek Wilk
2016-08-15 8:21 ` Jan Beulich
2016-08-15 14:09 ` Konrad Rzeszutek Wilk [this message]
2016-08-15 14:23 ` Jan Beulich
2016-08-15 14:57 ` Julien Grall
2016-08-15 15:17 ` Konrad Rzeszutek Wilk
2016-08-15 15:25 ` Julien Grall
2016-08-15 15:27 ` Andrew Cooper
2016-08-17 2:45 ` Konrad Rzeszutek Wilk
2016-08-17 9:02 ` Andrew Cooper
2016-08-15 15:17 ` Julien Grall
2016-08-17 1:50 ` Konrad Rzeszutek Wilk
2016-08-17 19:44 ` Julien Grall
2016-08-17 17:12 ` Julien Grall
2016-08-17 18:22 ` Julien Grall
2016-08-17 18:57 ` Konrad Rzeszutek Wilk
2016-08-17 19:50 ` Julien Grall
2016-08-22 19:22 ` Konrad Rzeszutek Wilk
2016-08-24 2:14 ` Konrad Rzeszutek Wilk
2016-08-25 13:54 ` Julien Grall
2016-08-14 23:07 ` [PATCH v1 7/9] livepatch: ARM64: Ignore mapping symbols: $[a, d, x, p] Konrad Rzeszutek Wilk
2016-08-17 12:21 ` Jan Beulich
2016-08-22 17:14 ` Konrad Rzeszutek Wilk
2016-08-14 23:07 ` [PATCH v1 8/9] livepatch: Move test-cases to common Konrad Rzeszutek Wilk
2016-08-17 12:24 ` Jan Beulich
2016-08-14 23:07 ` [PATCH v1 9/9] livepatch: tests: Make them compile under ARM64 Konrad Rzeszutek Wilk
2016-08-17 18:29 ` Julien Grall
2016-08-17 19:00 ` Konrad Rzeszutek Wilk
2016-08-17 19:57 ` Julien Grall
2016-08-17 20:08 ` Andrew Cooper
2016-08-18 10:38 ` Jan Beulich
2016-08-22 17:41 ` Konrad Rzeszutek Wilk
2016-08-22 19:59 ` Konrad Rzeszutek Wilk
2016-08-15 14:52 ` [PATCH v1] Livepatch ARM 64 implementation Julien Grall
2016-08-15 15:49 ` Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160815140934.GE26970@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=julien.grall@arm.com \
--cc=ross.lagerwall@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).