From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [uq/master PATCH] kvmvapic: add ioport read accessor Date: Sun, 5 May 2013 17:51:49 -0300 Message-ID: <20130505205149.GA2032@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel , kvm-devel To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59875 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752143Ab3EEUwy (ORCPT ); Sun, 5 May 2013 16:52:54 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Necessary since memory region accessor assumes read and write methods are registered. Otherwise reading I/O port 0x7e segfaults. https://bugzilla.redhat.com/show_bug.cgi?id=954306 Signed-off-by: Marcelo Tosatti diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 5b558aa..655483b 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -687,8 +687,14 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data, } } +static uint64_t vapic_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0xffffffff; +} + static const MemoryRegionOps vapic_ops = { .write = vapic_write, + .read = vapic_read, .endianness = DEVICE_NATIVE_ENDIAN, };