All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	kvm-devel <kvm@vger.kernel.org>
Subject: Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault
Date: Thu, 15 Jan 2015 12:00:20 +0000	[thread overview]
Message-ID: <20150115120020.GD16217@leverpostej> (raw)
In-Reply-To: <20150113133516.GF26222@cbox>

On Tue, Jan 13, 2015 at 01:35:16PM +0000, Christoffer Dall wrote:
> On Tue, Jan 13, 2015 at 12:12:41PM +0000, Peter Maydell wrote:
> > On 13 January 2015 at 12:04, Christoffer Dall
> > <christoffer.dall@linaro.org> wrote:
> > > Additionally, I haven't been able to think of a reasonable guest
> > > scenario where this breaks.  Once the guest turns on its MMU it should
> > > deal with the necessary icache invalidation itself (I think), so we're
> > > really talking about situations where the stage-1 MMU is off, and I
> > > gather that mostly you'll be seeing a single core doing any heavy
> > > lifting and then secondary cores basically coming up, only seeing valid
> > > entries in the icache, and doing the necessary invalidat+turn on mmu
> > > stuff.
> > 
> > The trouble with that is that as the secondary comes up, before it
> > turns on its icache its VA->PA mapping is the identity map; whereas
> > the primary vCPU's VA->PA mapping is "whatever the guest kernel's
> > usual mapping is". If the kernel has some mapping other than identity
> > for the VA which is wherever the secondary-CPU-startup-to-MMU-enable
> > code lives (which seems quite likely), then you have potential problems.
> > 
> Wouldn't a guest (and I believe Linux does this) reserve ASID 0 for
> additional cores and use ASID 1+++ for itself?

Not on arm since 52af9c6cd863fe37 (ARM: 6943/1: mm: use TTBR1 instead of
reserved context ID) and 45b95235b0ac86ce (ARM: 6944/1: mm: allow ASID 0
to be allocated to tasks). The swapper_pg_dir uses global mappings since
d427958a46af24f7 (ARM: 6942/1: mm: make TTBR1 always point to
swapper_pg_dir on ARMv6/7).

Similarly on arm64 the swapper_pg_dir and idmap_pg_dir use global
mappings and we don't reserve any ASIDs for use by the kernel.

Thanks,
Mark.

  parent reply	other threads:[~2015-01-15 12:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 11:59 [PATCH 0/4] arm/arm64: KVM: Random selection of MM related fixes Marc Zyngier
2015-01-08 11:59 ` [PATCH 1/4] mm: Correct ordering of *_clear_flush_young_notify Marc Zyngier
2015-01-08 13:12   ` Paolo Bonzini
2015-01-08 19:00   ` Andrea Arcangeli
2015-01-12 10:15     ` Steve Capper
2015-01-08 11:59 ` [PATCH 2/4] arm/arm64: KVM: Use set/way op trapping to track the state of the caches Marc Zyngier
2015-01-09 11:19   ` Christoffer Dall
2015-01-09 11:38     ` Marc Zyngier
2015-01-09 12:12       ` Christoffer Dall
2015-01-08 11:59 ` [PATCH 3/4] arm/arm64: KVM: Flush caches to memory on unmap Marc Zyngier
2015-01-09 12:30   ` Christoffer Dall
2015-01-09 14:35     ` Marc Zyngier
2015-01-11 12:30       ` Christoffer Dall
2015-01-12 11:15         ` Marc Zyngier
2015-01-12 20:13           ` Christoffer Dall
2015-01-13 13:47             ` Christoffer Dall
2015-01-13 13:57               ` Marc Zyngier
2015-01-08 11:59 ` [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault Marc Zyngier
2015-01-08 12:30   ` Peter Maydell
2015-01-08 13:07     ` Marc Zyngier
2015-01-08 13:16       ` Peter Maydell
2015-01-08 15:06         ` Marc Zyngier
2015-01-08 15:21           ` Peter Maydell
2015-01-09 12:50             ` Christoffer Dall
2015-01-09 13:03               ` Peter Maydell
2015-01-09 14:16                 ` Marc Zyngier
2015-01-09 15:28                   ` Peter Maydell
2015-01-09 17:18                     ` Marc Zyngier
2015-01-11 12:33                     ` Christoffer Dall
2015-01-11 17:37                       ` Peter Maydell
2015-01-11 17:58                         ` Christoffer Dall
2015-01-11 18:27                           ` Peter Maydell
2015-01-11 18:38                             ` Christoffer Dall
2015-01-12  9:58                               ` Marc Zyngier
2015-01-12 20:10                                 ` Christoffer Dall
2015-01-13 11:38                                   ` Marc Zyngier
2015-01-13 12:04                                     ` Christoffer Dall
2015-01-13 12:12                                       ` Peter Maydell
2015-01-13 13:35                                         ` Christoffer Dall
2015-01-13 13:41                                           ` Peter Maydell
2015-01-13 13:49                                             ` Christoffer Dall
2015-01-15 12:00                                           ` Mark Rutland [this message]
2015-01-15 13:00                                             ` Christoffer Dall
2015-01-15 15:47                                               ` Mark Rutland
2015-01-09 12:51   ` Christoffer Dall

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=20150115120020.GD16217@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=peter.maydell@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.