From patchwork Thu Mar 16 10:09:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13177303 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 CA55EC6FD1F for ; Thu, 16 Mar 2023 10:10:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.510471.788154 (Exim 4.92) (envelope-from ) id 1pckYU-0003xN-8C; Thu, 16 Mar 2023 10:09:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 510471.788154; Thu, 16 Mar 2023 10:09:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pckYU-0003xG-59; Thu, 16 Mar 2023 10:09:54 +0000 Received: by outflank-mailman (input) for mailman id 510471; Thu, 16 Mar 2023 10:09:53 +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 1pckYT-0003xA-KZ for xen-devel@lists.xenproject.org; Thu, 16 Mar 2023 10:09:53 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2062c.outbound.protection.outlook.com [2a01:111:f400:7d00::62c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b15e118e-c3e2-11ed-87f5-c1b5be75604c; Thu, 16 Mar 2023 11:09:52 +0100 (CET) Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by VE1PR04MB7471.eurprd04.prod.outlook.com (2603:10a6:800:1a7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.31; Thu, 16 Mar 2023 10:09:49 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::154e:166d:ec25:531b]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::154e:166d:ec25:531b%5]) with mapi id 15.20.6178.026; Thu, 16 Mar 2023 10:09:49 +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: b15e118e-c3e2-11ed-87f5-c1b5be75604c ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g3YezusTQ8bOl3QZd233UH7J2KKpJpKXTaTj1B0rvm/vSwhwI6AEpnxmrgn9bwLVbDFyIyz/SOdcmJVOfTx/dVLfjpv3/+L+4hAC4MZ2QqsEcgLVSmPvC1TUA6m+6Tx5AiPGrbvd+zDCvLrDb2SD9fBWasD488/he8cdUe5ITocCrfQD87Hk3l84dbEYvlM2iUhSynoBPWIpp8ePJgVX22UFpz54ftXVBZHOSNMPxv2kGNX+U9YHvP90emUjvJSBfbv6gUwxcdvN6veW1NJ4p96XL+QbqZOkeBA/AdMoa1kIGrLIlUn663Tj6w5aFcFPrDMwI+lH81uU4jKTsbCrFQ== 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=F61rJ1VJqnbVyOmO0Vewtq+N4fnWO8vW7lTHIHqvJKk=; b=DVPgBaA11qD6Nh3dJV1Aduavx6oNCDg7velrE4ENZ5MFPrfGnrdtitBkCFIWAvDWueaY5ORqqv/pS88pAQbvAzGEob5jLC5g+fiHeuUBVyoApk9tjHhcTd0j7mLGSV6C60nGsphwdxi0spRkF1+cK3qZ/SypbE0x2Uw9DDcX7sO/d1G3ca17NIxAMQPiLnCXn2su/yROrj6hkIqlwUVEci8CxC5PfCWScLupj4wck4QTEM1X5Oc7yioyaYkWikEBFV2/XvlxtLlBImzticNxlfymqL5I71GC6Ud0p+kgoa2EDpyi7QavKslH5Kj1hvl64jS7NCTuSfhQ/NCwvUay/A== 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=F61rJ1VJqnbVyOmO0Vewtq+N4fnWO8vW7lTHIHqvJKk=; b=RX9yOjXHCPia2n6YnKgfQfKiYMQlcSD1n6v9eKExt7stP6HWuQRHZBorfP30ST/ro98ZXFjXXHe0W5P1W3F18hJOVwRYGrlwC/yRQJJ9lVahq2SZm6IJXdQIgfUXqPkGhaLvXTmrDsnkx32yTVQWZ6hPpvYKnTGW9I/RviuL25beGJX+/XMEtGr4ByUKhrMmhOtzLSZ21qyPEXExH6nyjY6kc+tuEVwmagWM3OZTMm9tzR/w3CbPdvYrFUV9Za8xjai9ZQWf6RRZdfk/NDeVnXUzAts5xGigvjri7/jOVRCxcoTbueAR8H4B/P1YUh2DNe+SJoag4Rwnc0CFKrN2Jg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <4f605fa5-b763-bc8b-6bb0-b70e718eb585@suse.com> Date: Thu, 16 Mar 2023 11:09:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Oleksii Kurochko From: Jan Beulich Subject: [PATCH] x86: don't include processor.h from system.h X-ClientProxiedBy: FR3P281CA0014.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1d::7) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|VE1PR04MB7471:EE_ X-MS-Office365-Filtering-Correlation-Id: dbc07265-303e-4614-a58b-08db260693d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HnK2GoT6yHTz86JrN6s6kKEHCWme85NK0uh7JJ6CAdegHER3s4GbzfA9TD+K7Tf5GijNB2alpPCmrlzIst5oB+WM7kwxPIJzp1gpeHdB2QvVa74Fb/s9WW/T33jULqC6LEwPOE8oSZvkIKJxvrNn+HqS3wSxUjLQCOJ1NqeuvXQB5LejIZvhrLOdO4F0ZHmjbdk8YSqgCxlVyfp2KqnegzoeAgkYnhlnVek60SaDvSH0pNbDZq0Apqxh9Te7M2472i6nMCkOMIqRY0Lv9F0LGfuq2KUiK9+gCHj+X5BnwCahWduDYDJ1zc7zoiEr0qm8xu3h0qfz+GdrY762jJZ9h5mPow0uqqTynGLEESjd3k/ewDKLwGcJJ0MggnQGupjX12MNKdXffogKb/hqTyzUhrgxrt0wVQR/nxemIpD/r6/PsS+GqutJUivA1Hy9GfjtMSGC+BRxvljFj6Q/zEM4TqegubRmAUxJ+KwWy9z58xyjD8S6pcEjNV+EjdmQ1/IBpkeZLiIczvEePPFEpdDdVRH2pOWp56SWik4id8IwMNOoI1z6Bm6pgTkhb8wQRT4h1Mc62Kf1zVxmRv9MEZaHuCVHYvhuvxr5WT77EcxgTAMnbcX9t7g4uZSjqQRNeWhNvTklvzfMhXh3H3+5Lux4+INDm8vC0Cjt52k7EhXLO/xQu4fUABqHPryt0prvr5FSjr87J4wbk8kcajSQVjOZDjAFTLhTj7BsABhBfSHi97c= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(136003)(366004)(346002)(376002)(396003)(39850400004)(451199018)(38100700002)(31696002)(86362001)(36756003)(2906002)(4326008)(5660300002)(41300700001)(8936002)(6916009)(2616005)(26005)(6506007)(186003)(6512007)(316002)(54906003)(66476007)(66556008)(8676002)(66946007)(6666004)(6486002)(478600001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?RT0r1OGg4XLTTMk1V4zexe6FaDxD?= =?utf-8?q?LlAwD+A2ZcuKMTNCi82wBE7Jd8TpVAbetfsbu3V36iHpa+Ktf85w0rwLMmkWw9qGd?= =?utf-8?q?HEPrwq4yvAhHrdvPhBol4waLNTTMntomdlgUayCnKyKIc/k0eekDH5KUEMWuryBFK?= =?utf-8?q?5rVBlNhL4mEqYhPRF0mPZDyL/t5zZMdpxXSSsHxNQfd32tJZaYfo/unNVF6QqnDij?= =?utf-8?q?mXIqZ4uNmP6BHZ9mW8q7EmRM2wtlFbw/vNXD8qijShGv8iXex0Gl5UjbYXoDcvq6S?= =?utf-8?q?IP8hA1jSXcGRwU7Tf2YszCPv6Tkwqm/g4+RvvQxJ+3K2gRG7gpXGwDrQLzfp/TsYk?= =?utf-8?q?d37K18+MTWtPQeJ/RsEnv3HRE+k3X9Kf8DI50GjEYdV0b46Nno9vEe0Gc3J9Y8AMm?= =?utf-8?q?Qps/GCAg0+J+5ElpgGgNt2NOnZq/eLdhUgmyoXpe+DkUtIPjTq1OPgoRHyRrhlBTx?= =?utf-8?q?3Gw3DoBxzIr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K8sykd3PqPg5CQsBP3EQ7fTAgXPYhUDyw0IyB9z8/U6Ljs6SSwwndJ?= =?utf-8?q?+mY7o+do2Ys/1a6cxLjYh0jLY1RNlTGmnODjeHDWCHzU7LkiOkWsLU2+JdDQMBUgb?= =?utf-8?q?RH9TpEiX0kFxuOaImQDkbhepLDD03yTy3YqEiHm0hQwGsbG94oN8mT2xZDLEc0gJB?= =?utf-8?q?YrPRA2HLeFMn?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbc07265-303e-4614-a58b-08db260693d3 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2023 10:09:49.5931 (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: NNQl43WX5gMU56uCYlsQEAY8LsOzBm4338VpHrSoXCHQvsz1d9nRMoLOC8ZWysyqHqyjizUpYvhbnnr33wWIjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7471 processor.h in particular pulls in xen/smp.h, which is overly heavy for a supposedly pretty fundamental header like system.h. To keep things building, move the declarations of struct cpuinfo_x86 and boot_cpu_data to asm/cpufeature.h (which arguably also is where they belong). In the course of the move switch away from using fixed-width types and convert plain "int" to "unsigned int" for the two x86_cache_* fields. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- a/xen/arch/x86/include/asm/cpufeature.h +++ b/xen/arch/x86/include/asm/cpufeature.h @@ -19,6 +19,30 @@ #ifndef __ASSEMBLY__ #include +struct cpuinfo_x86 { + unsigned char x86; /* CPU family */ + unsigned char x86_vendor; /* CPU vendor */ + unsigned char x86_model; + unsigned char x86_mask; + int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */ + unsigned int extended_cpuid_level; /* Maximum supported CPUID extended level */ + unsigned int x86_capability[NCAPINTS]; + char x86_vendor_id[16]; + char x86_model_id[64]; + unsigned int x86_cache_size; /* in KB - valid only when supported */ + unsigned int x86_cache_alignment; /* In bytes */ + unsigned int x86_max_cores; /* cpuid returned max cores value */ + unsigned int booted_cores; /* number of cores as seen by OS */ + unsigned int x86_num_siblings; /* cpuid logical cpus per chip value */ + unsigned int apicid; + unsigned int phys_proc_id; /* package ID of each logical CPU */ + unsigned int cpu_core_id; /* core ID of each logical CPU */ + unsigned int compute_unit_id; /* AMD compute unit ID of each logical CPU */ + unsigned short x86_clflush_size; +} __cacheline_aligned; + +extern struct cpuinfo_x86 boot_cpu_data; + #define cpu_has(c, bit) test_bit(bit, (c)->x86_capability) #define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability) --- a/xen/arch/x86/include/asm/processor.h +++ b/xen/arch/x86/include/asm/processor.h @@ -118,34 +118,6 @@ struct x86_cpu_id { const void *driver_data; }; -struct cpuinfo_x86 { - uint8_t x86; /* CPU family */ - uint8_t x86_vendor; /* CPU vendor */ - uint8_t x86_model; - uint8_t x86_mask; - int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */ - uint32_t extended_cpuid_level; /* Maximum supported CPUID extended level */ - unsigned int x86_capability[NCAPINTS]; - char x86_vendor_id[16]; - char x86_model_id[64]; - int x86_cache_size; /* in KB - valid for CPUS which support this call */ - int x86_cache_alignment; /* In bytes */ - uint32_t x86_max_cores; /* cpuid returned max cores value */ - uint32_t booted_cores; /* number of cores as seen by OS */ - uint32_t x86_num_siblings; /* cpuid logical cpus per chip value */ - uint32_t apicid; - uint32_t phys_proc_id; /* package ID of each logical CPU */ - uint32_t cpu_core_id; /* core ID of each logical CPU */ - uint32_t compute_unit_id; /* AMD compute unit ID of each logical CPU */ - unsigned short x86_clflush_size; -} __cacheline_aligned; - -/* - * capabilities of CPUs - */ - -extern struct cpuinfo_x86 boot_cpu_data; - extern struct cpuinfo_x86 cpu_data[]; #define current_cpu_data cpu_data[smp_processor_id()] --- a/xen/arch/x86/include/asm/system.h +++ b/xen/arch/x86/include/asm/system.h @@ -3,7 +3,8 @@ #include #include -#include +#include +#include static inline void wbinvd(void) {