From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: stefano.stabellini@citrix.com,
Julien Grall <julien.grall@linaro.org>,
tim@xen.org, ian.campbell@citrix.com, Fu Wei <fu.wei@linaro.org>
Subject: [PATCH 2/3] xen/arm: Use p2m_restore_state in construct_dom0
Date: Wed, 19 Mar 2014 15:43:38 +0000 [thread overview]
Message-ID: <1395243819-30380-3-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1395243819-30380-1-git-send-email-julien.grall@linaro.org>
The address translation functions used while building dom0 rely on certain EL1
state being configured. In particular they are subject to the behaviour of
SCTLR_EL1.M (stage 1 MMU enabled).
The Xen (and Linux) boot protocol require that the kernel be entered with the
MMU disabled but they don't say anything explicitly about exception levels
other than the one which is active when entering the kernels. Arguably the
protocol could be said to apply to all exception levels but in any case we
should cope with this and setup the EL1 state as necessary.
Fu Wei discovered this when booting Xen from grub.efi over UEFI, it's not
clear whether grub or UEFI is responsible for leaving stage 1 MMU enabled.
Use directly the newly created function p2m_restore_state to retrieve a
correct EL1 state to translate an address.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reported-by: Fu Wei <fu.wei@linaro.org>
---
xen/arch/arm/domain_build.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d3345bf..9eb9f75 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1021,14 +1021,7 @@ int construct_dom0(struct domain *d)
return rc;
/* The following loads use the domain's p2m */
- p2m_load_VTTBR(d);
-#ifdef CONFIG_ARM_64
- d->arch.type = kinfo.type;
- if ( is_32bit_domain(d) )
- WRITE_SYSREG(READ_SYSREG(HCR_EL2) & ~HCR_RW, HCR_EL2);
- else
- WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_RW, HCR_EL2);
-#endif
+ p2m_restore_state(v);
/*
* kernel_load will determine the placement of the initrd & fdt in
--
1.7.10.4
next prev parent reply other threads:[~2014-03-19 15:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-19 15:43 [PATCH 0/3] xen/arm: setup a sane EL1 state while building domain 0 Julien Grall
2014-03-19 15:43 ` [PATCH 1/3] xen/arm: Move p2m context save/restore in a separate function Julien Grall
2014-03-20 17:23 ` Tim Deegan
2014-03-20 17:59 ` Julien Grall
2014-03-21 9:19 ` Ian Campbell
2014-03-28 12:44 ` Julien Grall
2014-03-28 12:47 ` Ian Campbell
2014-03-28 13:23 ` Julien Grall
2014-04-01 10:53 ` Ian Campbell
2014-03-21 16:52 ` Ian Campbell
2014-03-19 15:43 ` Julien Grall [this message]
2014-03-21 16:50 ` [PATCH 2/3] xen/arm: Use p2m_restore_state in construct_dom0 Ian Campbell
2014-03-28 13:26 ` Julien Grall
2014-03-28 13:51 ` Ian Campbell
2014-03-19 15:43 ` [PATCH 3/3] xen/arm: Don't need to export p2m_load_VTTBR Julien Grall
2014-03-21 16:52 ` Ian Campbell
2014-04-01 10:53 ` [PATCH 0/3] xen/arm: setup a sane EL1 state while building domain 0 Ian Campbell
2014-04-01 11:33 ` Fu Wei
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=1395243819-30380-3-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=fu.wei@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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).