Skip to contentSkip to conversation

kvmvapic: add ioport read accessor

PATCH Applied Marcelo Tosatti 3 participants 3 messages May 5, 2013 – May 6, 2013 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvmvapic: add ioport read accessor

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

hw/i386/kvmvapic.c +6 -0
index 5b558aa..655483b 100644
@@ -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,
 };
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Marcelo Tosatti

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

hw/i386/kvmvapic.c +1 -0
index 5b558aa..655483b 100644
@@ -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)

hw/i386/kvmvapic.c static void vapic_write(void *opaque, hwaddr addr, uint64_t data, · line 700

Quoted 10 lines
hw/i386/kvmvapic.c +5 -0
+{
+    return 0xffffffff;
+}
+
 static const MemoryRegionOps vapic_ops = {
     .write = vapic_write,
+    .read = vapic_read,
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 

Right. I'm just wondering why the guest reads from that port.

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
Applied
#2 lore raw
In reply to Marcelo Tosatti
Quoted 8 lines · Marcelo Tosatti

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

Applied, thanks.

Quoted 21 lines
hw/i386/kvmvapic.c +6 -1
index 5b558aa..655483b 100644
@@ -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,
 };
 
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Gleb.