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

Re: [PATCH 2/4] x86/hvmloader: Don't build as PIC/PIE


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 25 Aug 2022 09:20:58 +0200
  • 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=WIOCOVhm6SwhzfTV6ARkOvTh0o+gBDrXK5PAE8jgfy8=; b=fbrgw2NmxNDxNo8BBwVta2d35ywIUDy3l2LD+Q9M7WK9aIrAlBfC38oJxcre/o+n0QNcE3Yiyul0WaZyU2ZJbQUBVxuzkMPe4gaaeXDYKJ4P442KLj81T9rqaL7i18TvR+geyrdmKYuL7IMj+X1Doi0WsQ/HF9+pQx55uIjyjKIJUFxP1i/Pc5wIbllRYgvm9jVQdo2aDVYdWobEnPQInDrdhABcuMtwdXhYN4+o6EmmlUFDOzKf/ISYRinzkE/zFPmqOPVYFtV4GXG85dh6KfXKNEfN2r05Dlw0EFvuHyRApQU1nU8TkUiFegz9VUtB7w/nIlTbTUjsHA95LCCdLA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a+Ty4xvXOFS5zFjP2VMcdJjO7uiISYnm3jkY0LZxUpBkKW/9yw2bPFTSSMEB/azNlWougGZmYAMOHqwbBBBOYQhkiyOy9Guc7a43/iMPu7/ZRCa+naVO9qSGVpkZ8g8ZUGIMK7krHEzT1YwMaYUrUtnThLOCvwaSy83WljftCN05W9HV/jJMw/SXpl0+bR0Ohm1GGg+tfq8BS/eJwv9LyqtisWeBOa9Ps3g4dDcunLL53eFu6SOmH/DglyZ8vlv0K53T03kkonO5n7KD811qj8oYXF3TdHZEEJ7r22HEJr87kH005I26S5jlRkj+h8XgaXAyBtFrlbkE5SpqlDqvGQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 25 Aug 2022 07:21:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.08.2022 12:59, Andrew Cooper wrote:
> HVMLoader is not relocatable in memory, and 32bit PIC code has a large
> overhead.  Build it as non-relocatable.
> 
> Bloat-o-meter reports a net:
>   add/remove: 0/0 grow/shrink: 3/107 up/down: 14/-3370 (-3356)
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> ---
>  tools/firmware/hvmloader/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/firmware/hvmloader/Makefile 
> b/tools/firmware/hvmloader/Makefile
> index 4f31c881613c..eb757819274b 100644
> --- a/tools/firmware/hvmloader/Makefile
> +++ b/tools/firmware/hvmloader/Makefile
> @@ -23,7 +23,8 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk
>  # SMBIOS spec requires format mm/dd/yyyy
>  SMBIOS_REL_DATE ?= $(shell date +%m/%d/%Y)
>  
> -CFLAGS += $(CFLAGS_xeninclude)
> +CFLAGS += $(CFLAGS_xeninclude) -fno-pic
> +$(call cc-option-add,CFLAGS,-no-pie)

This is supposed to be coming from EMBEDDED_EXTRA_CFLAGS, if only
it was spelled correctly there. See the patch just sent. This line
(see that other patch) is meaningless anyway, as we don't use
$(CFLAGS) for linking here. So with it dropped
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

I do think though that the description could do with some expanding,
as I don't think -fpic or -fPIC is the default normally. I suppose
it's only specific distros which make this the default.

Jan



 


Rackspace

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