qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 06/13] hw/arm/boot: assert that secure_boot and secure_board_setup are false for AArch64
Date: Mon, 19 Mar 2018 18:34:08 +0000	[thread overview]
Message-ID: <20180319183415.1976-7-peter.maydell@linaro.org> (raw)
In-Reply-To: <20180319183415.1976-1-peter.maydell@linaro.org>

Add some assertions that if we're about to boot an AArch64 kernel,
the board code has not mistakenly set either secure_boot or
secure_board_setup. It doesn't make sense to set secure_boot,
because all AArch64 kernels must be booted in non-secure mode.

It might in theory make sense to set secure_board_setup, but
we don't currently support that, because only the AArch32
bootloader[] code calls this hook; bootloader_aarch64[] does not.
Since we don't have a current need for this functionality, just
assert that we don't try to use it. If it's needed we'll add
it later.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180313153458.26822-3-peter.maydell@linaro.org
---
 hw/arm/boot.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 196c7fb242..e21a92f972 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -720,6 +720,13 @@ static void do_cpu_reset(void *opaque)
                     } else {
                         env->pstate = PSTATE_MODE_EL1h;
                     }
+                    /* AArch64 kernels never boot in secure mode */
+                    assert(!info->secure_boot);
+                    /* This hook is only supported for AArch32 currently:
+                     * bootloader_aarch64[] will not call the hook, and
+                     * the code above has already dropped us into EL2 or EL1.
+                     */
+                    assert(!info->secure_board_setup);
                 }
 
                 /* Set to non-secure if not a secure boot */
-- 
2.16.2

  parent reply	other threads:[~2018-03-19 18:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 18:34 [Qemu-devel] [PULL 00/13] target-arm queue Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 01/13] fsl-imx6: Swap Ethernet interrupt defines Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 02/13] dump: Update correct kdump phys_base field for AArch64 Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 03/13] char: i.MX: Simplify imx_update() Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 04/13] char: i.MX: Add support for "TX complete" interrupt Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 05/13] hw/arm/raspi: Don't do board-setup or secure-boot for raspi3 Peter Maydell
2018-03-19 18:34 ` Peter Maydell [this message]
2018-03-19 18:34 ` [Qemu-devel] [PULL 07/13] hw/arm/boot: If booting a kernel in EL2, set SCR_EL3.HCE Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 08/13] hw/arm/bcm2386: Fix parent type of bcm2386 Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 09/13] hw/arm/bcm2836: Rename bcm2836 type/struct to bcm283x Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 10/13] hw/arm/bcm2836: Create proper bcm2837 device Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 11/13] hw/arm/bcm2836: Use correct affinity values for BCM2837 Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 12/13] hw/arm/bcm2836: Hardcode correct CPU type Peter Maydell
2018-03-19 18:34 ` [Qemu-devel] [PULL 13/13] hw/arm/raspi: Provide spin-loop code for AArch64 CPUs Peter Maydell
2018-03-20  9:51 ` [Qemu-devel] [PULL 00/13] target-arm queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180319183415.1976-7-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).