From patchwork Mon Aug 21 20:27:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9913693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 99B32602A0 for ; Mon, 21 Aug 2017 20:30:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BF9327FC0 for ; Mon, 21 Aug 2017 20:30:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80AFD287F4; Mon, 21 Aug 2017 20:30:56 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 16D8628582 for ; Mon, 21 Aug 2017 20:30:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djtJj-0003i8-Oc; Mon, 21 Aug 2017 20:28:59 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djtJi-0003ha-Bo for xen-devel@lists.xen.org; Mon, 21 Aug 2017 20:28:58 +0000 Received: from [85.158.143.35] by server-5.bemta-6.messagelabs.com id 63/91-03368-9824B995; Mon, 21 Aug 2017 20:28:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1VSf0gTYRj2u7ttp+3knIavNvsxyCTSNCOSKMo wdRJUfwRWkDe9ttE2x92MhYWaWFqCRWnpQq1FoZbZLDWamPYD0swwLSsUIUmRsjQRYVrtdtPs ++vhe57nfZ4XXhJX5EtDSdZqYTkTY1BJ/YiI4yglsjDelhr9rWTz1luTdmInSnrxxIXtQ4cke pMm05om0c1/dknMBZT166AyFw35nke+JEHn4dD+gxAwoo+A42EROo/8SAVdgoGrsVEiEAo6He rejiABS+nNUF/VIxNwEL0C3v965zHgdBcOU8/bPZMCaTVUOu9jYsJaGHM1eQyU+7/ZPuH5B3o lfHxThAvYl06BbudZJIapYWaulRD1AfCqfMSDcRqgfWwMF71r4KmrHBeCgb6C4HdbsVQ0r4NW 1zevKAxedF8nRLwXRi7NykRDPwbXLlQhkciXwZmriSLeAPaW596po1Jw2lq9ojiYnJ2VitgMp cUVmCgakIDj9mXvPkqYu1OFRMIugQHnECF2SoOJPy6v45UcBhpt3owiGdyYKJNdROEVS7atWL JtNcJqUQTPcidYLjJ2U5SG02t1FiOjN0TGRG+JMrI8z2hZA6Pho9IzjQ7kPgUf92tBXfX7O1A IiamWUw1sRarCX5OZcVLH8LqjXJaB5TuQkiRVQO3aZUtVBHCslrUe0xvc97RAAylXBVF+Ak3x ZsbI67Ui1YliyanKhmmMHLI9msYUhCnTxIYGU7sFKS1IdVmmxUELt9mLwkIDKeSuppCbWc6ot /zPj6NgEqkCqcfCFLneZFnMG3dXwdxVYgrKhCoW5h8Vmovkq+9k9x0cfGBdw32IuHeqAcKjC/ bM9JxrSirs/+GzbH+1I+HTy5RnORpN+nxwV8/N1xn+nd/rSqPy4rZnl7bRif3qnG3q8Ij5T5K Nhb0/a3q1B2q/pCbHv00IdCS/XGUqPrxDOlxXYPjeFxKe1mccTWqem5/cd/e0OiEmLrGmXTms IngdE7Me53jmL5ktW46WAwAA X-Env-Sender: Volodymyr_Babchuk@epam.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1503347336!78767624!1 X-Originating-IP: [40.107.1.75] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 37797 invoked from network); 21 Aug 2017 20:28:56 -0000 Received: from mail-eopbgr10075.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.107.1.75) by server-9.tower-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 21 Aug 2017 20:28:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=EPAM.onmicrosoft.com; s=selector1-epam-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vx4R76utpNL13riiFISVEVAulaFkupIcAaAeWy52Bm8=; b=B93RPv9LIJTmb8egYrElK90oxBqPA1j8GWsOfwTQK/pHxCFYMpQTUR6OI2ZUSRYWHj52z1jEEuu6EWLWAk/oN7WCPQLj7b4ap9S6XczDOxlhuzSM/nRRV7ab5RJ39IIftnInkfVA6WVkfmIR9TzT8iY2FEWLcsqqqH1Ya8nAviM= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.58) by HE1PR0301MB2137.eurprd03.prod.outlook.com (2603:10a6:3:21::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Mon, 21 Aug 2017 20:28:52 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Mon, 21 Aug 2017 23:28:47 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Mon, 21 Aug 2017 23:27:47 +0300 Message-Id: <1503347275-13039-4-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503347275-13039-1-git-send-email-volodymyr_babchuk@epam.com> References: <1503347275-13039-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.58] X-ClientProxiedBy: VI1P189CA0014.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::27) To HE1PR0301MB2137.eurprd03.prod.outlook.com (2603:10a6:3:21::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06fb0e34-c499-47b1-1d76-08d4e8d33d97 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR0301MB2137; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2137; 3:5WuGyJKvZy9+onLx/UJ3RH+I4JfMxIwINhW988r/KwPvZehWiKEGPusJp8CtZByeJ0XG9BD3rjWXa3XTIq3WKpkzqUpzqxijo+YGgKkzedkbPdIRWjHRQYWsjdLUn+lEw8ICD6v1kTqqDDo2J7XectwT9Z3iah8wodI6B6zi6mr3azL0HseDLFhv8fBWHuOReHdWJclgbps0SbF0nbw1mUa0VgQ7AJ9dVNQ/bZNGFRKEhSyUZObpG0h+G4AGDN2Y; 25:O6EKi31ecNhs9iEkR1Rg9xG+lqUdWQqeZP/v+z/MrLg6I7wdaMxqF9bZhYbjBZ1/SoDiEX9rFuBdqyCx5KY1Y1i4I/rRziYe33NkeuJcp9BiGKPkJnOu9oaHSsAvBxx/yDWVHFzj8X1Emi1ub2OSx1XExsx4ry7oHFdfW6kecvSWIT2ruEcH6S7HtVAdKe2uHwLDlaHWZQcej98+HK6in0WNFp2oUpBIkjkbh5yHghoZ0dUAclSjkiFNO1jxKnjpxQRa3gTkzjj+dXfqTbJkCkNn9ockxJwj1Vedfw6FKcBYwfwHLHQAE4WAFRhd0ZpxA4DkvlHzEteH2p4NNjAA4w==; 31:zhnGvQ8cjUS2NgPgm0JXopSkULdT7VGMf17eFkA+SJ+/ymv71yq0oZASBMJzHnlpg1kI+kVGgS55E8Q8i0oAkMRacZ6GoWr1nLVr/JSPcJMXBjulU42rVgPH/q/4owfDWj+/B5BIfFTZpU7ocjei1fxEUXruDTGzmx9PhjC++OWh02h631vm7fP7VZBTDFHxOQKIWeaCFNLr7/lTa5nb6T5Npvyw0Wl7BKlk9owf/GI= X-MS-TrafficTypeDiagnostic: HE1PR0301MB2137: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2137; 20:B+4jEonoxozHt+Id30fj740IuKhQNuxb6wuA5W8I02XMgHHPwfp+dUMvpITAAgmqEDSA/h8N2aX5/bN1HOhvB7ShjdZsgpipkHmeVe+OYampXDtsx1lifn0p2KizwSt0wRFXhrnpWFCR+4z7GQueegS3PS3u1FH4DJ6w4F1DzepSwFAZp3X4SjQNo9XD2cJ7kxPLEoo/dt8eecyz70q7wJe3+1GpzmXApYUQTdFbETn5DY0CtslN2tRqeR1MFRTvcf09C2XyVrKe8TnfJQFVYNORaqc+27nUatHD8h+IypcS8EqIEFebj1Ok+LE1DGmXWt8d7I1cX1UzRC9EgybgmVhB//dCaCoymu7CqZb+vJ8kMhnfHYrCfDikoX2YCb0/UtrzJjrGt5YN5aEG1SOByFV3Be3DVchYO33uQCqZKMoJeNJSxmkxGUJOyJ/iLoKC1tb43I5c13ToY6ObGeKpPxqRUVL7VEpEJAVTyfIezqd28xRWHudbmOZadwHgOqu4; 4:tOPRVP2zPQqK7r8kMsR/nWUoWKF21Wh8NlHslJD+lWS0pM/dENuchPfd38p1dEjPdR0arVXWOciwv4s0HLTKgYKBY2kOebYldErP6ArUFIgAkwoKupC5oPrNhsMbu9wkGL2bcWsHQPUxdNAW0q8IiV9hLhD2htDuEhRztQdSBQB1BEpv/53HyzcQWnz1Jfycj1UCFyDqzNqmIuR9AYrFYUjCNF92/7X5VF7xuYEAtLDnxHTrNsG7aXKKcDE83CeGE4TRXlGQ0L17ruEId/SsMC9noRJ5SUw7/p6AOOBqSjY= X-Exchange-Antispam-Report-Test: UriScan:(4114951738403); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123560025)(20161123555025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0301MB2137; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0301MB2137; X-Forefront-PRVS: 040655413E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(189002)(199003)(86362001)(48376002)(7416002)(101416001)(5660300001)(47776003)(50226002)(122856001)(97736004)(81166006)(50986999)(81156014)(50466002)(8676002)(66066001)(33646002)(80792005)(8656003)(76176999)(2906002)(7350300001)(189998001)(6116002)(5003940100001)(42186005)(8666007)(6916009)(2950100002)(72206003)(106356001)(2361001)(54906002)(7736002)(105586002)(2351001)(53936002)(478600001)(68736007)(110136004)(4326008)(45080400002)(305945005)(36756003)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0301MB2137; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0301MB2137; 23:tx9BfEermc+Wirb2qTlABH4y+92wscWJofcIrr+?= =?us-ascii?Q?ExzxhtxpxGUkanXduvwPYp+QKN+Zv8LuPrINAcW45A4T7DiiEZGE6dT4JtAt?= =?us-ascii?Q?dqbTaigSwKh61yYOAcTmHy377dLePYNMX6xj4Wor2htIb6568lbo1ZrprYxJ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H3Vi20oEHuXJ097ErXdn4ZX4QrA4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2017 20:28:52.2951 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0301MB2137 Cc: "Edgar E . Iglesias" , Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v4 03/11] public: xen.h: add definitions for UUID handling X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Added type xen_uuid_t. This type represents UUID as an array of 16 bytes in big endian format. Added macro XEN_DEFINE_UUID that constructs UUID in the usual way: XEN_DEFINE_UUID(00112233, 4455, 6677, 8899, aabbccddeeff) will construct UUID 00112233-4455-6677-8899-aabbccddeeff presented as {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff} NB: This is compatible with Linux kernel and with libuuid, but it is not compatible with Microsoft, as they use mixed-endian encoding (some components are little-endian, some are big-endian). Signed-off-by: Volodymyr Babchuk --- xen/include/public/xen.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 2ac6b1e..d1a4765 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -930,6 +930,15 @@ __DEFINE_XEN_GUEST_HANDLE(uint16, uint16_t); __DEFINE_XEN_GUEST_HANDLE(uint32, uint32_t); __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t); +typedef uint8_t xen_uuid_t[16]; +#define XEN_DEFINE_UUID(a, b, c, d, e1, e2, e3, e4, e5, e6) \ + {((a) >> 24) & 0xFF, ((a) >> 16) & 0xFF, \ + ((a) >> 8) & 0xFF, ((a) >> 0) & 0xFF, \ + ((b) >> 8) & 0xFF, ((b) >> 0) & 0xFF, \ + ((c) >> 8) & 0xFF, ((c) >> 0) & 0xFF, \ + ((d) >> 8) & 0xFF, ((d) >> 0) & 0xFF, \ + e1, e2, e3, e4, e5, e6} + #endif /* !__ASSEMBLY__ */ /* Default definitions for macros used by domctl/sysctl. */