From patchwork Tue Mar 19 13:05:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10859551 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 5430917E9 for ; Tue, 19 Mar 2019 13:07:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39DDB2239C for ; Tue, 19 Mar 2019 13:07:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DD6C29684; Tue, 19 Mar 2019 13:07:57 +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 CE75F2239C for ; Tue, 19 Mar 2019 13:07:56 +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 1h6ERT-0007cN-Ep; Tue, 19 Mar 2019 13:06:07 +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 1h6ERR-0007by-TU for xen-devel@lists.xenproject.org; Tue, 19 Mar 2019 13:06:05 +0000 X-Inumbo-ID: bf6c4aee-4a47-11e9-ae3c-ff202ad6d72e Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id bf6c4aee-4a47-11e9-ae3c-ff202ad6d72e; Tue, 19 Mar 2019 13:06:02 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.58,498,1544486400"; d="scan'208";a="80993191" From: Wei Liu To: Date: Tue, 19 Mar 2019 13:05:49 +0000 Message-ID: <20190319130550.32570-2-wei.liu2@citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190319130550.32570-1-wei.liu2@citrix.com> References: <20190319130550.32570-1-wei.liu2@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 1/2] x86: decouple xen alignment setting from EFI/ELF 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 ELF build 4K. Signed-off-by: Wei Liu Reviewed-by: Jan Beulich --- xen/arch/x86/Kconfig | 23 +++++++++++++++++++++++ xen/arch/x86/xen.lds.S | 12 ++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 5c2d1070b6..1f115c1e40 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -138,6 +138,29 @@ config TBOOT If unsure, say Y. +choice + prompt "Alignment of Xen image" + depends on X86 + default XEN_ALIGN_DEFAULT + ---help--- + Specify alignment for Xen image. + + 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 ELF build + the default alignment is 4K due to syslinux failing to handle + the increment of image size induced by 2M 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..5a0c1004f5 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,22 @@ 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 */ +#ifdef CONFIG_XEN_ALIGN_2M +#define SECTION_ALIGN MB(2) +#else /* Default alignment */ +#ifdef EFI +#define SECTION_ALIGN MB(2) +#else +#define SECTION_ALIGN PAGE_SIZE +#endif +#endif + OUTPUT_FORMAT(FORMAT, FORMAT, FORMAT) OUTPUT_ARCH(i386:x86-64) From patchwork Tue Mar 19 13:05:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10859553 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 DA7D217E9 for ; Tue, 19 Mar 2019 13:08:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C125828C13 for ; Tue, 19 Mar 2019 13:08:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B55272965B; Tue, 19 Mar 2019 13:08:02 +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 7077028C13 for ; Tue, 19 Mar 2019 13:08:02 +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 1h6ERT-0007cF-5O; Tue, 19 Mar 2019 13:06:07 +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 1h6ERR-0007bz-TV for xen-devel@lists.xenproject.org; Tue, 19 Mar 2019 13:06:05 +0000 X-Inumbo-ID: bf762c4e-4a47-11e9-ac35-3fcd8d3c7679 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id bf762c4e-4a47-11e9-ac35-3fcd8d3c7679; Tue, 19 Mar 2019 13:06:03 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.58,498,1544486400"; d="scan'208";a="80993193" From: Wei Liu To: Date: Tue, 19 Mar 2019 13:05:50 +0000 Message-ID: <20190319130550.32570-3-wei.liu2@citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190319130550.32570-1-wei.liu2@citrix.com> References: <20190319130550.32570-1-wei.liu2@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 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 potentially 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