All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christoffer Dall <christoffer.dall@linaro.org>,
	Laszlo Ersek <lersek@redhat.com>
Cc: list@lists.cs.columbia.edu, Overall <kvm@vger.kernel.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	open@lists.cs.columbia.edu,
	VirtualOpenSystems Technical Team <tech@virtualopensystems.com>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC] ARM/ARM64: KVM: Implement KVM_FLUSH_DCACHE_GPA ioctl
Date: Fri, 15 May 2015 17:24:55 +0200	[thread overview]
Message-ID: <55560FC7.30108@redhat.com> (raw)
In-Reply-To: <20150515151235.GD14144@lvm>



On 15/05/2015 17:12, Christoffer Dall wrote:
>>> > > Can you find out what memory attributes the guest is using for the
>>> > > memory---and if it's uncached, why?
>> > 
>> > For USB, see "drivers/usb/core/hcd-pci.c", function usb_hcd_pci_probe():
>> > it uses ioremap_nocache().
>> > 
>> > On the "why", that ioremap_nocache() call can be tracked to
>> > 
>> > http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/?id=a914dd8b
>> > 
>> > (Feb 2002), which predates the kernel's move to git. I guess
>> > ioremap_nocache() is used simply because USB host controllers are
>> > supposed to programmed like that.
>> > 
>> > And, from "arch/arm64/include/asm/io.h":
>> > 
>> > #define ioremap_nocache(addr, size)     __ioremap((addr), (size),
>> > __pgprot(PROT_DEVICE_nGnRE))
>> > 
> So this just means that these devices should be mapped as device memory
> (like the VGA case before) right?  And therefore should work with Drew's
> patches (assuming they are actually correct and you add the right QEMU
> annotations to set the memory regions and non-cacheable), correct?

As far as I understand ioremap_nocache() is used on a MMIO BAR.  QEMU
does not back those with RAM at all, each access causes a userspace exit.

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: pbonzini@redhat.com (Paolo Bonzini)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] ARM/ARM64: KVM: Implement KVM_FLUSH_DCACHE_GPA ioctl
Date: Fri, 15 May 2015 17:24:55 +0200	[thread overview]
Message-ID: <55560FC7.30108@redhat.com> (raw)
In-Reply-To: <20150515151235.GD14144@lvm>



On 15/05/2015 17:12, Christoffer Dall wrote:
>>> > > Can you find out what memory attributes the guest is using for the
>>> > > memory---and if it's uncached, why?
>> > 
>> > For USB, see "drivers/usb/core/hcd-pci.c", function usb_hcd_pci_probe():
>> > it uses ioremap_nocache().
>> > 
>> > On the "why", that ioremap_nocache() call can be tracked to
>> > 
>> > http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/?id=a914dd8b
>> > 
>> > (Feb 2002), which predates the kernel's move to git. I guess
>> > ioremap_nocache() is used simply because USB host controllers are
>> > supposed to programmed like that.
>> > 
>> > And, from "arch/arm64/include/asm/io.h":
>> > 
>> > #define ioremap_nocache(addr, size)     __ioremap((addr), (size),
>> > __pgprot(PROT_DEVICE_nGnRE))
>> > 
> So this just means that these devices should be mapped as device memory
> (like the VGA case before) right?  And therefore should work with Drew's
> patches (assuming they are actually correct and you add the right QEMU
> annotations to set the memory regions and non-cacheable), correct?

As far as I understand ioremap_nocache() is used on a MMIO BAR.  QEMU
does not back those with RAM at all, each access causes a userspace exit.

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christoffer Dall <christoffer.dall@linaro.org>,
	Laszlo Ersek <lersek@redhat.com>
Cc: list@lists.cs.columbia.edu, Overall <kvm@vger.kernel.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	open@lists.cs.columbia.edu,
	"Jérémy Fanguède" <j.fanguede@virtualopensystems.com>,
	"VirtualOpenSystems Technical Team" <tech@virtualopensystems.com>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Qemu-devel] [RFC] ARM/ARM64: KVM: Implement KVM_FLUSH_DCACHE_GPA ioctl
Date: Fri, 15 May 2015 17:24:55 +0200	[thread overview]
Message-ID: <55560FC7.30108@redhat.com> (raw)
In-Reply-To: <20150515151235.GD14144@lvm>



On 15/05/2015 17:12, Christoffer Dall wrote:
>>> > > Can you find out what memory attributes the guest is using for the
>>> > > memory---and if it's uncached, why?
>> > 
>> > For USB, see "drivers/usb/core/hcd-pci.c", function usb_hcd_pci_probe():
>> > it uses ioremap_nocache().
>> > 
>> > On the "why", that ioremap_nocache() call can be tracked to
>> > 
>> > http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/?id=a914dd8b
>> > 
>> > (Feb 2002), which predates the kernel's move to git. I guess
>> > ioremap_nocache() is used simply because USB host controllers are
>> > supposed to programmed like that.
>> > 
>> > And, from "arch/arm64/include/asm/io.h":
>> > 
>> > #define ioremap_nocache(addr, size)     __ioremap((addr), (size),
>> > __pgprot(PROT_DEVICE_nGnRE))
>> > 
> So this just means that these devices should be mapped as device memory
> (like the VGA case before) right?  And therefore should work with Drew's
> patches (assuming they are actually correct and you add the right QEMU
> annotations to set the memory regions and non-cacheable), correct?

As far as I understand ioremap_nocache() is used on a MMIO BAR.  QEMU
does not back those with RAM at all, each access causes a userspace exit.

Paolo

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

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05  9:13 [RFC] ARM/ARM64: KVM: Implement KVM_FLUSH_DCACHE_GPA ioctl Jérémy Fanguède
2015-05-05  9:13 ` [Qemu-devel] " Jérémy Fanguède
2015-05-05  9:13 ` Jérémy Fanguède
2015-05-06 14:12 ` Christoffer Dall
2015-05-06 14:12   ` [Qemu-devel] " Christoffer Dall
2015-05-06 14:12   ` Christoffer Dall
2015-05-07 10:50   ` Jérémy Fanguède
2015-05-07 10:50     ` [Qemu-devel] " Jérémy Fanguède
2015-05-07 10:50     ` Jérémy Fanguède
2015-05-07 11:20     ` Christoffer Dall
2015-05-07 11:20       ` [Qemu-devel] " Christoffer Dall
2015-05-07 11:20       ` Christoffer Dall
2015-05-07 14:50       ` Jérémy Fanguède
2015-05-07 14:50         ` [Qemu-devel] " Jérémy Fanguède
2015-05-07 14:50         ` Jérémy Fanguède
2015-05-07 15:34         ` Christoffer Dall
2015-05-07 15:34           ` [Qemu-devel] " Christoffer Dall
2015-05-07 15:34           ` Christoffer Dall
2015-05-07 16:56           ` Jérémy Fanguède
2015-05-07 16:56             ` [Qemu-devel] " Jérémy Fanguède
2015-05-07 16:56             ` Jérémy Fanguède
2015-05-07 17:01             ` Paolo Bonzini
2015-05-07 17:01               ` [Qemu-devel] " Paolo Bonzini
2015-05-07 17:01               ` Paolo Bonzini
2015-05-15 11:43               ` Laszlo Ersek
2015-05-15 11:43                 ` [Qemu-devel] " Laszlo Ersek
2015-05-15 11:43                 ` Laszlo Ersek
2015-05-15 15:12                 ` Christoffer Dall
2015-05-15 15:12                   ` [Qemu-devel] " Christoffer Dall
2015-05-15 15:12                   ` Christoffer Dall
2015-05-15 15:24                   ` Paolo Bonzini [this message]
2015-05-15 15:24                     ` [Qemu-devel] " Paolo Bonzini
2015-05-15 15:24                     ` 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=55560FC7.30108@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=lersek@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=list@lists.cs.columbia.edu \
    --cc=open@lists.cs.columbia.edu \
    --cc=qemu-devel@nongnu.org \
    --cc=tech@virtualopensystems.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 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.