Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp621060imn; Thu, 28 Jul 2022 10:39:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR61UPGBQl4UCqz24n0SqLQ/GJxLLH+6xvFF9rCKF6J5ZB4aXV7PSqJdlk1VDUfOUPClU9Ye X-Received: by 2002:a17:903:240a:b0:16d:b222:f8b2 with SMTP id e10-20020a170903240a00b0016db222f8b2mr18430plo.117.1659029941537; Thu, 28 Jul 2022 10:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659029941; cv=none; d=google.com; s=arc-20160816; b=kp8RowJFdH7KNcG68bD8JSp4OSmh0C1ripI94oIeSSDlOI0/awrQbn5gnxeixaQNGI GlPtW+Mz0e/KhhEMUe/phP30iZ22/ow+r5//e2QLtPKBu2A7/q5X8GMJRZXHiZsjfmeE PI2taLWwVDBbICAKjprn4fdF+qc6/byrrTqKOMIfxppkd441MtzhzopdvLDW+3zsUbzj eC0YiNSqmPiVzfgPW5thgRP4eiMkjpVyJhZ3+gBYMq8hvxC/Aea8RnSIHw2p///5fiZr XDvX44iFGujnZdbGvOIWQQoUpz5cd64GIk+e76hK9etfnNp+Y3M7e7iv1dczeheLenDB 3Kww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oc0lYZZen+n96H3YkJlz8amsnvCsXfd6yw7H3HRAv34=; b=aSmoeRYfQ4zmHJRLbYHSbF0rgUfgjQQtVTO4Sah+WzMN4FZq0I025NEQQt9+yRNiF3 ps+r2vtboL+3++kB0csaFCD8ptIlPdTnW/0W4bDtk9mIYrgo0jYhnw+yPxhNRlVKUNyv O0YVYXkv/Tx0gqB0nq+/A9Xiye3JEtqQsLNh9LDlQLRfPVKPjg2lEh9+x2hfR6kZ/fD+ OEc7NDWOIZv/AMxJBhP6iZZbc4G8gEeQb1M1yMjJcs1Bt/n6rOOVLbWYESFcxFscUcqu /Ss2ui1HyYdazB0L1k9IDR66i9eI/bGgeWZQ/ALqn8v0MOgZP/Ht6fv5FZbe+ocSWAMV uRFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LvEPmb5g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a170902cec600b0016d1b16b3c0si1759198plg.262.2022.07.28.10.38.45; Thu, 28 Jul 2022 10:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LvEPmb5g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbiG1Q4l (ORCPT + 99 others); Thu, 28 Jul 2022 12:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbiG1Q4j (ORCPT ); Thu, 28 Jul 2022 12:56:39 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CD165FACE for ; Thu, 28 Jul 2022 09:56:37 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-31bf3656517so25597767b3.12 for ; Thu, 28 Jul 2022 09:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oc0lYZZen+n96H3YkJlz8amsnvCsXfd6yw7H3HRAv34=; b=LvEPmb5gwSpnB2b/XfP2TsjWKUpKxjPvyNp/0TXuTe4dFBociwyBIFRmRBMgLufeqQ JbU7CU+ASwWDDo1aahIXU8O8h5SOOSRK/N7ugORv963f/VE1GEuPnMhMlQm0dNeH/unJ nZhQsjgzp0g4VX+AN+FU04VjYDYJp7WRZiDRl6Yk8NynNfO4fn8O01ME0GF3gijiDDkt k/OamyyajXQvcH/bO9zXFot9OOwaauBMAUwcR/pb/W4OfhawaBwLPrHvpv3AsRGuYRqF k9kdy25z5AKsLkQFzaEWhfsA7PJhpB9XiDCdiUa/axhtsSe6qASTK67wSRx9/5cXQE8v g74g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oc0lYZZen+n96H3YkJlz8amsnvCsXfd6yw7H3HRAv34=; b=DaY1OfmurZc7BU3HhYzvqPzXH2OYomSqpifayeTeQsIqvDhGXGLgkasxbA5P5/9fx4 OBZBoRpWpOuNXl9/aiUyfRbIWveMPPUgGlcrWLfH37xwgPgj4Ze+I3cjkygG7I6w4HaL XxPq0/nTQRhGkDA5rvNQKMQlPaYT8RWDfis2PLyEAaHUxOz7iSgjgLk0OOna21aacj+C ITLWpNbwYESlla/Jt2qmesDFj0HcC6BjTLhYfpWqdvUFF0+3XXU9M01gog8PmRF2ozRS +os0RBpsnzoddRO9Sn/URACShf2tN87NnqRDyggYhwxpaTUusvgs4HgUEAQhmO07eNGp iAFw== X-Gm-Message-State: ACgBeo0TYZq4iEA31sl8zbvXDfvo3GmfucFNdNowhEUS0vFuyEN//p5Q jaosN1q6TJtO1LvVjuHe0smv4D8jUpS2vFEnOPk4/w== X-Received: by 2002:a81:6a07:0:b0:323:8614:10c2 with SMTP id f7-20020a816a07000000b00323861410c2mr1192910ywc.191.1659027396641; Thu, 28 Jul 2022 09:56:36 -0700 (PDT) MIME-Version: 1.0 References: <20220723224949.1089973-1-luzmaximilian@gmail.com> <20220723224949.1089973-5-luzmaximilian@gmail.com> <20220726143005.wt4be7yo7sbd3xut@bogus> <829c8fee-cae5-597d-933d-784b4b57bd73@gmail.com> <20220726154138.74avqs6iqlzqpzjk@bogus> <7284953b-52bb-37ac-fbe1-1fa845c44ff9@linaro.org> <3d752603-365d-3a33-e13e-ca241cee9a11@gmail.com> <20220727132437.pjob3z2nyxsuxgam@bogus> In-Reply-To: From: Ilias Apalodimas Date: Thu, 28 Jul 2022 19:56:00 +0300 Message-ID: Subject: Re: [PATCH 4/4] dt-bindings: firmware: Add Qualcomm UEFI Secure Application client To: Maximilian Luz Cc: Sudeep Holla , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Ard Biesheuvel , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Steev Klimaszewski , Shawn Guo , Cristian Marussi , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, linux-efi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Thu, 28 Jul 2022 at 15:49, Maximilian Luz wrote: > [...] > >> > >>> I have an ancient branch somewhere that I can polish up and send an > >>> RFC [1], but the way I enabled that was to install an empty config > >>> table from the firmware. That empty table is basically an indication > >>> to the kernel saying "Hey I can't store variables, can you do that for > >>> me". > >>> > >>> Is there any chance we can do something similar on that device (or > >>> find a reasonable way of inferring that we need to replace some > >>> services). That way we could at least have a common entry point to > >>> the kernel and leave out the DT changes. > >>> > >>> [1] https://git.linaro.org/people/ilias.apalodimas/net-next.git/log/?h=setvar_rt_optee_3 > >> > >> I would very much like to avoid the need for special bootloaders. The > >> devices we're talking about are WoA devices, meaning they _should_ > >> ideally boot just fine with EFI and ACPI. > > > > I've already responded to following email, but I'll repeat it here for > > completeness. It's not a special bootloader. It's the opposite, it's > > a generic UEFI compliant bootloader which takes advantage of the fact > > EFI is extensible. We are doing something very similar in how we load > > our initrd via the EFI_LOAD_FILE2 protocol. Whether Qualcomm can add > > that to their bootloaders is a different topic though. But at some > > point we need to draw a line than keep overloading the DT because a > > vendor decided to go down it's own path. > > But still, you're asking users to install an extra thing in the boot > chain. Not users. EFI firmware implementations that want to support this in a generic way. > That's what I mean by "special". So the situation would then be > this: User needs a) GRUB (or something similar) for booting the kernel > (or dual-booting, ...), b) DTBLoader for loading the device-tree because > we don't support the ACPI Qualcomm provided, and c) your thing for EFI > variables and potentially other firmware fix-ups. b) and c) are both > things that "normal" users don't expect. IMHO we should try to get rid > of those "non-standard" things, not add more. But that's exactly why EFI is extensible . You can have non standard functionality on your firmware for cases like this which doesn't need to land in the spec. > > >> From an end-user perspective, it's annoying enough that we'll have to > >> stick with DTs for the time being due to the use of PEPs in ACPI. I > >> really don't want to add some special bootloader for fixups to that. > >> Also, this would just move the problem from kernel to bootloader. > > > > But it *is* a bootloader problem. The bootloader is aware of the fact > > that it can't provide runtime services for X reasons and that's > > exactly why we are trying to set EFI_RT_PROPERTIES_TABLE correctly > > from the firmware. All we are doing is install a config table to tell > > the OS "I can't do that, can you find a way around it?". > > Sure, but is making the Linux installation process more device > dependent and complicated really the best way to solve this? Isn't it device dependent already? That boat has sailed already since we need to change the very definition of runtime services and replace them with OS specific ones. If we add it on the DT, you'll end up with different DTs per OS and potentially per use case. In my head the DTs should be part of the firmware (and authenticated by the firmware as well) instead of loading whatever we want each time. By using a config table we can add a u64 (random thought), that tells the kernel which TEE implementation will handle variable storage. So we can have a common extension to boot loaders, which at least uses EFI interfaces to communicate the functionality. I really prefer this to adding it on a DT, but I am not that picky. Your email raises an important topic of replacing runtime services with OS specific ones, which is unfortunately very much needed and we should fix that. Thanks /Ilias > > Regards, > Max