From patchwork Tue Jan 17 13:53:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13104697 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 EAFC3C677F1 for ; Tue, 17 Jan 2023 13:54:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.479420.743259 (Exim 4.92) (envelope-from ) id 1pHmPl-0000Xb-JS; Tue, 17 Jan 2023 13:54:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 479420.743259; Tue, 17 Jan 2023 13:54:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHmPl-0000XU-FL; Tue, 17 Jan 2023 13:54:13 +0000 Received: by outflank-mailman (input) for mailman id 479420; Tue, 17 Jan 2023 13:54:12 +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 1pHmPj-0000F6-VZ for xen-devel@lists.xenproject.org; Tue, 17 Jan 2023 13:54:12 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 679b7d47-966e-11ed-b8d0-410ff93cb8f0; Tue, 17 Jan 2023 14:54:05 +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: 679b7d47-966e-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1673963649; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ZqFqnz0+1fOZwU/dhH9PGLPysacHFErPc/30UTcR1D4=; b=Azz1uy/c5+2+HCC+YXXFszlKyYozhzQEvsldUOoX/koePwtTGhV9eXfa LjYbJO92V9RDMtSNrIakSuhFERanjJKtRIqoAV2tO+ZRdfqQOGu7JItI1 rCvrROv8/7rtRtTaJ5CPCoQH2MKCv6PobAIxkUTcy4KlKw8+5mlFMleKg Q=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 91898366 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:BCp8cKoZ2eYew1u3xms3v0bEsT1eBmJgZRIvgKrLsJaIsI4StFCzt garIBmBOv+PZmXzL48gbdzn9UpS7Z7dxtU2TgBr/y0wE38S8JuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpAFc+E0/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKm06WxwUmAWP6gR5weHziZNVvrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXACoWbDTTocKY++KqFulNnv4mANbtGZxK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVxrl6PqLVxyG/U1AFri5DmMcbPe8zMTsJQ9qqdj jOfrzWpWU9EXDCZ4Qii22uHmODqph72H5MqO4GTqNxonkLGkwT/DzVJDADm8JFVkHWWS99Zb kAZ5Ccqhawz71CwCMnwWQWip3yJtQJaXMBfe8Ul7Cmdx6yS5ByWbkAGQSRGc8cOr9ItSHoh0 Vrhoj/yLWUx6vvPEyvbr+rK62roYkD5MFPuewceVgkhs//Djrpjn07Pb85ZFYKqiPjqTGSYL y+xkMQuu1kCpZdViP7qpwqf3GLESovhFVBsuFiONo6xxkYgPdP+OdT1gbTOxawYRLt1WGVtq 5TtdyK2yOkVRa+AmyWWKAnmNOH4vq3VWNEwbLMGInXAy9hO0yT5FWyoyGsiTHqFy+5dEdMTX GfduBlK+LhYN2awYKl8buqZUpp1lvixSYy1B6mFNbKih6SdkyferElTibO4hTixwCDAb4liU XtkTSpcJSlDUvk2pNZHb+wczaUq1kgDKZD7HPjGI+Cc+ePGPha9EO5VWGZim8hltMtoVi2Jq YcAXyZLoj0DONDDjt7/qt9DfQpUcyZhW/gbaaV/L4a+H+avI0l5Y9e5/F/rU9A+90iJvo8kJ k2AZ3I= IronPort-HdrOrdr: A9a23:t+4G/awqb7XrLUEP6eIdKrPw6r1zdoMgy1knxilNoHxuH/Bw9v re+MjzsCWftN9/Yh4dcLy7VpVoIkmskKKdg7NhXotKNTOO0AeVxedZjLcKqweKJ8SUzJ8+6U 4PSchD4N2bNykGse/KpDOWPvxl6uOhmZrY4ts3zR1WPH1Xg3cL1XYHNu6ZeHcGOjWvHfACZf yhDlIsnUvbRZwQBP7Lf0XsD4D41qX2fIuNW298OyIa X-IronPort-AV: E=Sophos;i="5.97,224,1669093200"; d="scan'208";a="91898366" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , Anthony PERARD , Juergen Gross Subject: [PATCH 1/6] tools/libxc: Move xc_version() out of xc_private.c into its own file Date: Tue, 17 Jan 2023 13:53:31 +0000 Message-ID: <20230117135336.11662-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230117135336.11662-1-andrew.cooper3@citrix.com> References: <20230117135336.11662-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 kexec-tools uses xc_version(), meaning that it is not a private API. As we're going to extend the functionality substantially, move it to its own file. Signed-off-by: Andrew Cooper Acked-by: Anthony PERARD --- CC: Wei Liu CC: Anthony PERARD CC: Juergen Gross --- tools/libs/ctrl/Makefile.common | 1 + tools/libs/ctrl/xc_private.c | 66 -------------------------------- tools/libs/ctrl/xc_private.h | 7 ---- tools/libs/ctrl/xc_version.c | 83 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 73 deletions(-) create mode 100644 tools/libs/ctrl/xc_version.c diff --git a/tools/libs/ctrl/Makefile.common b/tools/libs/ctrl/Makefile.common index 0a09c28fd369..4e3680c123f6 100644 --- a/tools/libs/ctrl/Makefile.common +++ b/tools/libs/ctrl/Makefile.common @@ -16,6 +16,7 @@ OBJS-y += xc_pm.o OBJS-y += xc_cpu_hotplug.o OBJS-y += xc_vm_event.o OBJS-y += xc_vmtrace.o +OBJS-y += xc_version.o OBJS-y += xc_monitor.o OBJS-y += xc_mem_paging.o OBJS-y += xc_mem_access.o diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c index 2f99a7d2cfb5..cb22da604fe8 100644 --- a/tools/libs/ctrl/xc_private.c +++ b/tools/libs/ctrl/xc_private.c @@ -489,72 +489,6 @@ int xc_sysctl(xc_interface *xch, struct xen_sysctl *sysctl) return do_sysctl(xch, sysctl); } -int xc_version(xc_interface *xch, int cmd, void *arg) -{ - DECLARE_HYPERCALL_BOUNCE(arg, 0, XC_HYPERCALL_BUFFER_BOUNCE_OUT); /* Size unknown until cmd decoded */ - size_t sz; - int rc; - - switch ( cmd ) - { - case XENVER_version: - sz = 0; - break; - case XENVER_extraversion: - sz = sizeof(xen_extraversion_t); - break; - case XENVER_compile_info: - sz = sizeof(xen_compile_info_t); - break; - case XENVER_capabilities: - sz = sizeof(xen_capabilities_info_t); - break; - case XENVER_changeset: - sz = sizeof(xen_changeset_info_t); - break; - case XENVER_platform_parameters: - sz = sizeof(xen_platform_parameters_t); - break; - case XENVER_get_features: - sz = sizeof(xen_feature_info_t); - break; - case XENVER_pagesize: - sz = 0; - break; - case XENVER_guest_handle: - sz = sizeof(xen_domain_handle_t); - break; - case XENVER_commandline: - sz = sizeof(xen_commandline_t); - break; - case XENVER_build_id: - { - xen_build_id_t *build_id = (xen_build_id_t *)arg; - sz = sizeof(*build_id) + build_id->len; - HYPERCALL_BOUNCE_SET_DIR(arg, XC_HYPERCALL_BUFFER_BOUNCE_BOTH); - break; - } - default: - ERROR("xc_version: unknown command %d\n", cmd); - return -EINVAL; - } - - HYPERCALL_BOUNCE_SET_SIZE(arg, sz); - - if ( (sz != 0) && xc_hypercall_bounce_pre(xch, arg) ) - { - PERROR("Could not bounce buffer for version hypercall"); - return -ENOMEM; - } - - rc = do_xen_version(xch, cmd, HYPERCALL_BUFFER(arg)); - - if ( sz != 0 ) - xc_hypercall_bounce_post(xch, arg); - - return rc; -} - unsigned long xc_make_page_below_4G( xc_interface *xch, uint32_t domid, unsigned long mfn) { diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h index ed960c6f30e6..6404077903f0 100644 --- a/tools/libs/ctrl/xc_private.h +++ b/tools/libs/ctrl/xc_private.h @@ -215,13 +215,6 @@ void xc__hypercall_buffer_cache_release(xc_interface *xch); * Hypercall interfaces. */ -static inline int do_xen_version(xc_interface *xch, int cmd, xc_hypercall_buffer_t *dest) -{ - DECLARE_HYPERCALL_BUFFER_ARGUMENT(dest); - return xencall2(xch->xcall, __HYPERVISOR_xen_version, - cmd, HYPERCALL_BUFFER_AS_ARG(dest)); -} - static inline int do_physdev_op(xc_interface *xch, int cmd, void *op, size_t len) { int ret = -1; diff --git a/tools/libs/ctrl/xc_version.c b/tools/libs/ctrl/xc_version.c new file mode 100644 index 000000000000..60e107dcee0b --- /dev/null +++ b/tools/libs/ctrl/xc_version.c @@ -0,0 +1,83 @@ +/* SPDX-License-Identifier: LGPL-2.1 */ +/* + * xc_version.c + * + * Wrappers aound XENVER_* hypercalls + */ + +#include "xc_private.h" +#include + +static int do_xen_version(xc_interface *xch, int cmd, + xc_hypercall_buffer_t *dest) +{ + DECLARE_HYPERCALL_BUFFER_ARGUMENT(dest); + return xencall2(xch->xcall, __HYPERVISOR_xen_version, + cmd, HYPERCALL_BUFFER_AS_ARG(dest)); +} + +int xc_version(xc_interface *xch, int cmd, void *arg) +{ + DECLARE_HYPERCALL_BOUNCE(arg, 0, XC_HYPERCALL_BUFFER_BOUNCE_OUT); /* Size unknown until cmd decoded */ + size_t sz; + int rc; + + switch ( cmd ) + { + case XENVER_version: + sz = 0; + break; + case XENVER_extraversion: + sz = sizeof(xen_extraversion_t); + break; + case XENVER_compile_info: + sz = sizeof(xen_compile_info_t); + break; + case XENVER_capabilities: + sz = sizeof(xen_capabilities_info_t); + break; + case XENVER_changeset: + sz = sizeof(xen_changeset_info_t); + break; + case XENVER_platform_parameters: + sz = sizeof(xen_platform_parameters_t); + break; + case XENVER_get_features: + sz = sizeof(xen_feature_info_t); + break; + case XENVER_pagesize: + sz = 0; + break; + case XENVER_guest_handle: + sz = sizeof(xen_domain_handle_t); + break; + case XENVER_commandline: + sz = sizeof(xen_commandline_t); + break; + case XENVER_build_id: + { + xen_build_id_t *build_id = (xen_build_id_t *)arg; + sz = sizeof(*build_id) + build_id->len; + HYPERCALL_BOUNCE_SET_DIR(arg, XC_HYPERCALL_BUFFER_BOUNCE_BOTH); + break; + } + default: + ERROR("xc_version: unknown command %d\n", cmd); + return -EINVAL; + } + + HYPERCALL_BOUNCE_SET_SIZE(arg, sz); + + if ( (sz != 0) && xc_hypercall_bounce_pre(xch, arg) ) + { + PERROR("Could not bounce buffer for version hypercall"); + return -ENOMEM; + } + + rc = do_xen_version(xch, cmd, HYPERCALL_BUFFER(arg)); + + if ( sz != 0 ) + xc_hypercall_bounce_post(xch, arg); + + return rc; +} From patchwork Tue Jan 17 13:53:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13104700 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 1C4E5C3DA78 for ; Tue, 17 Jan 2023 13:54:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.479423.743286 (Exim 4.92) (envelope-from ) id 1pHmPn-00016z-NG; Tue, 17 Jan 2023 13:54:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 479423.743286; Tue, 17 Jan 2023 13:54:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHmPn-00016A-FC; Tue, 17 Jan 2023 13:54:15 +0000 Received: by outflank-mailman (input) for mailman id 479423; Tue, 17 Jan 2023 13:54:14 +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 1pHmPm-0000F6-BF for xen-devel@lists.xenproject.org; Tue, 17 Jan 2023 13:54:14 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 690f5070-966e-11ed-b8d0-410ff93cb8f0; Tue, 17 Jan 2023 14:54:07 +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: 690f5070-966e-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1673963651; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Y1TsN24+gK5qG+xfcJUIrL6CpEgkX3sOFO8L70/aQgA=; b=hNTHdCOFdmvtUWckZytsRnkkPZjbPUc+qHVYX+2H53MevMwrKSK/8Gx5 sm1YKNNa5XafUce9DiY2pDJGiSUu0+2/KiXC7s4wZlFO8Lunh1BAkW37O U4No19jjl1HzOE+KhdSOeV5x8GL5+6Inwu1rsdNFkFShIHlJYfox+hteW A=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 91898368 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:wHfkaqBUJcICiBVW/yLjw5YqxClBgxIJ4kV8jS/XYbTApDNw3jVRm GNMX2qAOqyCYmX1eIx0Ot/g9x9TvcCByNY3QQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nNHuCnYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbyRFtMpvlDs15K6p4GpB4QRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw4P11JTFo1 dIjeCFRbjGbveea37SeVbw57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP pdHL2M1N3wsYDUWUrsTILs4kP2lmT/UdDpApUjOjaE2/3LS3Ep6172F3N/9K4XaFJUOwBbwS mTu1Ef5DjYrbvil+QHeyU2Ppc+UswjFYddHfFG/3qEz2wDCroAJMzUJUXOrrP//jVSxM/pPJ kpR9icwoKwa8E2wUsK7TxC+uGSDvBMXR5xXCeJSwA2E1Kf8+QuSAWkACDlbZ7QOtsAsQicx/ kSUhN6vDjtq2IB5UlrEqO3S92nrf3FIcylbP3RsoRY5D8fLupoxqkLpbvhYQL/pjvztIzTc3 Davs31r71kMtvLnx5lX7Hie3W3398KTFlFljunEdjn7t10kPeZJc6TtsAGGtqgYce51W3Hb5 BA5d96iAPfi5H1nvAiEW60zEb6g/J5p2xWM0Ac0T/HNG9lAkkNPnLy8Axkkfi+Fyu5eJVfUj Lb74Gu9HqN7MnqwdrNQaImsEcksxqWIPY27CauEP4YWMskoJVTvEMRSiam4hjCFraTRuftnZ cfznTiEUB729piLPBLpHrxAgNfHNwg1xH/JRICT8vhU+eP2WZJhcp9caAHmRrlgvMu5TPD9r 4432z2il08OD4UTo0D/reYuELz9BSNqVcCs9ZIJLLDrz8gPMDhJNsI9CIgJI+RN95m5XM+Up xlRhmcwJILDuED6 IronPort-HdrOrdr: A9a23:nXztU63mx44FWTcRMYJqsAqjBHQkLtp133Aq2lEZdPU0SKGlfq GV7ZAmPHrP4gr5N0tOpTntAse9qBDnhPtICOsqTNSftWDd0QPFEGgF1+rfKlXbcBEWndQtt5 uIHZIfNDXxZ2IK8PrS0U2DPPsLhPO818mT9IDjJ3UGd3AXV0m3hT0JdTpyESdNNXd77YJSLu v72iLezQDQA0j+aK6AdwA4t7iqnayyqHr+CyR2fCIa1A== X-IronPort-AV: E=Sophos;i="5.97,224,1669093200"; d="scan'208";a="91898368" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , Juergen Gross , Christian Lindig , David Scott , Edwin Torok , Rob Hoes Subject: [PATCH 2/6] tools: Introduce a non-truncating xc_xenver_extraversion() Date: Tue, 17 Jan 2023 13:53:32 +0000 Message-ID: <20230117135336.11662-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230117135336.11662-1-andrew.cooper3@citrix.com> References: <20230117135336.11662-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 ... which uses XENVER_extraversion2. In order to do sensibly, use manual hypercall buffer handling. Not only does this avoid an extra bounce buffer (we need to strip the xen_varbuf_t header anyway), it's also shorter and easlier to follow. Update libxl and the ocaml stubs to match. No API/ABI change in either. With this change made, `xl info` can now correctly access a >15 char extraversion: # xl info xen_version 4.18-unstable+REALLY LONG EXTRAVERSION Signed-off-by: Andrew Cooper Acked-by: Christian Lindig Reviewed-by: Anthony PERARD --- CC: Wei Liu CC: Anthony PERARD CC: Juergen Gross CC: Christian Lindig CC: David Scott CC: Edwin Torok CC: Rob Hoes Note: There is a marginal risk for a memory leak in the ocaml bindings, but it turns out we have the same bug elsewhere and fixing that is going to be rather complicated. --- tools/include/xenctrl.h | 6 +++ tools/libs/ctrl/xc_version.c | 75 +++++++++++++++++++++++++++++++++++++ tools/libs/light/libxl.c | 4 +- tools/ocaml/libs/xc/xenctrl_stubs.c | 9 +++-- 4 files changed, 87 insertions(+), 7 deletions(-) diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index 23037874d3d5..1e88d49371a4 100644 --- a/tools/include/xenctrl.h +++ b/tools/include/xenctrl.h @@ -1604,6 +1604,12 @@ long xc_memory_op(xc_interface *xch, unsigned int cmd, void *arg, size_t len); int xc_version(xc_interface *xch, int cmd, void *arg); +/* + * Wrappers around XENVER_* subops. Callers must pass the returned pointer to + * free(). + */ +char *xc_xenver_extraversion(xc_interface *xch); + int xc_flask_op(xc_interface *xch, xen_flask_op_t *op); /* diff --git a/tools/libs/ctrl/xc_version.c b/tools/libs/ctrl/xc_version.c index 60e107dcee0b..2c14474feec5 100644 --- a/tools/libs/ctrl/xc_version.c +++ b/tools/libs/ctrl/xc_version.c @@ -81,3 +81,78 @@ int xc_version(xc_interface *xch, int cmd, void *arg) return rc; } + +/* + * Raw hypercall wrapper, letting us pass NULL and things which aren't of + * xc_hypercall_buffer_t *. + */ +static int do_xen_version_raw(xc_interface *xch, int cmd, void *hbuf) +{ + return xencall2(xch->xcall, __HYPERVISOR_xen_version, + cmd, (unsigned long)hbuf); +} + +/* + * Issues a xen_varbuf_t subop, using manual hypercall buffer handling to + * avoid unnecessary buffering. + * + * On failure, returns NULL. errno probably useful. + * On success, returns a pointer which must be freed with xencall_free_buffer(). + */ +static xen_varbuf_t *varbuf_op(xc_interface *xch, unsigned int subop) +{ + xen_varbuf_t *hbuf = NULL; + ssize_t sz; + + sz = do_xen_version_raw(xch, subop, NULL); + if ( sz < 0 ) + return NULL; + + hbuf = xencall_alloc_buffer(xch->xcall, sizeof(*hbuf) + sz); + if ( !hbuf ) + return NULL; + + hbuf->len = sz; + + sz = do_xen_version_raw(xch, subop, hbuf); + if ( sz < 0 ) + { + xencall_free_buffer(xch->xcall, hbuf); + return NULL; + } + + hbuf->len = sz; + return hbuf; +} + +/* + * Wrap varbuf_op() to obtain a simple string. Copy out of the hypercall + * buffer, stripping the xen_varbuf_t header and appending a NUL terminator. + * + * On failure, returns NULL, errno probably useful. + * On success, returns a pointer which must be free()'d. + */ +static char *varbuf_simple_string(xc_interface *xch, unsigned int subop) +{ + xen_varbuf_t *hbuf = varbuf_op(xch, subop); + char *res; + + if ( !hbuf ) + return NULL; + + res = malloc(hbuf->len + 1); + if ( res ) + { + memcpy(res, hbuf->buf, hbuf->len); + res[hbuf->len] = '\0'; + } + + xencall_free_buffer(xch->xcall, hbuf); + + return res; +} + +char *xc_xenver_extraversion(xc_interface *xch) +{ + return varbuf_simple_string(xch, XENVER_extraversion2); +} diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c index a0bf7d186f69..3e16e568839c 100644 --- a/tools/libs/light/libxl.c +++ b/tools/libs/light/libxl.c @@ -581,7 +581,6 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) { GC_INIT(ctx); union { - xen_extraversion_t xen_extra; xen_compile_info_t xen_cc; xen_changeset_info_t xen_chgset; xen_capabilities_info_t xen_caps; @@ -600,8 +599,7 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) info->xen_version_major = xen_version >> 16; info->xen_version_minor = xen_version & 0xFF; - xc_version(ctx->xch, XENVER_extraversion, &u.xen_extra); - info->xen_version_extra = libxl__strdup(NOGC, u.xen_extra); + info->xen_version_extra = xc_xenver_extraversion(ctx->xch); xc_version(ctx->xch, XENVER_compile_info, &u.xen_cc); info->compiler = libxl__strdup(NOGC, u.xen_cc.compiler); diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index 2fba9c5e94d6..f3ce12dd8683 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -929,9 +929,8 @@ CAMLprim value stub_xc_version_version(value xch) { CAMLparam1(xch); CAMLlocal1(result); - xen_extraversion_t extra; + char *extra; long packed; - int retval; caml_enter_blocking_section(); packed = xc_version(_H(xch), XENVER_version, NULL); @@ -941,10 +940,10 @@ CAMLprim value stub_xc_version_version(value xch) failwith_xc(_H(xch)); caml_enter_blocking_section(); - retval = xc_version(_H(xch), XENVER_extraversion, &extra); + extra = xc_xenver_extraversion(_H(xch)); caml_leave_blocking_section(); - if (retval) + if (!extra) failwith_xc(_H(xch)); result = caml_alloc_tuple(3); @@ -953,6 +952,8 @@ CAMLprim value stub_xc_version_version(value xch) Store_field(result, 1, Val_int(packed & 0xffff)); Store_field(result, 2, caml_copy_string(extra)); + free(extra); + CAMLreturn(result); } From patchwork Tue Jan 17 13:53:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13104701 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 F13D1C677F1 for ; Tue, 17 Jan 2023 13:54:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.479425.743302 (Exim 4.92) (envelope-from ) id 1pHmPp-0001a0-1W; Tue, 17 Jan 2023 13:54:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 479425.743302; Tue, 17 Jan 2023 13:54: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 1pHmPo-0001Xp-TU; Tue, 17 Jan 2023 13:54:16 +0000 Received: by outflank-mailman (input) for mailman id 479425; Tue, 17 Jan 2023 13:54:16 +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 1pHmPo-0000XC-0g for xen-devel@lists.xenproject.org; Tue, 17 Jan 2023 13:54:16 +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 6be8b0f7-966e-11ed-91b6-6bf2151ebd3b; Tue, 17 Jan 2023 14:54:13 +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: 6be8b0f7-966e-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1673963653; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=mE/iBXFwyWDQLAcCnVIU+5UD6GpcaO2CE3H3XDadFrA=; b=CIyhQRxXWhoJHJ1OBMCv2KtAvqV6vX2X9RjeOpet/5ot9cUAtMQQ/WHT xmUnI0hIqQUwxnyA5rQ6Yus7tMncpb4I/DiFbTPZM0yjxUq/1z+qrUdiO b8NogMY6LV+YrndYtzCxeLgA7KY1EQXA4Pfc6Mh60msM6femd7hvqWCyi w=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 91898371 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:veBvuakiVdH2uTlxDxxP/yLo5gyKJkRdPkR7XQ2eYbSJt1+Wr1Gzt xJNWzjVPP2NYWqhe4h/a4+1oRtQvcXSzNdhSQdl+Xo3EyMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icf3grHmeIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE4p7auaVA8w5ARkPqgS5QCGzRH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 eYDKhRdSDCtvLKnnLKaUtNpqtslCda+aevzulk4pd3YJfMvQJSFSKTW/95Imjw3g6iiH96HO ZBfM2A2Kk2dPVsWYAx/5JEWxY9EglHWdTFCpU3Tjq0w+2XJlyR60aT3McqTcduPLSlQthfB9 jOWpDugav0cHPW/zQrdzW/9uqjooyr8XtwdBqa6r9c/1TV/wURMUUZLBDNXu8KRlUqWS99Zb UsO9UIGvaU0sUCmUNT5dxm5u2Kf+A4RXcJKFO834x3LzbDbiy6VD3YJZiRMY9snsIkxXzNC/ l2GhdTyHhR0raaYD3ma89+pQSiaYHZPazVYPGldEFVDuoO4yG0usv7RZsx4EorlqP3bImHhn zCrtBI7q6oVqNFegs1X4mv7byKQSonhF1BqvVSNBDr6vmuVd6b+OdX2tAGzAeJoad/AEwLf5 CVsd922trhmMH2bqMCarAzh9pmN7u3NDjDTiEUH83IJp2X0oC7LkWy9DVhDyKZV3iUsI2WBj Lf741852XOqFCLCgVVLS4ywEd826qPrCM7oUPvZBvIXPMcqJF7bpHE/PB/Lt4wIrKTLufhvU ap3jO72VSpKYUiZ5GfeqxghPU8DmXllmDK7qWHTxBW7y7uODEN5up9cWGZimtsRtfveyC2Mq oY3Cid/40kHOAEISnWNoNF7wJFjBSRTOK0aXOQMJ77TeFQ4Rjt/YxITqJt4E7FYc21uvr+g1 hmAtoVwkwWXaaHvQelSVk1eVQ== IronPort-HdrOrdr: A9a23:5gipqqMnNqAtUMBcTgejsMiBIKoaSvp037BK7S1MoH1uA6ilfq WV9sjzuiWatN98Yh8dcLO7Scy9qBHnhP1ICOAqVN/PYOCBggqVxelZhrcKqAeQeREWmNQ86U 9hGZIOdeHYPBxBouvRpCODNL8bsb66GKLDv5aj85+6JzsaFJ2J7G1Ce3im+lUdfnghOXKgfq DsnPauoVCbCA0qhpTSPAh8YwDbzee7767bXQ== X-IronPort-AV: E=Sophos;i="5.97,224,1669093200"; d="scan'208";a="91898371" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , Juergen Gross , Christian Lindig , David Scott , Edwin Torok , Rob Hoes Subject: [PATCH 3/6] tools: Introduce a non-truncating xc_xenver_capabilities() Date: Tue, 17 Jan 2023 13:53:33 +0000 Message-ID: <20230117135336.11662-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230117135336.11662-1-andrew.cooper3@citrix.com> References: <20230117135336.11662-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Update libxl and the ocaml stubs to match. No API/ABI change in either. Signed-off-by: Andrew Cooper Acked-by: Christian Lindig Reviewed-by: Anthony PERARD --- CC: Wei Liu CC: Anthony PERARD CC: Juergen Gross CC: Christian Lindig CC: David Scott CC: Edwin Torok CC: Rob Hoes --- tools/include/xenctrl.h | 1 + tools/libs/ctrl/xc_version.c | 5 +++++ tools/libs/light/libxl.c | 4 +--- tools/ocaml/libs/xc/xenctrl_stubs.c | 17 +++++++++++++++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index 1e88d49371a4..279dc17d67d4 100644 --- a/tools/include/xenctrl.h +++ b/tools/include/xenctrl.h @@ -1609,6 +1609,7 @@ int xc_version(xc_interface *xch, int cmd, void *arg); * free(). */ char *xc_xenver_extraversion(xc_interface *xch); +char *xc_xenver_capabilities(xc_interface *xch); int xc_flask_op(xc_interface *xch, xen_flask_op_t *op); diff --git a/tools/libs/ctrl/xc_version.c b/tools/libs/ctrl/xc_version.c index 2c14474feec5..512302a393ea 100644 --- a/tools/libs/ctrl/xc_version.c +++ b/tools/libs/ctrl/xc_version.c @@ -156,3 +156,8 @@ char *xc_xenver_extraversion(xc_interface *xch) { return varbuf_simple_string(xch, XENVER_extraversion2); } + +char *xc_xenver_capabilities(xc_interface *xch) +{ + return varbuf_simple_string(xch, XENVER_capabilities2); +} diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c index 3e16e568839c..139e838d1407 100644 --- a/tools/libs/light/libxl.c +++ b/tools/libs/light/libxl.c @@ -583,7 +583,6 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) union { xen_compile_info_t xen_cc; xen_changeset_info_t xen_chgset; - xen_capabilities_info_t xen_caps; xen_platform_parameters_t p_parms; xen_commandline_t xen_commandline; xen_build_id_t build_id; @@ -607,8 +606,7 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) info->compile_domain = libxl__strdup(NOGC, u.xen_cc.compile_domain); info->compile_date = libxl__strdup(NOGC, u.xen_cc.compile_date); - xc_version(ctx->xch, XENVER_capabilities, &u.xen_caps); - info->capabilities = libxl__strdup(NOGC, u.xen_caps); + info->capabilities = xc_xenver_capabilities(ctx->xch); xc_version(ctx->xch, XENVER_changeset, &u.xen_chgset); info->changeset = libxl__strdup(NOGC, u.xen_chgset); diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index f3ce12dd8683..368f4727f0a0 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -1009,9 +1009,22 @@ CAMLprim value stub_xc_version_changeset(value xch) CAMLprim value stub_xc_version_capabilities(value xch) { - xen_capabilities_info_t ci; + CAMLparam1(xch); + CAMLlocal1(result); + char *capabilities; + + caml_enter_blocking_section(); + retval = xc_xenver_capabilities(_H(xch)); + caml_leave_blocking_section(); - return xc_version_single_string(xch, XENVER_capabilities, &ci); + if (!capabilities) + failwith_xc(_H(xch)); + + result = caml_copy_string(capabilities); + + free(capabilities); + + CAMLreturn(result); } From patchwork Tue Jan 17 13:53:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13104699 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 3A0A0C678D4 for ; Tue, 17 Jan 2023 13:54:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.479421.743264 (Exim 4.92) (envelope-from ) id 1pHmPl-0000Zt-V6; Tue, 17 Jan 2023 13:54:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 479421.743264; Tue, 17 Jan 2023 13:54:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHmPl-0000ZW-OT; Tue, 17 Jan 2023 13:54:13 +0000 Received: by outflank-mailman (input) for mailman id 479421; Tue, 17 Jan 2023 13:54:13 +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 1pHmPl-0000XC-75 for xen-devel@lists.xenproject.org; Tue, 17 Jan 2023 13:54:13 +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 6a75dd9c-966e-11ed-91b6-6bf2151ebd3b; Tue, 17 Jan 2023 14:54:11 +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: 6a75dd9c-966e-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1673963650; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=/f+gRZe5yeZkzcEod1cob8AlGi1kzQQ0lSYKT6D72pM=; b=R0A8vR10SsyED/t7YXfpQhXQQpGOAYwLwWcpvNMwrO6sfnveNegci+Xj p0W6eYflkwj9FHuL/qTeN96RalJELyyS+UtkH03ts/Wzk6GVixAUa3dIm xqI+3XZA/KyMGsCNAuQFhDAWUrX0hvGmYwEipIu5N+VDc8kxvjcXH4yp3 E=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 91898370 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:0hHgiKum7DucC1PlgZHt/Lky++fnVF1eMUV32f8akzHdYApBsoF/q tZmKTrVMvyMYjOgf9sjOtvj80xQuceDyd81QVBkrSAyHi4X+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg0HVU/IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4bKj51v0gnRkPaoQ5AaHyCFPZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwMisPSkClp8yNkKPnSsh0vMEPM8/OI9ZK0p1g5Wmx4fcORJnCR+PB5MNC3Sd2jcdLdRrcT 5NHM3w1Nk2GOkARfA5NU/rSn8/x7pX7WxRepEiYuuwc5G/LwRYq+LPsLMDUapqBQsA9ckOw9 zuWrjSiXUly2Nq30jek2y+Qic30sj7laYc/TKei6eNBnwjGroAUIEJPDgbqyRWjsWahX/pPJ kpS/TAhxYAi+UruQtTjUhmQpH+fogVaS9dWC/c96gyG1uzT+QnxLmQNUDNpctEts84yAzsw2 TehndzzAid0mKaIUn/b/bCRxQ5eIgBMczVEP3VdC1JYvZ+6+tpbYg/zoshLCrW3qo3TOR/Lk yHWrAkmvbA/ksguyPDulbzYuA5AtqQlXyZsuFqMDzj/tlwpDGK2T9f2sAaGtJ6sOK7cFwDc5 yZcxqBy+chUVfmweDqxrPLh9V1Dz9KMK3XijFFmBPHNHBz9qif4Lei8DNyTTXqF0/romhezO ic/QSsLuPdu0IKCNMebmb6ZBcUw1rTHHt/4TP3SZdcmSsEvK1TXrX02NR/JjjuFfK0QfUYXY MfzTCpRJSxCVfQPIMSeGo/xLoPHNghhnDiOFPgXPjys0KaEZW79dFv2GALmUwzN14vd+F+92 48GZ6O3J+B3DLWWjt//rdRCcjjn7BETWfjLliCgXrXSclo8Rj9/UaG5LHFIU9UNopm5X9zgp hmVMnK0AnKk2hUr9S3ihqhfVY7S IronPort-HdrOrdr: A9a23:YGR2yqxS4OclT4vDZ3JaKrPwKL1zdoMgy1knxilNoEpuA6ilfq GV/MjzuiWetN98YhsdcLO7WZVoI0myyXcv2/h1AV7KZmCPhILPFuxfBODZrQEIdReTygbzv5 0QFJSXpLfLfDtHZWeR2njbL+od X-IronPort-AV: E=Sophos;i="5.97,224,1669093200"; d="scan'208";a="91898370" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , Juergen Gross , Christian Lindig , David Scott , Edwin Torok , Rob Hoes Subject: [PATCH 4/6] tools: Introduce a non-truncating xc_xenver_changeset() Date: Tue, 17 Jan 2023 13:53:34 +0000 Message-ID: <20230117135336.11662-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230117135336.11662-1-andrew.cooper3@citrix.com> References: <20230117135336.11662-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Update libxl and the ocaml stubs to match. No API/ABI change in either. Signed-off-by: Andrew Cooper Acked-by: Christian Lindig Reviewed-by: Anthony PERARD --- CC: Wei Liu CC: Anthony PERARD CC: Juergen Gross CC: Christian Lindig CC: David Scott CC: Edwin Torok CC: Rob Hoes --- tools/include/xenctrl.h | 1 + tools/libs/ctrl/xc_version.c | 5 +++++ tools/libs/light/libxl.c | 5 +---- tools/ocaml/libs/xc/xenctrl_stubs.c | 19 ++++++++----------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index 279dc17d67d4..48dbf3eab75f 100644 --- a/tools/include/xenctrl.h +++ b/tools/include/xenctrl.h @@ -1610,6 +1610,7 @@ int xc_version(xc_interface *xch, int cmd, void *arg); */ char *xc_xenver_extraversion(xc_interface *xch); char *xc_xenver_capabilities(xc_interface *xch); +char *xc_xenver_changeset(xc_interface *xch); int xc_flask_op(xc_interface *xch, xen_flask_op_t *op); diff --git a/tools/libs/ctrl/xc_version.c b/tools/libs/ctrl/xc_version.c index 512302a393ea..9f2cae03dba8 100644 --- a/tools/libs/ctrl/xc_version.c +++ b/tools/libs/ctrl/xc_version.c @@ -161,3 +161,8 @@ char *xc_xenver_capabilities(xc_interface *xch) { return varbuf_simple_string(xch, XENVER_capabilities2); } + +char *xc_xenver_changeset(xc_interface *xch) +{ + return varbuf_simple_string(xch, XENVER_changeset2); +} diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c index 139e838d1407..80e763aba944 100644 --- a/tools/libs/light/libxl.c +++ b/tools/libs/light/libxl.c @@ -582,7 +582,6 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) GC_INIT(ctx); union { xen_compile_info_t xen_cc; - xen_changeset_info_t xen_chgset; xen_platform_parameters_t p_parms; xen_commandline_t xen_commandline; xen_build_id_t build_id; @@ -607,9 +606,7 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) info->compile_date = libxl__strdup(NOGC, u.xen_cc.compile_date); info->capabilities = xc_xenver_capabilities(ctx->xch); - - xc_version(ctx->xch, XENVER_changeset, &u.xen_chgset); - info->changeset = libxl__strdup(NOGC, u.xen_chgset); + info->changeset = xc_xenver_changeset(ctx->xch); xc_version(ctx->xch, XENVER_platform_parameters, &u.p_parms); info->virt_start = u.p_parms.virt_start; diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index 368f4727f0a0..291e92db7300 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -983,27 +983,24 @@ CAMLprim value stub_xc_version_compile_info(value xch) } -static value xc_version_single_string(value xch, int code, void *info) +CAMLprim value stub_xc_version_changeset(value xch) { CAMLparam1(xch); - int retval; + CAMLlocal1(result); + char *changeset; caml_enter_blocking_section(); - retval = xc_version(_H(xch), code, info); + retval = xc_xenver_changeset(_H(xch)); caml_leave_blocking_section(); - if (retval) + if (!changeset) failwith_xc(_H(xch)); - CAMLreturn(caml_copy_string((char *)info)); -} + result = caml_copy_string(changeset); + free(changeset); -CAMLprim value stub_xc_version_changeset(value xch) -{ - xen_changeset_info_t ci; - - return xc_version_single_string(xch, XENVER_changeset, &ci); + CAMLreturn(result); } From patchwork Tue Jan 17 13:53:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13104698 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 9921EC678D7 for ; Tue, 17 Jan 2023 13:54:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.479422.743281 (Exim 4.92) (envelope-from ) id 1pHmPn-00012g-AO; Tue, 17 Jan 2023 13:54:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 479422.743281; Tue, 17 Jan 2023 13:54:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHmPn-00012Q-5s; Tue, 17 Jan 2023 13:54:15 +0000 Received: by outflank-mailman (input) for mailman id 479422; Tue, 17 Jan 2023 13:54:14 +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 1pHmPm-0000XC-53 for xen-devel@lists.xenproject.org; Tue, 17 Jan 2023 13:54:14 +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 6c6af839-966e-11ed-91b6-6bf2151ebd3b; Tue, 17 Jan 2023 14:54:13 +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: 6c6af839-966e-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1673963652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=UeCGU2douQiNkU5ETGdTRi7QCglzQpQvZz38J5a3SzA=; b=WyBH/eqlxAibQyesBemv9euhIM+u2eaOWQke3FQWib9UqTpEEKcOiJ+2 nGX2KMj82GPVxFtI/Bs2kgwuMtFt2yrqx8woPl/Uu+TDLJjFqZK32yq3q +4Q7Gr8XsJPaI0bbPhhLQGM05iY+ifrf+U/H884IQNcdj+Uv0/CBEAk2s c=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 91898369 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:G9Nj6aLVmo4EyW5yFE+RqZUlxSXFcZb7ZxGr2PjKsXjdYENS1TMDn 2dJWT2EO/aLNmGheI8iPoi+/EsDscfSyoQ3T1BlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHv+kUrWs1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPcwP9TlK6q4mhA5wVhPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5tGmNqp do4Bgtdf0yDpvqMxZ6kTMxz05FLwMnDZOvzu1llxDDdS/0nXYrCU+PB4towMDUY354UW6yEP oxANGQpNU6bC/FMEg5/5JYWteGknHTgNRZfr0qYv/Ef6GnP1g1hlrPqNbI5f/TbHJUEzh3G9 woq+UzbKDgBJuat2AOM63n9it7kjyrqVrs7QejQGvlC3wTImz175ActfUu2p7y1h1CzX/pbK lcI4Ww+oK4q7kupQ9LhGRqirxasoRo0S9dWVeog52mlyKXO5B2CLnMZVTMHY9sj3PLaXhRzi AXPxYmwQ2Uy7vvMEyn1GqqoQS2aIzMXCT8kRQE/HRpZ4/j7moQfkRTqUYM2eEKqteEZCQ0c0 hjT8ndl1u9J1ZFbv0mo1QuZ2mzx//AlWiZwv1yKBTz9s2uVcab/P+SVBU7nAeGsxWpzZn2Ip zA6lseX94ji5rndxXXWEI3h8FxEjstp0QEwYnY1RfHNDxz3pxaekXl4uVmS3ntBPMceYiPOa 0TOow5X75I7FCL0MvQnMt7pW5VznPOI+THZuhf8N4omX3SMXFXfoHEGibC4gggBb3TAYYlgY MzGIK5A/F4RCLh9zSreegvu+eZD+8zK/kuKHcqT503+gdKjiIu9Fe9t3K2mMrpos8tpYWz9r 75iCid9404OAL2kPHeJq9B7wJJjBSFTOK0aYvd/LoarSjeK0kl6Wpc9HZtJl1RZoplo IronPort-HdrOrdr: A9a23:Agn956ATYoxs0SPlHemo55DYdb4zR+YMi2TDgXoBLSC9E/b5qy nApp8mPHPP4gr5O0tApTnjAsa9qCjnhPtICOAqVN+ftW/d1VdAR7sN0WKN+VHd84KVzJ876U /NGZIOa+EZrDJB/KTH3DU= X-IronPort-AV: E=Sophos;i="5.97,224,1669093200"; d="scan'208";a="91898369" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , Anthony PERARD , Juergen Gross Subject: [PATCH 5/6] tools: Introduce a non-truncating xc_xenver_cmdline() Date: Tue, 17 Jan 2023 13:53:35 +0000 Message-ID: <20230117135336.11662-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230117135336.11662-1-andrew.cooper3@citrix.com> References: <20230117135336.11662-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Update libxl to match. No API/ABI change. Signed-off-by: Andrew Cooper Reviewed-by: Anthony PERARD --- CC: Wei Liu CC: Anthony PERARD CC: Juergen Gross --- tools/include/xenctrl.h | 1 + tools/libs/ctrl/xc_version.c | 5 +++++ tools/libs/light/libxl.c | 4 +--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index 48dbf3eab75f..fd80a509197d 100644 --- a/tools/include/xenctrl.h +++ b/tools/include/xenctrl.h @@ -1611,6 +1611,7 @@ int xc_version(xc_interface *xch, int cmd, void *arg); char *xc_xenver_extraversion(xc_interface *xch); char *xc_xenver_capabilities(xc_interface *xch); char *xc_xenver_changeset(xc_interface *xch); +char *xc_xenver_commandline(xc_interface *xch); int xc_flask_op(xc_interface *xch, xen_flask_op_t *op); diff --git a/tools/libs/ctrl/xc_version.c b/tools/libs/ctrl/xc_version.c index 9f2cae03dba8..02f6e9551b57 100644 --- a/tools/libs/ctrl/xc_version.c +++ b/tools/libs/ctrl/xc_version.c @@ -166,3 +166,8 @@ char *xc_xenver_changeset(xc_interface *xch) { return varbuf_simple_string(xch, XENVER_changeset2); } + +char *xc_xenver_commandline(xc_interface *xch) +{ + return varbuf_simple_string(xch, XENVER_commandline2); +} diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c index 80e763aba944..3f906a47148b 100644 --- a/tools/libs/light/libxl.c +++ b/tools/libs/light/libxl.c @@ -583,7 +583,6 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) union { xen_compile_info_t xen_cc; xen_platform_parameters_t p_parms; - xen_commandline_t xen_commandline; xen_build_id_t build_id; } u; long xen_version; @@ -613,8 +612,7 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) info->pagesize = xc_version(ctx->xch, XENVER_pagesize, NULL); - xc_version(ctx->xch, XENVER_commandline, &u.xen_commandline); - info->commandline = libxl__strdup(NOGC, u.xen_commandline); + info->commandline = xc_xenver_commandline(ctx->xch); u.build_id.len = sizeof(u) - sizeof(u.build_id); r = libxl__xc_version_wrap(gc, info, &u.build_id); From patchwork Tue Jan 17 13:53:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13104702 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 09810C63797 for ; Tue, 17 Jan 2023 13:54:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.479426.743313 (Exim 4.92) (envelope-from ) id 1pHmPq-0001sa-CQ; Tue, 17 Jan 2023 13:54:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 479426.743313; Tue, 17 Jan 2023 13:54:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHmPq-0001rO-7m; Tue, 17 Jan 2023 13:54:18 +0000 Received: by outflank-mailman (input) for mailman id 479426; Tue, 17 Jan 2023 13:54: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 1pHmPp-0000XC-0l for xen-devel@lists.xenproject.org; Tue, 17 Jan 2023 13:54: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 6d1a7f45-966e-11ed-91b6-6bf2151ebd3b; Tue, 17 Jan 2023 14:54:14 +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: 6d1a7f45-966e-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1673963654; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ZeZpvUYtzSln2z+je77HpdVO31fBudqozIWZgnYM4bM=; b=fyZo0hd8H4zT9vNvABqWnUP+qlDrMJBpinIK6YhrTbQPpb2EkRpUK2LU /uZW3sbC40/NXHm8HJz3koONVHv/5bWnjX2uJgcply1gQ1yC2WAy6Faa9 5G/eGdftyAeooAyNQwCjPmvMPWFcLoycTAkNGM3n+9Opr1u2/ANZflMI2 w=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 91898372 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:Jw6Dq6BIcP9mURVW/1Hjw5YqxClBgxIJ4kV8jS/XYbTApD4q3jBWz 2IaX2GDPfnZYjH8ed0iPI3j8kIHvJHUnNY2QQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nNHuCnYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbyRFtMpvlDs15K6p4GpB4QRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw4P11JTFo1 dIjeCFRbjGbveea37SeVbw57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP pdHL2M1N3wsYDUWUrsTILs4kP2lmT/UdDpApUjOjaE2/3LS3Ep6172F3N/9K4XaFJUOwRzwS mTu40X9LRoXMcalzSve0FG0vu/rhQzHYddHfFG/3qEz2wDCroAJMzUUWkG8uuKRkVOlVpRUL El80jojq+0++VKmSvH5XgakuziUsxgEQd1SHuYmrgaXxcL8/AKxFmUCCDlbZ7QbWNQeHGJwk AXTxpWwWGIp6efOIZ6AyluKhSmpOwxFC08sXn8VEQsk++PmjJ41qw2aG76PD5WJYs3J9SDYm m7V93lk3e1M3abnxI3gowmZ3mvESozhC1dsu16JBj/NAhZRPtbNWmC+1bTMAR+sxq69R0LJg nULktP2AAsmXcDUz3zlrAng8diUCxe53N702wQH82EJrWjFxpJaVdk4DMtCDEloKN0YXjTif VXevwhcjLcKYiTxPf4rO9LgUpVxpUQFKTgCfqmEBuein7ArLFPXlM2QTRP4M5/RfLgEzvhkZ MbznTeEBncGE6V3pAdatM9EuYLHMhsWnDuJLbiilkTP7FZrTCLNIVvzGAfUP79RAWLtiFm9z uuzwOPRmkUPCrOgPHOJmWPRRHhTRUUG6VnNg5Q/Xoa+zsBOQz5J5yP5qV/5R7FYog== IronPort-HdrOrdr: A9a23:uzWFFq3bOauASq+PY8E6YwqjBHQkLtp133Aq2lEZdPU0SKGlfq GV7ZAmPHrP4gr5N0tOpTntAse9qBDnhPtICOsqTNSftWDd0QPFEGgF1+rfKlXbcBEWndQtt5 uIHZIfNDXxZ2IK8PrS0U2DPPsLhPO818mT9IDjJ3UGd3AXV0m3hT0JdTpyESdNNXd77YJSLu v72iLezQDQA0j+aK6AdwA4t7iqnayyqHr+CyR2fCIa1A== X-IronPort-AV: E=Sophos;i="5.97,224,1669093200"; d="scan'208";a="91898372" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , Juergen Gross Subject: [PATCH 6/6] tools: Introduce a xc_xenver_buildid() wrapper Date: Tue, 17 Jan 2023 13:53:36 +0000 Message-ID: <20230117135336.11662-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230117135336.11662-1-andrew.cooper3@citrix.com> References: <20230117135336.11662-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 ... which converts binary content to hex automatically. Update libxl to match. No API/ABI change. This removes a latent bug for cases when the buildid is longer than 4092 bytes. Signed-off-by: Andrew Cooper Reviewed-by: Anthony PERARD --- CC: Wei Liu CC: Anthony PERARD CC: Juergen Gross --- tools/include/xenctrl.h | 1 + tools/libs/ctrl/xc_version.c | 33 +++++++++++++++++++++++++++++++++ tools/libs/light/libxl.c | 44 +------------------------------------------- 3 files changed, 35 insertions(+), 43 deletions(-) diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index fd80a509197d..48296930b892 100644 --- a/tools/include/xenctrl.h +++ b/tools/include/xenctrl.h @@ -1612,6 +1612,7 @@ char *xc_xenver_extraversion(xc_interface *xch); char *xc_xenver_capabilities(xc_interface *xch); char *xc_xenver_changeset(xc_interface *xch); char *xc_xenver_commandline(xc_interface *xch); +char *xc_xenver_buildid(xc_interface *xch); int xc_flask_op(xc_interface *xch, xen_flask_op_t *op); diff --git a/tools/libs/ctrl/xc_version.c b/tools/libs/ctrl/xc_version.c index 02f6e9551b57..54d1b9296696 100644 --- a/tools/libs/ctrl/xc_version.c +++ b/tools/libs/ctrl/xc_version.c @@ -171,3 +171,36 @@ char *xc_xenver_commandline(xc_interface *xch) { return varbuf_simple_string(xch, XENVER_commandline2); } + +static void str2hex(char *dst, const unsigned char *src, size_t n) +{ + static const unsigned char hex[] = "0123456789abcdef"; + + for ( ; n; n-- ) + { + unsigned char c = *src++; + + *dst++ = hex[c >> 4]; + *dst++ = hex[c & 0xf]; + } +} + +char *xc_xenver_buildid(xc_interface *xch) +{ + xen_varbuf_t *hbuf = varbuf_op(xch, XENVER_build_id); + char *res; + + if ( !hbuf ) + return NULL; + + res = malloc((hbuf->len * 2) + 1); + if ( res ) + { + str2hex(res, hbuf->buf, hbuf->len); + res[hbuf->len * 2] = '\0'; + } + + xencall_free_buffer(xch->xcall, hbuf); + + return res; +} diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c index 3f906a47148b..5512f444aca2 100644 --- a/tools/libs/light/libxl.c +++ b/tools/libs/light/libxl.c @@ -545,38 +545,6 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr) return ret; } -static int libxl__xc_version_wrap(libxl__gc *gc, libxl_version_info *info, - xen_build_id_t *build) -{ - int r; - - r = xc_version(CTX->xch, XENVER_build_id, build); - switch (r) { - case -EPERM: - case -ENODATA: - case 0: - info->build_id = libxl__strdup(NOGC, ""); - break; - - case -ENOBUFS: - break; - - default: - if (r > 0) { - unsigned int i; - - info->build_id = libxl__zalloc(NOGC, (r * 2) + 1); - - for (i = 0; i < r ; i++) - snprintf(&info->build_id[i * 2], 3, "%02hhx", build->buf[i]); - - r = 0; - } - break; - } - return r; -} - const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) { GC_INIT(ctx); @@ -586,7 +554,6 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) xen_build_id_t build_id; } u; long xen_version; - int r; libxl_version_info *info = &ctx->version_info; if (info->xen_version_extra != NULL) @@ -613,17 +580,8 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) info->pagesize = xc_version(ctx->xch, XENVER_pagesize, NULL); info->commandline = xc_xenver_commandline(ctx->xch); + info->build_id = xc_xenver_buildid(ctx->xch); - u.build_id.len = sizeof(u) - sizeof(u.build_id); - r = libxl__xc_version_wrap(gc, info, &u.build_id); - if (r == -ENOBUFS) { - xen_build_id_t *build_id; - - build_id = libxl__zalloc(gc, info->pagesize); - build_id->len = info->pagesize - sizeof(*build_id); - r = libxl__xc_version_wrap(gc, info, build_id); - if (r) LOGEV(ERROR, r, "getting build_id"); - } out: GC_FREE; return info;