From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJeDv-0000yu-9R for qemu-devel@nongnu.org; Mon, 27 Jul 2015 04:57:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJeDu-00085L-48 for qemu-devel@nongnu.org; Mon, 27 Jul 2015 04:57:27 -0400 Message-ID: <55B5F26D.1050005@suse.de> Date: Mon, 27 Jul 2015 10:57:17 +0200 From: Hannes Reinecke MIME-Version: 1.0 References: <1437987112-24744-1-git-send-email-speirofr@gmail.com> In-Reply-To: <1437987112-24744-1-git-send-email-speirofr@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] megasas: Add write function to handle write access to PCI BAR 3 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?U2FsdmEgUGVpcsOz?= , qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-block@nongnu.org On 07/27/2015 10:51 AM, Salva Peir=C3=B3 wrote: > This patch fixes a QEMU SEGFAULT when a write operation is performed on > the memory region of the PCI BAR 3 (base address space). > When a writeb(0xe0000000) is performed the .write function is invoked t= o > handle the write access, however, since the .write is not initialised, > the call to 0, causes QEMU to SEGFAULT. >=20 > Signed-off-by: Salva Peir=C3=B3 > --- > hw/scsi/megasas.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c > index 51ba9e0..a04369c 100644 > --- a/hw/scsi/megasas.c > +++ b/hw/scsi/megasas.c > @@ -2202,8 +2202,15 @@ static uint64_t megasas_queue_read(void *opaque,= hwaddr addr, > return 0; > } > =20 > +static void megasas_queue_write(void *opaque, hwaddr addr, > + uint64_t val, unsigned size) > +{ > + return; > +} > + > static const MemoryRegionOps megasas_queue_ops =3D { > .read =3D megasas_queue_read, > + .write =3D megasas_queue_write, > .endianness =3D DEVICE_LITTLE_ENDIAN, > .impl =3D { > .min_access_size =3D 8, >=20 Yep, that's the correct fix. Acked-by: Hannes Reinecke Cheers, Hannes --=20 Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg GF: F. Imend=C3=B6rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG N=C3=BCrnberg)