xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, tim@xen.org,
	Fu Wei <fu.wei@linaro.org>,
	stefano.stabellini@citrix.com
Subject: Re: [PATCH 2/3] xen/arm: Use p2m_restore_state in construct_dom0
Date: Fri, 28 Mar 2014 13:26:28 +0000	[thread overview]
Message-ID: <53357884.2020504@linaro.org> (raw)
In-Reply-To: <1395420636.25521.23.camel@kazak.uk.xensource.com>

On 03/21/2014 04:50 PM, Ian Campbell wrote:
> On Wed, 2014-03-19 at 15:43 +0000, Julien Grall wrote:
>> 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>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> I think this will leave some initial dom0 vcpu state in the idle vcpu
> (my patch had the same issue), but I think that is tolerable. It might
> just be worth clearing HCR_VM and perhaps VTTBR (more worried about the
> VMID than the base address) when scheduling an idle vcpu.

I think it's already the case when idle VPCU are scheduled. We don't
change the VTTBR so it keeps the one used by the previous running VCPU.

-- 
Julien Grall

  reply	other threads:[~2014-03-28 13:26 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 ` [PATCH 2/3] xen/arm: Use p2m_restore_state in construct_dom0 Julien Grall
2014-03-21 16:50   ` Ian Campbell
2014-03-28 13:26     ` Julien Grall [this message]
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=53357884.2020504@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=fu.wei@linaro.org \
    --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).