From patchwork Tue Jan 3 20:09:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13088006 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1F49C4708E for ; Tue, 3 Jan 2023 20:10:25 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.470708.730322 (Exim 4.92) (envelope-from ) id 1pCnc1-0006B5-Q9; Tue, 03 Jan 2023 20:10:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 470708.730322; Tue, 03 Jan 2023 20:10:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCnc1-00069t-Jm; Tue, 03 Jan 2023 20:10:17 +0000 Received: by outflank-mailman (input) for mailman id 470708; Tue, 03 Jan 2023 20:10:17 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCnc1-0004E1-0Y for xen-devel@lists.xenproject.org; Tue, 03 Jan 2023 20:10:17 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a33a766e-8ba2-11ed-91b6-6bf2151ebd3b; Tue, 03 Jan 2023 21:10:16 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a33a766e-8ba2-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1672776616; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=VaSW3H4jlJ3dv04QHJz+xn4RvXE21Emi7q8vmojUlYQ=; b=K1YvjnCQ8K5mZB3i6BUWM59Lo5NSp758Kd+vknByeD0K4ogC4iuu17bL upcLJJ5vpZkSGWggLMcQqkBF6fFNiV6fWLcqhqoreGYC/MyHlxTUEhgiJ 4g2bsSQgyifm0fmPYe02LPTvlPcElLoA4r/mtLQ4gJJ4A5ifNwlKYRPIP 8=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 89980396 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:zISvBajSqRhsWFeCDFxR0A02X161VhAKZh0ujC45NGQN5FlHY01je htvCmrXPqyPamD1fIokPdy2pB4AscXQmtFmSFE9/iphRXsb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmUpH1QMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWs0N8klgZmP6sT5QeFzyV94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+ tQmGGoANAu8uti4wbvhYddctp56dcj0adZ3VnFIlVk1DN4jSJHHBa7L+cVZzHE7gcUm8fT2P pRDL2A1NVKZPkMJagx/5JEWxY9EglHWdTFCpU3Tjq0w+2XJlyR60aT3McqTcduPLSlQthbJ9 zKepDWnav0cHPPFjhSX0UOMvN3esjP2c6MdOf6etdc/1TV/wURMUUZLBDNXu8KRlUqWS99Zb UsO9UIGr7U29UGtZsnwWVu/unHslgUHR9NaHuk+6QeM4qnZ+QCUAi4DVDEpQMwrsoo6SCIn0 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkA9D0UPeCsFRgst+MT4rcc4iRenczp4OPfr1JuvQ2i2m m3U6nhl71kOsSIV/5uLp12dmA2RnJbIR1Qe2DXnBDv87xwsMeZJeLeUwVTc6P9BKqOQQV+Ao GUIlqCi0QweMX2evHfTGbtQRdlF897AaWSB2gA3Q/HN4hz3oxaekZZsDCaSzauDGuINYnfXb UDaomu9D7cDbSLxPcebj29cYvnGLJQM9/y/DZg4jfIUOPCdkTNrGwkwDXN8J0i3zCARfVgXY P93i/qEA3cAErhAxzGrXeob2rJD7nlgmjmMGsirn0z+jer2iJuppVAtaQLmUwzExPnc/FW9H yh3baNmNCmzoMWhO3KKoOb/3HgBLGQhBICelvG7gtWre1I8cEl4Uq+5/F/UU9A990ijvruSr y7Vt44x4AaXuEAr3i3TNyk7MOq+AMYgxZ/5VAR1VWuVN7EYSd7HxM8im1EfJNHLKMQLISZIc sQ4 IronPort-HdrOrdr: A9a23:oznK46q+t3YFZKpl/7t2pyQaV5rveYIsimQD101hICG9Evb0qy nOpoV/6faQslwssR4b9uxoVJPvfZq+z+8W3WByB9eftWDd0QPFEGgL1+DfKlbbak7DH4BmtJ uJc8JFeafN5VoRt7eG3OFveexQvOVu88qT9JjjJ28Gd3APV0n5hT0JcjpyFCdNNW57LKt8Lr WwzOxdqQGtfHwGB/7LfUXsD4D41rv2fIuNW29+OyIa X-IronPort-AV: E=Sophos;i="5.96,297,1665460800"; d="scan'208";a="89980396" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , George Dunlap , Jan Beulich , "Stefano Stabellini" , Wei Liu , Julien Grall Subject: [PATCH 1/4] public/version: Change xen_feature_info to have a fixed size Date: Tue, 3 Jan 2023 20:09:40 +0000 Message-ID: <20230103200943.5801-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230103200943.5801-1-andrew.cooper3@citrix.com> References: <20230103200943.5801-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 This is technically an ABI change, but Xen doesn't operate in any environment where "unsigned int" is differnet to uint32_t, so switch to the explicit form. This avoids the need to derive (identical) compat logic for handling the subop. Signed-off-by: Andrew Cooper Acked-by: Julien Grall --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Wei Liu CC: Julien Grall --- xen/include/public/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/public/version.h b/xen/include/public/version.h index 9c78b4f3b6a4..0ff8bd9077c6 100644 --- a/xen/include/public/version.h +++ b/xen/include/public/version.h @@ -50,7 +50,7 @@ typedef struct xen_platform_parameters xen_platform_parameters_t; #define XENVER_get_features 6 struct xen_feature_info { - unsigned int submap_idx; /* IN: which 32-bit submap to return */ + uint32_t submap_idx; /* IN: which 32-bit submap to return */ uint32_t submap; /* OUT: 32-bit submap */ }; typedef struct xen_feature_info xen_feature_info_t; From patchwork Tue Jan 3 20:09:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13088004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38994C3DA7D for ; Tue, 3 Jan 2023 20:10:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.470703.730296 (Exim 4.92) (envelope-from ) id 1pCnbm-0004km-MH; Tue, 03 Jan 2023 20:10:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 470703.730296; Tue, 03 Jan 2023 20:10:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCnbm-0004kF-J9; Tue, 03 Jan 2023 20:10:02 +0000 Received: by outflank-mailman (input) for mailman id 470703; Tue, 03 Jan 2023 20:10:01 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCnbl-0004TZ-Bx for xen-devel@lists.xenproject.org; Tue, 03 Jan 2023 20:10:01 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 97c03ea5-8ba2-11ed-b8d0-410ff93cb8f0; Tue, 03 Jan 2023 21:09:58 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 97c03ea5-8ba2-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1672776598; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=/mBbqgiiuNZanVYbh0nZVNE+sEURAYgdK6CFKGtITFc=; b=RNyF8re0u6gsjimsCEUzigihal79cUqMyWBE5z8TpwKxL6lmH/4GcjHd B9DsC1uRN8NSIrSjc7LdOjPuMVP50ubTXE0lP/oRJ/mNdm6fzakgXyL5w gwto9jLvqkV+EG5z1mNDbzXV4P/n38YVMBuv91z2s2koE8SRimRn768im 4=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 90516756 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:k8kcW6sr222vbiNZasQ29fFuCufnVGBeMUV32f8akzHdYApBsoF/q tZmKTuAP/fcNmWhf910YIqwp04HuMDczdM1SQNq+XxhQytH+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg0HVU/IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4bKj5lv0gnRkPaoQ5AaGzCFJZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwcQgPdkqxiNKKzLO3e8dIr8A8E+PxM9ZK0p1g5Wmx4fcORJnCR+PB5MNC3Sd2jcdLdRrcT 5NHM3w1Nk2GOkARfAdMYH49tL7Aan3XWjtUsl+K44Ew5HDe1ldZ27nxKtvFPNeNQK25m27J/ j+foTukXHn2MvSu+weD1SqAn9PtlBLcAb4cTrCk8uxT1Qj7Kms7V0RNCArTTeOColWlR9tVJ kgQ+ywvhas/7kqmSp/6RRLQiGGAlg4RXZxXCeJSwAOQzqvZ5S6JC25CSSROAPQEnsIrQT0h1 neSgsjkQzdotdW9WX+bs7uZsz62ESwUNnMZIz8JSxMf5Nvuq511iQjAJuuPC4bs0IezQ2uph WnX8m5u3N3/kPLnyY3ixVLf2QCjlqTFTwIEyCH+Wn2axBl2MdvNi5OT1XDX6vNJLYC8R1aHv WQZl8X20N3iHa1hhwTWHrxTQejBC+KtdWSF3AUxR8VJGyGFoSbLQGxG3N1pyK6F2O4gcCShX kLcsBg5CHR7bCrzNv8fj25c5q0XIUnc+TbNDKu8gjlmOMIZmOq7EMZGOyatM5jFyhRErE3GE c7znTyQJXgbE7976zG9Wv0Q17QmrghnmzyJGs+jn0T/iObODJJwdVviGALXBt3VEYve+FmFm zqhH5HiJ+pjvB3WPXCMrN97waEiJnknH5Hmw/Fqmhq4ClM+QgkJUqaBqY7NjqQ5x8y5YM+Up CDiMqKZoXKj7UD6xfKiMy06MOu2DMsv8hrW/0UEZD6V5pTqWq73hI93Snf9VeJPGDBLpRKsc 8Q4Rg== IronPort-HdrOrdr: A9a23:Ki5oxqqFSrmfBcOJouT2EOwaV5rveYIsimQD101hICG9Evb0qy nOpoV/6faQslwssR4b9uxoVJPvfZq+z+8W3WByB9eftWDd0QPFEGgL1+DfKlbbak7DH4BmtJ uJc8JFeafN5VoRt7eG3OFveexQvOVu88qT9JjjJ28Gd3APV0n5hT0JcjpyFCdNNW57LKt8Lr WwzOxdqQGtfHwGB/7LfUXsD4D41rv2fIuNW29+OyIa X-IronPort-AV: E=Sophos;i="5.96,297,1665460800"; d="scan'208";a="90516756" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , George Dunlap , Jan Beulich , Stefano Stabellini , Wei Liu , Julien Grall Subject: [PATCH 2/4] xen/version: Drop compat/kernel.c Date: Tue, 3 Jan 2023 20:09:41 +0000 Message-ID: <20230103200943.5801-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230103200943.5801-1-andrew.cooper3@citrix.com> References: <20230103200943.5801-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 kernel.c is mostly in an #ifndef COMPAT guard, because compat/kernel.c reincludes kernel.c to recompile xen_version() in a compat form. However, the xen_version hypercall is almost guest-ABI-agnostic; only XENVER_platform_parameters has a compat split. Handle this locally, and do away with the reinclude entirely. In particular, this removed the final instances of obfucation via the DO() macro. No functional change. Also saves 2k of of .text in the x86 build. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Wei Liu CC: Julien Grall --- xen/common/Makefile | 2 +- xen/common/compat/kernel.c | 53 -------------------------------------------- xen/common/kernel.c | 43 ++++++++++++++++++++++------------- xen/include/hypercall-defs.c | 2 +- xen/include/xlat.lst | 3 +++ 5 files changed, 33 insertions(+), 70 deletions(-) delete mode 100644 xen/common/compat/kernel.c diff --git a/xen/common/Makefile b/xen/common/Makefile index 9a3a12b12dea..bbd75b4be6d3 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -59,7 +59,7 @@ obj-y += xmalloc_tlsf.o obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma lzo unlzo unlz4 unzstd earlycpio,$(n).init.o) -obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o) +obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o memory.o multicall.o xlat.o) ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) obj-y += domctl.o diff --git a/xen/common/compat/kernel.c b/xen/common/compat/kernel.c deleted file mode 100644 index 804b919bdc72..000000000000 --- a/xen/common/compat/kernel.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** - * kernel.c - */ - -EMIT_FILE; - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern xen_commandline_t saved_cmdline; - -#define xen_extraversion compat_extraversion -#define xen_extraversion_t compat_extraversion_t - -#define xen_compile_info compat_compile_info -#define xen_compile_info_t compat_compile_info_t - -CHECK_TYPE(capabilities_info); - -#define xen_platform_parameters compat_platform_parameters -#define xen_platform_parameters_t compat_platform_parameters_t -#undef HYPERVISOR_VIRT_START -#define HYPERVISOR_VIRT_START HYPERVISOR_COMPAT_VIRT_START(current->domain) - -#define xen_changeset_info compat_changeset_info -#define xen_changeset_info_t compat_changeset_info_t - -#define xen_feature_info compat_feature_info -#define xen_feature_info_t compat_feature_info_t - -CHECK_TYPE(domain_handle); - -#define DO(fn) int compat_##fn -#define COMPAT - -#include "../kernel.c" - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/common/kernel.c b/xen/common/kernel.c index f8134d3e7a9d..ccee178ff17a 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -18,7 +18,13 @@ #include #include -#ifndef COMPAT +#ifdef CONFIG_COMPAT +#include + +CHECK_compile_info; +CHECK_feature_info; +CHECK_build_id; +#endif enum system_state system_state = SYS_STATE_early_boot; @@ -463,15 +469,7 @@ static int __init cf_check param_init(void) __initcall(param_init); #endif -# define DO(fn) long do_##fn - -#endif - -/* - * Simple hypercalls. - */ - -DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) +long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { bool_t deny = !!xsm_xen_version(XSM_OTHER, cmd); @@ -520,12 +518,27 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) case XENVER_platform_parameters: { - xen_platform_parameters_t params = { - .virt_start = HYPERVISOR_VIRT_START - }; +#ifdef CONFIG_COMPAT + if ( current->hcall_compat ) + { + compat_platform_parameters_t params = { + .virt_start = HYPERVISOR_COMPAT_VIRT_START(current->domain), + }; + + if ( copy_to_guest(arg, ¶ms, 1) ) + return -EFAULT; + } + else +#endif + { + xen_platform_parameters_t params = { + .virt_start = HYPERVISOR_VIRT_START, + }; + + if ( copy_to_guest(arg, ¶ms, 1) ) + return -EFAULT; + } - if ( copy_to_guest(arg, ¶ms, 1) ) - return -EFAULT; return 0; } diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c index 41e1af01f6b2..6d361ddfce1b 100644 --- a/xen/include/hypercall-defs.c +++ b/xen/include/hypercall-defs.c @@ -245,7 +245,7 @@ multicall compat:2 do:2 compat do do update_va_mapping compat do - - - set_timer_op compat do compat do - event_channel_op_compat do do - - dep -xen_version compat do compat do do +xen_version do do do do do console_io do do do do do physdev_op_compat compat do - - dep #if defined(CONFIG_GRANT_TABLE) diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst index 65f7fe3811c7..f2bae220a6df 100644 --- a/xen/include/xlat.lst +++ b/xen/include/xlat.lst @@ -169,6 +169,9 @@ ! vcpu_runstate_info vcpu.h ? vcpu_set_periodic_timer vcpu.h ! vcpu_set_singleshot_timer vcpu.h +? compile_info version.h +? feature_info version.h +? build_id version.h ? xenoprof_init xenoprof.h ? xenoprof_passive xenoprof.h ? flask_access xsm/flask_op.h From patchwork Tue Jan 3 20:09:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13088003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70E1BC4708E for ; Tue, 3 Jan 2023 20:10:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.470702.730284 (Exim 4.92) (envelope-from ) id 1pCnbf-0004EE-DW; Tue, 03 Jan 2023 20:09:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 470702.730284; Tue, 03 Jan 2023 20:09:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCnbf-0004E7-As; Tue, 03 Jan 2023 20:09:55 +0000 Received: by outflank-mailman (input) for mailman id 470702; Tue, 03 Jan 2023 20:09:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCnbe-0004E1-CL for xen-devel@lists.xenproject.org; Tue, 03 Jan 2023 20:09:54 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 93d66c6d-8ba2-11ed-91b6-6bf2151ebd3b; Tue, 03 Jan 2023 21:09:52 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 93d66c6d-8ba2-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1672776592; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=2yFcSH2umpU0naapLlqvQU9WmOebWnbXbogEZZlzszQ=; b=NGhzt1fpRodRKYbZz8kndgdKkukR2L0+6sTWeGoXnbizLFxsR2VorXDx IkzjmWA/WAc7PILrIsreGejf0Rxs5pDf/OlGJLWhso3LElhhAZTjTx2Ov D1pd0wvgli+LX+mOZWQxpQyQIMNA/c9dxx+rNTdyOvopGqmomNsaob86O I=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 91025429 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:K79aoK27suSQTPsnj/bD5eVxkn2cJEfYwER7XKvMYLTBsI5bpzNTy mQbCDjXOfiOYjf9f9Ekb4rkoxgBuZCHnIVgTVBupC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK5ULSfUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS9nuDgNyo4GlD5gVmPqgX1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfPX588 KZfAjQ0cU7cmeuQkI66bukzr5F2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP ZNfMGcxKkSbC/FMEg5/5JYWteGknHTgNRZfr0qYv/Ef6GnP1g1hlrPqNbI5f/TbHJ0PwxrC9 woq+Uz1LhU2BfKv1gO68yuJvPHLxB6jYoI7QejQGvlC3wTImz175ActfUCgvfCzh0q6WtReA 08Z4Cwjqe417kPDZsb5dw21pjiDpBF0c9hNF+w37imdx6yS5ByWbkAmZDNcbN0ttOctWCcnk FSOmrvBFTFp9bGYV3+Z3rOVti+pfzgYK3cYYi0JRhdD5MPsyLzflTqWEIwlSvTsyISoR3egm FhmsRTSmZ0vkvwOjeKR+WnY3W2yr76Zcg8R5lr+CzfNAhxCWKapYImh6F7+5PlGLZqEQlTpg EXoi/Ry/8hVU8jTyXXlrPElWejwuq3baGG0bUtHRcFJyti7x5K0kWm8ChlaLVwhDMsLcCSBj KT76VIIv8870JdHgMZKj2ON5yYCl/OI+TfNDKq8gj9yjn9ZKme6ENlGPxL44owUuBFEfVsDE Zmaa92wKn0RFL5qyjG7L89Ej+BxmX9mlTOLHMyrp/hC7VZ5TCfMIYrpzXPUNrxphE96iF+9H ylj2zuilEwEDbyWjtj/+o8PN1EaRUUG6WTNg5UPLIare1M2cFzN/teNmdvNjaQ5xfUK/goJl 1nhMnJlJK3X3CCecV3TOy0zN9sCn/9X9BoGAMDlBn7ws1BLXGplxP13m0cfFVX/yNFe8A== IronPort-HdrOrdr: A9a23:MwMeY6B+wy/VSHDlHems55DYdb4zR+YMi2TDtnoBLyC9F/bzqy nApoV46faWslYssRMb6LW90cC7KBu2lKKdirNhWYtKMjOW31dA77sP0WIh+VDd8uHFmdK1HJ 0PT0DZZeeAbmRHsQ== X-IronPort-AV: E=Sophos;i="5.96,297,1665460800"; d="scan'208";a="91025429" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , George Dunlap , Jan Beulich , Stefano Stabellini , Wei Liu , Julien Grall Subject: [PATCH 3/4] xen/version: Drop bogus return values for XENVER_platform_parameters Date: Tue, 3 Jan 2023 20:09:42 +0000 Message-ID: <20230103200943.5801-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230103200943.5801-1-andrew.cooper3@citrix.com> References: <20230103200943.5801-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 A split in virtual address space is only applicable for x86 PV guests. Furthermore, the information returned for x86 64bit PV guests is wrong. Explain the problem in version.h, stating the other information that PV guests need to know. For 64bit PV guests, and all non-x86-PV guests, return 0, which is strictly less wrong than the values currently returned. Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Wei Liu CC: Julien Grall --- xen/common/kernel.c | 6 ++++-- xen/include/public/version.h | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/xen/common/kernel.c b/xen/common/kernel.c index ccee178ff17a..70e7dff87488 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -522,7 +522,9 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) if ( current->hcall_compat ) { compat_platform_parameters_t params = { - .virt_start = HYPERVISOR_COMPAT_VIRT_START(current->domain), + .virt_start = is_pv_vcpu(current) + ? HYPERVISOR_COMPAT_VIRT_START(current->domain) + : 0, }; if ( copy_to_guest(arg, ¶ms, 1) ) @@ -532,7 +534,7 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) #endif { xen_platform_parameters_t params = { - .virt_start = HYPERVISOR_VIRT_START, + .virt_start = 0, }; if ( copy_to_guest(arg, ¶ms, 1) ) diff --git a/xen/include/public/version.h b/xen/include/public/version.h index 0ff8bd9077c6..c8325219f648 100644 --- a/xen/include/public/version.h +++ b/xen/include/public/version.h @@ -42,6 +42,26 @@ typedef char xen_capabilities_info_t[1024]; typedef char xen_changeset_info_t[64]; #define XEN_CHANGESET_INFO_LEN (sizeof(xen_changeset_info_t)) +/* + * This API is problematic. + * + * It is only applicable to guests which share pagetables with Xen (x86 PV + * guests), and is supposed to identify the virtual address split between + * guest kernel and Xen. + * + * For 32bit PV guests, it mostly does this, but the caller needs to know that + * Xen lives between the split and 4G. + * + * For 64bit PV guests, Xen lives at the bottom of the upper canonical range. + * This previously returned the start of the upper canonical range (which is + * the userspace/Xen split), not the Xen/kernel split (which is 8TB further + * on). This now returns 0 because the old number wasn't correct, and + * changing it to anything else would be even worse. + * + * For all guest types using hardware virt extentions, Xen is not mapped into + * the guest kernel virtual address space. This now return 0, where it + * previously returned unrelated data. + */ #define XENVER_platform_parameters 5 struct xen_platform_parameters { xen_ulong_t virt_start; From patchwork Tue Jan 3 20:09:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13088005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB67AC54EBC for ; Tue, 3 Jan 2023 20:10:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.470704.730307 (Exim 4.92) (envelope-from ) id 1pCnbo-0005CO-5e; Tue, 03 Jan 2023 20:10:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 470704.730307; Tue, 03 Jan 2023 20:10:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCnbo-0005Bq-0q; Tue, 03 Jan 2023 20:10:04 +0000 Received: by outflank-mailman (input) for mailman id 470704; Tue, 03 Jan 2023 20:10:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCnbm-0004TZ-Sh for xen-devel@lists.xenproject.org; Tue, 03 Jan 2023 20:10:03 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9a018dc3-8ba2-11ed-b8d0-410ff93cb8f0; Tue, 03 Jan 2023 21:10:00 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9a018dc3-8ba2-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1672776600; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=JKdrRr7waCmGtSepF69W8Ba+E4SGmyEJw2vd/HieU84=; b=ffSbfg2XRS+ZCjyF/xrg7vJqJ8yWr+HTHFhj4+sdz3Tc2NX+mqRprw4k AoDajDy01nxfofsqU5pZzrrBtzup5rBynJbVgu4JIi6k3Ed3U12rG54c6 EZMfFwaSXVJ7+fbA+1LETXLD+ZSAleBS+1gmXfufsojCbV8NsXL2MLg09 s=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 90516757 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:rqrKsqJugGU/2yUtFE+R55UlxSXFcZb7ZxGr2PjKsXjdYENShjIDm GAdCmGGb/bbMWqhco10bI7jpENUvJeHyYQwGgdlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHv+kUrWs1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPdwP9TlK6q4mhA5wRlPawjUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c4uOWNWr 84XGAwBbxyyqcafxK2EYPNj05FLwMnDZOvzu1llxDDdS/0nXYrCU+PB4towMDUY354UW6yEP oxANGQpPE+ojx5nYz/7DLoXmuuyi2a5WDpfsF+P/oI84nTJzRw327/oWDbQUo3SGJwLwRvHz o7A12LdKT1ABffc8jPbzHmto82fggnSUatHQdVU8dY12QbOlwT/EiY+TkCnqPO0jkq/XdN3K EEO/Ccq668o+ySDUd3VTxC+5nmesXY0WcdUEuA8wBGAzOzT+QnxLkouQyNFadcmnNQrXjFs3 ViM9/v5CDoqvLCLRHa18raPsSj0KSUTNXUFZyIPUU0C+daLnW0opkuRFJA5Svfz14CrX2Grq 9yXkMQgr+wrj9ZR5aqLwVzGjwOCgrHNUTEf/AqCCwpJ8ThFTIKiYoWp733S4vBBMJuVQzG9g ZQUpySNxLtQVM/QzURhVM1IRej0vKjdbFUwlHY1R/EcGyKRF2lPlGy6yBV3Pw9XP8kNYlcFi 2eD6FoKtPe/0JZHBJKbgr5d6exwlsAM9vy/DJg4i+aihbAvHDJrBAk0OSatM5nFySDAa50XN 5aBatqLBn0HE6lhxzfeb75DjuV0mXhulTuKGcCTI/GbPV22PSf9dFv4GAHWMrBRAF2s+m05D Oqzx+PVkk4CAYUSkwHc8JIJLEBiEEXX8ave8pQNHsbae1oOJY3UI6OJqV/XU9A/zvs9eyah1 i3VZ3K0P3Km2CSfcVzbNyA8AF4tNL4mxU8G0eUXFQ7A8xAejUyHt8/zq7NfkWEbydFe IronPort-HdrOrdr: A9a23:rENAKKPYHoXrDcBcTgWjsMiBIKoaSvp037BK7S1MoH1uA6mlfq WV9sjzuiWatN98Yh8dcLO7Scu9qBHnlaKdiLN5VduftWHd01dAR7sSjrcKrQeAJ8X/nNQtr5 uJccJFeaDN5Y4Rt7eH3OG6eexQv+Vu6MqT9IPjJ+8Gd3ATV0lnhT0JbTqzIwlNayRtI4E2L5 aY7tovnUvaRZxGBv7LYEXsRoL41qT2qK4= X-IronPort-AV: E=Sophos;i="5.96,297,1665460800"; d="scan'208";a="90516757" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , George Dunlap , Jan Beulich , Stefano Stabellini , Wei Liu , Julien Grall Subject: [PATCH 4/4] xen/version: Introduce non-truncating XENVER_* subops Date: Tue, 3 Jan 2023 20:09:43 +0000 Message-ID: <20230103200943.5801-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230103200943.5801-1-andrew.cooper3@citrix.com> References: <20230103200943.5801-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Recently in XenServer, we have encountered problems caused by both XENVER_extraversion and XENVER_commandline having fixed bounds. More than just the invariant size, the APIs/ABIs also broken by typedef-ing an array, and using an unqualified 'char' which has implementation-specific signed-ness. Provide brand new ops, which are capable of expressing variable length strings, and mark the older ops as broken. This fixes all issues around XENVER_extraversion being longer than 15 chars. More work is required to remove other assumptions about XENVER_commandline being 1023 chars long. Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Wei Liu CC: Julien Grall Tested by forcing XENVER_extraversion to be 20 chars long, and confirming that an untruncated version can be obtained. API/ABI wise, XENVER_build_id could be merged into xenver_varstring_op(), but the internal infrastructure is awkward. --- xen/common/kernel.c | 69 ++++++++++++++++++++++++++++++++++++++++++++ xen/include/public/version.h | 56 +++++++++++++++++++++++++++++++++-- xen/include/xlat.lst | 1 + xen/xsm/flask/hooks.c | 4 +++ 4 files changed, 128 insertions(+), 2 deletions(-) diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 70e7dff87488..56bd6c6f5d9c 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -24,6 +24,7 @@ CHECK_compile_info; CHECK_feature_info; CHECK_build_id; +CHECK_var_string; #endif enum system_state system_state = SYS_STATE_early_boot; @@ -469,6 +470,66 @@ static int __init cf_check param_init(void) __initcall(param_init); #endif +static long xenver_varstring_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) +{ + const char *str = NULL; + size_t sz = 0; + union { + xen_capabilities_info_t info; + } u; + struct xen_var_string user_str; + + switch ( cmd ) + { + case XENVER_extraversion2: + str = xen_extra_version(); + break; + + case XENVER_changeset2: + str = xen_changeset(); + break; + + case XENVER_commandline2: + str = saved_cmdline; + break; + + case XENVER_capabilities2: + memset(u.info, 0, sizeof(u.info)); + arch_get_xen_caps(&u.info); + str = u.info; + break; + + default: + ASSERT_UNREACHABLE(); + break; + } + + if ( !str || + !(sz = strlen(str)) ) + return -ENODATA; /* failsafe */ + + if ( sz > INT32_MAX ) + return -E2BIG; /* Compat guests. 2G ought to be plenty. */ + + if ( guest_handle_is_null(arg) ) /* Length request */ + return sz; + + if ( copy_from_guest(&user_str, arg, 1) ) + return -EFAULT; + + if ( user_str.len == 0 ) + return -EINVAL; + + if ( sz > user_str.len ) + return -ENOBUFS; + + if ( copy_to_guest_offset(arg, offsetof(struct xen_var_string, buf), + str, sz) ) + return -EFAULT; + + return sz; +} + long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { bool_t deny = !!xsm_xen_version(XSM_OTHER, cmd); @@ -670,6 +731,14 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) return sz; } + + case XENVER_extraversion2: + case XENVER_capabilities2: + case XENVER_changeset2: + case XENVER_commandline2: + if ( deny ) + return -EPERM; + return xenver_varstring_op(cmd, arg); } return -ENOSYS; diff --git a/xen/include/public/version.h b/xen/include/public/version.h index c8325219f648..cf2d2ef38b54 100644 --- a/xen/include/public/version.h +++ b/xen/include/public/version.h @@ -19,12 +19,20 @@ /* arg == NULL; returns major:minor (16:16). */ #define XENVER_version 0 -/* arg == xen_extraversion_t. */ +/* + * arg == xen_extraversion_t. + * + * This API/ABI is broken. Use XENVER_extraversion2 instead. + */ #define XENVER_extraversion 1 typedef char xen_extraversion_t[16]; #define XEN_EXTRAVERSION_LEN (sizeof(xen_extraversion_t)) -/* arg == xen_compile_info_t. */ +/* + * arg == xen_compile_info_t. + * + * This API/ABI is broken and truncates data. + */ #define XENVER_compile_info 2 struct xen_compile_info { char compiler[64]; @@ -34,10 +42,20 @@ struct xen_compile_info { }; typedef struct xen_compile_info xen_compile_info_t; +/* + * arg == xen_capabilities_info_t. + * + * This API/ABI is broken. Use XENVER_capabilities2 instead. + */ #define XENVER_capabilities 3 typedef char xen_capabilities_info_t[1024]; #define XEN_CAPABILITIES_INFO_LEN (sizeof(xen_capabilities_info_t)) +/* + * arg == xen_changeset_info_t. + * + * This API/ABI is broken. Use XENVER_changeset2 instead. + */ #define XENVER_changeset 4 typedef char xen_changeset_info_t[64]; #define XEN_CHANGESET_INFO_LEN (sizeof(xen_changeset_info_t)) @@ -88,6 +106,11 @@ typedef struct xen_feature_info xen_feature_info_t; */ #define XENVER_guest_handle 8 +/* + * arg == xen_commandline_t. + * + * This API/ABI is broken. Use XENVER_commandline2 instead. + */ #define XENVER_commandline 9 typedef char xen_commandline_t[1024]; @@ -103,6 +126,35 @@ struct xen_build_id { }; typedef struct xen_build_id xen_build_id_t; +/* + * Container for an arbitrary variable length string. + */ +struct xen_var_string { + uint32_t len; /* IN: size of buf[] in bytes. */ + unsigned char buf[XEN_FLEX_ARRAY_DIM]; /* OUT: requested data. */ +}; +typedef struct xen_var_string xen_var_string_t; + +/* + * arg == xenver_string_t + * + * Equivalent to the original ops, but with a non-truncating API/ABI. + * + * Passing arg == NULL is a request for size. The returned size does not + * include a NUL terminator, and has a practical upper limit of INT32_MAX for + * 32bit guests. This is expected to be plenty for the purpose. + * + * Otherwise, the input xenver_string_t provides the size of the following + * buffer. Xen will fill the buffer, and return the number of bytes written + * (e.g. if the input buffer was longer than necessary). + * + * These hypercalls can fail, in which case they'll return -XEN_Exx. + */ +#define XENVER_extraversion2 11 +#define XENVER_capabilities2 12 +#define XENVER_changeset2 13 +#define XENVER_commandline2 14 + #endif /* __XEN_PUBLIC_VERSION_H__ */ /* diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst index f2bae220a6df..19cef4424add 100644 --- a/xen/include/xlat.lst +++ b/xen/include/xlat.lst @@ -172,6 +172,7 @@ ? compile_info version.h ? feature_info version.h ? build_id version.h +? var_string version.h ? xenoprof_init xenoprof.h ? xenoprof_passive xenoprof.h ? flask_access xsm/flask_op.h diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 78225f68c15c..a671dcd0322e 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1777,15 +1777,18 @@ static int cf_check flask_xen_version(uint32_t op) /* These sub-ops ignore the permission checks and return data. */ return 0; case XENVER_extraversion: + case XENVER_extraversion2: return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_VERSION, VERSION__XEN_EXTRAVERSION, NULL); case XENVER_compile_info: return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_VERSION, VERSION__XEN_COMPILE_INFO, NULL); case XENVER_capabilities: + case XENVER_capabilities2: return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_VERSION, VERSION__XEN_CAPABILITIES, NULL); case XENVER_changeset: + case XENVER_changeset2: return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_VERSION, VERSION__XEN_CHANGESET, NULL); case XENVER_pagesize: @@ -1795,6 +1798,7 @@ static int cf_check flask_xen_version(uint32_t op) return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_VERSION, VERSION__XEN_GUEST_HANDLE, NULL); case XENVER_commandline: + case XENVER_commandline2: return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_VERSION, VERSION__XEN_COMMANDLINE, NULL); case XENVER_build_id: