Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp660607pxb; Wed, 16 Feb 2022 01:16:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxml7XnRNfR28S3ZCR7hruqmPmpUkOek4uSfcsGwMQJu2Py3Y54RDA4kbmU0+skXqyHUwFM X-Received: by 2002:a62:ab09:0:b0:4e0:d967:318f with SMTP id p9-20020a62ab09000000b004e0d967318fmr1791458pff.86.1645002989183; Wed, 16 Feb 2022 01:16:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1645002989; cv=pass; d=google.com; s=arc-20160816; b=xOT2IhA57m1hMwDPUMOgaHdaa+Op2BTWy4MV6sT215M6s2FezwWRu4iWOWN2Qeq+nw 4T0+QqcboNm5Qb56lpxCvurtm3nCp9E6P4VTNUl3Lnq03M9VHS7mBEhey/Cn9UHHFWwo 1oJ6utC8Csa0Q6obtrjEZZ+OaCRsiYW7NOE4rHHd3+ijGdW5fdn7tVyS3dSeswgQhQxP HXUXYCCDhmmIGM5BsIS/u+K6MB1LTi1CW0y6kZzcOUicO/fgmvh+DbIoXTKFwVlJ6baN JBpc3oGfXE8w9QqNebwLzJRgdDqyWGrV308TDdjSfd4Trzy5OGN4tGDQShZ2x70ZV7bQ zXmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to :content-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature; bh=ZBBrIARNwROdZr29RMGq8yRCx2v19kWFIsPhN293FxE=; b=Ydlfxni5nNfDZ0JwJbX/2/ffXvZ//KpmzEJ/7EubSSL7CXrK5NIdA1Ycypk5kf1M3G jZftqDRS4XW8pKZ/IlnYCW7sn5K7FWbM4shGQEFg/+4kcGOzMKdtnGKwLHzoZXAh1v4+ msTSDJA7P5PCduWqVEmfhujhSS6UiV0xlOvaOkaukQg5CH1RBgYQn0IpDAAl6thRTkE4 j9gZ//SnKWeHackHG/FSfjqlQTmk7HWDq55VmpNwfJJyJuOusA57sk6GzkC0rrNsCb5+ IdihFuNLiw1JlqbwPp6zo6v7k+sSGHxjSybm3YNAxMahkeM27GeNBFHEowuUWiBiAi6N qD0A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nokia.onmicrosoft.com header.s=selector1-nokia-onmicrosoft-com header.b="i/PTKZsV"; arc=pass (i=1 spf=pass spfdomain=nokia.com dkim=pass dkdomain=nokia.com dmarc=pass fromdomain=nokia.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nokia.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a13si19873982plh.537.2022.02.16.01.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 01:16:29 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@nokia.onmicrosoft.com header.s=selector1-nokia-onmicrosoft-com header.b="i/PTKZsV"; arc=pass (i=1 spf=pass spfdomain=nokia.com dkim=pass dkdomain=nokia.com dmarc=pass fromdomain=nokia.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nokia.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5B8D10E077; Wed, 16 Feb 2022 01:12:31 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbiBPJM0 (ORCPT + 99 others); Wed, 16 Feb 2022 04:12:26 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:46816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231202AbiBPJMY (ORCPT ); Wed, 16 Feb 2022 04:12:24 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70114.outbound.protection.outlook.com [40.107.7.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A420A2DAA6; Wed, 16 Feb 2022 01:12:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jJc9v7h1jugrbCnrm57agS4lFeo3tbGkvXzdbkZh5R6vDCkUzmupJi+HBuzrz4m2VNsinOfIUxgdDjAsa7QzsaTsVUnpBS97dBC/ab25Kg6wa/PUMqtH8ZC1Pfi6SkJHH+8lM681QFdrJYWKbW9AXUS0JVFKk1UFtkm5PnGu3jPlzexK6NGIZT76TYECFUcyLwl5Tef362gDkv3om4fIY4yeQu1xaWk7iO6Y1WbTgJJxrunRGIgOuZKu/BpIpTZCVcYf+puFJYlrH2G396FgiLfXjaPGcFDIGOpHRqWQLnevU7/TlpjyMSTiAXNsCl0BzYu8lEat9tZc39nleyWiuw== 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=ZBBrIARNwROdZr29RMGq8yRCx2v19kWFIsPhN293FxE=; b=HNaKn2pAfgKWxg9PPC3rTeL2nDrUxeUmgVgafv+bXpUAezDSspUz8VXoO76wbOlBp5ENwLv8GwP/VJiR58LQe3A9/AQBwNDhf0i6ydw5dpyoktT/aVJDW3UMscYXu1LGG2M8Jj42q6UnVfvz2IknhKCc1S6Sf/hL0Zbw4S55Q6tCMf7HxmcSEd2oTFkaKpyUiAWU0Z2cUdvLiUQGcDzjpSBYJyLVkMkTvxVJ1cvseTqcMDXIpiKb8EzGvnxIs3x9IOKh/KQIOAAdKDnUcRXs02tAQI7u1xxGIzX9omnnLv4XqtxZzOIO/9lBNLAHFYftV4XDv+pgrrui7B9kSxdMOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZBBrIARNwROdZr29RMGq8yRCx2v19kWFIsPhN293FxE=; b=i/PTKZsV8VbDLOAqOurbO6/CDvknIiRgMG90ws+ho8fI6rkx73SLzu+/KcW2QhP9CnhK+8eLiATeWXMGbdxvW0pZOfM2eB5xRASW9MU7rPrkfGaAntNGTiHmaO1t6iUXSzT0hr30wEyoWas3rXDEYOkFuIusBCmAc8FsrSf3LO0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com; Received: from AS8PR07MB8104.eurprd07.prod.outlook.com (2603:10a6:20b:373::6) by AM8PR07MB7393.eurprd07.prod.outlook.com (2603:10a6:20b:246::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.6; Wed, 16 Feb 2022 09:12:08 +0000 Received: from AS8PR07MB8104.eurprd07.prod.outlook.com ([fe80::903c:34b9:dbbf:c1b1]) by AS8PR07MB8104.eurprd07.prod.outlook.com ([fe80::903c:34b9:dbbf:c1b1%6]) with mapi id 15.20.4995.006; Wed, 16 Feb 2022 09:12:08 +0000 Date: Wed, 16 Feb 2022 10:11:59 +0100 From: Krzysztof Adamski To: Ard Biesheuvel Cc: Guenter Roeck , Alexander Sverdlin , Mark Rutland , Catalin Marinas , Will Deacon , Peter Collingbourne , Wolfram Sang , Matija Glavinic-Pecotic , Linux ARM , Linux Kernel Mailing List , linux-efi Subject: Re: [PATCH v2] arm64: move efi_reboot to restart handler Message-ID: References: <79bcce92-abb2-4c3e-7193-d18e144da8a0@nokia.com> <489b76f9-fbaf-dae0-c90d-c52ee0de92a4@roeck-us.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: HE1PR0202CA0028.eurprd02.prod.outlook.com (2603:10a6:3:e4::14) To AS8PR07MB8104.eurprd07.prod.outlook.com (2603:10a6:20b:373::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15bf4e8a-3b89-40c4-4933-08d9f12c682f X-MS-TrafficTypeDiagnostic: AM8PR07MB7393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K1Xf/z64gFZXb7Smufd57ZjYsj7UWep1n/szPYbiqxMmncC0Ws01Oiq/0U48RlFBElV/YVU8SEJgLq+ZcZjfkYEYqswuK5Qb3nCyxYVEjVy3UFFKZ+3GqcoElwdZf0MITnWWhEIpfZbnC95X72lAg/a0dQpKF2zqbCdU2ZlPybCbmzHdOp7/4SoMVhuAq2K4gVGIrNpiIr1Uj4pic2f+raLRm3UoKJ6zxgxOlfsTmS1UVz1g9AiAVe5K8lj4emkKuebVTfHZ99n5ZXs9u1Wv2NVLMWUkHS7lCM3UI+hykmTN9wsBCKAcDhyvMoplFHmVMK1FtnhgJueUcqKphRGaGrrBC9SHrl5svXHA4by1SxMKxTnd7AfVtxnWJwF9SobImAdmCg7aygZWPsy5CtU22ZdV5xW9XJMQ7AH0ontkgRBne8M03RPbxpDAYEmnm6LR3AJ7zgTH58LcZuU/M7wKz9Qz57VakksPz/sekPeO8rrxHk1sN2CJZQGA88r06A0NYCM7RZhf4/6+dd0JTU8dAKdkjBktkUjzDtuqH0R4ZIoq4y2zvcgY1qkdwx1IHKD/B9owI1SGf8yT8qh0iPzH1dKl1FllVS6guKPfojy669r81jYOkWhIPBnikqJ8dDBplceYwZXuDqE8WZBJNUDov/iDQYG60Arv7jp1fXL706J1X4ozaMaycSTfnw4GTCew8SkiaAcH0twck+iw0IA+2LcJAsWuC86mNZ2Xnii8c2mFKq+U/Dv5vHGCOVqA8xR0 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR07MB8104.eurprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(26005)(7416002)(44832011)(8936002)(508600001)(9686003)(52116002)(66476007)(66556008)(4326008)(6512007)(8676002)(2906002)(66946007)(186003)(5660300002)(83380400001)(6486002)(316002)(6506007)(6666004)(82960400001)(86362001)(54906003)(6916009)(38100700002)(38350700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R1hSVzdiek5kcGN0TG85WEluU0F4QVZtcFh6aGN6RXErMkZyeEQ1TVhYRG5S?= =?utf-8?B?S3VWRTdhNkNrbzdMbVB6RUtobzZPV3ZYaEZHd2RwZkY1QnVKRlF4RFpPQWZ4?= =?utf-8?B?SmNZRHRuVzYrYnRHV3hKV0poSTZKZkhlUlN5ZHluUm9HTk9TRzR1SVlHTFVD?= =?utf-8?B?bE5CQ3RBemdFTUcvM2lDRFdOWTdPU0kzODNMQ2crR1FCcmcvTTNnMEJCOFF2?= =?utf-8?B?ZW1JOFg1VDR1Q1c5NEg0Q3d0WTVlOXg5SWlqY1c2S2VGNXZyanhIQzBJQ2Nj?= =?utf-8?B?Zy9IM1hNVXplTTlzRG45NU5rYVBhQVZkakM4ejc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Y2U2RZbFJNN2VXYm55NGFUT25CSmRwdTZCc1IwL09WWjhPUGNreHY4?= =?utf-8?B?N1FYUnJiYWtJWEgyK1BzUENVMGllcEdxZURKUzJkWUxmZ2JpYURTbm1kTVNL?= =?utf-8?B?WHNpSzluSk90azdjQ1p6RTV2cldRPT0=?= X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15bf4e8a-3b89-40c4-4933-08d9f12c682f X-MS-Exchange-CrossTenant-AuthSource: AS8PR07MB8104.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2022 09:12:08.3106 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QnPRu8Kz2Ll2M4pqjuDk1nTz7TaQEXDzfeXq0JesLrIH6B4K5DjKZj0+mDjoyMcZhYwXQWmZXn+R+1biYWO/pHHEMzBjh6DhOYxS0u/bn44= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB7393 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dnia Tue, Feb 15, 2022 at 06:03:30PM +0100, Ard Biesheuvel napisaƂ(a): >> > But if we want to prevent registering some custom code to be run before > efi_reboot(), that new API would have to be rejected as well, for the >> > same reason. So what is the point? >> > >> >> Ah, yes, you are right. The emmc example does reset the emmc, after all, >> which one could use as argument that it "violates" the EFI mandate. >> Sorry, I guess you'll be stuck with out-of-tree code (and, realistically, >> so is everyone using emmc in an arm64 based system with an EFI restart >> handler which does not implement emmc reset). Actually, turns out that >> the emmc restart handling code is not reliable anyway, since for example >> x86 doesn't use/support the restart handler call chain, and neither >> do several other architectures. >> > >Rich firmware like EFI and ACPI implies that the firmware knows how to >manage the hardware. > In an ideal world, probably yes. When I move there, I will probably have less concerns :) > >> Other options for you might be to disable EFI restart handling in your >> system (assuming that is possible), or to implement the necessary code >> as part of the EFI restart handler, ie outside Linux, again if that is >> possible. >> > >Either implement EFI reset properly, or not at all. Adding code to the >OS that forces it to reason about whether or not EFI reset can be >called safely simply means that the EFI implementation is broken and >should probably be avoided entirely. That is black-and-white thinking. There are shades of gray, too :) Imagine this sitation - you have a SoC and the vendor delivers this SoC together with support and code for that SoC. You use it to build some platform around that SoC but that platform is much more complicated than the basic one. It is custom and specific to your needs. The vendor provided firmware, together with the EFI implementation can handle reseting the SoC without problems but you also have some additional parts in your platform you would like to handle. Why, in such a case, I should not use the existing EFI implementation and just build on top of that? Avoiding using it entirely does not seem reasonable to me. It might also not be possible as you might not know all the details to reimplement it. On PC/Server world, that approach might be feasible - the vendor knows the usecase for their product well enough to support all the cases. But ARM64 is being often used for other, so called "embedded", usecases. People working in "embedded" often have unique needs and I do understand that mainline kernel cannot support all of them. But when supporting them is easy and does not require some ugly hacks to be added, why not? For years we were implementing ways to overcome limitations in hardware and vendor software implementations. restart_handler mechanism is quite pretty example of that, one which isn't really hacky, does not introduce maintainabity problems if widely used. Why not support it on ARM64 as well? Only because in ideal world it wouldn't be needed? :) I understand it should not be needed in EFI world and there are approaches that could be used instead of that one, but they all seem like taking a sledgehammer to crack a nut. Krzysztof