From patchwork Wed Sep 13 07:31:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13382538 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 A3D74CA5502 for ; Wed, 13 Sep 2023 07:32:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.601001.936883 (Exim 4.92) (envelope-from ) id 1qgKM2-0000sW-AW; Wed, 13 Sep 2023 07:32:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 601001.936883; Wed, 13 Sep 2023 07:32:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qgKM2-0000sP-7s; Wed, 13 Sep 2023 07:32:06 +0000 Received: by outflank-mailman (input) for mailman id 601001; Wed, 13 Sep 2023 07:32:05 +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 1qgKM1-0000sJ-01 for xen-devel@lists.xenproject.org; Wed, 13 Sep 2023 07:32:05 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2061a.outbound.protection.outlook.com [2a01:111:f400:7d00::61a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a1ce4891-5207-11ee-9b0d-b553b5be7939; Wed, 13 Sep 2023 09:32:03 +0200 (CEST) Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by AS8PR04MB8756.eurprd04.prod.outlook.com (2603:10a6:20b:42f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.19; Wed, 13 Sep 2023 07:32:00 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654%6]) with mapi id 15.20.6792.019; Wed, 13 Sep 2023 07:32:00 +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: a1ce4891-5207-11ee-9b0d-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ai58XmAK60Y5crv7Ldek21LSTLBC8ox+o8jfZ2UVCYs3EwpUJJ2utQpdnEi2iamDOCBtt6dpZAiR0zqcLJg0xyKL+hxJlGCWBUHo7r6j7OyeT8613LplL+kLtjFH5ln1UvKpiX6E9kEmDPmb38xlOokFyzmep2xYayWbAUs6ny8L0OwBHvnxfPKOQwDaD0T7vhqR3csunTnrBKnOWBz6MT9+7DRSNrKQWD2Uj26yYnlXI5erl3o4iOoLQZskusQUyhz1cs541XUJhC/ZHLW8JSTmsc8rHxHB5kMidMNXS0GJuMtip08dTkBoJDr2BXZ4L3vzSIHlj4PHP3I5TEesUA== 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=/tiHzTrYqqG3aaqu9LsDUaxhtnU6xcOEZaIY6SzhcLI=; b=FhPMdOY4X1s6Bnxs3Fck3sBfWlHwiT7VtpXs0NqFSFgDTuR/9+MRFsc61iUp+flPX5G1afSUGHx5/m8aTqO7HXmS5xM5do+7KPd9QqJ0vCJvkAG4MRfH61gOEBshD2WMpCwWOdpXGsDYoFomZ6tjAEzl57hScA2zg0wX5mIdlR7IfVCeMS/thKdc9pAYq2XApsjn3t/bfLYvcd3YKZXnvCsxEhQ8dlhqXpujWHRoNABcMSIYJrBZDoEFvzfTVIqDGCLF7JEPtjnTk2UNvcBY7RKluNboi5r+ft2v77H2Ya3MdEAO/jCfmaFo7KIFZgmiojWg5/WfZc+nA5lql0z6MA== 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=/tiHzTrYqqG3aaqu9LsDUaxhtnU6xcOEZaIY6SzhcLI=; b=Qy/YmyjNbU3Zbw5NeNJDb972AHKole3yVHqN7uoAJFCQtBTm8CJir1lyL8SdhSdGQxPSDqjamv4jsBk1fZtFB43D+3hAXUwWfE7VNoMG7EETRz/u97dTYwAwfF8lBdMbDye3YrKJjzW5dYeagLUwIEvcONZaoH1mk5v3kB07stJgVh3t8mK3KG7kT8RaCVxCCFki8+TYcR5iWYqhELhvILpIqZdjh7XG49csZYNGUHtoXR+0XeZlmTPDIcnsHu8vls8vHt3p7cqkThQpH5KFUrScyxRuQ67SwXuP3rwzCfFvFE0CX31t4AyohdsFayqkMoC72NpgBQv84Q2Yb6b7GQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Wed, 13 Sep 2023 09:31:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu From: Jan Beulich Subject: [PATCH] timer: fix NR_CPUS=1 build with gcc13 X-ClientProxiedBy: FRYP281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::14) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8756:EE_ X-MS-Office365-Filtering-Correlation-Id: 19b146e7-f195-4b6d-55c2-08dbb42b8468 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0umaN6X0wUYLlXTbF3J0l/HaCUKRzcC4NOvHa0/XcWHYHZJOlrzg7vZSA2yRILDUtNFHkXzjRXV8pqDLKVnBAHhRe08am4wySNA3CX16RaZJft8+ybgJFZBZvpTyh9O7tpPunz1dG2E1SF5QHDfnVa9n0k85IXzWLfNPEK/PTUBlOrxR0epAzWJuAxaGBD+dyCqcd232jX2X7zUCfJF9B3lBRoQLtGHjXISIpSbZpS74YeA/l75LFfqeMk/SGXfl6bXJRhUkQXSWq5JbjSzSL+tgvn7LsUd+46/ERIYzp78M5UWvJBAV9DmSRIfw/87NZRK8bCsveK92GkpSwewu2IIlW30cHp9/OufH30RRuXQZMQo+gI3rS3YR7p2vmqVzga7hyTVROjKFYeYM5CbRnYBJdlx94yzVCFjk59H2fTcN7+6vfqWZ0Tk7zI50bwGvZWe6m0DapNSKpSbbimasaU4gEyZwtaRCZs3vswP28gGCbvRPND1b1H56zcnsSDxUWXJhFmH5OT7GP2wP5y4yHZG57I+HawFMUeDPga75MTFTi0Q/f/cERyooKusyYEoiNJi9T9x/ieWfQhH3UwOFQTqvf4LFiL2Jby7YCaVrY6sKssBghqCf8Ed6VzbeRIxKKUMgX33E7GCKhGLWdvcBZQ== 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:(13230031)(366004)(346002)(376002)(136003)(396003)(39860400002)(451199024)(1800799009)(186009)(31686004)(6506007)(6486002)(6666004)(478600001)(38100700002)(2906002)(4744005)(83380400001)(6512007)(2616005)(26005)(36756003)(86362001)(31696002)(66476007)(54906003)(66556008)(66946007)(316002)(6916009)(41300700001)(8676002)(4326008)(8936002)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6U5ULLkyZQ6/T9ukKQRWZ5ly6k5x?= =?utf-8?q?kymCQQGGG49o23Mzt0rHCMMBEhbbNrkzDsIPqUfOhmDPMZGuHu9KMCoMsp2QfZevB?= =?utf-8?q?vkQeKcbcVcTBWqQOUsD5XD7n233H4IG0cRUnyTb9cOx+eNfvjvwMCQl+RuvRy4Cu8?= =?utf-8?q?2kXgqpBSzwaaJvUI4GL0twXVqrBczpYOG/g1LvJLDBUDV8zfw0QGhDs6AMRNsfENg?= =?utf-8?q?wEgXrvkcO93F06uQ1uOChhBXK4lkg+FVFjrOrmBDGranX9EeNk9VvZ6GyiBSQrVM7?= =?utf-8?q?uNiByRqlsdaY88BruvVieGNVdMiQ4Czt/66KVY49Qg+7XYCwHM8HNkbuyqXNoFfZ/?= =?utf-8?q?Gi2CZZyEDQEQLfrA9vW7E/G+UOJSIQPu/tOKJBMetrzqq6K7HsV9In/EcEydmOCRN?= =?utf-8?q?aJbhIkDQgrNODj+m+7Rfegqe4I0T2dI23UghVzWH9t7QKkQx9i9g0vNtEddCMvDIq?= =?utf-8?q?B63BvebbX6TCE+rI1tCP5dxM4HTXPhPAn3trtOIihe/Z+ZgZ6EBneAnzWGYzJ50f3?= =?utf-8?q?dnvbDiOtO39IqszamHG+8jJ5Cj1JG1+CqUPMEEg84C/XsnJwvCP1dOO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=?utf-8?q?nraWlOtSviLOvR/ngr+To3GEmwsP5c9VIBvKZilxAV0amn8lGFv7iiNiSoD07IL+l?= =?utf-8?q?l2wy6h/8Q0V+?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19b146e7-f195-4b6d-55c2-08dbb42b8468 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2023 07:32:00.2497 (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: A+kXmMOltB2lqD+stXgOPER9QI2vc7zaqVcX1NsEn0bAzG3VNoAHdhfVH6y66dDbLIfLq7YxysOmbIs1NRig8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8756 Gcc13 apparently infers from "if ( old_cpu < new_cpu )" that "new_cpu" is >= 1, and then (on x86) complains about "per_cpu(timers, new_cpu)" exceeding __per_cpu_offset[]'s bounds (being an array of 1 in such a configuration). Make the code conditional upon there being at least 2 CPUs configured (otherwise there simply is nothing to migrate [to]). Signed-off-by: Jan Beulich --- a/xen/common/timer.c +++ b/xen/common/timer.c @@ -356,6 +356,7 @@ bool timer_expires_before(struct timer * void migrate_timer(struct timer *timer, unsigned int new_cpu) { +#if CONFIG_NR_CPUS > 1 unsigned int old_cpu; bool_t active; unsigned long flags; @@ -404,6 +405,7 @@ void migrate_timer(struct timer *timer, spin_unlock(&per_cpu(timers, old_cpu).lock); spin_unlock_irqrestore(&per_cpu(timers, new_cpu).lock, flags); +#endif /* CONFIG_NR_CPUS > 1 */ }