From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8F500C6498F for ; Thu, 25 Aug 2022 14:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=67SbHQhTjCTtNruDAdimUrxdg3uy84vQ+E4R3LSjw7w=; b=RPvxy3KVhkK4xa 2xFnV/ghZ31NpMVhPCD/YqEmcwKbjOigMm98dhZfHgD8mUD2tJE9lcv+JJO6ClSRe80w57DffmDw6 7UKlQzKyuTUyIZghnJdlvnGYGSiW6zcxeGR5xtGd3ngeQEYGB42+FEZ2U69hJ1NsIIfXotHoAnCDZ b7Fw5ZvSRDxbexB+oeLEvoeAB2IcPKxfIhdN4oCSjvYtTctYTnop3vchD9YbpAZv1AT20IIs1sX/K xt0siWyiuzdRfso4gyurQ6SfiCVc77N97m/NXnin9FpnmV26tmL3/xbwiQAfUMefWX/dsgLm+1UYw cN+YyZMqlD8SzLpcBzTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oREIo-00FSzr-QH; Thu, 25 Aug 2022 14:57:51 +0000 Received: from mail-eopbgr140079.outbound.protection.outlook.com ([40.107.14.79] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oREIl-00FSux-3p for linux-arm-kernel@lists.infradead.org; Thu, 25 Aug 2022 14:57:49 +0000 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=QOEN0mt8fhizsiMzu88GzckIjwSxawvHayIGiqDfe2iBqVtVix8g0JetMhDf4lqPx3ZhZE5j0AZp/qeELR4zzdNYhYiw4NlDC/PweHamN1WGyaqdQRBb0imlnXIkbO6TgGVikOYfYISHqAM2ymk/SflBIsH1zmx37WkDBnN8wPCTr2BMA5INjx/OXMX0qGcaTCDpyDViI5TzkFsLLntNo8j2ozTuj0IK+tfu3+D5/ZRW5JC0Gdw8Q6aiN5AWmLKk1Ot3RYiHlPgOSeHOd9u1bU/n+zbKVIofrkqS4eJwKJYNd86yn23cb6Xvj7MGOyKxVUV4sz5x9tSTzHWFhzqWcg== ARC-Message-Signature: i=2; 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=ZdWtIR7V6dMWTz1tj/Y+SYyRR5aBxY4LwdaSo2iBxbs=; b=F/XqUiEOcY9L9FbpDDKGrDF4dF5hu9FeeJ1i4awfpHgwrE5jSu27LI8QBwXxvrduIz4e2L4fxLAzdDfIuGdSkeGvR61Vm48iOruBpby4adg8EG7ZJ7FJPhQiEDjifvkcPaQbHPK/FdBJD0ywX+7OZ8W5ZNIP89MiWOorKcYuR2P5HC+z30OPweKXiu5QPgvYdMO71dwqr+aMHOTybOK0zDYs+BuWiPiN9omPv01DgaV5MgyAJ9yCwylxIH5D8B74Zh9zYTSyDhluV9i/GugmaR/RO6uQt9xyKjbaUsvn/Kw6oqr0lGl//5922/ZaJLwm4XyT93mo4LSun3BVmYabWQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZdWtIR7V6dMWTz1tj/Y+SYyRR5aBxY4LwdaSo2iBxbs=; b=lQqnBHytj5U8PgKroB36uNdl41I3KIaCceg1jloTVxOq7o+3f8lMLuM+VtLHLk0UZ+oYJqlShXWHndjlXIkLZ2n5g3346p0/PQ9qDEUwDeHC0VneLYPhQjJVhdTEi/VGIsy64xrrY0YzwvRco05Ae3FjCj2VEgFoRF7v+cwVuQk= Received: from AM7PR02CA0028.eurprd02.prod.outlook.com (2603:10a6:20b:100::38) by AM6PR08MB4900.eurprd08.prod.outlook.com (2603:10a6:20b:cc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.18; Thu, 25 Aug 2022 14:57:41 +0000 Received: from VE1EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::c6) by AM7PR02CA0028.outlook.office365.com (2603:10a6:20b:100::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.19 via Frontend Transport; Thu, 25 Aug 2022 14:57:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT061.mail.protection.outlook.com (10.152.19.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 14:57:40 +0000 Received: ("Tessian outbound c883b5ba7b70:v123"); Thu, 25 Aug 2022 14:57:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a2be18c5014c8b5f X-CR-MTA-TID: 64aa7808 Received: from 1caccd118bb5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5FDFF09D-A7EE-4F4F-BB0B-5B636D03FACC.1; Thu, 25 Aug 2022 14:57:34 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1caccd118bb5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 25 Aug 2022 14:57:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BJIHGJKUMpM61KgUnH4MEoEwj6e30PYkPHA52iXTDPryw3YB838chH9cvEIQJWCaxreWst9heVpeZ1VqMhbiinJaXW4MXkBD2ENbiB1lsvqQBzSzDsblRKePUmCkt36b/ZURFzHfKD0C6juAGRfGRfahmMW76Bho/ZptfeJYv9sbk3w425/lsQrwv1ahin6Lc3Flv59utDrklz6rH0r4XmdAE5onw8IbRaGgB2iz29jGmNoiCfiTXXPd5DI/LeAqGIxTCQyPkTpbdx3xXjeid2TRCVsHdHpyedj1H8V/XtjanOrVt85xKTb0XpoUltMvZKk1ag27TmHJhii/UKMsLA== 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=ZdWtIR7V6dMWTz1tj/Y+SYyRR5aBxY4LwdaSo2iBxbs=; b=VxhTc/YEeWHwacA2lFuP226XErfJ9I7nDtkW2n5zmOGTYDb5wiaTS+dTG2dv3jo1ifPRODn/q5qXbMNu1BOKKTuwBkzSTZg7wVd8RXZeNkot659MDhfglzAzKWSnL9KUy9oZgMAmBVx2XqLAKbcEMThimuL0g1Kv98yMSE4zra0CEkoBJG4Fh1qMrXQfQzQIZWJSoxB4P58bL8b8x+DgZxFEVavhFh+TC/NBoEPQaE4dlCywP0BpaLVZuMve+QQ5Zc+X6WTO4tzJhx2vU723N9p0DG59Vtx/FAoIgF25z5QpOVbACiDWrArfzRxJJt700+mjVduNCeKD8KQrzQL5ww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZdWtIR7V6dMWTz1tj/Y+SYyRR5aBxY4LwdaSo2iBxbs=; b=lQqnBHytj5U8PgKroB36uNdl41I3KIaCceg1jloTVxOq7o+3f8lMLuM+VtLHLk0UZ+oYJqlShXWHndjlXIkLZ2n5g3346p0/PQ9qDEUwDeHC0VneLYPhQjJVhdTEi/VGIsy64xrrY0YzwvRco05Ae3FjCj2VEgFoRF7v+cwVuQk= Received: from AS9PR07CA0057.eurprd07.prod.outlook.com (2603:10a6:20b:46b::35) by VI1PR08MB2910.eurprd08.prod.outlook.com (2603:10a6:802:25::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.21; Thu, 25 Aug 2022 14:57:30 +0000 Received: from AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46b:cafe::f5) by AS9PR07CA0057.outlook.office365.com (2603:10a6:20b:46b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.3 via Frontend Transport; Thu, 25 Aug 2022 14:57:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT015.mail.protection.outlook.com (100.127.140.173) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 14:57:30 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Thu, 25 Aug 2022 14:57:29 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9 via Frontend Transport; Thu, 25 Aug 2022 14:57:28 +0000 Date: Thu, 25 Aug 2022 15:57:27 +0100 From: Joey Gouly To: Mark Rutland CC: , , , , , Subject: Re: [PATCH v1 2/3] arm64: alternative: patch alternatives in the vDSO Message-ID: <20220825145727.GA46645@e124191.cambridge.arm.com> References: <20220825102025.53916-1-joey.gouly@arm.com> <20220825102025.53916-3-joey.gouly@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 56b944f8-ea33-4bfb-c0eb-08da86aa289b X-MS-TrafficTypeDiagnostic: VI1PR08MB2910:EE_|VE1EUR03FT061:EE_|AM6PR08MB4900:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: j95H2ap8x0UQxmQnXoPJhkfvFiIDpf2urqW8UIgEfzZ8fAPSX1SPo7PL8GayijJbE87hftldA1cdPEVpBdZNK6DSX5dpp/sG9HtJs7RRUILJb2WR4WKMLt5xquDfhff8diR/YWaGEf3XuZPpojsyCGRrRF+FJrUXuACcFonE6bI+uUu5G0YBy5KvXRrUVWhUBcPeWxWLw1ZX26ZexTuE2r/wySkTg2v8YcetT4SjbUc/jcGPdNSJqVR/Y+fnHRW3DpMV59rBsGZE7g4xua5aTzbBUiuUUKM/zbldZM9S6m83JQL6WS7dJiCqn1LVg04IoJxaGRsNIdD2E4Zz0Uyqm2poNm1TS5dgJaxnDg+wdMP0iQ0FFGdEy0h/S7CaKrNDCTiA2mP6UcJ6jNocArXAmzEbVO8AZKYnCGTv/SxU83iT2NKz7m6IRE8XIrArHVjzww39bpZJrbNX5TVjYJe/TuU1UIJs+HiCPzSwDXVQXLGCQHKvdlQiqE2tdwRxl+vZUVFZ/K79muV+fJSShZ+0Y1iNBTeYRMxQBCAa7HhaIcbE4ExKB2prJRxF7xNru6zoeCwAooVpbfppTwl0uWRuUnOk2dQn6mdzRTcBUPajvh2k/b4GQr80WJZqrAHY9+AIDMYVka74m5Z/44vVOhrPVXToZ0j/GujrNXUHA1TlqrsGiJ+rv8vEY/8/bYckOh1i7YseZ5LWnTlTmYeLo9uzFBwQznsmmLqkvRgIhnP2iPgXU/xpmR2c2eqEVwlJvCg81EQkrzWcUzlCpBrUdgTTFOdaNhGPtJIVJ9zfhoFtb6+g0a32bpeK8ZAObwICbP4G X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(4636009)(136003)(39860400002)(346002)(376002)(396003)(40470700004)(46966006)(36840700001)(81166007)(33656002)(186003)(2906002)(44832011)(1076003)(47076005)(83380400001)(356005)(336012)(4326008)(426003)(8676002)(40480700001)(5660300002)(55016003)(70586007)(6862004)(8936002)(70206006)(478600001)(316002)(82310400005)(86362001)(7696005)(41300700001)(6636002)(54906003)(26005)(40460700003)(82740400003)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2910 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a66beb2e-b35a-429b-9285-08da86aa2254 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z1vm0WWiluZBfylKm72/GSOncOFNUxiDY+sYxiKHihuyooVlqDJxDMLUcuv4tfAReV4Rjj4zVpvcoqtw1lG5TbJKBvXjsC0V7XFlkdSZMQ4UwMWCCXZgUTz9Q+tVzFmBnqtDInvG/nptAf+Tg4aUu96ybOIgFxjnQ1QPZ+VAN0+69UC7m+FOhsWm7j3Y6Cq5r9+DBfEVhRJY2VOzUqeQ5cce81kx5Qj/6izgIyHPq1oY/v+2AlZSHTtCiZAkUU9g+nZlMnS+o3us6GyFBEl1Sg8mWxDVIz46sShN82w8VhoKfp1Fy75i58rXGOYD2sgnJqK7XzF6zFhwr7PpM47KiaD0JIF9ivGip7Mm3kUTdlwMgV6L+E3H6sQmCI6ksCY0ayGHA/roOMyD6bcqlGEhqIIprbWZAVRI5ZCFqK7Dzkc94lohpIPXqmk/yPecRyrLNlBlAeNuyWtVVby61Q9db64Xnz7yI63nEWWF04gpK4DnWhjcsrQIQ2YjtW60t2CJLOWGY5dWD04Owhy5MPvbwYNPocxC9WIN9lxJ/qHkEdmTtCvuTli5N7vKUtKuJGPzMmzYAI3iVqA/I7L3uP7VavAcg5jTMHLhbqMDl8p6hKlkFPPyHkFqewX1N8VgpM8DKIFFFy7v96OGXaPTy5UgbGa9hAQN3g5cSsdElP8OSQwO4YspWb7Of3QIPSOjDqyl3U8j/HmRtP8swfS8Ef6dxjyoplumK5yF7bf3BvXh6V4ozXo7jaQQNN+YnRkGSsgCD+gFHxsyGQeoAIaxUTyvGA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(396003)(136003)(346002)(376002)(39860400002)(36840700001)(40470700004)(46966006)(6862004)(8936002)(40480700001)(55016003)(54906003)(6636002)(82310400005)(70586007)(478600001)(4326008)(107886003)(41300700001)(8676002)(5660300002)(44832011)(70206006)(316002)(26005)(7696005)(336012)(1076003)(47076005)(33656002)(186003)(83380400001)(426003)(2906002)(36860700001)(81166007)(82740400003)(86362001)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 14:57:40.9111 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56b944f8-ea33-4bfb-c0eb-08da86aa289b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4900 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220825_075747_352284_CD417948 X-CRM114-Status: GOOD ( 24.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mark, Thanks for the review! On Thu, Aug 25, 2022 at 02:19:32PM +0100, Mark Rutland wrote: > On Thu, Aug 25, 2022 at 11:20:24AM +0100, Joey Gouly wrote: > > Make it possible to use alternatives in the vDSO, so that better > > implementations can be used if possible. > > > > Signed-off-by: Joey Gouly > > Cc: Catalin Marinas > > Cc: Will Deacon > > Cc: Vincenzo Frascino > > Cc: Mark Rutland > > --- > > arch/arm64/include/asm/vdso.h | 3 +++ > > arch/arm64/kernel/alternative.c | 25 +++++++++++++++++++++++++ > > arch/arm64/kernel/vdso.c | 3 --- > > arch/arm64/kernel/vdso/vdso.lds.S | 7 +++++++ > > 4 files changed, 35 insertions(+), 3 deletions(-) > > [..] > > +void apply_alternatives_vdso(unsigned long *feature_mask) > > +{ > > + struct alt_region region; > > + const struct elf64_hdr *hdr; > > + const struct elf64_shdr *shdr; > > + const struct elf64_shdr *alt; > > + > > + hdr = (struct elf64_hdr *)vdso_start; > > + shdr = (void *)hdr + hdr->e_shoff; > > + alt = find_section(hdr, shdr, ".altinstructions"); > > + if (!alt) > > + return; > > + > > + region = (struct alt_region){ > > + .begin = (void *)hdr + alt->sh_offset, > > + .end = (void *)hdr + alt->sh_offset + alt->sh_size, > > + }; > > + > > + __apply_alternatives(®ion, false, feature_mask); > > +} > > + > > /* > > * We might be patching the stop_machine state machine, so implement a > > * really simple polling protocol here. > > @@ -216,6 +240,7 @@ static int __apply_alternatives_multi_stop(void *unused) > > > > BUG_ON(all_alternatives_applied); > > __apply_alternatives(®ion, false, remaining_capabilities); > > + apply_alternatives_vdso(remaining_capabilities); > > Since we didn't patch the vdso in apply_boot_alternatives(), using > `remaining_capabilities` means that we could in theory miss alternatives for > features which were detected on the boot CPU. > > Since the VDSO cannot be concurrently executed within the kernel, we could > hoist the call to apply_alternatives_vdso() out of > __apply_alternatives_multi_stop(), and call it before the stop_machine in > apply_alternatives_all(). > > That would keep __apply_alternatives_multi_stop() simple (and easier to make > noinstr-safe), and we could use the same mask logic as > apply_alternatives_module(), e.g. > > void apply_alternatives_vdso(void) > { > DECLARE_BITMAP(all_capabilities, ARM64_NPATCHABLE); > bitmap_fill(all_capabilities, ARM64_NPATCHABLE); > > struct alt_region region; > const struct elf64_hdr *hdr; > const struct elf64_shdr *shdr; > const struct elf64_shdr *alt; > > hdr = (struct elf64_hdr *)vdso_start; > shdr = (void *)hdr + hdr->e_shoff; > alt = find_section(hdr, shdr, ".altinstructions"); > if (!alt) > return; > > region = (struct alt_region){ > .begin = (void *)hdr + alt->sh_offset, > .end = (void *)hdr + alt->sh_offset + alt->sh_size, > }; > > __apply_alternatives(®ion, false, &all_capabilities[0]); > } > > ... does that sound ok to you? Yep, this makes sense, will send a v2 with this and the fixes for the other patch. Thanks, Joey _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel