public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
	"lersek@redhat.com" <lersek@redhat.com>,
	"drjones@redhat.com" <drjones@redhat.com>,
	"wei@redhat.com" <wei@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots
Date: Mon, 17 Nov 2014 17:03:11 +0100	[thread overview]
Message-ID: <546A1C3F.80009@redhat.com> (raw)
In-Reply-To: <546A16A9.6050504@arm.com>



On 17/11/2014 16:39, Marc Zyngier wrote:
> ARM is broadly similar, but there's a number of gotchas:
> - uncacheable (guest level) + cacheable (host level) -> uncacheable: the
> read request is going to be directly sent to RAM, bypassing the caches.
> - Userspace is going to use a cacheable view of the "NOR" pages, which
> is going to stick around in the cache (this is just memory, after all).

Ah, x86 also has uncacheable + cacheable -> uncacheable, but Intel also
added a bit to ignore the guest-provided type.  We use that bit for
RAM-backed areas.

Also, on x86 if the cache is disabled the processor will still snoop
caches (including its own cache) and perform writeback+invalidate of the
cache line before accessing main memory, if it's dirty.  AMD does not
have the aforementioned bit, but applies this same algorithm if the host
says the page is writeback in the MTRR (memory type range register).
The Intel solution is less tricky and has better performance.

Paolo

> The net result is that we need to detect those cases and make sure the
> guest sees the latest bit of data written by userland.
> 
> We already have a similar mechanism when we fault pages in, but the
> guest has not enabled its caches yet.

  reply	other threads:[~2014-11-17 16:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 14:58 [PATCH 1/3] kvm: add a memslot flag for incoherent memory regions Ard Biesheuvel
2014-11-17 14:58 ` [PATCH 2/3] arm, arm64: KVM: allow forced dcache flush on page faults Ard Biesheuvel
2014-11-17 14:58 ` [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots Ard Biesheuvel
2014-11-17 15:29   ` Paolo Bonzini
2014-11-17 15:39     ` Marc Zyngier
2014-11-17 16:03       ` Paolo Bonzini [this message]
2014-11-17 15:49     ` Laszlo Ersek
2014-11-19 23:32       ` Mario Smarduch
2014-11-20  8:08         ` Laszlo Ersek
2014-11-20 18:35           ` Mario Smarduch
2014-11-20 18:40             ` Peter Maydell
2014-11-20 19:15               ` Mario Smarduch
2014-11-20 19:49               ` Jon Masters
2014-11-20 20:10                 ` Peter Maydell
2014-11-20 21:13                   ` Laszlo Ersek
2014-11-20 21:59                     ` Peter Maydell
2014-11-21 11:19         ` Christoffer Dall
2014-11-22  1:50           ` Mario Smarduch
2014-11-22 10:18             ` Christoffer Dall
2014-11-22 10:26               ` Laszlo Ersek
2014-11-22 12:27             ` Peter Maydell
2014-11-19  8:51   ` Ard Biesheuvel
2014-11-19 11:02     ` Paolo Bonzini
2014-11-19 11:03     ` Paolo Bonzini

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=546A1C3F.80009@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=lersek@redhat.com \
    --cc=marc.zyngier@arm.com \
    --cc=wei@redhat.com \
    /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