From: pbonzini@redhat.com (Paolo Bonzini)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings
Date: Thu, 05 Mar 2015 13:26:39 +0100 [thread overview]
Message-ID: <54F84B7F.5010007@redhat.com> (raw)
In-Reply-To: <20150305120348.GD7712@e104818-lin.cambridge.arm.com>
On 05/03/2015 13:03, Catalin Marinas wrote:
>> >
>> > I'd hate to have to do that. PCI should be entirely probeable
>> > given that we tell the guest where the host bridge is, that's
>> > one of its advantages.
> I didn't say a DT node per device, the DT doesn't know what PCI devices
> are available (otherwise it defeats the idea of probing). But we need to
> tell the OS where the host bridge is via DT.
>
> So the guest would be told about two host bridges: one for real devices
> and another for virtual devices. These can have different coherency
> properties.
Yeah, and it would suck that the user needs to know the difference
between the coherency proprties of the host bridges.
It would especially suck if the user has a cluster with different
machines, some of them coherent and others non-coherent, and then has to
debug why the same configuration works on some machines and not on others.
To avoid replying in two different places, which of the solutions look
to me like something that half-works? Pretty much all of them, because
in the end it is just a processor misfeature. For example, Intel
virtualization extensions let the hypervisor override stage1 translation
_if necessary_. AMD doesn't, but has some other quirky things that let
you achieve the same effect..
In particular, I am not even sure that this is about bus coherency,
because this problem does not happen when the device is doing bus master
DMA. Working around coherency for bus master DMA would be easy.
The problem arises with MMIO areas that the guest can reasonably expect
to be uncacheable, but that are optimized by the host so that they end
up backed by cacheable RAM. It's perfectly reasonable that the same
device needs cacheable mapping with one userspace, and works with
uncacheable mapping with another userspace that doesn't optimize the
MMIO area to RAM.
Currently the VGA framebuffer is the main case where this happen, and I
don't expect many more. Because this is not bus master DMA, it's hard
to find a QEMU API that can be hooked to invalidate the cache. QEMU is
just reading from an array of chars.
In practice, the VGA framebuffer has an optimization that uses dirty
page tracking, so we could piggyback on the ioctls that return which
pages are dirty. It turns out that piggybacking on those ioctls also
should fix the case of migrating a guest while the MMU is disabled.
But it's a hack, and it may not work for other devices.
We could use _DSD to export the device tree property separately for each
device, but that wouldn't work for hotplugged devices.
Paolo
next prev parent reply other threads:[~2015-03-05 12:26 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-19 10:54 [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings Ard Biesheuvel
2015-02-19 10:54 ` [RFC/RFT PATCH 1/3] arm64: KVM: handle some sysreg writes in EL2 Ard Biesheuvel
2015-03-03 17:59 ` Mario Smarduch
2015-02-19 10:54 ` [RFC/RFT PATCH 2/3] arm64: KVM: mangle MAIR register to prevent uncached guest mappings Ard Biesheuvel
2015-02-19 10:54 ` [RFC/RFT PATCH 3/3] arm64: KVM: keep trapping of VM sysreg writes enabled Ard Biesheuvel
2015-02-19 13:40 ` Marc Zyngier
2015-02-19 13:44 ` Ard Biesheuvel
2015-02-19 15:19 ` Marc Zyngier
2015-02-19 15:22 ` Ard Biesheuvel
2015-02-19 14:50 ` [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings Alexander Graf
2015-02-19 14:56 ` Ard Biesheuvel
2015-02-19 15:27 ` Alexander Graf
2015-02-19 15:31 ` Ard Biesheuvel
2015-02-19 16:57 ` Andrew Jones
2015-02-19 17:19 ` Ard Biesheuvel
2015-02-19 17:55 ` Andrew Jones
2015-02-19 17:57 ` Paolo Bonzini
2015-02-20 14:29 ` Andrew Jones
2015-02-20 14:37 ` Ard Biesheuvel
2015-02-20 15:36 ` Andrew Jones
2015-02-24 14:55 ` Andrew Jones
2015-02-24 17:47 ` Ard Biesheuvel
2015-02-24 19:12 ` Andrew Jones
2015-03-02 16:31 ` Christoffer Dall
2015-03-02 16:47 ` Paolo Bonzini
2015-03-02 16:55 ` Laszlo Ersek
2015-03-02 17:05 ` Andrew Jones
2015-03-02 16:48 ` Andrew Jones
2015-03-03 2:20 ` Mario Smarduch
2015-03-04 11:35 ` Catalin Marinas
2015-03-04 11:50 ` Ard Biesheuvel
2015-03-04 12:29 ` Catalin Marinas
2015-03-04 12:43 ` Ard Biesheuvel
2015-03-04 14:12 ` Andrew Jones
2015-03-04 14:29 ` Catalin Marinas
2015-03-04 14:34 ` Peter Maydell
2015-03-04 17:03 ` Paolo Bonzini
2015-03-04 17:28 ` Catalin Marinas
2015-03-05 10:12 ` Paolo Bonzini
2015-03-05 11:04 ` Catalin Marinas
2015-03-05 11:52 ` Peter Maydell
2015-03-05 12:03 ` Catalin Marinas
2015-03-05 12:26 ` Paolo Bonzini [this message]
2015-03-05 14:58 ` Catalin Marinas
2015-03-05 17:43 ` Paolo Bonzini
2015-03-06 21:08 ` Mario Smarduch
2015-03-09 14:26 ` Andrew Jones
2015-03-09 15:33 ` Mario Smarduch
2015-03-05 19:13 ` Ard Biesheuvel
2015-03-06 20:33 ` Mario Smarduch
2015-02-19 18:44 ` Ard Biesheuvel
2015-03-03 17:34 ` Alexander Graf
2015-03-03 18:13 ` Laszlo Ersek
2015-03-03 20:58 ` Andrew Jones
2015-03-03 18:32 ` Catalin Marinas
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=54F84B7F.5010007@redhat.com \
--to=pbonzini@redhat.com \
--cc=linux-arm-kernel@lists.infradead.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).