From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtHUb-0003R8-UL for qemu-devel@nongnu.org; Fri, 15 May 2015 11:25:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtHUW-0006Ge-Qa for qemu-devel@nongnu.org; Fri, 15 May 2015 11:25:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtHUW-0006GW-HR for qemu-devel@nongnu.org; Fri, 15 May 2015 11:25:36 -0400 Message-ID: <55560FC7.30108@redhat.com> Date: Fri, 15 May 2015 17:24:55 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430817191-6231-1-git-send-email-j.fanguede@virtualopensystems.com> <20150506141249.GA6796@cbox> <20150507112027.GC25885@cbox> <554B9A70.6020309@redhat.com> <5555DBFD.4080503@redhat.com> <20150515151235.GD14144@lvm> In-Reply-To: <20150515151235.GD14144@lvm> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] ARM/ARM64: KVM: Implement KVM_FLUSH_DCACHE_GPA ioctl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoffer Dall , Laszlo Ersek Cc: list@lists.cs.columbia.edu, Overall , QEMU Developers , open@lists.cs.columbia.edu, =?windows-1252?Q?J=E9r=E9my_Fangu=E8de?= , VirtualOpenSystems Technical Team , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" 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