[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] livepatch: correctly handle altinstruction sections


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 11 Mar 2022 09:12:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Hqj1Ct1vF/IdmNBlplv5XpzFFposBQj93hAh9uGH5E0=; b=enFpNX9J+YhiTcjxCjiHZ+r8OYjo8zOUS5pPq4vk7JSiHLmU4Q/8iznj4IwZID3BzUSD+ql0t+wObnbN0uLMtNL3xMp3mWSRaD21Z7vXX6i0EcraXi5pZ1kNP41hFQ0QsSnFF+3EUje6XNZF0CrSFMftuzC2wLkk8Mox2eLnmY7BkZr2DDex8B5KscKnuz6KXt+K7r2VoFnPvV6+2+culbqIcfLNYs5O9CG/wzDHQ8D3gCkPRUQ0gJThD/fOpzZTgiIKUepySQ+hI0Y/1xBEvBW52b0sTcSG/ALYl2s0jIXdqhWARDBo6Ytnwx5eiXWltBw59WApKG0dod1xynkQqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iFaPO0e8UAUmOC8VrA4+2l1gpDEoBybsMpi1WPm2eWRH34TOdmT1xBdDQmTtONNsEKsX8h+/3a372cO4exqGEnVZbU//tafbeqS1SPCWDd1o2XvDSH1Nh/OV6B1u+85hN3STtSbJnk/ls0YLN+IMtUD56UNr5dGdg7yqkoQsLYpgSziWHl0cMsIC1mWX34tlFqKS2ZEdzH3/gHIhoYqz4qThEQR8bVj2caeQnueO9DOU1O1fu8Tqj7sjqvZTv6XyddROXYwP88QzkSICAO0PNNpoTAqBbxNMllp5Fqm+Y/hBLfvx1sKgW5yoZJ5qFtCDlb/PsShhn5pwWfAEZOsn6Q==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, <doebel@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 11 Mar 2022 08:12:43 +0000
  • Ironport-data: A9a23:eUCbaKAXMLtAMRVW/x3jw5YqxClBgxIJ4kV8jS/XYbTApD0ngjYDy GBOXG+Ha6yMM2D9Lt9/OY/l8kID78DczN9jQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHWeIdA970Ug5w7Vg29Yx6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPhw1 fsXnraZcTw7O6/SvL4ieQAbSSxhaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguw5K8bmJsUHs2xIxjDFF/c2B5vERs0m4PcGgWZh1p4QTJ4yY eI3ewo0Uy/tfiZseX06JJs6s8uTmSLWJmgwRFW9+vNsvjm7IBZK+LTqPdDYfvSDQMxHmUDeq m+u13T0BFQWOcKSzRKB82mwnanfkCXjQoUQGbaksPlwjzW7xGYeFRkXXluTuuSihwi1XNc3A 08T/DAnoe4t9UioZt7nVha8rTiPuRt0ZjZLO7RkskfXkPOSulvHQDhfJt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ApIs+P/P+UpgNd9vpYfHHfVAlEii8Rl57HzzcZdM60jT22tvK3Ik=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Mar 11, 2022 at 08:35:18AM +0100, Jan Beulich wrote:
> On 10.03.2022 16:08, Roger Pau Monne wrote:
> > --- a/common.c
> > +++ b/common.c
> > @@ -249,19 +249,22 @@ int is_text_section(struct section *sec)
> >             (sec->sh.sh_flags & SHF_EXECINSTR));
> >  }
> >  
> > +#define SEC_MATCH(n) !strncmp(sec->name, n, strlen(n) - 1)
> >  int is_rodata_section(struct section *sec)
> >  {
> >     return sec->sh.sh_type == SHT_PROGBITS &&
> >            !(sec->sh.sh_flags & (SHF_EXECINSTR | SHF_WRITE)) &&
> > -          !strncmp(sec->name, ".rodata", 7);
> > +          (SEC_MATCH(".rodata") || SEC_MATCH(".data.ro_after_init"));
> >  }
> >  
> >  int is_init_section(struct section *sec)
> >  {
> >     return sec->sh.sh_type == SHT_PROGBITS &&
> >            (sec->sh.sh_flags & SHF_ALLOC) &&
> > -          !strncmp(sec->name, ".init", 5);
> > +          (SEC_MATCH(".init") || SEC_MATCH(".text.startup") ||
> > +           SEC_MATCH(".altinstr") || SEC_MATCH(".ctors"));
> 
> Having dealt with this recently - what about .init_array? Modern gcc
> prefers that over .ctors. Of course the question is whether either
> really needs dealing with here - these sections, to my knowledge,
> appear only with gcov support enabled. Not sure that's a case where
> livepatching is actually expected to be used.

.init_array will match the .init comparison, and thus is already
handled.

Regarding .ctors, it's certainly an .init section, so it doesn't hurt
to get added here in any case? (regardless of us only knowing it being
used for code coverage so far)

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.