From patchwork Tue Mar 1 11:05:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12764624 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 51A04C433EF for ; Tue, 1 Mar 2022 11:06:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.281245.479491 (Exim 4.92) (envelope-from ) id 1nP0KH-0005sA-Pq; Tue, 01 Mar 2022 11:05:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 281245.479491; Tue, 01 Mar 2022 11:05:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nP0KH-0005s3-MR; Tue, 01 Mar 2022 11:05:53 +0000 Received: by outflank-mailman (input) for mailman id 281245; Tue, 01 Mar 2022 11:05:52 +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 1nP0KG-0005rB-DZ for xen-devel@lists.xenproject.org; Tue, 01 Mar 2022 11:05:52 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8e601d69-994f-11ec-8539-5f4723681683; Tue, 01 Mar 2022 12:05:51 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02lp2059.outbound.protection.outlook.com [104.47.4.59]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-23-bIPFnNKYN3uSy7cJjYTBhA-2; Tue, 01 Mar 2022 12:05:49 +0100 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by PAXPR04MB8095.eurprd04.prod.outlook.com (2603:10a6:102:1c6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26; Tue, 1 Mar 2022 11:05:49 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::d479:b728:345c:bd65]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::d479:b728:345c:bd65%6]) with mapi id 15.20.5017.027; Tue, 1 Mar 2022 11:05: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: 8e601d69-994f-11ec-8539-5f4723681683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1646132751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yVhh9raFqY1k1mmmz8RZiJfkzqL7jHEKprsJSfJ+qW8=; b=HLdOUkx+gebQi2TvLwqlywxBsKktvMc9Hv5XBYqScvWGUQ1Xxg8LlJ6feFTdd9yfucTuLL 7u0r93VUqP88e9Mfwtm8nX08mjHoIxgM1KVEUeZThtDP5gpRnC75NLjWfQfX814LE6XCln pL3JUez3K6cCvowuK+9IxH71toaBa+M= X-MC-Unique: bIPFnNKYN3uSy7cJjYTBhA-2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZRdmnOnjSJ2Uvo98Tm4jPYGnspuBqOptTwVzWy63A5oEvqHELWgEHrrBuhhH26TOBO5dYNO56E6XVoW1n+l4Ovkp93471Y7WgMtI2vlYfySZOk2oZiQSZtohFjNMvxZYUhXiTaGI9AeZ5EqQeowoAzhX5TAm8/eax3C0pq3QRPGULmBS2okUxcZD0/pFZjjCPUK54HnMkNF0ABwMqYsA4Gizai7yPoACVHYE2VpyCpwpsZXsAmlZn43Tg2EDeXgXhasKFQUl4x0J+HsKvSHLWHCpIuQC0HpTVdBf/Cu6cvubKZxMPEds8hlSWBbLmhIRWU5HsvUpJV8ULfQlsTwVDQ== 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=yVhh9raFqY1k1mmmz8RZiJfkzqL7jHEKprsJSfJ+qW8=; b=jWCBziFs9DYO4cOpBFWd56R5GdRyQDRW0Ktv1A7qpK25XnhBlHOPKPbo6GKtL0giyHF6jjVmKngksQnWxvS+mOY1ocbO7j39TKlihvpQDs23SKJkW3RAFAW/gJORS4iW4umlQ+MDLF5yEjBvGOYWks+VoOEhIODaOJTPCssLnIqt8WZP3p/2q+/PLG8wnnnDZa84KvMwk7CDmTN3WfAehU7b72mZorgSxwAN8RZb9WsqDj2CRxydXwx7y3Bsrp4tjx3xc+z8Bafkc43K5oj5tbvxMs41pKid5EN/Sdf2iPQ2ZGuGTHwIZEssPeBrJicOg46O7yaDlCOeIbbMS1dNSw== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Tue, 1 Mar 2022 12:05:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: [PATCH 1/2] x86/time: use fake read_tsc() Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <77675e7f-2a7e-f517-4aba-e20774c8bfe5@suse.com> In-Reply-To: <77675e7f-2a7e-f517-4aba-e20774c8bfe5@suse.com> X-ClientProxiedBy: AS9PR06CA0272.eurprd06.prod.outlook.com (2603:10a6:20b:45a::10) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 69dc9f71-5cd7-4d6d-2022-08d9fb73710f X-MS-TrafficTypeDiagnostic: PAXPR04MB8095:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uh62QAnIYPkzL7Nagz1kpvhoFB1YtFwNl/H03ifJNkxRi54G5YE+Z/Lz4UQSAAdg3qmemxbPx8QtScuMlB0fo0TVbCYw53JzrmDDnuVT2syHUvpRfEhYZ2zRWaYc4UmUgQfdChk2ZH/ZLxKO3ibbs11lKacIRSeI8cGR4aWnQxe4GaH10eT32tKqeIC1g7Zs46uD7oVLnz6aQI5FrcmOzDAG/xy4KzqKkCqZltDUWwhVvDbsmhTwz2Ha0sEza/TCa9l1OhpQd3rwl+cjUuNOCYqTdLdGdghsGbxfuLvNDV6dHy/v9b530EMP93CuvzXLoZla1DkViBpyDkTTZbQQbCY5rWpsEqHf5+6TdIAlyKgHV9kpKm/B2tPHA5/QXwaGrAv3ZysNMfTeiR5t8B0tr52RTOQ/UXbLNqgTlH65GAP9g5EErJAfhhcSaO1C+cAw2L9syWFOLWaP9OQxEwe/e76jo4NZIYS9FLqXV6S0/4ggPLqS0EVh6SU/O8A6LGAdTtLYNSt5SqJkovkPxIsOO5ZjHsAizp7u/7IavC0xs2XoI75OcOUXE/pUYNnFuGm28Roiyv3s0l/GoUvVkfX/KLVxYFwR6JW7ecP6WCexyybPtfSWY/Km9rj/ZuU8h6YVbZgUA5mWPMo4kGkDMEkTneRmTUfKlRtvz9sX/KwL7mID+nqpftaRvNnvcFAag9EPT2gswAJRKOE4U40D3uXJYjrYbBbiBoDGGpMeWiTT/Xk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(5660300002)(31696002)(86362001)(6512007)(66476007)(66556008)(8936002)(83380400001)(316002)(38100700002)(4326008)(6916009)(54906003)(66946007)(508600001)(6486002)(8676002)(2906002)(2616005)(186003)(31686004)(26005)(6506007)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9i4YwhWZRv/o4QJ61tklCaQW+5MC?= =?utf-8?q?SvOLVx2H9dU7HOqr69PFZOz6vtpD1Ky8+z/oV1wrkH6gId+KhPTYrvIWjp247eERd?= =?utf-8?q?t7wDrJNjbCocFZtdGJy1y3dhL9WSb0DnxeSKk1LvI+5fz9V+qD2f8/VaESQQ7qLdU?= =?utf-8?q?bUDbd/kfADxcx9sA/k6/PtTYZajta3zhXOunqAPMEfbZLG8MB0JhPa5DROxr27DJJ?= =?utf-8?q?6slhkv4+fezY8mpt6TuFKaw8wkgX0c/YlfdKgWviPrArYiYHSc41l0IaI24rVdEwW?= =?utf-8?q?IbAu+Sr9EujJChGEx5Zx2ySM8W8eX1f9ZVHPSynRzyGURZ3vyqgB8h2OT/Mhvayym?= =?utf-8?q?gEiz7M87ozwz9lZWeg6GAMkSkYXL58k5NUrywcRs8X5kvL3f3fXIMOseZFKULeBeU?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?= =?utf-8?q?0uJDYVHXUsG7+FidHw7bjrrewGtrm9tfhcztBrAibf8t+XBYWrI7dM76tvUx2n7SA?= =?utf-8?q?wqrliQkDyBTnGh6ozwoeaVcvDox5HTRr4+uAPKO/vJMT7IWqpFUkkecLDbqjxJleE?= =?utf-8?q?cu1obq5rgjCjY3Vrl40aghe2c6K9TN3FtLsIkFq5BAdJx1T4wu633E56hju/HiuxW?= =?utf-8?q?Jojz0LV+jmfBYcjQ0Viivi5yFr+nA0h56RaMvQkFgWtWzB+KrEHpURednCGOhQE0h?= =?utf-8?q?2lC4UWZvlY6/5V7k3U8AjGiwcM9WA+/j97Bp5H8YQ2tStU3oeKBZw4U=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69dc9f71-5cd7-4d6d-2022-08d9fb73710f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2022 11:05:48.7825 (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: CeUt1EXn8FJ9jcllL9zZFAqp9084DVoxGU2H/9W4iefjzdD4KnNnVp7T6BAKFeWZivSD9auPMGQE+xkmUzP0CA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8095 Go a step further than bed9ae54df44 ("x86/time: switch platform timer hooks to altcall") did and eliminate the "real" read_tsc() altogether: It's not used except in pointer comparisons, and hence it looks overall more safe to simply poison plt_tsc's read_counter hook. Signed-off-by: Jan Beulich --- I wasn't really sure whether it would be better to use simply void * for the type of the expression, resulting in an undesirable data -> function pointer conversion, but making it impossible to mistakenly try and call the (fake) function directly. --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -585,10 +585,12 @@ static s64 __init cf_check init_tsc(stru return ret; } -static uint64_t __init cf_check read_tsc(void) -{ - return rdtsc_ordered(); -} +/* + * plt_tsc's read_counter hook is (and should not be) invoked via the struct + * field. To avoid carrying an unused, indirectly reachable function, poison + * the field with an easily identifiable non-canonical pointer. + */ +#define read_tsc ((uint64_t(*)(void))0x75C75C75C75C75C0ul) static struct platform_timesource __initdata plt_tsc = { From patchwork Tue Mar 1 11:06:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12764625 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 9F05EC433EF for ; Tue, 1 Mar 2022 11:06:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.281253.479502 (Exim 4.92) (envelope-from ) id 1nP0L1-0006dG-3g; Tue, 01 Mar 2022 11:06:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 281253.479502; Tue, 01 Mar 2022 11:06:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nP0L1-0006d5-0T; Tue, 01 Mar 2022 11:06:39 +0000 Received: by outflank-mailman (input) for mailman id 281253; Tue, 01 Mar 2022 11:06:38 +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 1nP0L0-0006HM-4A for xen-devel@lists.xenproject.org; Tue, 01 Mar 2022 11:06:38 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a9c78dd7-994f-11ec-8eba-a37418f5ba1a; Tue, 01 Mar 2022 12:06:37 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2176.outbound.protection.outlook.com [104.47.17.176]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-30-64P3WOMhN2WodCFz9b4a_g-1; Tue, 01 Mar 2022 12:06:36 +0100 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by PAXPR04MB8095.eurprd04.prod.outlook.com (2603:10a6:102:1c6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26; Tue, 1 Mar 2022 11:06:35 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::d479:b728:345c:bd65]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::d479:b728:345c:bd65%6]) with mapi id 15.20.5017.027; Tue, 1 Mar 2022 11:06:35 +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: a9c78dd7-994f-11ec-8eba-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1646132797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Hcjv5yq81hzSD4vfgXUo4NPyGvjN63yGcHqxJqVJiY=; b=BbRJWy+XxuD5k03LhPXhyTru08aIU04K7RjO8+8nvvgy6Z0NhqeYaxFLsJbh2jKYvKYH10 +wATSF3+Omb6Lgg80+WME0Y7YcOB8CVquf5XdItemWVwWNNFBVS4tIg2Dg//LHcPs0N5Hx M/t/5/O/EpzazG1Wgu9AXYje52sQr0w= X-MC-Unique: 64P3WOMhN2WodCFz9b4a_g-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XoYDXQIh6HdPVxe+FEDuGpz8xMLiqZzSV6fkP+UPJ+Ok1/PTKfjN/ocImxVrNI9eImI0iPYxYfqs6V244N1FuhLmKvtBNjyfuFkBj+h5RzS9xl8tLwzyy5B6S+7PK3re+0aHd7zEayMDKbfLJr52h01abo1B7znC7bX0ZmASA4lD4aNGkC5IsLkUfhFcVhQokxVC1wQRkwUFzCEoWSQ1odXON4CbCjQ+W75FEC2fmDwMhgdSx9XajGOsddfWCyBs8d7yzCn6H8iZ/hl2f1DGk315+XoqQak7HmLfjCM2MKXesEdHEUq5R7Bba1XBUjaEgTSOW7Z64XvKstzP+cHUBA== 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=7Hcjv5yq81hzSD4vfgXUo4NPyGvjN63yGcHqxJqVJiY=; b=fuRvz87fIqhfNko060phsYx6S1OJVgl4BX08S8RPneS2gvQYhT+kGwL4C7RccNxdpYLfAqx9Xmpq3JjXMYmm5Zsm+svkIrnMlTDomYBOOoHu/Z1kgvav52AzenfHQXqf5MJpGtqIh0V8dryHw21PU7nVZiZn+9YydadRTJbvvVQoPJwyUD9+ss0h4nmp/DVxcXOlHv2Wa9hB0RmuUBIGbaPfZi2CxpkoCYdwaSoMh2k9Tb3+T1mWD3nFF6iVnMENCKVwkc6NIgNTpG2uy/K+SZIBxCs+qo3T7IhsPpdqLYzdX6edu50VxCJA/9J6JOEMrmf6hWMtpI0ZvOuxwbwGyQ== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <61bbf544-74ac-b698-425a-d1db80acab43@suse.com> Date: Tue, 1 Mar 2022 12:06:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: [PATCH 2/2] x86/time: add CF-clobber annotations Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <77675e7f-2a7e-f517-4aba-e20774c8bfe5@suse.com> In-Reply-To: <77675e7f-2a7e-f517-4aba-e20774c8bfe5@suse.com> X-ClientProxiedBy: AM6P194CA0024.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::37) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a595ae01-3f95-4936-90b3-08d9fb738cb0 X-MS-TrafficTypeDiagnostic: PAXPR04MB8095:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8bIr4f7BfXW8zS8WBQy9sw8bXKYzfv8zssvTh0yvT1fgJGd1E3Cup7RGVvXw7AbT+08WrthkGvPM1wFep+aUVrHLxsIvl7chNRB0VoP9cwVULDsh85O0kp0AXndLANayqgAj8l/O2R2PBgDDOg748SI+v8faBjkeGScduc/5npIY/T76Z/vXcxGSDFXj/Ok9oEmVNQXxTgMIWDHAM/9u95hOuauU5VmJE8NsI72MYb+ZZCneJWMoEiUhsnuaNqYnuuiZNHbDYf2OylwwDY5XFFBsxu49I2oY84jmx5hWdAO5Mez3q8eYVl218nTKOO2ZsZOvupd4DbyR/z8iWQn/b6q+JDBz17TOVrcD7gZB76ERIoSGrZGKCkq/gr7hFoub1AKatECC1gYXi0hSNZ1feOHA+0JUSyirkRpPbMKWxCO1C/E1hYsAztDO9QDG2uhAr7nvHKjXZ1gX7GNDyT4hAcr1Xy2CqSmZPVotuToo93kW5hk9+w3WA6hn2SGticOQSgMWwLV59GwVqgwzdjyvregSelagmH34ohEu6JhXM9tKKHW3zNeDeo6IhkE0NkUMvvntJxPlNsA54u8d6/pjOKJGOL9q09Gkeq9tnAJ8gbLVjpheNMq5zgQ2rNX337u6n/pzEXWV/RmaFzhFJiVtOqmvvuskY5naREh0Fy0+53sJk/jki4vqC/9aq7S9g3msUUpR8uefJkE7WH6s15dCGfbiGL+yFrs9kbGZnXifyWR7LJquD2XPtJjatkCekgwW X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(5660300002)(31696002)(86362001)(6512007)(66476007)(66556008)(8936002)(83380400001)(316002)(38100700002)(4326008)(6916009)(54906003)(66946007)(508600001)(6486002)(8676002)(2906002)(2616005)(186003)(31686004)(26005)(6506007)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kfipB2X4tCw25QjEAg7emuP2olK8?= =?utf-8?q?ovkXDVr5HjQahY+zUAIpA6/9h0fKujKqe59SBXUJNmImRteH2OhI/Zxzl+gPUnX+5?= =?utf-8?q?6GyMODx/LHRBcOC80T4M7984dvoLfb83C6rpWsJ3+o0cq9K+ZRtlTaLcwe4nuRbHx?= =?utf-8?q?hTDmgJZTdn8fOzFri/4j9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BtOSq7WNY/DHyp2+seuiytuKpqLjHas7wJOa?= =?utf-8?q?yd41BX8O1Db9ejfJUfkd3+vpNxKQkwugFcqXfBp09I8Z3SRUHXxYVdSSfiJ4IVW1O?= =?utf-8?q?yESnZGjxJMYc1jqrGkIggeVO7GOd8GGovCVkQJ5hfzvsfR6jDN5qe33EJAfW1fo5h?= =?utf-8?q?Z7ho80+Tb+nScUqd64vkiyOb186V8DGskiJWaAIdtNcNqI0n4ydkD98c3MXXauMMK?= =?utf-8?q?nMqVYLbX+4tKtodV9GHo/iPuCTYFew0eBy2Mq2+uRV/q/cSVstQe3jbyVm+dih1uh?= =?utf-8?q?BkPT0P8op0fCJ4WzKI2eyAzI8kudOmvueiA2fMgCGI2wn5BdDSsjcfmf5FIxKPt0E?= =?utf-8?q?xRuK7mYrW1+Ay6AO9TExVagJk2ZmYJPbwDMj88laBDJYJxROkjow0MEki2fUO43YN?= =?utf-8?q?YcZy8hMTh49tOYr4tNxcM1Apz7Dj1uwzKXuL6CBMqi0XUGAi6cnmLwJRCRzM4zoFF?= =?utf-8?q?kt9D0F8pwdq6XmdjZ4lD6/ZMuDIiqwU6uQmSpnVlc+8M/FT9lw2Gy5Q=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a595ae01-3f95-4936-90b3-08d9fb738cb0 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2022 11:06:35.1078 (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: pyRoRVU43jPHoeLfyRyqCSiFmtTG2dwJ+cSbAKveiE8YqwI7GAdfN7rTyp4qou2AcwMkYVpRdTlqDgtPtUdFbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8095 With bed9ae54df44 ("x86/time: switch platform timer hooks to altcall") in place we can further arrange for ENDBR removal from the functions no longer subject to indirect calls. Note that plt_tsc is left untouched, for not holding any pointer eligible for ENDBR removal. Signed-off-by: Jan Beulich --- I did consider converting most of the plt_* to const (plt_hpet and plt_pmtimer cannot be converted), but this would entail quite a few further changes. --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -375,7 +375,7 @@ static void cf_check resume_pit(struct p outb(0, PIT_CH2); /* MSB of count */ } -static struct platform_timesource __initdata plt_pit = +static struct platform_timesource __initdata_cf_clobber plt_pit = { .id = "pit", .name = "PIT", @@ -483,7 +483,7 @@ static void cf_check resume_hpet(struct hpet_resume(NULL); } -static struct platform_timesource __initdata plt_hpet = +static struct platform_timesource __initdata_cf_clobber plt_hpet = { .id = "hpet", .name = "HPET", @@ -528,7 +528,7 @@ static s64 __init cf_check init_pmtimer( return adjust_elapsed(rdtsc_ordered() - start, elapsed, target); } -static struct platform_timesource __initdata plt_pmtimer = +static struct platform_timesource __initdata_cf_clobber plt_pmtimer = { .id = "acpi", .name = "ACPI PM Timer", @@ -683,7 +683,7 @@ static void cf_check resume_xen_timer(st write_atomic(&xen_timer_last, 0); } -static struct platform_timesource __initdata plt_xen_timer = +static struct platform_timesource __initdata_cf_clobber plt_xen_timer = { .id = "xen", .name = "XEN PV CLOCK", @@ -780,7 +780,7 @@ static uint64_t cf_check read_hyperv_tim return hv_scale_tsc(tsc, scale, offset); } -static struct platform_timesource __initdata plt_hyperv_timer = +static struct platform_timesource __initdata_cf_clobber plt_hyperv_timer = { .id = "hyperv", .name = "HYPER-V REFERENCE TSC",