This patch introduces the two IOPorts on e1000, IOADDR and IODATA. The
IOADDR is used to specify which register we want to access when we
read
or write on IODATA.
This patch fixes some weird behavior that I see when I use e1000 with
QEMU/Xen, the guest memory can be corrupted by this NIC because it
will
write on memory that it doesn't own anymore after a reset. It's
because
the kernel Linux use the IOPort to reset the network card instead of
the
MMIO.
Signed-off-by: Anthony PERARD <address@hidden>
---
@@ -971,7 +1006,7 @@ static bool is_version_1(void *opaque, int
version_id)
static const VMStateDescription vmstate_e1000 = {
.name = "e1000",
- .version_id = 2,
+ .version_id = 3,
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.fields = (VMStateField []) {
@@ -1043,6 +1078,7 @@ static const VMStateDescription vmstate_e1000
= {
VMSTATE_UINT32_SUB_ARRAY(mac_reg, E1000State, RA, 32),
VMSTATE_UINT32_SUB_ARRAY(mac_reg, E1000State, MTA, 128),
VMSTATE_UINT32_SUB_ARRAY(mac_reg, E1000State, VFTA, 128),
+ VMSTATE_UINT32_V(ioport_addr, E1000State, 3),
VMSTATE_END_OF_LIST()
}
};