Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1145647imm; Thu, 13 Sep 2018 13:29:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbZ6+8PgDDIpjXgv0Nub7Yah+WQETspM7Sb+8QPKwdkwS9DRpd/j2fa3bDaOGwGPYiltMsW X-Received: by 2002:a63:bd41:: with SMTP id d1-v6mr8656073pgp.309.1536870571027; Thu, 13 Sep 2018 13:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536870570; cv=none; d=google.com; s=arc-20160816; b=TuhZqJg8iixH0h6k3aoIQLMVbfHeS+WEQLE6rIgrYEa9Y5Lpg/LqVdBqRt+I3P8oWC 0k3kmlAK+mquhb6wmdmgpsG7mSxPctY1XoIIqyPM03IZ4Zk7ABi6IUlMKPm7EZGk6oXc 6CIUcd2XLFZfwmnLewTLFR0Qju+GqLnPUrsZAZFA+7YVbwz0leDJGbekosvPFhhDhanx pCRhaZWIPpe4RzkF7kbTd45mAH+tLq5o6G6NKAIPNcqHis4B9AWTaB2J8p4uCe9BCFjJ V6BEmQog0cR9MF41ZniH1HHXNSsQVRZi8VsgrKsuxtyKQqWSOfZpbhueMbXRU4MaPpiL bDDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=4SoW90uiVGeXBwQDZBoEdwVJr27rAmCSY/9P69WvW2g=; b=wNaooMkldRWG2XcOz5EGKfyYu/RKPHlVOyIy0jW+wlcdKOPdKCFW/h22S18KNZzw3h /jKwE8thIK4oNPcUsWImmAaL6VAY0NhLRIpyM0XOLWw59kayKJsE8DvlWi32NKz20Lil /iELkSE3rXAbgUJi60Phofi+MSIQWjxL6FVW1HQXEwZFnPmMqjjN9VNbIBH0B7R0D1CY VjBibHZHiUCaCxQEIgi0nJP5QNlEeEFnlkBugb/5Js1paeJq4n8MfeMNbARh/NDp5JiC r5DkEM1D/bKVZYvB9lUnf6nZQB+tTHsguhgUiqkG0B5YbTPDeBYU51SVQi6g4CJ357pl LuMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Z5dQKL9O; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1-v6si4931796pli.412.2018.09.13.13.29.15; Thu, 13 Sep 2018 13:29:30 -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=@broadcom.com header.s=google header.b=Z5dQKL9O; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728236AbeINBd3 (ORCPT + 99 others); Thu, 13 Sep 2018 21:33:29 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:43231 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728215AbeINBd3 (ORCPT ); Thu, 13 Sep 2018 21:33:29 -0400 Received: by mail-ed1-f66.google.com with SMTP id z27-v6so5650602edb.10 for ; Thu, 13 Sep 2018 13:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=4SoW90uiVGeXBwQDZBoEdwVJr27rAmCSY/9P69WvW2g=; b=Z5dQKL9OLihoQPiq9q81okiUs3jMhRxFomSp59ikQyddektdwYEDYmGDatUfb2JcQu gMaRX10o0YwHvR5tEPGMd+rx6T3Pl4pT4DOCpa0gXBenIcYhza5dWtwaFTU2+YaNHxTb Y/RQxlhKnrG1kt7lvyT3vz2458wuBvcfMBykw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=4SoW90uiVGeXBwQDZBoEdwVJr27rAmCSY/9P69WvW2g=; b=npE4hI0JdHb2NAZNrab4fnJhdLvJCw70WpaSYp+vQS5HhK6CLyNnNs2BqXmi3xGffz G2Cv8rxQEi3fxCatM1cWq7r8X7BmdAJn5q8/JhC47gg/pJ3aoc+bkpbU2VnOMGCZ9cOw uKLQMcr72FCbh16w3trBYiX0esmhlCiClEoh3A5BFbdzEHQgV7S1sKw5LtdAHpcL0Mz3 H+RElpWPTtLyPa7lnFTNykXoAXY2BY8hHFuyisfv7R5MCmv/SiWZpBNEKAd+R8JqPOhz 0mYs+PwN7UR2uVJ/R6wsgbJpUMUT72AqafscX+RZWI/A8/nY+7Fbvj2RL0/1q2zaTa7Q 4PRQ== X-Gm-Message-State: APzg51CzpdGhpUk1VhV1CQ74o6GbeTIs5caGmlIzS5FFr+zK/tz30xfg 59wpgyc0Uyge0zwLy5wrAqS9JQ== X-Received: by 2002:a50:bb69:: with SMTP id y96-v6mr14164358ede.10.1536870143231; Thu, 13 Sep 2018 13:22:23 -0700 (PDT) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id x44-v6sm2117869edd.1.2018.09.13.13.22.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 13:22:22 -0700 (PDT) Subject: Re: [PATCH] arm64: defconfig: enable EFI_ARMSTUB_DTB_LOADER To: Ard Biesheuvel , Olof Johansson Cc: Grant Likely , Catalin Marinas , Will Deacon , Arnd Bergmann , Broadcom Kernel Feedback List , Linux ARM , Linux Kernel Mailing List , Leif Lindholm , Alexander Graf References: <1535563287-24803-1-git-send-email-scott.branden@broadcom.com> <1946321c-704c-f800-1007-b720d6c7f162@broadcom.com> From: Scott Branden Message-ID: Date: Thu, 13 Sep 2018 13:22:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18-09-10 11:08 AM, Ard Biesheuvel wrote: > On 10 September 2018 at 20:01, Olof Johansson wrote: >> On Mon, Sep 10, 2018 at 10:53 AM, Scott Branden >> wrote: >>> Olof/All, >>> >>> >>> On 18-09-04 03: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. >>>> >>>> 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. >>>> >>>> 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. >>>> >>>>>> 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. >>> What's the path forward? Revert, defconfig change (this patch), or Kconfig >>> default addition? >> Revert or Kconfig select, and a Kconfig select means that the option >> is a dead one anyway so we might as well revert. >> > I disagree. Making it default y is fine by me, but please don't remove it. > >> Ard, do you have other fixes lined up or should we take the patch >> through arm-soc? >> > I don't have any fixes but either way is fine. I submitted the version of the patch Ard requested here for somebody to pick up. https://lore.kernel.org/patchwork/patch/984521/