public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 4/7] ARM: switch to non-secure state during bootm execution
Date: Tue, 30 Jul 2013 07:23:58 -0700	[thread overview]
Message-ID: <20130730142358.GA6722@cbox> (raw)
In-Reply-To: <51F7A43E.4020903@linaro.org>

On Tue, Jul 30, 2013 at 01:32:14PM +0200, Andre Przywara wrote:
> On 07/30/2013 12:02 AM, Christoffer Dall wrote:
> >On Wed, Jul 10, 2013 at 01:54:16AM +0200, Andre Przywara wrote:
> >
> >[...]
> >
> >>diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> >>index 1b6e0ac..7b0619e 100644
> >>--- a/arch/arm/lib/bootm.c
> >>+++ b/arch/arm/lib/bootm.c
> >>@@ -34,6 +34,10 @@
> >>  #include <asm/bootm.h>
> >>  #include <linux/compiler.h>
> >>
> >>+#ifdef CONFIG_ARMV7_NONSEC
> >>+#include <asm/armv7.h>
> >>+#endif
> >>+
> >>  DECLARE_GLOBAL_DATA_PTR;
> >>
> >>  static struct tag *params;
> >>@@ -186,6 +190,29 @@ static void setup_end_tag(bd_t *bd)
> >>
> >>  __weak void setup_board_tags(struct tag **in_params) {}
> >>
> >>+static void do_nonsec_virt_switch(void)
> >>+{
> >>+#ifdef CONFIG_ARMV7_NONSEC
> >>+	int ret;
> >>+
> >>+	ret = armv7_switch_nonsec();
> >>+	switch (ret) {
> >>+	case NONSEC_VIRT_SUCCESS:
> >>+		debug("entered non-secure state\n");
> >>+		break;
> >>+	case NONSEC_ERR_NO_SEC_EXT:
> >>+		printf("nonsec: Security extensions not implemented.\n");
> >>+		break;
> >>+	case NONSEC_ERR_NO_GIC_ADDRESS:
> >>+		printf("nonsec: could not determine GIC address.\n");
> >>+		break;
> >>+	case NONSEC_ERR_GIC_ADDRESS_ABOVE_4GB:
> >>+		printf("nonsec: PERIPHBASE is above 4 GB, no access.\n");
> >>+		break;
> >>+	}
> >>+#endif
> >>+}
> >
> >I still don't get why you just don't make armv7_switch_nonsec a void and
> >print the error when they occur... ???
> 
> My apologies for not elaborating on these comments I didn't incorporate:
> 
> So, I don't like the idea of marrying a low-level routine with high
> level output. I don't want to constraint the usage of the routine by
> requiring an output channel. Also some parts may not be fatal for
> all users - someone could just try to switch and then behave
> differently if that failed - without bothering the user.
> May seem a bit over-engineered, but I like it better this way ;-)
> 
> If that is a show-stopper for you, I can change it, of course.
> 
I won't hold back my ack for the patch series based on this, but I do
think it's over-engineered.  I think at least just returning -1 for
error and 0 for success (or even make it a bool) and just printing a
generic error message is cleaner - the level of details as to why the
switch to hyp/nonsec didn't work could then be debug statements that a
board developer could enable with a "#define DEBUG 1" in the
corresponding file.

But ok, we've had the conversation, if you still feel this is better and
necessary, then I'll let it be.

-Christoffer

  reply	other threads:[~2013-07-30 14:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 23:54 [U-Boot] [PATCH v3 0/7] ARMv7: Add HYP mode switching support Andre Przywara
2013-07-09 23:54 ` [U-Boot] [PATCH v3 1/7] ARM: prepare armv7.h to be included from assembly source Andre Przywara
2013-07-09 23:54 ` [U-Boot] [PATCH v3 2/7] ARM: add secure monitor handler to switch to non-secure state Andre Przywara
2013-07-29 22:02   ` Christoffer Dall
2013-07-30 11:38     ` Andre Przywara
2013-07-09 23:54 ` [U-Boot] [PATCH v3 3/7] ARM: add assembly routine " Andre Przywara
2013-07-10 12:47   ` Nikolay Nikolaev
2013-07-09 23:54 ` [U-Boot] [PATCH v3 4/7] ARM: switch to non-secure state during bootm execution Andre Przywara
2013-07-10 12:49   ` Nikolay Nikolaev
2013-07-29 22:02   ` Christoffer Dall
2013-07-30 11:32     ` Andre Przywara
2013-07-30 14:23       ` Christoffer Dall [this message]
2013-07-09 23:54 ` [U-Boot] [PATCH v3 5/7] ARM: add SMP support for non-secure switch Andre Przywara
2013-07-29 22:02   ` Christoffer Dall
2013-07-30 11:51     ` Andre Przywara
2013-07-30 14:28       ` Christoffer Dall
2013-07-09 23:54 ` [U-Boot] [PATCH v3 6/7] ARM: extend non-secure switch to also go into HYP mode Andre Przywara
2013-07-29 22:02   ` Christoffer Dall
2013-07-30 11:59     ` Andre Przywara
2013-07-30 14:31       ` Christoffer Dall
2013-08-05  5:15   ` Masahiro Yamada
2013-07-09 23:54 ` [U-Boot] [PATCH v3 7/7] ARM: VExpress: enable ARMv7 virt support for VExpress A15 Andre Przywara

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=20130730142358.GA6722@cbox \
    --to=christoffer.dall@linaro.org \
    --cc=u-boot@lists.denx.de \
    /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