From patchwork Thu Aug 3 14:15:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13340174 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 B715EC04A94 for ; Thu, 3 Aug 2023 14:15:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.576416.902533 (Exim 4.92) (envelope-from ) id 1qRZ6r-00052x-ID; Thu, 03 Aug 2023 14:15:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 576416.902533; Thu, 03 Aug 2023 14:15:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qRZ6r-00052q-Dk; Thu, 03 Aug 2023 14:15:25 +0000 Received: by outflank-mailman (input) for mailman id 576416; Thu, 03 Aug 2023 14:15:24 +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 1qRZ6q-00052g-J1 for xen-devel@lists.xenproject.org; Thu, 03 Aug 2023 14:15:24 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20631.outbound.protection.outlook.com [2a01:111:f400:7e1a::631]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2f317f22-3208-11ee-b268-6b7b168915f2; Thu, 03 Aug 2023 16:15:23 +0200 (CEST) Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by DBBPR04MB7977.eurprd04.prod.outlook.com (2603:10a6:10:1ed::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Thu, 3 Aug 2023 14:15:21 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.046; Thu, 3 Aug 2023 14:15:21 +0000 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: 2f317f22-3208-11ee-b268-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aYlbFVuVqu4CUqRNH4M/OO/m8/CyOQ3+xBmCk5+DVAC8W3U1U/HVoXc6UuugRdZQfScu62pv0gy56vsOOiSrztUnBrO8jZRXkfpq+UEEJOsxABCLwcU0plM8H7k+pPvSB/5NRUjCtG4KyZGiuQr/WEK0gVMZQSYTAUpi765RfgdFIab7S6iXhNfux9lJGDHmmGU7JaDPbsjhe7EQVd4XxUOmgR5pMy9LomANFWcQQhz82sbt88ICA0SscvpNygkrGT3ymBMfERSu88KDHIxMX0oJYx5bkzf8q2NaQX5jt0NgOP9DSE2jeZMHSM5SMBJgLt8MJGu2VTRDzggV3sgKcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pW0Q7b7mAbaCsN9ic44XlYuE60szaE3+3cpssf/B9Jw=; b=QTzN53d7Le6uhlStV/QGQCSzuAJU3cAjqTYctgC1IdCRJvoIKDQJDn0wC6VRY3tt4h7sVvhjaC7j+ht0KBCmbLG401/gbbkl1L3hUjnoZLcwfbs5wzGauVuWQLUi33YdixWkIhdnRjSNEUtEDoo9HzfwmZNZZe+wZcaMWNWrPiHUQrWY1PT/lY+ghPKwhrxqzTuSblz43nKskAl0n6zpsB9wab4yfcr1TZanbj1SKw1mm46KvnS8Y9Dd2j2vfykwo4t6vk3n3B/ONgsbt8NZ9ldMMF2Jj0In1VKfcaAYxLjg4gUlTOix0GgFFh02TYHoPh/ro/3KK0wBBKgaCXQ7kQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pW0Q7b7mAbaCsN9ic44XlYuE60szaE3+3cpssf/B9Jw=; b=aICgwONFGMdantSZIeV5fBJDuPRAEavYjrmCVm0Syc93dawV/nJhliYZol/tfV8FkhsI1w88OzaazycSt06UVHnDzUVorDT/f0mV0QCiAEdMNChCgbwFQTRAZbVK4ARwyHHb1U+W16zSKGDidEpqMtaVxZAelkuDH5YfcENCohqYtFOqRDFFNqAFUIyPOtLlwF2zgMlHIoLxlToxm8gh9scvjZx8foIsk1WJho0YGjuQK/StWGyNxdMLLrug/G9Kv+s4CDPtWVSrU6ggU8tFp1Pusb97cOC5/hTgf3du7XAhMIgxpnngiyzaN4rM5YETwvY7MU4N4W8YL1Y0ElH2hg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <550a2b3d-ed15-6035-623d-8725edb40b2d@suse.com> Date: Thu, 3 Aug 2023 16:15:19 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: [PATCH 2/2] libxl: allow building with old gcc again Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Anthony Perard , Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Juergen Gross References: <226f087d-34b1-1a27-4048-f9c6ce3d2d76@suse.com> In-Reply-To: <226f087d-34b1-1a27-4048-f9c6ce3d2d76@suse.com> X-ClientProxiedBy: FR0P281CA0204.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ad::13) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7977:EE_ X-MS-Office365-Filtering-Correlation-Id: dccf5f94-90d6-4614-da5d-08db942c126f X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b53N3KypiyzVIIKvaO3W/pOoLO1+hezA1tgpkg56YQZkgxEXJOfVCAq3tOEAHjiobOM2W2iN3bYj3dxtxe85+agKDbXiXjgaOynXzaDDrer/iv91F52DJjBVcgr7kc9D4pN3OxrYlZRZIrV5CrbVb8fqVKEnNkYpCdNo4yakZ8WM7Uiz6W4dirWaLFX0UPW1aOF8wSLZ0fls0tzT7EQ+BgD7Tc6B7MOscGJhy1OI/iPnf21IQqaSBkWc5LZTdnhQjc7ZCGpZXwmfhhFCNMnhY0mJEqBRgbZr/TngfX8JzfFHke+IxGgI/7gTjkfU0gF0Zoau0DvaGFrvdIskQFNhVD6+2m49dR/TXESC0+19DN6daWWkxrgtgmKw+gPz5JZ+D0iCgwqeyrkmTmyTSRqUyNEimPXQ92p4RwAlmvmZzDDX/NdQSVv/d+olWFUduRJRPFYjs44mZr+jZA7e6dkMTMi81MERX5NxOSNnKPA/nHtlQoaINOK2DO4zt9Rw63Y9opUV0LrfTJtVnllJb2qI9NAtfJmGbh65+N5ZzkwO+wI2CqDvsKvMvrq7v6k6+JTxBdCQ+0hNtkWJhA13e4s2BGpE1DJ8Rr2DdFpH3/GdDmh3LHiM6aVigEkYk9nmUwL4D82e8McdFy/NCcc9yqvCHw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(136003)(39860400002)(346002)(366004)(451199021)(54906003)(6506007)(107886003)(26005)(478600001)(2616005)(6486002)(36756003)(4326008)(66946007)(186003)(38100700002)(316002)(6916009)(66556008)(41300700001)(66476007)(86362001)(31686004)(6512007)(31696002)(5660300002)(8676002)(8936002)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?fVMLCh/E32gP2Xj8SFNIla4zOlKu?= =?utf-8?q?2MNVE8ZIKfAkxObBGBquXEHPdLUU6lE1SqAn60GhRKUe8z5724EyJr0mKGupA+9yy?= =?utf-8?q?zdNmlGYFCUjNgr0XNfD6CK8pJcANxT4SXbOg8p4grxCPEMbxNrzmTZc4tuA3zXg2v?= =?utf-8?q?36mxKySRD2mT4LzgmpnEdI84TsXEDCx89iwm34KpFilmggrHRb2srL3C0YA0k3hzl?= =?utf-8?q?sXWF0SkQMectoQBYGJc1p/hFOPH2f8iVPaN6m87/izpHy3Ffax+Ds6D1NHWJlVxaN?= =?utf-8?q?sq9Iyo79fA6aRANcoYet2okWBl/wA2bEwHyZPDq9uaRiSHdDALm/NuZUai2LS53/I?= =?utf-8?q?h8wg6ilQxSHqZXEa9fdg0pghi8hrC2g2FNLB96W2BsZMl6QuUkwWMKTiYvhldY6PG?= =?utf-8?q?JDAXKuxND1qHWOp4rXqUTh0dHBGfIYTY0xQfW/gvZqtIp2MN1srdFA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l5jEiFyOKt6W1?= =?utf-8?q?BFAT85H9HiAbRos5Z5uR+t/5F9HrlrH9KlRTuCJKJMKypAsThwwtgdNhlX32TOlM5?= =?utf-8?q?Uq8e3ZCdDqdds2jbSm2czOv2cG9d6yQBX7i0LIe3O3xe5NU/U6o+O4IDGAmsXrrqe?= =?utf-8?q?epqnpZfMUDoL+HSWKR96oDdOi59xmJk1MNbLLzGCavCgUT46UFCH+oy5LzuqBG1jV?= =?utf-8?q?9xrOI86K29he?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: dccf5f94-90d6-4614-da5d-08db942c126f X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2023 14:15:21.3130 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EV+FjhvzJJUKVVvV8Lpra1Qe0K03d7BqNc7GINrr2iwshgW7czoNxyDasuOo6w9gm+tBQMvcp3mvE3U4hPiw3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7977 We can't use initializers of unnamed struct/union members just yet. Fixes: d638fe233cb3 ("libxl: use the cpuid feature names from cpufeatureset.h") Signed-off-by: Jan Beulich --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -316,12 +316,16 @@ int libxl_cpuid_parse_config(libxl_cpuid uint32_t index; unsigned int reg; } msr; - }; + } u; } feature_to_policy[] = { #define CPUID_ENTRY(l, s, r) \ - { .type = FEAT_CPUID, .cpuid.leaf = l, .cpuid.subleaf = s, .cpuid.reg = r } + { .type = FEAT_CPUID, \ + .u = { .cpuid.leaf = l, .cpuid.subleaf = s, .cpuid.reg = r } \ + } #define MSR_ENTRY(i, r) \ - { .type = FEAT_MSR, .msr.index = i, .msr.reg = r } + { .type = FEAT_MSR, \ + .u = { .msr.index = i, .msr.reg = r } \ + } CPUID_ENTRY(0x00000001, NA, CPUID_REG_EDX), CPUID_ENTRY(0x00000001, NA, CPUID_REG_ECX), CPUID_ENTRY(0x80000001, NA, CPUID_REG_EDX), @@ -380,9 +384,9 @@ int libxl_cpuid_parse_config(libxl_cpuid struct cpuid_flags f; f.name = feat->name; - f.leaf = feature_to_policy[feat->bit / 32].cpuid.leaf; - f.subleaf = feature_to_policy[feat->bit / 32].cpuid.subleaf; - f.reg = feature_to_policy[feat->bit / 32].cpuid.reg; + f.leaf = feature_to_policy[feat->bit / 32].u.cpuid.leaf; + f.subleaf = feature_to_policy[feat->bit / 32].u.cpuid.subleaf; + f.reg = feature_to_policy[feat->bit / 32].u.cpuid.reg; f.bit = feat->bit % 32; f.length = 1; @@ -393,10 +397,10 @@ int libxl_cpuid_parse_config(libxl_cpuid { unsigned int bit = feat->bit % 32; - if (feature_to_policy[feat->bit / 32].msr.reg == CPUID_REG_EDX) + if (feature_to_policy[feat->bit / 32].u.msr.reg == CPUID_REG_EDX) bit += 32; - return msr_add(policy, feature_to_policy[feat->bit / 32].msr.index, + return msr_add(policy, feature_to_policy[feat->bit / 32].u.msr.index, bit, val); } }