Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2820575imm; Tue, 4 Sep 2018 10:30:39 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb/d83MCo7CtsMd+xqrEjZ9Jz9JxPmFUzFk5MLvy8CaYYVqebutrGalmsjWmgUFbDiylRzr X-Received: by 2002:a63:e443:: with SMTP id i3-v6mr32815019pgk.381.1536082239495; Tue, 04 Sep 2018 10:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536082239; cv=none; d=google.com; s=arc-20160816; b=qTrvndht8PPZ7Xg6Yj/CD15O9NIbQoujJH44vz0FMbAGA4KVON2hDcfdRJgCqM/gE9 BGlPAX0N5jC7mYAWzg+LM2PpB6j1SMMspyxhq4E6KFwajwCb2Z7eFdjmN0p+LSueIqQn wRQh0K9z7RI+FKdmkdDWx67ipEO+d5nnlL2LPbFGLybZmHSEuvFXPs8KA6JzEASW6JVa 8hdyEq5iFDNBOffDuUiTvMhTr1ep1okIcDv1jMfe0X2QXOJ4myCJGkwctneQ52an0lxp ibvQ6biEKrfeM24YsJH1phcaq84zsmdjC/uHcm4jvdm/luY1w+Lh7ryTRfuvUpJ/z2nX Dbow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=gt+deXbHZEB0bnH+Y+zxKibrQwTxu82a4o4aLU9k0WM=; b=WC6JWn0TUlNHGoFNM7oidt2N1a7pJOZYFpwajAbtcc7ywSLAjkso3jWugoRAvNf5LG Ihl0Hhx2bArpCIhjSJSd/x8dyC86neuZ7YweSbREd0U25SDZ8f/pGz0NEpOdIKLkkNCR hdaI5Pxy4y436bjZTY7wEMvZeboopJnjHm0aNBZSzsdNQfA3fXxFZ+oVJBypvG68lgIx CHKdgQRug5Hjyw+r3U/3Og2GK4jNQMDQvrm03Us8oUxiyoGZ5NeQUijCDfZc43kV3BdP 7cQtTMpDvHvn5z2jbKettIVVyewKQDBbLvNSwUbq8LrbhhboFf1UipJhvUQ3h+bLxQfW 9j6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=w2s+pfIy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k64-v6si19927770pge.129.2018.09.04.10.30.23; Tue, 04 Sep 2018 10:30:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=w2s+pfIy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727104AbeIDVyz (ORCPT + 99 others); Tue, 4 Sep 2018 17:54:55 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41439 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbeIDVyy (ORCPT ); Tue, 4 Sep 2018 17:54:54 -0400 Received: by mail-lj1-f196.google.com with SMTP id y17-v6so3843514ljy.8 for ; Tue, 04 Sep 2018 10:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gt+deXbHZEB0bnH+Y+zxKibrQwTxu82a4o4aLU9k0WM=; b=w2s+pfIySSU/Kwz/u1tlFMmlqLF8O+RUTqFh0spy0lwq7UEC1Zm+tUCVus3QGnhPSx T/P+XBPw62Sae4QKQbLJ/GHlCNHsNzmF0jTnLmiajYPmrNgoy3eI6iQGCQl5mwF+TSlJ 2T6AJ9xv3fQWcisMy1k+7/NwdU2e9ygJ4xKbQQAvvqdkA6PgzbYli6kpMgoa/C1l/iWW tHjoVBTwDMsGzQaAiSnikMNqixsPbTbnhcgXhpmw/S8F417WUtqtjeGxK0fC2Gi6NTA0 B+2o+QLiyJVby6kd01d6sIv7ABZbxYN0HAkvGpPawGqyU/K36qG1KKn2hROqgkZRbxkX SY3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gt+deXbHZEB0bnH+Y+zxKibrQwTxu82a4o4aLU9k0WM=; b=b6O2M7895SMNtcmNLZTJud0/5B0aWyEK5dPaRyQnQf2bXhNExMXfKIu4bnjUspLW4b 5Lfg5/6PrrGgizvFDPtKJ35J1XnHSkloAezM4Tj5p2e8CKkxGnUDURa5hjBDzqNcCXZf MskfrCeHnbUje9fg5nesfdBcWoePHlyMw4zGhMzkS1sY4N+TlAePZ3olh6gX3xUBa+Ko Efrcbk3qyQRtzSdBfaRnE6BNDoQIKgf+sAiLWTFePlhkiDoSwevh3zmuctyJVONxvJ3N oDipq+nehUSXhFCh05qQSuC9mut1KIvLb4sNkyASil2pQGozP3ntFbVCRzT2Wv370Xq0 hz3A== X-Gm-Message-State: APzg51Cn4mqLD9JP13wAxOUJccQatYqu/ZSSEY8cMwCTKAJNZmlGCIPX QaLwlgypZekFY4jAcmtsl27VvVEdkWqaL5sKEnj6bg== X-Received: by 2002:a2e:8e89:: with SMTP id z9-v6mr3550019ljk.155.1536082126681; Tue, 04 Sep 2018 10:28:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:175b:0:0:0:0:0 with HTTP; Tue, 4 Sep 2018 10:28:45 -0700 (PDT) X-Originating-IP: [2620:10d:c090:200::4:a2ee] In-Reply-To: References: <1535563287-24803-1-git-send-email-scott.branden@broadcom.com> From: Olof Johansson Date: Tue, 4 Sep 2018 10:28:45 -0700 Message-ID: Subject: Re: [PATCH] arm64: defconfig: enable EFI_ARMSTUB_DTB_LOADER To: Grant Likely Cc: Ard Biesheuvel , Scott Branden , Catalin Marinas , Will Deacon , Arnd Bergmann , Broadcom Kernel Feedback List , Linux ARM , Linux Kernel Mailing List , Leif Lindholm , Alexander Graf Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 4, 2018 at 3:13 AM, Grant Likely wrote: > Hey folks. More comments below, but the short answer is I really don't > see what the problem is. Distros cannot easily support platforms that > require a dtb= parameter, and so they probably won't. They may or may > not disable 'dtb=', depending on whether they see it as valuable for > debug. Sure, I'm all for enterprise distros not wanting to support this, but there are boatloads of kernel parameters that they're unlikely to already be supporting, including "initrd=" and others. "dtb=" shouldn't be any different. Needing to disable it with a config option sounds like an odd approach to this. > Vertically integrated platforms are a different beast. We may strongly > recommend firmware provides the dtb for all the mentioned good > reasons, but they still get to decide their deployment methodology, > and it is not burdensome for the kernel to keep the dtb= feature that > they are using. +1 > On Tue, Sep 4, 2018 at 7:24 AM Ard Biesheuvel wrote: >> >> On 2 September 2018 at 04:54, Olof Johansson wrote: >> > On Thu, Aug 30, 2018 at 9:23 AM, Ard Biesheuvel >> > wrote: >> >> On 30 August 2018 at 17:06, Olof Johansson wrote: >> >>> On Wed, Aug 29, 2018 at 10:54 PM, Ard Biesheuvel >> >>> wrote: >> >>>> On 29 August 2018 at 20:59, Scott Branden wrote: >> >>>>> Hi Olof, >> >>>>> >> >>>>> >> >>>>> On 18-08-29 11:44 AM, Olof Johansson wrote: >> >>>>>> >> >>>>>> Hi, >> >>>>>> >> >>>>>> On Wed, Aug 29, 2018 at 10:21 AM, Scott Branden >> >>>>>> wrote: >> >>>>>>> >> >>>>>>> Enable EFI_ARMSTUB_DTB_LOADER to add support for the dtb= command line >> >>>>>>> parameter to function with efi loader. >> >>>>>>> >> >>>>>>> Required to boot on existing bootloaders that do not support devicetree >> >>>>>>> provided by the platform or by the bootloader. >> >>>>>>> >> >>>>>>> Fixes: 3d7ee348aa41 ("efi/libstub/arm: Add opt-in Kconfig option for the >> >>>>>>> DTB loader") >> >>>>>>> Signed-off-by: Scott Branden >> >>>>>> >> >>>>>> Why did Ard create an option for this if it's just going be turned on >> >>>>>> in default configs? Doesn't make sense to me. >> >>>>>> >> >>>>>> It would help to know what firmware still is crippled and how common >> >>>>>> it is, since it's been a few years that this has been a requirement by >> >>>>>> now. >> >>>>> >> >>>>> Broadcom NS2 and Stingray in current development and production need this >> >>>>> option in the kernel enabled in order to boot. >> >>>> >> >>>> And these production systems run mainline kernels in a defconfig configuration? >> >>>> >> >>>> The simply reality is that the DTB loader has been deprecated for a >> >>>> good reason: it was only ever intended as a development hack anyway, >> >>>> and if we need to treat the EFI stub provided DTB as a first class >> >>>> citizen, there are things we need to fix to make things works as >> >>>> expected. For instance, GRUB will put a property in the /chosen node >> >>>> for the initramfs which will get dropped if you boot with dtb=. >> >>>> >> >>>> Don't be surprised if some future enhancements of the EFI stub code >> >>>> depend on !EFI_ARMSTUB_DTB_LOADER. > > That's an odd statement to make. The DTB loader code is well contained > and with defined semantics... True, the semantics are "I DON'T BELIEVE > FIRMWARE", but it is still well defined. What scenario are you > envisioning where EFI_ARMSTUB_DTB_LOADER would be explicitly excluded? > > Conversely, the dtb= argument is an invaluable debug tool during > development. As Olof has already said, there are a lot of embedded > deployments where there is no desire for grub or any other > intermediary loader. > >> >>>> On UEFI systems, DTBs [or ACPI >> >>>> tables] are used by the firmware to describe itself and the underlying >> >>>> platform to the OS, and the practice of booting with DTB file images >> >>>> (taken from the kernel build as well) conflicts with that view. Note >> >>>> that GRUB still permits you to load DTBs from files (and supports more >> >>>> sources than just the file system the kernel Image was loaded from). >> >>> >> >>> Ard, >> >>> >> >>> Maybe a WARN() splat would be more useful as a phasing-out method than >> >>> removing functionality for them that needs to be reinstated through >> >>> changing the config? >> >>> >> >> >> >> We don't have any of that in the stub, and inventing new ways to pass >> >> such information between the stub and the kernel proper seems like a >> >> cart-before-horse kind of thing to me. The EFI stub diagnostic >> >> messages you get on the serial console are not recorded in the kernel >> >> log buffer, so they only appear if you actually look at the serial >> >> output. > > As an aside, they probably should be recorded. That is probably a > question for the UEFI USWG. Grub and the ARMSTUB could probably bodge > something together, but that would be non-standard. Having a way to pass firmware console messages onto the kernel is a generic problem; different firmware stacks seem to solve this in different ways. Having a unified way of passing, say, a text buffer to the kernel filled with the firmware console log would indeed be useful for everyone, not just EFI. >> > Ah yeah. I suppose you could do it in the kernel later if you detect >> > you've booted through EFI with dtb= on the command line though. >> > >> >> >> >>> Once the stub and the boot method is there, it's hard to undo as we >> >>> can see here. Being loud and warn might be more useful, and set a >> >>> timeline for hard removal (12 months?). >> >>> >> >> >> >> The dtb= handling is still there, it is just not enabled by default. >> >> We can keep it around if people are still using it. But as I pointed >> >> out, we may decide to make new functionality available only if it is >> >> disabled, and at that point, we'll have to choose between one or the >> >> other in defconfig, which is annoying. >> >> >> >>> Scott; an alternative for you is to do a boot wrapper that bundles a >> >>> DT and kernel, and boot that instead of the kernel image (outside of >> >>> the kernel tree). Some 32-bit platforms from Marvell use that. That >> >>> way the kernel will just see it as a normally passed in DT. >> >>> >> >> >> >> Or use GRUB. It comes wired up in all the distros, and let's you load >> >> a DT binary from anywhere you can imagine, as opposed to the EFI stub >> >> which can only load it if it happens to reside in the same file system >> >> (or even directory - I can't remember) as the kernel image. Note that >> >> the same reservations apply to doing that - the firmware is no longer >> >> able to describe itself to the OS via the DT, which is really the only >> >> conduit it has available on an arm64 system.. >> > >> > So, I've looked at the history here a bit, and dtb= support was >> > introduced in 2014. Nowhere does it say that it isn't a recommended >> > way of booting. >> > >> > There are some firmware stacks today that modify and provide a >> > runtime-updated devicetree to the kernel, but there are also a bunch >> > who don't. Most "real" products will want a firmware that knows how to >> > pass in things such as firmware environment variables, or MAC >> > addresses, etc, to the kernel, but not all of them need it. >> > >> > In particular, in a world where you want EFI to be used on embedded >> > platforms, requiring another bootloader step such as GRUB to be able >> > to reasonably boot said platforms seems like a significant and >> > unfortunate new limitation. Documentation/efi-stub.txt has absolutely >> > no indication that it is a second-class option that isn't expected to >> > be available everywhere. It doesn't really matter what _your_ >> > intention was around it, if those who use it never found out and now >> > rely on it. >> > >> > Unfortunately the way forward here is to revert 3d7ee348aa4127a. >> > >> >> I agree with your analysis but not with your conclusion. >> >> Whether or not the option is def_bool y and/or enabled in defconfig is >> a matter of policy. ACPI-only distros such as RHEL are definitely >> going to disable this option. But in general, supporting DTBs loaded >> from files is a huge pain for the distros, so I expect most of them to >> disable it as well. > > I support leaving 3d7ee348 in, and making it def_bool y Again, with the argument above -- I question its presence at all. We usually don't pick up kernel changes just because a distro wants to make a policy statement. In this case, there is no genuine technical motivation for this change, especially when the parallel "initrd=" option is still there. -Olof