Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp823779imm; Fri, 31 Aug 2018 14:30:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZZgNvDnAA67KCcaIsIMwT2yd2jYlW9EkIudSMSbhvptJBRlKK1oM+v/uElKRvunVuGtYED X-Received: by 2002:a17:902:59ce:: with SMTP id d14-v6mr17218857plj.42.1535751011510; Fri, 31 Aug 2018 14:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535751011; cv=none; d=google.com; s=arc-20160816; b=Lt1KlwcknWW0/Ts4JapjXvdX48To6Rz3muc129hNotDjwS5vO0e5en6XuyJeu6nE5n CUlhGGCwM+16598TX0edQdFfKGmStCnZghg4hz7g4QBzUWM+li/2dz4rpqOI5G21nkFZ rDnG35AfXLMucBiVZzNp3JnJWlnjZ0ze2f+b2OCuyLtt8B0k375NeKYj4G32ZJ6ZcXfy 99ScVFUM65L7N9vRWCTELodfhX6RlNdJazs7+BwzLFkz3LGzx97INKoZbKnXxNFSbUQM 4LP3a+NaL0PKIdqvYF2vel+a9cWYn/CqX9/H14OrkkTsWAny2lM33RAcSHGIpItQHdhC ILMw== 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 :arc-authentication-results; bh=OPsUovlMABJGeFdHeNwnykwxvaWpvnEXhRqBdRUkVPc=; b=jDFT9qWYBy0D7jQrHWi1HonQh+/jx5jZLxgzpimqNOwzWczxmkSYVpVTIB/uuKpHdC +iVniDTD9Ftqdlp2kNEMP1mpkH02Wyh+M6TEK3VekTNtafuv/Kgs1OV6f9A6gJlGJjwC fTTzPTSwgbI5+jKdcxItnipa55AEY18yiqdgAT7q0r5ikGZ8dSRP7ErUj/MTySrZ113q hmuQFjIyAViJ+gZJTBw81t+C0gc89i8N4ZCpX8jsYIPlDkpSHwo5kdwgNxo5QtjZFd0X iGz9M1N2jVHGqp+d1jw+YG53aYOKO86D5Hf350JShkxW0vLSGcH1DxKJUvfpWLlVLMZY dcXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=YnPNCLgq; 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 d40-v6si11085760pla.217.2018.08.31.14.29.57; Fri, 31 Aug 2018 14:30:11 -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=YnPNCLgq; 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 S1727628AbeIABhz (ORCPT + 99 others); Fri, 31 Aug 2018 21:37:55 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:42729 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727281AbeIABhy (ORCPT ); Fri, 31 Aug 2018 21:37:54 -0400 Received: by mail-qk1-f194.google.com with SMTP id g13-v6so2333845qki.9 for ; Fri, 31 Aug 2018 14:28:33 -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=OPsUovlMABJGeFdHeNwnykwxvaWpvnEXhRqBdRUkVPc=; b=YnPNCLgqYZpPY4/xjjhz4vQGdvZd0/YDDKa31OWMJUIBXI+Z9Fw6xmMg3SMc3cBGfn JspftWs5GbpOtZNIgXzzHvym2og5cLhBNnPuiN+FOFKshcfSdyJGP+Is7YSibCNVzXi8 9dIlaJ/bpBo7uWN5XyXAExhreHNCyrlDcHG4k= 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=OPsUovlMABJGeFdHeNwnykwxvaWpvnEXhRqBdRUkVPc=; b=JMrlzmYGwWx40BD1rK432cO3ZSUthLVYrpFzjM2REneU/eInLjdhinSKQRKD5c1rx1 mUhjCKZIBSe7FtzasT5lZ8vhAPRyHwur7MOgumcNOWVM0flUJluAUnHuYqg6jlfrAww4 N+3XRHniG1X/BbamL6ToRu1TxsROZZd+11HncYZOCtAvpaLNOQfQIJ4lEYFuTJJgFVpu bsl4l+BXAlP6eQn70gjDvD6aGRqTSEewe5xKxNQs6Hhr0ZpTF+Q3o/uJPY0Dcf0q/tGO Tt10E8KU1Y7Iof8W1ArOLzpiRUhaHRwmTUNkrxQP/DJGqwrq8tzG/RS30rKmL8vf8tlr zjfQ== X-Gm-Message-State: APzg51Aj8a3yzKwSHXgQtLyfjlcE427LxFp6vwia8kqwC+N8mBz702b+ sSPR6MYSwoCc1QRRb7UNAoDFKApWPXHqGw== X-Received: by 2002:a37:8106:: with SMTP id c6-v6mr16638121qkd.261.1535750913181; Fri, 31 Aug 2018 14:28:33 -0700 (PDT) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id c15-v6sm5998049qkm.42.2018.08.31.14.28.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 14:28:32 -0700 (PDT) Subject: Re: [PATCH] arm64: defconfig: enable EFI_ARMSTUB_DTB_LOADER To: Ard Biesheuvel , Olof Johansson Cc: Catalin Marinas , Will Deacon , Arnd Bergmann , BCM Kernel Feedback , Linux ARM Mailing List , Linux Kernel Mailing List References: <1535563287-24803-1-git-send-email-scott.branden@broadcom.com> From: Scott Branden Message-ID: Date: Fri, 31 Aug 2018 14:28:21 -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: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Olof/Ard, On 18-08-30 09: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. 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. > >> 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. dtb= handling does need to be enabled in the only defconfig upstreamed though.  ARM64 maintainers have mandated a single defconfig upstreamed up this point.  If another incompatible efistub is needed in the future then 2 kernel images would need to be built to support booting on all platforms. > >> 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. The EFI stub is the boot wrapper?  Everything works perfectly today with the upstream kernel (with the defconfig fix of the efistub regression). We support a single kernel image booting with multiple DTs (selected in UEFI and passed in via dtb= on command line). >> > 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.. Ard, GRUB is not a requirement to boot the kernel.  But, it sounds like using GRUB may be a solution to your problem?  You could use GRUB and leave the efistub alone then (or at least leave dtb= in the upstream defconfg). Regards,  Scott