From patchwork Tue Mar 1 11:36:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12764651 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 776EFC433F5 for ; Tue, 1 Mar 2022 11:36:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.281263.479513 (Exim 4.92) (envelope-from ) id 1nP0nf-0001qY-Kh; Tue, 01 Mar 2022 11:36:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 281263.479513; Tue, 01 Mar 2022 11:36:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nP0nf-0001qR-HK; Tue, 01 Mar 2022 11:36:15 +0000 Received: by outflank-mailman (input) for mailman id 281263; Tue, 01 Mar 2022 11:36:14 +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 1nP0ne-0001qL-8M for xen-devel@lists.xenproject.org; Tue, 01 Mar 2022 11:36:14 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id cbd7b545-9953-11ec-8539-5f4723681683; Tue, 01 Mar 2022 12:36:12 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2107.outbound.protection.outlook.com [104.47.17.107]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-20-mvBW0GLBNK2bXaF868IcLw-2; Tue, 01 Mar 2022 12:36:11 +0100 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by PR3PR04MB7356.eurprd04.prod.outlook.com (2603:10a6:102:8d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.25; Tue, 1 Mar 2022 11:36:10 +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:36:10 +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: cbd7b545-9953-11ec-8539-5f4723681683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1646134572; 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; bh=1CGuQnavDaQzxl8KQfCDTDU2TjGe6+yb2XeXhfdCsjI=; b=RxwI8dNwrcND+MjbPBnCnHH8qZBoeZ3B+bxeNHT3bUUI8kZc82Vj9Ymnd3EMhbmGOZAiqn ja/ilHw8hCClooNTURM0UcRVIFdK2BmhK4mAcImxZ79u15qJo3WPTZ1oR905JmyE34tDoA 5euntlp97WylkkwKWcu8wc+f0skA5l8= X-MC-Unique: mvBW0GLBNK2bXaF868IcLw-2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mzq7KSX76EZzT/aHLQyWd9FdkdzscqKe0mKOBFj60LCIJuxTcV9lM2o2VBmC+K6R60RNGcfL96KE7uwHsnRtcAsA3nk4GsttLpQcojB1BtLDz7uBuEGrBcqH5PPTZ3SLoAC9oKsI9KknBOs9WbZsBMfZE3a9IM6VwZPpM36RlqYb4n3wOCaxYDl+MuBfSq2iEa6SV3GstcsmtHto2kvk7oLHGfHb6XGFd4E0aMb0Fqofr2j31FFmGvYXlwZ4Vj7q2hA51k/b6jebM98uXcrnrPRGEsMzcs7zMeJq7Mjx1NGurdHRQeHo/Yv3fRINGX+NY7qehHobBf3H54Ww7YHcvQ== 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=1CGuQnavDaQzxl8KQfCDTDU2TjGe6+yb2XeXhfdCsjI=; b=c4vXLvOfnq5ne9vobrOCKSGq3Ddsf7S1hR67isvr6sCti+GYjlRv8d0IyDnzuk3CJO+mdIBdjSXUXCFNaIkTOW+VfGjUABKtoDzDjuUWVU2+Vv0sCCzRUSnDgHZ0u4CvrXBZKKOMlfQK3j0XA6g57MGFV0Yhk354j+kWZE37uwUKBIS/XjlbJKB5L5zYNbELos2h4ETpxUIQw0TzDyg2mLpV3Tpiiwc9Q6eEoQvWRBA3KOuEJrqwD0ksDoyn7koo6gJIYsvyCA7866odkSo/QoQ8jbw0UPDKL0Je/3na10rnJglw3WcwK2ZPTATcq12l9i3fg67C5evUNPD5bPI59g== 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: <0e3594ff-c637-46f2-bc95-7a26b5471b86@suse.com> Date: Tue, 1 Mar 2022 12:36:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= From: Jan Beulich Subject: [PATCH] x86/altcall: silence undue warning X-ClientProxiedBy: AS9PR0301CA0016.eurprd03.prod.outlook.com (2603:10a6:20b:468::34) 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: ac26bf4d-58be-45ce-2a90-08d9fb77aea7 X-MS-TrafficTypeDiagnostic: PR3PR04MB7356: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: 8dsD3V15LU1DxfhZFIAepuWGR+CsqKO36Smh00aAYJcQQs0nR0lQAvGJ1umOwXWhEICpdb+a2LO/heaVe0vgCzHh9lG/fbIiV/kIba8ZVxawUOocdYAItP1qu/xwtaa2zdPRluOOnUZoIaqR8VE7CpzTjXq6PuD1hZ8Db7Xutw/nuGfy34IezjYm4MrhcmqjKEXLhwnL2ChTFiUQmPpvawh+CjqWDTLab3DISEpAKa+LmsMAZaRK35HovxJjysf3rsmNKJboaie+oB6/Asyg7b5dDnIzmsHLnOFW+fvX5NAqoQDzZXEUrywjdq0wQBDuTwezaxpyMWrnC4Co3DZOGSQff4WS9r+8j640IXTXXObo/da47S824+HsAYcYfQj07JCL3vaE/xaLwNiSKQXW2hdzUHt1S6VLUcxaa/DBMyDMDE3Eon3ov5HBPPFcaXQfHVOCmPyWOUaB+h7TPL6Go1/nVpg2Up2fv2JJqmf+QZtoEYBWpnKU6xKOBL/NvZMszH3SlM879F7pnh6+Rwt5XxY0KRaFsiFw87/La7URs2hTcZvEE24jpyBF9/pc+auh21T7jsc1vgSa/A7KRGzeupp7KGTjIq2goPa7TJqaycStryxmGXkZwCHJ8I16h7ZRegLLEVlG7SzvxkI0VhIYWXH1QWH0lKtLbTtc7hvftQhC+MxycbwKb+XepGRDjPXqCpbTHXZMR8eXM5Av8kRRNx0jXq37OKw65uLZi4nYEmM= 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)(31696002)(8936002)(86362001)(6916009)(54906003)(4326008)(8676002)(6506007)(36756003)(66556008)(66946007)(66476007)(38100700002)(26005)(186003)(316002)(83380400001)(6512007)(5660300002)(2906002)(4744005)(2616005)(6486002)(508600001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?sm+sjykamEVPJPJ2PHSkBTN5Ajo4?= =?utf-8?q?smIaoMdZnGQBFcXEfU+i/LaqacnDV6i4916nJ3/UjLNLFLM3y6pPICKCtz/x9Eoxs?= =?utf-8?q?7lByEut7D9c0YXJ78Ak3O6MMoxeizMqRhsOLyZA5Kj0asMzc4O+8afUa+ZrmTcpos?= =?utf-8?q?seq8CKkFzYY01yTWhWSVmMmCtoeQegY+MuvyWcMHGwjr5H0ao0UO8owvGuDFN/+lj?= =?utf-8?q?NPP1R3WzBEz5OZ+UGrDAKxGbCK9QDcR1zsWOR9+i79+dV487kR7LDSWXor/8KnczZ?= =?utf-8?q?WAt3ptJycaPPVmRaCUVzTxPqXV99rh4mB/c3GeEQHuRBc0wSuKNwnnlPgAKg8geOY?= =?utf-8?q?wO9NNawEUvGH+RI+NGhWKBpjz+itGVL4coYBC08cftcfmjdB6zw2xl8y66cTfrpO0?= =?utf-8?q?76Z0E8K9Vp6ZM/ojlwd4K0ID9IeEyKTIXOX0Z/gkLFfry4tb3kT+DV5p7VDoUXF1O?= =?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2N5ad64sWaR8dX2g0PmUuUVOf2BcKoah7fqM//Xik/aUsbN2jlLMTcJ0zsd9M/u?= =?utf-8?q?4SHJRAtvy0O4MwrhbookFt/Nq8yjrO9Zkut0pmoor41kGhFdZxHGlJGpUts7adeIz?= =?utf-8?q?yrNYl1MgITdbNWxvD2/hCLEOFLa37AIv3u7zYAKBhBnICY2en50WTnvRHKTsIMQS9?= =?utf-8?q?LEN+fisFhzGduYDjDE8FCcJz1Zrh4YyHhiQ+qoLN0a+rG/QvVrewyzQ=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac26bf4d-58be-45ce-2a90-08d9fb77aea7 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:36:10.1069 (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: ao0yPZqaURAYGtVxJp9EbwWDPv4fSel04260zMzAOYhLkNE8GNE+BsEGYFS5NYCQel5hx8y2zou0cqQAWofYkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7356 Suitable compiler options are passed only when the actual feature (XEN_IBT) is enabled, not when merely the compiler capability was found to be available. Fixes: 12e3410e071e ("x86/altcall: Check and optimise altcall targets") Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- Furthermore, is "Optimised away ..." really appropriate in what 37ed5da851b8 ("x86/altcall: Optimise away endbr64 instruction where possible") added? If this really was an optimization (rather than hardening), shouldn't we purge ENDBR also when !cpu_has_xen_ibt, and then ideally all of them? Whereas if this is mainly about hardening, wouldn't the message better say "Purged" or "Clobbered"? --- a/xen/arch/x86/alternative.c +++ b/xen/arch/x86/alternative.c @@ -295,7 +295,7 @@ static void init_or_livepatch _apply_alt * marginal perf improvement which saves on instruction * decode bandwidth. */ - if ( IS_ENABLED(CONFIG_HAS_CC_CET_IBT) ) + if ( IS_ENABLED(CONFIG_XEN_IBT) ) { if ( is_endbr64(dest) ) dest += ENDBR64_LEN;