From patchwork Thu Jan 31 11:22:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1034114 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="UDpazzBq"; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 43qyXx4QbDz9sBn for ; Thu, 31 Jan 2019 22:23:45 +1100 (AEDT) Received: from localhost ([127.0.0.1]:53032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpARb-0002QG-DJ for incoming@patchwork.ozlabs.org; Thu, 31 Jan 2019 06:23:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpAQf-0002A5-Az for qemu-devel@nongnu.org; Thu, 31 Jan 2019 06:22:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpAQe-0008B0-LC for qemu-devel@nongnu.org; Thu, 31 Jan 2019 06:22:45 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:37438) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpAQe-0008AX-FQ for qemu-devel@nongnu.org; Thu, 31 Jan 2019 06:22:44 -0500 Received: by mail-wm1-x343.google.com with SMTP id g67so2130472wmd.2 for ; Thu, 31 Jan 2019 03:22:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6KMspSn5pQ2uKgLYMeJKO75iQe8Dqi6xIeUCCNIRlxE=; b=UDpazzBqY71x+bWquf8pDFz3rqiUWgqW64JKx1AP8J2VQKZopvKmoTJbDITJrXw4dI s/qmO0HFUlIP9VrMGWtn64VPVa8l2zxA2eTszFEZwpU5LqsCzDlZEqbovNYVX+2MAX/u ko6MWfGLJ9x/On/AhkKHQ/wths2g+ctgWR9Qc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6KMspSn5pQ2uKgLYMeJKO75iQe8Dqi6xIeUCCNIRlxE=; b=Z1r6Vs4ET3j2u9S24+u4gohQE9AFmCE4LTHIPQZRb88TG/qYXM6XJTONjcy8/yYQd5 7fvPXNldKxTUWNmMa+0BXRzfNh8goQfGDrMSUIN04N2XhxwPhKC97mpZuj7TlYRzLJLt ldAMYbXDsKKLORn5Pgc7ts+9/3kXpqmZ2Lh8SX0vHH3rE1ho5IA8YeFeXlh/RUfkVc0T P9HXU8NBRYvHbSOXoKdchaP3NLCLg6my6sPsMR3PmbURtMwKF6Hot0QlO6S2RgBBLB7V CQdhBpQrJvYtMGQK5dorsVSM4kYt/8V9ulGi6IlLL/9dVLxF0Gw+fqZCSx5uRvwNbotK K17Q== X-Gm-Message-State: AHQUAubPwFWc5rxjAeb+HNRVsGRBOZg42B4elYbHTsuP9oB4rq5irF8B mEebB8XNPvFlEzXlwwAH7X+OMA== X-Google-Smtp-Source: AHgI3IYX3QAJ2/O2WvuQLOlrbF9tfJyEZBukSlbR/rzMLkoBfqMZDHxqjZNLfqQbjdO1Xyoi3mERnQ== X-Received: by 2002:a1c:7511:: with SMTP id o17mr906873wmc.42.1548933763132; Thu, 31 Jan 2019 03:22:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id c8sm4078173wrx.42.2019.01.31.03.22.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 03:22:42 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Thu, 31 Jan 2019 11:22:35 +0000 Message-Id: <20190131112240.8395-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 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::343 Subject: [Qemu-devel] [PATCH 0/5] 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: , Cc: Hongbo Zhang , Igor Mammedov , patches@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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. The first four patches in this set are just refactoring, splitting the code in arm_load_kernel() out into a couple of sub-functions for "direct kernel boot" and "firmware boot". The last patch that fixes the issue is then just a one-liner. (Without the refactoring we'd need to use a goto, which is what I wanted to avoid.) thanks -- PMM Peter Maydell (5): hw/arm/boot: Fix block comment style in arm_load_kernel() hw/arm/boot: Factor out "direct kernel boot" code into its own function hw/arm/boot: Factor out "set up firmware boot" code hw/arm/boot: Clarify why arm_setup_firmware_boot() doesn't set env->boot_info hw/arm/boot: Support DTB autoload for firmware-only boots hw/arm/boot.c | 166 +++++++++++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 70 deletions(-) Reviewed-by: Richard Henderson Reviewed-by: Igor Mammedov