From patchwork Tue Oct 28 16:18:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 39686 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06A8624046 for ; Tue, 28 Oct 2014 16:24:03 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id h11sf914177wiw.7 for ; Tue, 28 Oct 2014 09:24:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=HIdfx15TG2TaVZv3i2ReaNjDJD/dJ0osugwA3aFLC6U=; b=D8Szyc1bDX7R8P9D2o2l/S9/otKpVZvlpRQJBrgSXhWIWSsBxmc7Iaizb8kDSB1uJu XC0Enx2jMXfTkepodAgX7RMJwip7dgTJtFMMpv5o8ardWUb5fLFugt0HXE6B+R0SuVNg 6da4MU89pXqWHHvhGGJhKljVIt0gBAv96MvaBN1C2AeCAfztKCYYQy4uzVjEZrlnfUxf 92gJFss1IObMHsul7z4i6ERw9xJbhKXZxNiiHVl7GkJFQ69eqeKVMID5JwW6sCswDvN2 Nwy14/Ef3dxBQyh2jd7vNEV4K6Y1jprVBQ4jgE6gGb3V0t1mVGcudJtzG0HLcqUR+egz MIzg== X-Gm-Message-State: ALoCoQkwSZNO5AeIfIDTMC64XwSmgGrF58hB5WyIY7CivFBWd5y29ua8nlQZTG/eokCgPVfgfKgf X-Received: by 10.152.42.171 with SMTP id p11mr800262lal.4.1414513443134; Tue, 28 Oct 2014 09:24:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.52 with SMTP id o20ls91267laa.3.gmail; Tue, 28 Oct 2014 09:24:03 -0700 (PDT) X-Received: by 10.112.29.175 with SMTP id l15mr5052857lbh.39.1414513442987; Tue, 28 Oct 2014 09:24:02 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id l10si3305299lbd.29.2014.10.28.09.24.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Oct 2014 09:24:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id w7so898245lbi.40 for ; Tue, 28 Oct 2014 09:24:02 -0700 (PDT) X-Received: by 10.112.14.69 with SMTP id n5mr5199500lbc.34.1414513442883; Tue, 28 Oct 2014 09:24:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp510849lbz; Tue, 28 Oct 2014 09:24:01 -0700 (PDT) X-Received: by 10.70.103.80 with SMTP id fu16mr4587708pdb.128.1414513440759; Tue, 28 Oct 2014 09:24:00 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kt8si1633595pdb.238.2014.10.28.09.24.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Oct 2014 09:24:00 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xj9XC-000790-KG; Tue, 28 Oct 2014 16:22:14 +0000 Received: from mail-wg0-f45.google.com ([74.125.82.45]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xj9Ua-00047r-Dz for linux-arm-kernel@lists.infradead.org; Tue, 28 Oct 2014 16:19:33 +0000 Received: by mail-wg0-f45.google.com with SMTP id x12so1289368wgg.16 for ; Tue, 28 Oct 2014 09:19:13 -0700 (PDT) X-Received: by 10.180.100.106 with SMTP id ex10mr30029187wib.63.1414513152960; Tue, 28 Oct 2014 09:19:12 -0700 (PDT) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id wc7sm2357578wjc.8.2014.10.28.09.19.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Oct 2014 09:19:11 -0700 (PDT) From: Ard Biesheuvel To: leif.lindholm@linaro.org, roy.franz@linaro.org, msalter@redhat.com, mark.rutland@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, matt.fleming@intel.com, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dyoung@redhat.com, yi.li@linaro.org Subject: [PATCH v2 10/10] efi: efi-stub: notify on DTB absence Date: Tue, 28 Oct 2014 17:18:43 +0100 Message-Id: <1414513123-20400-11-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1414513123-20400-1-git-send-email-ard.biesheuvel@linaro.org> References: <1414513123-20400-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141028_091932_648275_989897CD X-CRM114-Status: GOOD ( 13.12 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.45 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.45 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Mark Rutland In the absence of a DTB configuration table, the EFI stub will happily continue attempting to boot a kernel, despite the fact that this kernel may not function without a description of the hardware. In this case, as with a typo'd "dtb=" option (e.g. "dbt=") or many other possible failures, the only output seen by the user will be the rather terse output from the EFI stub: EFI stub: Booting Linux Kernel... To aid those attempting to debug such failures, this patch adds a notice when no DTB is found, making the output more helpful: EFI stub: Booting Linux Kernel... EFI stub: Generating empty DTB Additionally, a positive acknowledgement is added when a user-specified DTB is in use: EFI stub: Booting Linux Kernel... EFI stub: Using DTB from command line Similarly, a positive acknowledgement is added when a DTB from a configuration table is in use: EFI stub: Booting Linux Kernel... EFI stub: Using DTB from configuration table Signed-off-by: Mark Rutland Acked-by: Leif Lindholm Acked-by: Ard Biesheuvel Cc: Mark Salter Cc: Matt Fleming Acked-by: Roy Franz Signed-off-by: Ard Biesheuvel Acked-by: Matt Fleming --- drivers/firmware/efi/libstub/arm-stub.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index 75ee05964cbc..eb48a1a1a576 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c @@ -247,9 +247,18 @@ unsigned long __init efi_entry(void *handle, efi_system_table_t *sys_table, goto fail_free_cmdline; } } - if (!fdt_addr) + + if (fdt_addr) { + pr_efi(sys_table, "Using DTB from command line\n"); + } else { /* Look for a device tree configuration table entry. */ fdt_addr = (uintptr_t)get_fdt(sys_table); + if (fdt_addr) + pr_efi(sys_table, "Using DTB from configuration table\n"); + } + + if (!fdt_addr) + pr_efi(sys_table, "Generating empty DTB\n"); status = handle_cmdline_files(sys_table, image, cmdline_ptr, "initrd=", dram_base + SZ_512M,