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

Re: [PATCH] livepatch: set -f{function,data}-sections compiler option


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 2 Mar 2022 17:09:10 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=nQNCvubhZW4ZvndGWUbmmG7haHcJKGdcAU+Z1OTWR0Y=; b=JoMRap4r6vFzodH4aIj1WmkBAc4riS4mIjdt2idAFkC41u3uaJQ5WzjHwAPLyuYpujDKF0/g9ax65Gmh6wCSY+eNeBPpsFxhdvnEQiV26cD+E1hx5CaZVllFE2vnCgjaEkyZ/Cu7fdQbBWMuWATXCcgMpKmZbNfUM1enrhhy5EwlQ9PITIkU0a5Y2Ddm8TEybWGkMJsWqvm/t1cju7cC/rEM8UoU6F5UQKonNyEZRrr7+uFIOg2MxYsWz5Ummd9zq3/SUjq+mtba0xsmo49z/NKvTcLWf8gNWZk6XtO5n5vSVibD1f8aghKUeIXbqA5T2A5DB3mE3y9+G3a3/sOfSg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+M2QGEZNvDXOpaKo48VUMruwLMnbvjcsTeBGxME5jB6RtsMOaj2IQNwpDO5IPJd5kctnFNFGAYfcLBbvD5/cB0jabuVJ1JRP0dweGcMi+1CofFLPYY5Xl6EvYEEUi5wfKfArs4a4Nbg1SfuToNaA4lJpGmug0GAbs1KzvHeKyEVAYTXtRWzeiQKY5Islfx1RsYuq5APQrJglUIkpJNEEusH3ERDOv5eHMo6+brxbfOoGsP87rhk6TT4Ee5Apk3jPo9Ez8qDrGEbr8Za+wpV4SZcQr24CQ2YlJsxF5aPtoJK0Rpyy3ji50rD8/C9Ee91ySoUuInb7/DThNlKBFGcJQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 02 Mar 2022 16:09:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.03.2022 16:46, Roger Pau Monné wrote:
> On Wed, Mar 02, 2022 at 03:41:21PM +0100, Jan Beulich wrote:
>> On 02.03.2022 14:44, Roger Pau Monne wrote:
>>> @@ -292,6 +295,9 @@ SECTIONS
>>>         *(.data)
>>>         *(.data.rel)
>>>         *(.data.rel.*)
>>> +#ifdef CONFIG_LIVEPATCH
>>> +       *(.data.*)
>>> +#endif
>>>         CONSTRUCTORS
>>>    } PHDR(text)
>>>  
>>> @@ -308,6 +314,9 @@ SECTIONS
>>>         . = ALIGN(SMP_CACHE_BYTES);
>>>         __per_cpu_data_end = .;
>>>         *(.bss)
>>> +#ifdef CONFIG_LIVEPATCH
>>> +       *(.bss.*)
>>> +#endif
>>
>> ... are these two really in need of being conditional?
> 
> Will drop if you agree. I didn't want to risk introducing unwanted
> changes in the !CONFIG_LIVEPATCH case.

The only "unwanted" change I can imagine here would be that we place a
section which the linker would otherwise need to guess how to place,
for being "orphan".

>>> --- a/xen/common/Kconfig
>>> +++ b/xen/common/Kconfig
>>> @@ -353,7 +353,9 @@ config CRYPTO
>>>  config LIVEPATCH
>>>     bool "Live patching support"
>>>     default X86
>>> -   depends on "$(XEN_HAS_BUILD_ID)" = "y"
>>> +   depends on "$(XEN_HAS_BUILD_ID)" = "y" && \
>>> +              $(cc-option,-ffunction-sections) && \
>>> +              $(cc-option,-fdata-sections)
>>
>> Is this for certain Clang versions? Gcc has been supporting this in
>> 4.1.x already (didn't check when it was introduced).
> 
> I've checked clang and it seems to be prevent in at least Clang 5,
> which is likely enough?

Clang5 accepts the options fine here. But that wouldn't be enough,
./README says "Clang/LLVM 3.5 or later".

> I've added the check just to be on the safe side.

Well, yes, if you're unsure and the old version can't be checked,
then perhaps indeed better to probe.

Jan




 


Rackspace

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