All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall@linaro.org>
To: Andrew Jones <drjones@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [Qemu-devel] [RFC/RFT PATCH v2 0/3] KVM: Introduce KVM_MEM_UNCACHED
Date: Fri, 15 May 2015 08:09:49 -0700	[thread overview]
Message-ID: <20150515150949.GC14144@lvm> (raw)
In-Reply-To: <20150514133637.GE12812@localhost.localdomain>

On Thu, May 14, 2015 at 03:36:37PM +0200, Andrew Jones wrote:
> On Thu, May 14, 2015 at 02:11:59PM +0100, Peter Maydell wrote:
> > On 14 May 2015 at 14:03, Andrew Jones <drjones@redhat.com> wrote:
> > > On Thu, May 14, 2015 at 11:37:46AM +0100, Peter Maydell wrote:
> > >> On 14 May 2015 at 11:31, Andrew Jones <drjones@redhat.com> wrote:
> > >> > Forgot to (4): switch from setting userspace's mapping to
> > >> > device memory to normal, non-cacheable. Using device memory
> > >> > caused a problem that Alex Graf found, and Peter Maydell suggested
> > >> > using normal, non-cacheable instead.
> > >>
> > >> Did you check that non-cacheable is definitely the correct
> > >> kind of Normal memory attribute we want? (ie not write-through).
> > >
> > > I was concerned that write-through wouldn't be sufficient. If the
> > > guest writes to its non-cached memory, and QEMU needs to see what
> > > it wrote, then won't write-through fail to work? Unless we some
> > > how invalidate the cache first?
> > 
> > Well, I meant more that the correct mapping for userspace is
> > the same as the guest, whatever that is, and so somebody needs
> > to look at what the guest actually does rather than merely
> > hoping NormalNC is OK. (For instance, do we need to provide
> > support for QEMU to map both NC and writethrough?)
> >
> 
> Ah, we assume the guest is mapping it as device memory, and in
> this version of the series, I ensure that it is at least NC with
> the S2 attributes. I don't think we can look at what some guests
> do with some devices to come up with anything beyond (poor?)
> heuristics. I prefer that we force both the guest and QEMU to NC
> (or guest chooses Device and QEMU is forced to NC) to make sure
> we get it right.
> 
But picking up on Peter's feedback I think it would be good if the
series clearly states something like:

1) We assume that the guest may use device type memory for the accesses
2) we cannot use device memory for the userspace mapping because
userspace may be doing unaligned accesses to it 3) normal non-cacheable
bridges these worlds becauase of x, y, and z.

I assume x, y, and z would include a fairly involved discussion of the
interesting aspects of how you can configure memory accesses on ARM ...
:)

-Christoffer

WARNING: multiple messages have this Message-ID (diff)
From: Christoffer Dall <christoffer.dall@linaro.org>
To: Andrew Jones <drjones@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Alexander Graf <agraf@suse.de>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [Qemu-devel] [RFC/RFT PATCH v2 0/3] KVM: Introduce KVM_MEM_UNCACHED
Date: Fri, 15 May 2015 08:09:49 -0700	[thread overview]
Message-ID: <20150515150949.GC14144@lvm> (raw)
In-Reply-To: <20150514133637.GE12812@localhost.localdomain>

On Thu, May 14, 2015 at 03:36:37PM +0200, Andrew Jones wrote:
> On Thu, May 14, 2015 at 02:11:59PM +0100, Peter Maydell wrote:
> > On 14 May 2015 at 14:03, Andrew Jones <drjones@redhat.com> wrote:
> > > On Thu, May 14, 2015 at 11:37:46AM +0100, Peter Maydell wrote:
> > >> On 14 May 2015 at 11:31, Andrew Jones <drjones@redhat.com> wrote:
> > >> > Forgot to (4): switch from setting userspace's mapping to
> > >> > device memory to normal, non-cacheable. Using device memory
> > >> > caused a problem that Alex Graf found, and Peter Maydell suggested
> > >> > using normal, non-cacheable instead.
> > >>
> > >> Did you check that non-cacheable is definitely the correct
> > >> kind of Normal memory attribute we want? (ie not write-through).
> > >
> > > I was concerned that write-through wouldn't be sufficient. If the
> > > guest writes to its non-cached memory, and QEMU needs to see what
> > > it wrote, then won't write-through fail to work? Unless we some
> > > how invalidate the cache first?
> > 
> > Well, I meant more that the correct mapping for userspace is
> > the same as the guest, whatever that is, and so somebody needs
> > to look at what the guest actually does rather than merely
> > hoping NormalNC is OK. (For instance, do we need to provide
> > support for QEMU to map both NC and writethrough?)
> >
> 
> Ah, we assume the guest is mapping it as device memory, and in
> this version of the series, I ensure that it is at least NC with
> the S2 attributes. I don't think we can look at what some guests
> do with some devices to come up with anything beyond (poor?)
> heuristics. I prefer that we force both the guest and QEMU to NC
> (or guest chooses Device and QEMU is forced to NC) to make sure
> we get it right.
> 
But picking up on Peter's feedback I think it would be good if the
series clearly states something like:

1) We assume that the guest may use device type memory for the accesses
2) we cannot use device memory for the userspace mapping because
userspace may be doing unaligned accesses to it 3) normal non-cacheable
bridges these worlds becauase of x, y, and z.

I assume x, y, and z would include a fairly involved discussion of the
interesting aspects of how you can configure memory accesses on ARM ...
:)

-Christoffer

  reply	other threads:[~2015-05-15 15:00 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 11:31 [RFC/RFT PATCH v2 0/3] KVM: Introduce KVM_MEM_UNCACHED Andrew Jones
2015-05-13 11:31 ` [Qemu-devel] " Andrew Jones
2015-05-13 11:31 ` [RFC/RFT PATCH v2 1/3] arm/arm64: pageattr: add set_memory_nc Andrew Jones
2015-05-13 11:31   ` [Qemu-devel] " Andrew Jones
2015-05-14 11:05   ` Christoffer Dall
2015-05-14 11:05     ` [Qemu-devel] " Christoffer Dall
2015-05-14 13:46     ` Andrew Jones
2015-05-14 13:46       ` [Qemu-devel] " Andrew Jones
2015-05-15 14:51       ` Christoffer Dall
2015-05-15 14:51         ` [Qemu-devel] " Christoffer Dall
2015-05-18 15:53       ` Catalin Marinas
2015-05-18 15:53         ` [Qemu-devel] " Catalin Marinas
2015-05-19 10:03         ` Andrew Jones
2015-05-19 10:03           ` [Qemu-devel] " Andrew Jones
2015-05-19 11:18           ` Catalin Marinas
2015-05-19 11:18             ` [Qemu-devel] " Catalin Marinas
2015-05-19 11:38             ` Andrew Jones
2015-05-19 11:38               ` [Qemu-devel] " Andrew Jones
2015-05-20 10:01             ` Christoffer Dall
2015-05-20 10:01               ` [Qemu-devel] " Christoffer Dall
2015-05-20 11:24               ` Catalin Marinas
2015-05-20 11:24                 ` [Qemu-devel] " Catalin Marinas
2015-05-23  1:08         ` Mario Smarduch
2015-05-23  1:08           ` [Qemu-devel] " Mario Smarduch
2015-05-25 17:11           ` Andrew Jones
2015-05-25 17:11             ` Andrew Jones
2015-05-27  1:08             ` Mario Smarduch
2015-05-27  1:08               ` Mario Smarduch
2015-05-13 11:31 ` [RFC/RFT PATCH v2 2/3] KVM: promote KVM_MEMSLOT_INCOHERENT to uapi Andrew Jones
2015-05-13 11:31   ` [Qemu-devel] " Andrew Jones
2015-05-14 10:12   ` Paolo Bonzini
2015-05-14 10:12     ` [Qemu-devel] " Paolo Bonzini
2015-05-14 10:34   ` Christoffer Dall
2015-05-14 10:34     ` [Qemu-devel] " Christoffer Dall
2015-05-13 11:31 ` [RFC/RFT PATCH v2 3/3] arm/arm64: KVM: implement 'uncached' mem coherency Andrew Jones
2015-05-13 11:31   ` [Qemu-devel] " Andrew Jones
2015-05-14 10:55   ` Christoffer Dall
2015-05-14 10:55     ` [Qemu-devel] " Christoffer Dall
2015-05-14 13:32     ` Andrew Jones
2015-05-14 13:32       ` Andrew Jones
2015-05-15 15:02       ` Christoffer Dall
2015-05-15 15:02         ` Christoffer Dall
2015-05-15 17:04         ` Andrew Jones
2015-05-15 17:04           ` Andrew Jones
2015-05-15 20:16           ` Jérémy Fanguède
2015-05-15 20:16             ` Jérémy Fanguède
2015-05-21  2:29           ` Mario Smarduch
2015-05-21  2:29             ` Mario Smarduch
2015-05-21 16:50             ` Andrew Jones
2015-05-21 16:50               ` Andrew Jones
2015-05-14 10:30 ` [RFC/RFT PATCH v2 0/3] KVM: Introduce KVM_MEM_UNCACHED Christoffer Dall
2015-05-14 10:30   ` [Qemu-devel] " Christoffer Dall
2015-05-14 11:09   ` Laszlo Ersek
2015-05-14 11:09     ` [Qemu-devel] " Laszlo Ersek
2015-05-14 11:29     ` Christoffer Dall
2015-05-14 11:29       ` [Qemu-devel] " Christoffer Dall
2015-05-14 11:31       ` Paolo Bonzini
2015-05-14 11:31         ` [Qemu-devel] " Paolo Bonzini
2015-05-14 11:36         ` Christoffer Dall
2015-05-14 11:36           ` [Qemu-devel] " Christoffer Dall
2015-05-14 11:38           ` Paolo Bonzini
2015-05-14 11:38             ` [Qemu-devel] " Paolo Bonzini
2015-05-14 12:00             ` Christoffer Dall
2015-05-14 12:00               ` [Qemu-devel] " Christoffer Dall
2015-05-14 12:08               ` Paolo Bonzini
2015-05-14 12:08                 ` [Qemu-devel] " Paolo Bonzini
2015-05-14 12:24                 ` Christoffer Dall
2015-05-14 12:24                   ` [Qemu-devel] " Christoffer Dall
2015-05-14 12:28                   ` Paolo Bonzini
2015-05-14 12:28                     ` [Qemu-devel] " Paolo Bonzini
2015-05-14 12:34                     ` Christoffer Dall
2015-05-14 12:34                       ` [Qemu-devel] " Christoffer Dall
2015-05-14 13:01                       ` Laszlo Ersek
2015-05-14 13:01                         ` [Qemu-devel] " Laszlo Ersek
2015-05-14 12:38                     ` Peter Maydell
2015-05-14 12:38                       ` [Qemu-devel] " Peter Maydell
2015-05-14 13:00                       ` Andrew Jones
2015-05-14 13:00                         ` Andrew Jones
2015-05-14 13:32                         ` Laszlo Ersek
2015-05-14 13:32                           ` Laszlo Ersek
2015-05-14 13:48                           ` Michael S. Tsirkin
2015-05-14 13:48                             ` Michael S. Tsirkin
2015-05-14 14:19                             ` Laszlo Ersek
2015-05-14 14:19                               ` Laszlo Ersek
2015-05-14 14:41                               ` Michael S. Tsirkin
2015-05-14 14:41                                 ` Michael S. Tsirkin
2015-05-15  9:00                                 ` Ard Biesheuvel
2015-05-15  9:00                                   ` Ard Biesheuvel
2015-05-14 10:31 ` Andrew Jones
2015-05-14 10:31   ` [Qemu-devel] " Andrew Jones
2015-05-14 10:37   ` Peter Maydell
2015-05-14 10:37     ` [Qemu-devel] " Peter Maydell
2015-05-14 13:03     ` Andrew Jones
2015-05-14 13:03       ` [Qemu-devel] " Andrew Jones
2015-05-14 13:11       ` Peter Maydell
2015-05-14 13:11         ` [Qemu-devel] " Peter Maydell
2015-05-14 13:33         ` Laszlo Ersek
2015-05-14 13:33           ` [Qemu-devel] " Laszlo Ersek
2015-05-14 13:36         ` Andrew Jones
2015-05-14 13:36           ` Andrew Jones
2015-05-15 15:09           ` Christoffer Dall [this message]
2015-05-15 15:09             ` 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=20150515150949.GC14144@lvm \
    --to=christoffer.dall@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=drjones@redhat.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=lersek@redhat.com \
    --cc=marc.zyngier@arm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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.