From patchwork Mon Mar 18 14:57:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10857869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 717F41669 for ; Mon, 18 Mar 2019 14:59:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56B0527F91 for ; Mon, 18 Mar 2019 14:59:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B01E27F9F; Mon, 18 Mar 2019 14:59:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E6F2127F91 for ; Mon, 18 Mar 2019 14:59:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h5thj-00081l-KF; Mon, 18 Mar 2019 14:57:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h5thh-000813-W2 for xen-devel@lists.xenproject.org; Mon, 18 Mar 2019 14:57:30 +0000 X-Inumbo-ID: 243bd59e-498e-11e9-ac6c-cf2c19d72078 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 243bd59e-498e-11e9-ac6c-cf2c19d72078; Mon, 18 Mar 2019 14:57:25 +0000 (UTC) IronPort-Data: A9a23:p6xUuax99AJBWdsOZkt6t4n5zX0WlJwBZkZKjXDtlgiZGahqw2QMvo d5JOUv6r737ls0yUpREvUMlNY9CmZSUTlFNlQ26gaXhW8bvFhZHPe1L/jqZgRD9crBIzVNag mZpWL81MBCLzbQPAne+flOKVyoaH6xqhvY6q7i9EqQmkWeaRvayS8mAJNC7QNdnh7tDN0XO5 lPR+n+THxPHHEQYV86+QWdMsGIBagEDZVVEJ2PvHID75gqYrZlKyrzaWDAM7yStqM9sj1kXj A50n59ajeM2hjWOzeqZWUJ45swaPw4JeLE/rF2UVQwfOmg+da1rwqCafzpVpIFq8jBfnFsbb KbSEhfrVcIKyrc8wz/bO+pLWJeWN5f6qfAGaB/3XQo6zx32ulDWU094UxsUzL8ymz2ccM1St cQrS3xWCzAgE079XVSN8BnHpPeZp0eiXmPwdowBId/eum+3LaMFJkgRxlBmzJXl/wa6rzukd 1dHmnSzxZAvyKYBMTZ81apVAX+h2075RPyE7rpagXlCGYMLqhKdwpxkyWSr91dVUwWWDtsU3 JpYI2JsrN0eSniAcq9OEhS1YS99+H1VyJPMc55gw+n567k4dvN6KlDgxPvKDve3gGAxb6bQG EdpoOXwWMiHsOwljpnom4qEhu6WixvlcbNrbxRzVKvlxPWqzG29tNoVBCAUfaL9CkvP3V78W pW9CgpdkZTtWjhpaGcuswc7FYz53dSpYLx8a6jvkGq28jRUG5mmyMb9tN11gmqIXIKWCNEd1 VtM58gIBgYEvq/UjONOzZ7gxXzoAct0oBES9Nvnah77Zd72wkRZ6H3/8ffm0QSD15JUYouH8 2dXFM01qqox+2zJKZ48hE1pvmvlcmqSHrHpYX7O7j4iIe53IHgEdkubQOdKU5pzI42Q+8+Pv sVzaArT0U9JieUHWtAqGgZHYsID0X1TciUzMn4i8Lmx0F8beaTg9gPCjrlOt4VRzgCBSSd47 OI2ZVM129Qej0DiSH6ndOiODg14xZX4hNbspFT/Mjjqnbw8nREV6+zW+x1Lnvs3MkTxGIJx9 1R96ae5Mo8f4i+WoPASiUktyuawQUQziSc/cZmz/fov01Zav3JmdDHL/aOaZ/VyI5zVtgn6h rgfyxMf3cOhUN94QopT/bhkcRvpOt0eHbIFvhG6+QCjeAECeFY7LayGN1+K1a0zAvtfJ/oDr 9h6WyhCaW+J2GVWyuR3F5rhFsAHwQUVYYp9h1hJNCcbwgE9fsALSefkZl8N//HmUkSS0hG6E tFQ2zN0GOpmGT3ZtAhek8HKSAJXfiV96g6UD7auVCsb/pTHB7u+t2YmZ0lre5ivNGGG3CMth A0m0LHCL/dohNKbCbkxmBLr65O7eS2qU0N79As4TqxBWi6dgM1oBP6IH7pMp0yI/nvYO46CX Hh+WIBR9aSlocqIMrAdCQ6wx1Ad3J6CdQsegMMCxDZMAQrT/f4w+PtcZzoiKvh9fnzrDdN4j U2UEyz3KPqKnndV8ZUYpI2BrFpYmrNjZG9ea5WNiBugmvvjSOPFt27rZkhD84ZCk2L1UVYd1 xkBVPJBmPLJr3xc5OJtk/EKlBHWTJR6Aa76E7ZK1pCuTit1SL66w9JS8VxiUVgHEqvLcmL0z qLL+njFXtD0dlXep8Fyqnbb16wAgtcipGFs0MQ84MasXx/YCBi+NDibeHJpTqBX3dAL5bcSE pMjfsVNF0cPAm+G7Oj7MZ5sLW0rPlyk8/4/5BVQIVj5Vlr5LpeqzlYviE9vzvvinJFI1xVAF 9XZPYQvv/f6bV9tuxvPwmRLxBpmKNLVBqqd9IfcO3ld/E= X-IronPort-AV: E=Sophos;i="5.58,494,1544486400"; d="scan'208";a="80881930" From: Wei Liu To: Date: Mon, 18 Mar 2019 14:57:18 +0000 Message-ID: <20190318145719.11396-2-wei.liu2@citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190318145719.11396-1-wei.liu2@citrix.com> References: <20190318145719.11396-1-wei.liu2@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/2] x86: decouple xen alignment setting from EFI/non-EFI build X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Introduce a new Kconfig option to pick the alignment for xen binary. To retain original behaviour, the default pick for EFI build is 2M and non-EFI build 4K. Signed-off-by: Wei Liu --- xen/arch/x86/Kconfig | 26 ++++++++++++++++++++++++++ xen/arch/x86/xen.lds.S | 16 ++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 5c2d1070b6..b15053cfbe 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -138,6 +138,32 @@ config TBOOT If unsure, say Y. +choice + prompt "Alignment of Xen binary" + depends on X86 + default XEN_ALIGN_DEFAULT + ---help--- + Specify alignment for Xen binary. + + If unsure, choose "default". + +config XEN_ALIGN_DEFAULT + bool "Default alignment" + ---help--- + Pick alignment according to build variants. + + For EFI build the default alignment is 2M. For non-EFI build + the default alignment is 4K due to syslinux failing to handle + 2M alignment. + +config XEN_ALIGN_4K + bool "4K alignment" + +config XEN_ALIGN_2M + bool "2M alignment" + +endchoice + config XEN_GUEST def_bool n prompt "Xen Guest" diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 6e9bda5109..163de31574 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -12,7 +12,6 @@ #define FORMAT "pei-x86-64" #undef __XEN_VIRT_START #define __XEN_VIRT_START __image_base__ -#define SECTION_ALIGN MB(2) #define DECL_SECTION(x) x : ENTRY(efi_start) @@ -20,13 +19,26 @@ ENTRY(efi_start) #else /* !EFI */ #define FORMAT "elf64-x86-64" -#define SECTION_ALIGN PAGE_SIZE #define DECL_SECTION(x) x : AT(ADDR(x) - __XEN_VIRT_START) ENTRY(start_pa) #endif /* EFI */ +#if defined CONFIG_XEN_ALIGN_2M +#define SECTION_ALIGN MB(2) +#elif defined CONFIG_XEN_ALIGN_4K +#define SECTION_ALIGN PAGE_SIZE +#elif defined CONFIG_XEN_ALIGN_DEFAULT + #ifdef EFI + #define SECTION_ALIGN MB(2) + #else + #define SECTION_ALIGN PAGE_SIZE + #endif +#else +#error "Section alignment undefined" +#endif + OUTPUT_FORMAT(FORMAT, FORMAT, FORMAT) OUTPUT_ARCH(i386:x86-64) From patchwork Mon Mar 18 14:57:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10857865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E86531575 for ; Mon, 18 Mar 2019 14:59:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB8AD27F92 for ; Mon, 18 Mar 2019 14:59:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC63C27F9F; Mon, 18 Mar 2019 14:59:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C47127F91 for ; Mon, 18 Mar 2019 14:59:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h5thj-00081U-B7; Mon, 18 Mar 2019 14:57:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h5thh-000814-W2 for xen-devel@lists.xenproject.org; Mon, 18 Mar 2019 14:57:30 +0000 X-Inumbo-ID: 24e55114-498e-11e9-917f-3390f170c329 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 24e55114-498e-11e9-917f-3390f170c329; Mon, 18 Mar 2019 14:57:27 +0000 (UTC) IronPort-Data: A9a23:Lm/L/qphZ47asiKBY7Tg2XPell5eBgzWbkX5aSTDNTPssVdhRD0nAh feI9mrqiUQZOypu1No5nlPRNkhw4Yg1nBD8/JDZOzSBdN/FH8uRPrSPFXijdnylRsA4Qii6l bc9Mm5LoeBNlLd2o8Ar6XZjDhQkZZLV85aA0ilH8o5P7JnMkZrv4lb1edEbk/qUZtoU0GCKv BzoXshHoqGhlm+eoQZw/Wd2AUpWegUP743SKZ+k8cM8JIfJuKPTIHQIXKRbo4Bc3GYEFJR3f 4h3Mm2Lc0Lxck+t3FiJ4+phegBEClwP45gsBuXMXDvy/1j5m0T5wkeBaXGPwf7Aho9rh8f1S kP/GbePgQvIlgI99jRcps2IH4WAbDHKD4bC3nzO1CT+PQeMxZswjOKiJig7Nl+xN+GJchh2L 4ZdN2XWpM6XPzk5AWGBS6jC1HrhYujBxtIR1sSaPYynZWNcVn1BFJ9XThfzqbx/JLd/ZlvAQ rS4xdDtMBQV0vSOK+auJHxCtbddE9l+sYaOZgMdDhwmY2H9viHEs5GtuYNWqkN/8LiSCNWNe wqvGc82g6UMMkHZTJGTDGttYZicVk2WoER3PSAqymivqHN/N8b/qtDwsIjqtZ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jn2B4n7fQpE rL/PHC+L9lDH7ullutxHxCwGIuy7bA3nbmEPp3O1NoKty/8U3a64/WY3CfVGXb6uqmwg8iUj Ttru1/7nbFyGtnVNHnYdPtRwB5St7kZOqy+KjP X-IronPort-AV: E=Sophos;i="5.58,494,1544486400"; d="scan'208";a="80881945" From: Wei Liu To: Date: Mon, 18 Mar 2019 14:57:19 +0000 Message-ID: <20190318145719.11396-3-wei.liu2@citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190318145719.11396-1-wei.liu2@citrix.com> References: <20190318145719.11396-1-wei.liu2@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/2] x86/pvshim: use 2M alignment X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The pvshim is loaded directly by toolstack. Use 2M alignment for potential better performance. Signed-off-by: Wei Liu --- xen/arch/x86/configs/pvshim_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/pvshim_defconfig index a12e3d0465..8e50b60cda 100644 --- a/xen/arch/x86/configs/pvshim_defconfig +++ b/xen/arch/x86/configs/pvshim_defconfig @@ -5,6 +5,7 @@ CONFIG_PVH_GUEST=y CONFIG_PV_SHIM=y CONFIG_PV_SHIM_EXCLUSIVE=y CONFIG_NR_CPUS=32 +CONFIG_XEN_ALIGN_2M=y # Disable features not used by the PV shim # CONFIG_SHADOW_PAGING is not set # CONFIG_BIGMEM is not set