From: "Jan Beulich" <JBeulich@suse.com>
To: Martin Pohlack <mpohlack@amazon.de>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: elena.ufimtseva@oracle.com, hanweidong@huawei.com,
john.liuqiming@huawei.com, paul.voccio@rackspace.com,
daniel.kiper@oracle.com, major.hayden@rackspace.com,
liuyingdong@huawei.com, aliguori@amazon.com,
xiantao.zxt@alibaba-inc.com, lars.kurth@citrix.com,
steven.wilson@rackspace.com, ian.campbell@citrix.com,
peter.huangpeng@huawei.com, msw@amazon.com,
xen-devel@lists.xenproject.org, rick.harris@rackspace.com,
boris.ostrovsky@oracle.com, josh.kearney@rackspace.com,
jinsong.liu@alibaba-inc.com, amesserl@rackspace.com,
mpohlack@amazon.com, fanhenglong@huawei.com,
andrew.cooper3@citrix.com
Subject: Re: [PATCH v1 5/5] xsplice: Use ld-embedded build-ids
Date: Fri, 02 Oct 2015 09:13:39 -0600 [thread overview]
Message-ID: <560EBB4302000078000A7B3E@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1442437276-2620-6-git-send-email-konrad.wilk@oracle.com>
>>> On 16.09.15 at 23:01, <konrad.wilk@oracle.com> wrote:
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -108,11 +108,11 @@ $(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o
> $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
> $(NM) -n $(@D)/.$(@F).0 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).0.S
> $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o
> - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
> + $(LD) $(LDFLAGS) -T xen.lds -N prelink.o --build-id=sha1 \
> $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
> $(NM) -n $(@D)/.$(@F).1 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).1.S
> $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o
> - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
> + $(LD) $(LDFLAGS) -T xen.lds -N prelink.o --build-id=sha1 \
> $(@D)/.$(@F).1.o -o $@
> rm -f $(@D)/.$(@F).[0-9]*
Which raises the question: What about xen.efi?
> @@ -44,6 +46,36 @@ struct payload {
> struct tasklet tasklet;
> };
>
> +#ifdef CONFIG_ARM
> +static int build_id(char **p, unsigned int *len)
> +{
> + return 0;
> +}
> +#else
Any reason not to make the build logic common, in order to avoid such
#ifdef-ery?
> +extern char * __note_gnu_build_id_start; /* defined in linker script */
const, and I think you mean the type to be Elf_Note[].
> @@ -68,9 +100,31 @@ static const char *status2str(int64_t status)
> return names[status];
> }
>
> +#define LEN 128
Because of?
> void xsplice_printall(unsigned char key)
> {
> struct payload *data;
> + char *binary_id = NULL;
> + unsigned int len = 0;
> + int rc;
> +
> + rc = build_id(&binary_id, &len);
> + printk("build-id: ");
> + if ( !rc )
> + {
> + unsigned int i;
> +
> + if ( len > LEN )
> + len = LEN;
> +
> + for ( i = 0; i < len; i++ )
> + {
> + uint8_t c = binary_id[i];
> + printk("%02x", c);
Hard tabs.
> + }
> + printk("\n");
> + } else if ( rc < 0 )
Coding style.
> @@ -415,6 +470,34 @@ static int xsplice_action(xen_sysctl_xsplice_action_t *action)
> return rc;
> }
>
> +static int xsplice_info(xen_sysctl_xsplice_info_t *info)
> +{
> + int rc;
> + unsigned int len = 0;
> + char *p = NULL;
> +
> + if ( info->cmd != XEN_SYSCTL_XSPLICE_INFO_BUILD_ID )
> + return -EINVAL;
> +
> + if ( info->size == 0 )
> + return -EINVAL;
> +
> + if ( !guest_handle_okay(info->u.info, info->size) )
> + return -EFAULT;
> +
> + rc = build_id(&p, &len);
> + if ( rc )
> + return rc;
> +
> + if ( len > info->size )
> + return -ENOMEM;
> +
> + if ( copy_to_guest(info->u.info, p, len) )
> + return -EFAULT;
So how does the caller know how much data got copied?
Jan
next prev parent reply other threads:[~2015-10-02 15:13 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 21:01 [PATCH v1] xSplice initial foundation patches Konrad Rzeszutek Wilk
2015-09-16 21:01 ` [PATCH v1 1/5] xsplice: Design document Konrad Rzeszutek Wilk
2015-10-05 10:02 ` Jan Beulich
2015-10-05 10:28 ` Ross Lagerwall
2015-10-12 11:44 ` xsplice-build prototype (was [PATCH v1 1/5] xsplice: Design document.) Ross Lagerwall
2015-10-12 13:06 ` Konrad Rzeszutek Wilk
2015-10-12 14:20 ` Konrad Rzeszutek Wilk
2015-10-06 12:57 ` [PATCH v1 1/5] xsplice: Design document Ross Lagerwall
2015-10-27 8:08 ` Martin Pohlack
2015-10-27 8:45 ` Ross Lagerwall
2015-10-06 15:26 ` Jan Beulich
2015-10-26 12:01 ` Martin Pohlack
2015-10-26 12:10 ` Jan Beulich
2015-10-26 13:21 ` Ross Lagerwall
2015-10-26 13:55 ` Konrad Rzeszutek Wilk
2015-09-16 21:01 ` [PATCH v1 2/5] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op Konrad Rzeszutek Wilk
2015-10-02 15:06 ` Jan Beulich
2015-09-16 21:01 ` [PATCH v1 3/5] libxc: Implementation of XEN_XSPLICE_op in libxc Konrad Rzeszutek Wilk
2015-09-16 21:01 ` [PATCH v1 4/5] xen-xsplice: Tool to manipulate xsplice payloads Konrad Rzeszutek Wilk
2015-09-16 21:01 ` [PATCH v1 5/5] xsplice: Use ld-embedded build-ids Konrad Rzeszutek Wilk
2015-09-16 21:41 ` Andrew Cooper
2015-09-16 21:59 ` Konrad Rzeszutek Wilk
2015-09-16 22:31 ` Andrew Cooper
2015-09-17 6:41 ` Martin Pohlack
2015-09-17 9:35 ` Andrew Cooper
2015-09-17 18:45 ` Is: Make XENVER_* use XSM, seperate the different ops in smaller security domains. Was:Re: " Konrad Rzeszutek Wilk
2015-09-18 11:40 ` Andrew Cooper
2015-09-22 13:22 ` Konrad Rzeszutek Wilk
2015-09-22 13:33 ` Andrew Cooper
2015-09-22 13:45 ` Konrad Rzeszutek Wilk
2015-09-22 16:28 ` Daniel De Graaf
2015-09-22 16:28 ` Daniel De Graaf
2015-09-25 20:18 ` Konrad Rzeszutek Wilk
2015-10-02 15:13 ` Jan Beulich [this message]
2015-10-02 14:48 ` [PATCH v1] xSplice initial foundation patches Konrad Rzeszutek Wilk
2015-10-09 12:46 ` 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=560EBB4302000078000A7B3E@prv-mh.provo.novell.com \
--to=jbeulich@suse.com \
--cc=aliguori@amazon.com \
--cc=amesserl@rackspace.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=daniel.kiper@oracle.com \
--cc=elena.ufimtseva@oracle.com \
--cc=fanhenglong@huawei.com \
--cc=hanweidong@huawei.com \
--cc=ian.campbell@citrix.com \
--cc=jinsong.liu@alibaba-inc.com \
--cc=john.liuqiming@huawei.com \
--cc=josh.kearney@rackspace.com \
--cc=konrad.wilk@oracle.com \
--cc=lars.kurth@citrix.com \
--cc=liuyingdong@huawei.com \
--cc=major.hayden@rackspace.com \
--cc=mpohlack@amazon.com \
--cc=mpohlack@amazon.de \
--cc=msw@amazon.com \
--cc=paul.voccio@rackspace.com \
--cc=peter.huangpeng@huawei.com \
--cc=rick.harris@rackspace.com \
--cc=steven.wilson@rackspace.com \
--cc=xen-devel@lists.xenproject.org \
--cc=xiantao.zxt@alibaba-inc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.