From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8RJG-0001sM-Ed for qemu-devel@nongnu.org; Tue, 27 Sep 2011 02:38:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8RJF-0001qd-Am for qemu-devel@nongnu.org; Tue, 27 Sep 2011 02:38:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8RJF-0001qT-1C for qemu-devel@nongnu.org; Tue, 27 Sep 2011 02:38:29 -0400 Message-ID: <4E816F5E.60608@redhat.com> Date: Tue, 27 Sep 2011 09:38:22 +0300 From: Avi Kivity MIME-Version: 1.0 References: <87litcs1ly.fsf@ginnungagap.bsc.es> <20110926075159.GA6455@stefanha-thinkpad.localdomain> <87r533piq5.fsf@ginnungagap.bsc.es> In-Reply-To: <87r533piq5.fsf@ginnungagap.bsc.es> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Help writing a trivial device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org On 09/26/2011 03:54 PM, Llu=C3=ADs Vilanova wrote: > It is the second bar that generates the problems with KVM: > > s->data_ptr =3D g_malloc(s->size); > memory_region_init_ram_ptr(&s->data,&s->dev.qdev, "backdoor.data", > s->size, s->data_ptr); > pci_register_bar(&s->dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY,&s->dat= a); > s->data_ptr is not properly aligned. Use memory_region_init_ram(). > > I only had a few minutes and couldn't test reading from BAR0, but yo= u > > might want to get 32-bit reads working first before trying 64-bit. > > The next problem is using 64bit reads and writes... if I set min_access= _size and > max_access_size to 4, I get the calls to 'control_io_read', but not wit= h 8... > 8-byte accesses are not yet supported. --=20 I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.