All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Dongli Zhang <dongli.zhang@oracle.com>
Cc: ross.lagerwall@citrix.com, xen-devel@lists.xenproject.org
Subject: Re: RFC: how to differentiate livepatched symbol and original symbol in Xen hypervisor
Date: Mon, 06 Jun 2016 08:13:45 -0600	[thread overview]
Message-ID: <5755A13902000078000F2126@prv-mh.provo.novell.com> (raw)
In-Reply-To: <a182c48e-ab57-4ee7-a066-d42d0374ec28@default>

>>> On 06.06.16 at 15:32, <dongli.zhang@oracle.com> wrote:
> Hi,
> 
> About the livepatch TODO: "Make XENPF_get_symbol also include Live Patch
> symbols" mentioned at http://wiki.xenproject.org/wiki/XSplice, I am 
> wondering
> how the patched function would be dumped.
> 
> For instance, if function "gnttab_usage_print_all" is livepatched, it  would
> show as symbol in both Xen hypervisor and applied livepatch. How are we 
> going
> to differentiate the old and new symbols referring to the same symbol name 
> but
> different address? One address is the original and another is the on pointed 
> by
> instruction "e9 xxxxxxxx".
> 
> Here is a sample on my test machine. The following is my own customized xen
> debug message in "xl debug-keys x". I am patching my own function 
> "my_old_func"
> in Xen hypervisor.
> 
> (XEN) name=my_global_domain, value=0xffff82d080409054, size=28, new=1
> (XEN) name=my_old_func, value=0xffff82d080409070, size=89, new=0
> (XEN) name=mg_data, value=0xffff82d08040a000, size=4, new=1
> 
> The following is the current result of XENPF_get_symbol on Dom0:
> 
> root@vm:/soft/img# cat /proc/xen/xensyms | grep my_old_func
> ffff82d0802465a4 T my_old_func
> ffff82d0802465a4 t .text.my_old_func
> 
> In this example, I livepatched "my_old_func" and thus we have two symbols
> referring the same name but different addresses now (ffff82d0802465a4 and
> ffff82d080409070).
> 
> Are we going to use new nm symbol flag , append extra string in symbol name
> (e.g., my_old_func#livepatch) or this even does not matter?

While the output is clearly wrong, the problem isn't distinguishing
the symbols - that's simple: Everything outside of [_start,_end)
is in a livepatch. (One issue here would be multiple replacement of
the same symbol.) The main problem I see here is that
xensyms_read() doesn't even enumerate the new symbols.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

      parent reply	other threads:[~2016-06-06 14:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 13:32 RFC: how to differentiate livepatched symbol and original symbol in Xen hypervisor Dongli Zhang
2016-06-06 14:13 ` Konrad Rzeszutek Wilk
2016-06-06 14:13 ` Jan Beulich [this message]

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=5755A13902000078000F2126@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=dongli.zhang@oracle.com \
    --cc=ross.lagerwall@citrix.com \
    --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 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.