From patchwork Tue Feb 5 17:05:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 10797823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FA5D1390 for ; Tue, 5 Feb 2019 17:28:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C7952C6E0 for ; Tue, 5 Feb 2019 17:28:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E3F02C6D9; Tue, 5 Feb 2019 17:28:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 183C12C6D9 for ; Tue, 5 Feb 2019 17:28:46 +0000 (UTC) Received: from localhost ([127.0.0.1]:35517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gr4Wb-0004O2-A7 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 05 Feb 2019 12:28:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gr4AS-0001uV-M9 for qemu-devel@nongnu.org; Tue, 05 Feb 2019 12:05:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gr4AR-0000Yx-I2 for qemu-devel@nongnu.org; Tue, 05 Feb 2019 12:05:52 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:35761) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gr4AR-0000V1-7T for qemu-devel@nongnu.org; Tue, 05 Feb 2019 12:05:51 -0500 Received: by mail-wr1-x443.google.com with SMTP id z18so3712104wrh.2 for ; Tue, 05 Feb 2019 09:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=OfKY4K9BkMjjwiqunb7cujWZfwYnebUV8ouMZGLQAag=; b=n3Ngm2jtNtXEJPJ/m3Bmrj/n5p+Bzj1S99PEI4PCR4ejg8eIBlDPJcDzRAlzOsygJr T6eUh+yAKw1VoaQCQmBnFL9BxEHI0wK1Ja6I7vL3LE7o2E4mIuITlDMmMST95z2sxOas BbO6PBI0ipjzL1Y1yH/v+0sLjtJ9J7ViDl8/qjGHTlR0bu6MPDcTrJClKxoIESTXEQs+ mHaHdd5wQcwF7ZKcerdfwfvDoC05EF7O9VOnXTZ1jzGO6HkqaEfP3+hDyg9KNFeNXT1m ktFdPlgcoa3+Jin+VOjW/U/3oCR4UhoQSxYK6gaACwV7U5o+ZcnNPBArzAZ3+p+Evs9R rUlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OfKY4K9BkMjjwiqunb7cujWZfwYnebUV8ouMZGLQAag=; b=bDTz7H6JvqUmReWm2KTGwW1dAnEuJz0exMkACKkKXaC3z6qkxTm4rBcsIAXZgBIRRx Uobv0+HOkFCXf93yuPsMzlQA9a11v/5T3FwpzNsr1sv3ub2sds25Pzss9F1a8NuLiZTi 7PlYQgB1F/RpypkvR/kIj7DkKJXOsakdEEQQQ7lyv5ip57kNTZUKi/cleLjxGtNOObbo qQUTOrq8e/Tv8uPeRlU5Nzwfvogqi29vO084xmI7Fr75WtOaUIVxAx5K3Ogo71gFQkEj RMhOQQWqdhDUMDDLBBDZKIG8M6iNnyqa5cx9KmGZ8TQdjVuE8VW7M4ngsfG1tzKf+k+5 YTWA== X-Gm-Message-State: AHQUAuZSO6X6ZrC+s/BIH5ZSAaYGHBGyLbHrDkC40RxuPsanhS8tymgx rRCcvZ3nOU0go2RjZIswZJStLuuSgKIoyw== X-Google-Smtp-Source: AHgI3IbQiV0Cawwvyj/tGTRxzZ1i8vYAhKBmI/LfVJGzVVhvyDXapW5WCfpUAMschZb34fQmzQVdew== X-Received: by 2002:a5d:49cd:: with SMTP id t13mr4539111wrs.144.1549386343795; Tue, 05 Feb 2019 09:05:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id w13sm5583164wmf.5.2019.02.05.09.05.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 09:05:42 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 5 Feb 2019 17:05:09 +0000 Message-Id: <20190205170510.21984-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190205170510.21984-1-peter.maydell@linaro.org> References: <20190205170510.21984-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PULL 21/22] hw/arm/boot: Support DTB autoload for firmware-only boots X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The arm_boot_info struct has a skip_dtb_autoload flag: if this is set to true by the board code then arm_load_kernel() will not load the DTB itself, but will leave this for the board code to do itself later. However, the check for this is done in a code path which is only executed for the case where we load a kernel image file. If we're taking the "boot via firmware" code path then the flag isn't honoured and the DTB is never loaded. We didn't notice this because the only real user of "boot via firmware" that cares about the DTB is the virt board (for UEFI boot), and that always wants skip_dtb_autoload anyway. But the SBSA reference board model we're planning to add will want the flag to behave correctly. Now we've refactored the arm_load_kernel() function, the fix is simple: drop the early 'return' so we fall into the same "load the DTB" code the boot-direct-kernel path uses. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Igor Mammedov Message-id: 20190131112240.8395-6-peter.maydell@linaro.org --- hw/arm/boot.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 328cc6bd245..496c8c18b08 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -1215,7 +1215,6 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) /* Load the kernel. */ if (!info->kernel_filename || info->firmware_loaded) { arm_setup_firmware_boot(cpu, info); - return; } else { arm_setup_direct_kernel_boot(cpu, info); }