From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttd82-00037y-Fh for qemu-devel@nongnu.org; Fri, 11 Jan 2013 06:50:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ttd80-00080h-J4 for qemu-devel@nongnu.org; Fri, 11 Jan 2013 06:50:30 -0500 Received: from cantor2.suse.de ([195.135.220.15]:57911 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttd80-00080Y-AX for qemu-devel@nongnu.org; Fri, 11 Jan 2013 06:50:28 -0500 Message-ID: <50EFFC7F.8090606@suse.de> Date: Fri, 11 Jan 2013 12:50:23 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1357895886-14283-1-git-send-email-stefanha@redhat.com> <1357895886-14283-7-git-send-email-stefanha@redhat.com> In-Reply-To: <1357895886-14283-7-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 6/6] hw/pc.c: Fix converting of ioport_register* to MemoryRegion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , Julien Grall Cc: Anthony Liguori , qemu-devel@nongnu.org Am 11.01.2013 10:18, schrieb Stefan Hajnoczi: > From: Julien Grall >=20 > The commit 258711 introduced MemoryRegion to replace ioport_region* > for ioport 80h and F0h. > A MemoryRegion needs to have both read and write callback otherwise a s= egfault > will occur when an access is made. >=20 > The previous behaviour of this both ioport is to return 0xfffffffffffff= fff. > So keep this behaviour. >=20 > Reported-by: Adam Lackorzynski > Signed-off-by: Julien Grall > Tested-by: Adam Lackorzynski > Signed-off-by: Stefan Hajnoczi > --- > hw/pc.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/hw/pc.c b/hw/pc.c > index df0c48e..90b1bf7 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -103,6 +103,11 @@ static void ioport80_write(void *opaque, hwaddr ad= dr, uint64_t data, > { > } > =20 > +static uint64_t ioport80_read(void *opaque, hwaddr addr, unsigned size= ) > +{ > + return 0xffffffffffffffff; Might these require ULL for i386? Andreas > +} > + > /* MSDOS compatibility mode FPU exception support */ > static qemu_irq ferr_irq; > =20 > @@ -123,6 +128,11 @@ static void ioportF0_write(void *opaque, hwaddr ad= dr, uint64_t data, > qemu_irq_lower(ferr_irq); > } > =20 > +static uint64_t ioportF0_read(void *opaque, hwaddr addr, unsigned size= ) > +{ > + return 0xffffffffffffffff; > +} > + > /* TSC handling */ > uint64_t cpu_get_tsc(CPUX86State *env) > { > @@ -960,6 +970,7 @@ static void cpu_request_exit(void *opaque, int irq,= int level) > =20 > static const MemoryRegionOps ioport80_io_ops =3D { > .write =3D ioport80_write, > + .read =3D ioport80_read, > .endianness =3D DEVICE_NATIVE_ENDIAN, > .impl =3D { > .min_access_size =3D 1, > @@ -969,6 +980,7 @@ static const MemoryRegionOps ioport80_io_ops =3D { > =20 > static const MemoryRegionOps ioportF0_io_ops =3D { > .write =3D ioportF0_write, > + .read =3D ioportF0_read, > .endianness =3D DEVICE_NATIVE_ENDIAN, > .impl =3D { > .min_access_size =3D 1, --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg