* [Qemu-devel] [PATCH] Memory: unify ioport registration
@ 2012-04-02 14:37 Julien Grall
2012-04-03 7:51 ` Avi Kivity
2012-04-03 9:34 ` Andreas Färber
0 siblings, 2 replies; 8+ messages in thread
From: Julien Grall @ 2012-04-02 14:37 UTC (permalink / raw)
To: qemu-devel; +Cc: Julien Grall, julian.pidancet, avi, stefano.stabellini
Replace register_ioport* by portio_list_*.
All ioports registered by the previous functions don't call memory callback.
Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
hw/acpi_piix4.c | 22 +++++++++++++++++++---
hw/cirrus_vga.c | 31 ++++++++++++++++++-------------
hw/pc.c | 39 +++++++++++++++++++++++++--------------
hw/serial.c | 13 +++++++++++--
4 files changed, 73 insertions(+), 32 deletions(-)
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 797ed24..4ce87bc 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -27,6 +27,7 @@
#include "sysemu.h"
#include "range.h"
#include "ioport.h"
+#include "exec-memory.h"
//#define DEBUG
@@ -325,10 +326,23 @@ static void piix4_pm_machine_ready(Notifier *n, void *opaque)
}
+static const MemoryRegionPortio piix4_portio_list[] = {
+ { 0x00, 64, 1, .read = smb_ioport_readb, }, /* s->smb_io_base */
+ { 0x00, 64, 1, .write = smb_ioport_writeb, }, /* s->smb_io_base */
+ PORTIO_END_OF_LIST(),
+};
+
+static const MemoryRegionPortio acpi_portio_list[] = {
+ { 0x00, 4, 4, .write = acpi_dbg_writel, }, /* ACPI_DBG_IO_ADDR */
+ PORTIO_END_OF_LIST(),
+};
+
static int piix4_pm_initfn(PCIDevice *dev)
{
PIIX4PMState *s = DO_UPCAST(PIIX4PMState, dev, dev);
uint8_t *pci_conf;
+ PortioList *piix4_port_list = g_new(PortioList, 1);
+ PortioList *acpi_port_list = g_new(PortioList, 1);
pci_conf = s->dev.config;
pci_conf[0x06] = 0x80;
@@ -341,7 +355,8 @@ static int piix4_pm_initfn(PCIDevice *dev)
/* APM */
apm_init(&s->apm, apm_ctrl_changed, s);
- register_ioport_write(ACPI_DBG_IO_ADDR, 4, 4, acpi_dbg_writel, s);
+ portio_list_init(acpi_port_list, acpi_portio_list, s, "piix4-acpi");
+ portio_list_add(acpi_port_list, get_system_io(), ACPI_DBG_IO_ADDR);
if (s->kvm_enabled) {
/* Mark SMM as already inited to prevent SMM from running. KVM does not
@@ -354,8 +369,9 @@ static int piix4_pm_initfn(PCIDevice *dev)
pci_conf[0x90] = s->smb_io_base | 1;
pci_conf[0x91] = s->smb_io_base >> 8;
pci_conf[0xd2] = 0x09;
- register_ioport_write(s->smb_io_base, 64, 1, smb_ioport_writeb, &s->smb);
- register_ioport_read(s->smb_io_base, 64, 1, smb_ioport_readb, &s->smb);
+
+ portio_list_init(piix4_port_list, piix4_portio_list, s, "piix4-acpi");
+ portio_list_add(piix4_port_list, get_system_io(), s->smb_io_base);
acpi_pm_tmr_init(&s->ar, pm_tmr_timer);
acpi_gpe_init(&s->ar, GPE_LEN);
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index afedaa4..aae82d5 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -32,6 +32,7 @@
#include "console.h"
#include "vga_int.h"
#include "loader.h"
+#include "exec-memory.h"
/*
* TODO:
@@ -2781,11 +2782,26 @@ static const MemoryRegionOps cirrus_linear_io_ops = {
},
};
+static const MemoryRegionPortio cirrus_portio_list[] = {
+ { 0x04, 2, 1, .write = cirrus_vga_ioport_write,
+ .read = cirrus_vga_ioport_read, }, /* 0x3b4 */
+ { 0x0a, 1, 1, .write = cirrus_vga_ioport_write,
+ .read = cirrus_vga_ioport_read, }, /* 0x3ba */
+ { 0x10, 16, 1, .write = cirrus_vga_ioport_write,
+ .read = cirrus_vga_ioport_read, }, /* 0x3c0 */
+ { 0x24, 2, 1, .write = cirrus_vga_ioport_write,
+ .read = cirrus_vga_ioport_read, }, /* 0x3d4 */
+ { 0x2a, 1, 1, .write = cirrus_vga_ioport_write,
+ .read = cirrus_vga_ioport_read, }, /* 0x3da */
+ PORTIO_END_OF_LIST (),
+};
+
static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci,
MemoryRegion *system_memory)
{
int i;
static int inited;
+ PortioList *cirrus_port_list = g_new(PortioList, 1);
if (!inited) {
inited = 1;
@@ -2814,19 +2830,8 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci,
s->bustype = CIRRUS_BUSTYPE_ISA;
}
- register_ioport_write(0x3c0, 16, 1, cirrus_vga_ioport_write, s);
-
- register_ioport_write(0x3b4, 2, 1, cirrus_vga_ioport_write, s);
- register_ioport_write(0x3d4, 2, 1, cirrus_vga_ioport_write, s);
- register_ioport_write(0x3ba, 1, 1, cirrus_vga_ioport_write, s);
- register_ioport_write(0x3da, 1, 1, cirrus_vga_ioport_write, s);
-
- register_ioport_read(0x3c0, 16, 1, cirrus_vga_ioport_read, s);
-
- register_ioport_read(0x3b4, 2, 1, cirrus_vga_ioport_read, s);
- register_ioport_read(0x3d4, 2, 1, cirrus_vga_ioport_read, s);
- register_ioport_read(0x3ba, 1, 1, cirrus_vga_ioport_read, s);
- register_ioport_read(0x3da, 1, 1, cirrus_vga_ioport_read, s);
+ portio_list_init(cirrus_port_list, cirrus_portio_list, s, "cirrus-io");
+ portio_list_add(cirrus_port_list, get_system_io(), 0x3b0);
memory_region_init(&s->low_mem_container,
"cirrus-lowmem-container",
diff --git a/hw/pc.c b/hw/pc.c
index 83a1b5b..eee5757 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -592,6 +592,17 @@ int e820_add_entry(uint64_t address, uint64_t length, uint32_t type)
return index;
}
+static const MemoryRegionPortio bochs_bios_portio_list[] = {
+ { 0x000, 2, 2, .write = bochs_bios_write, }, /* 0x400 */
+ { 0x002, 2, 1, .write = bochs_bios_write, }, /* 0x402 */
+ { 0x100, 1, 1, .write = bochs_bios_write, }, /* 0x500 */
+ { 0x101, 1, 1, .write = bochs_bios_write, }, /* 0x501 */
+ { 0x101, 2, 2, .write = bochs_bios_write, }, /* 0x501 */
+ { 0x103, 1, 1, .write = bochs_bios_write, }, /* 0x503 */
+ { 0x8500, 1, 1, .write = bochs_bios_write, }, /* 0x8900 */
+ PORTIO_END_OF_LIST(),
+};
+
static void *bochs_bios_init(void)
{
void *fw_cfg;
@@ -599,18 +610,11 @@ static void *bochs_bios_init(void)
size_t smbios_len;
uint64_t *numa_fw_cfg;
int i, j;
+ PortioList *bochs_bios_port_list = g_new(PortioList, 1);
- register_ioport_write(0x400, 1, 2, bochs_bios_write, NULL);
- register_ioport_write(0x401, 1, 2, bochs_bios_write, NULL);
- register_ioport_write(0x402, 1, 1, bochs_bios_write, NULL);
- register_ioport_write(0x403, 1, 1, bochs_bios_write, NULL);
- register_ioport_write(0x8900, 1, 1, bochs_bios_write, NULL);
-
- register_ioport_write(0x501, 1, 1, bochs_bios_write, NULL);
- register_ioport_write(0x501, 1, 2, bochs_bios_write, NULL);
- register_ioport_write(0x502, 1, 2, bochs_bios_write, NULL);
- register_ioport_write(0x500, 1, 1, bochs_bios_write, NULL);
- register_ioport_write(0x503, 1, 1, bochs_bios_write, NULL);
+ portio_list_init(bochs_bios_port_list, bochs_bios_portio_list,
+ NULL, "bosch-bios");
+ portio_list_add(bochs_bios_port_list, get_system_io(), 0x400);
fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
@@ -1077,6 +1081,12 @@ static void cpu_request_exit(void *opaque, int irq, int level)
}
}
+static const MemoryRegionPortio pc_basic_portio_list[] = {
+ { 0x00, 1, 1, .write = ioport80_write, }, /* 0x80 */
+ { 0x70, 1, 1, .write = ioportF0_write, }, /* 0xf0 */
+ PORTIO_END_OF_LIST(),
+};
+
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
ISADevice **floppy,
@@ -1091,10 +1101,11 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
qemu_irq *a20_line;
ISADevice *i8042, *port92, *vmmouse, *pit;
qemu_irq *cpu_exit_irq;
+ PortioList *pc_basic_port_list = g_new(PortioList, 1);
- register_ioport_write(0x80, 1, 1, ioport80_write, NULL);
-
- register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
+ portio_list_init(pc_basic_port_list, pc_basic_portio_list,
+ NULL, "pc-basic");
+ portio_list_add(pc_basic_port_list, get_system_io(), 0x80);
/*
* Check if an HPET shall be created.
diff --git a/hw/serial.c b/hw/serial.c
index c0ee55d..61ee450 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -28,6 +28,7 @@
#include "pc.h"
#include "qemu-timer.h"
#include "sysemu.h"
+#include "exec-memory.h"
//#define DEBUG_SERIAL
@@ -806,10 +807,17 @@ static const VMStateDescription vmstate_isa_serial = {
}
};
+static const MemoryRegionPortio serial_portio_list[] = {
+ { 0x00, 8, 1, .write = serial_ioport_write,
+ .read = serial_ioport_read, }, /* base */
+ PORTIO_END_OF_LIST (),
+};
+
SerialState *serial_init(int base, qemu_irq irq, int baudbase,
CharDriverState *chr)
{
SerialState *s;
+ PortioList *serial_port_list = g_new(PortioList, 1);
s = g_malloc0(sizeof(SerialState));
@@ -820,8 +828,9 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase,
vmstate_register(NULL, base, &vmstate_serial, s);
- register_ioport_write(base, 8, 1, serial_ioport_write, s);
- register_ioport_read(base, 8, 1, serial_ioport_read, s);
+ portio_list_init(serial_port_list, serial_portio_list, s, "serial-io");
+ portio_list_add(serial_port_list, get_system_io(), base);
+
return s;
}
--
Julien Grall
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] Memory: unify ioport registration
2012-04-02 14:37 [Qemu-devel] [PATCH] Memory: unify ioport registration Julien Grall
@ 2012-04-03 7:51 ` Avi Kivity
2012-04-03 9:38 ` Julien Grall
2012-04-04 15:55 ` Julien Grall
2012-04-03 9:34 ` Andreas Färber
1 sibling, 2 replies; 8+ messages in thread
From: Avi Kivity @ 2012-04-03 7:51 UTC (permalink / raw)
To: Julien Grall
Cc: julian.pidancet, qemu-devel, Anthony Liguori, stefano.stabellini
On 04/02/2012 05:37 PM, Julien Grall wrote:
> Replace register_ioport* by portio_list_*.
> All ioports registered by the previous functions don't call memory callback.
>
> Signed-off-by: Julien Grall <julien.grall@citrix.com>
> ---
> hw/acpi_piix4.c | 22 +++++++++++++++++++---
> hw/cirrus_vga.c | 31 ++++++++++++++++++-------------
> hw/pc.c | 39 +++++++++++++++++++++++++--------------
> hw/serial.c | 13 +++++++++++--
Please split into separate patches.
> @@ -27,6 +27,7 @@
> #include "sysemu.h"
> #include "range.h"
> #include "ioport.h"
> +#include "exec-memory.h"
>
Remove please.
> //#define DEBUG
>
> @@ -325,10 +326,23 @@ static void piix4_pm_machine_ready(Notifier *n, void *opaque)
>
> }
>
> +static const MemoryRegionPortio piix4_portio_list[] = {
> + { 0x00, 64, 1, .read = smb_ioport_readb, }, /* s->smb_io_base */
> + { 0x00, 64, 1, .write = smb_ioport_writeb, }, /* s->smb_io_base */
> + PORTIO_END_OF_LIST(),
> +};
> +
> +static const MemoryRegionPortio acpi_portio_list[] = {
> + { 0x00, 4, 4, .write = acpi_dbg_writel, }, /* ACPI_DBG_IO_ADDR */
> + PORTIO_END_OF_LIST(),
> +};
> +
> static int piix4_pm_initfn(PCIDevice *dev)
> {
> PIIX4PMState *s = DO_UPCAST(PIIX4PMState, dev, dev);
> uint8_t *pci_conf;
> + PortioList *piix4_port_list = g_new(PortioList, 1);
> + PortioList *acpi_port_list = g_new(PortioList, 1);
>
Make these fields in PIIX4PMState to avoid the allocation.
> pci_conf = s->dev.config;
> pci_conf[0x06] = 0x80;
> @@ -341,7 +355,8 @@ static int piix4_pm_initfn(PCIDevice *dev)
> /* APM */
> apm_init(&s->apm, apm_ctrl_changed, s);
>
> - register_ioport_write(ACPI_DBG_IO_ADDR, 4, 4, acpi_dbg_writel, s);
> + portio_list_init(acpi_port_list, acpi_portio_list, s, "piix4-acpi");
> + portio_list_add(acpi_port_list, get_system_io(), ACPI_DBG_IO_ADDR);
Use pci_address_space_io() instead.
>
> if (s->kvm_enabled) {
> /* Mark SMM as already inited to prevent SMM from running. KVM does not
> @@ -354,8 +369,9 @@ static int piix4_pm_initfn(PCIDevice *dev)
> pci_conf[0x90] = s->smb_io_base | 1;
> pci_conf[0x91] = s->smb_io_base >> 8;
> pci_conf[0xd2] = 0x09;
> - register_ioport_write(s->smb_io_base, 64, 1, smb_ioport_writeb, &s->smb);
> - register_ioport_read(s->smb_io_base, 64, 1, smb_ioport_readb, &s->smb);
> +
> + portio_list_init(piix4_port_list, piix4_portio_list, s, "piix4-acpi");
> + portio_list_add(piix4_port_list, get_system_io(), s->smb_io_base);
pci_address_space_io()
>
> acpi_pm_tmr_init(&s->ar, pm_tmr_timer);
> acpi_gpe_init(&s->ar, GPE_LEN);
> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
> index afedaa4..aae82d5 100644
> --- a/hw/cirrus_vga.c
> +++ b/hw/cirrus_vga.c
> @@ -32,6 +32,7 @@
> #include "console.h"
> #include "vga_int.h"
> #include "loader.h"
> +#include "exec-memory.h"
>
Remove.
> /*
> * TODO:
> @@ -2781,11 +2782,26 @@ static const MemoryRegionOps cirrus_linear_io_ops = {
> },
> };
>
> +static const MemoryRegionPortio cirrus_portio_list[] = {
> + { 0x04, 2, 1, .write = cirrus_vga_ioport_write,
> + .read = cirrus_vga_ioport_read, }, /* 0x3b4 */
> + { 0x0a, 1, 1, .write = cirrus_vga_ioport_write,
> + .read = cirrus_vga_ioport_read, }, /* 0x3ba */
> + { 0x10, 16, 1, .write = cirrus_vga_ioport_write,
> + .read = cirrus_vga_ioport_read, }, /* 0x3c0 */
> + { 0x24, 2, 1, .write = cirrus_vga_ioport_write,
> + .read = cirrus_vga_ioport_read, }, /* 0x3d4 */
> + { 0x2a, 1, 1, .write = cirrus_vga_ioport_write,
> + .read = cirrus_vga_ioport_read, }, /* 0x3da */
> + PORTIO_END_OF_LIST (),
> +};
> +
> static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci,
> MemoryRegion *system_memory)
> {
> int i;
> static int inited;
> + PortioList *cirrus_port_list = g_new(PortioList, 1);
>
Into CirrusVGAState.
> if (!inited) {
> inited = 1;
> @@ -2814,19 +2830,8 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci,
> s->bustype = CIRRUS_BUSTYPE_ISA;
> }
>
> - register_ioport_write(0x3c0, 16, 1, cirrus_vga_ioport_write, s);
> -
> - register_ioport_write(0x3b4, 2, 1, cirrus_vga_ioport_write, s);
> - register_ioport_write(0x3d4, 2, 1, cirrus_vga_ioport_write, s);
> - register_ioport_write(0x3ba, 1, 1, cirrus_vga_ioport_write, s);
> - register_ioport_write(0x3da, 1, 1, cirrus_vga_ioport_write, s);
> -
> - register_ioport_read(0x3c0, 16, 1, cirrus_vga_ioport_read, s);
> -
> - register_ioport_read(0x3b4, 2, 1, cirrus_vga_ioport_read, s);
> - register_ioport_read(0x3d4, 2, 1, cirrus_vga_ioport_read, s);
> - register_ioport_read(0x3ba, 1, 1, cirrus_vga_ioport_read, s);
> - register_ioport_read(0x3da, 1, 1, cirrus_vga_ioport_read, s);
> + portio_list_init(cirrus_port_list, cirrus_portio_list, s, "cirrus-io");
> + portio_list_add(cirrus_port_list, get_system_io(), 0x3b0);
>
Please pass either pci_address_space_io() or isa_io_address_space()
(you'll have to write the latter) to cirrus_init_common() from its
callers. We really want to avoid get_system_io().
> memory_region_init(&s->low_mem_container,
> "cirrus-lowmem-container",
> diff --git a/hw/pc.c b/hw/pc.c
> index 83a1b5b..eee5757 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -592,6 +592,17 @@ int e820_add_entry(uint64_t address, uint64_t length, uint32_t type)
> return index;
> }
>
> +static const MemoryRegionPortio bochs_bios_portio_list[] = {
> + { 0x000, 2, 2, .write = bochs_bios_write, }, /* 0x400 */
> + { 0x002, 2, 1, .write = bochs_bios_write, }, /* 0x402 */
> + { 0x100, 1, 1, .write = bochs_bios_write, }, /* 0x500 */
> + { 0x101, 1, 1, .write = bochs_bios_write, }, /* 0x501 */
> + { 0x101, 2, 2, .write = bochs_bios_write, }, /* 0x501 */
> + { 0x103, 1, 1, .write = bochs_bios_write, }, /* 0x503 */
> + { 0x8500, 1, 1, .write = bochs_bios_write, }, /* 0x8900 */
> + PORTIO_END_OF_LIST(),
> +};
> +
Using offsets from 0x400 is... wierd. It's not like there's a vga where
the ports are all bunched together.
>
> +static const MemoryRegionPortio pc_basic_portio_list[] = {
> + { 0x00, 1, 1, .write = ioport80_write, }, /* 0x80 */
> + { 0x70, 1, 1, .write = ioportF0_write, }, /* 0xf0 */
> + PORTIO_END_OF_LIST(),
> +};
> +
> void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
> ISADevice **rtc_state,
> ISADevice **floppy,
> @@ -1091,10 +1101,11 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
> qemu_irq *a20_line;
> ISADevice *i8042, *port92, *vmmouse, *pit;
> qemu_irq *cpu_exit_irq;
> + PortioList *pc_basic_port_list = g_new(PortioList, 1);
>
> - register_ioport_write(0x80, 1, 1, ioport80_write, NULL);
> -
> - register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
> + portio_list_init(pc_basic_port_list, pc_basic_portio_list,
> + NULL, "pc-basic");
> + portio_list_add(pc_basic_port_list, get_system_io(), 0x80);
isa_register_portio_list()
>
> +static const MemoryRegionPortio serial_portio_list[] = {
> + { 0x00, 8, 1, .write = serial_ioport_write,
> + .read = serial_ioport_read, }, /* base */
> + PORTIO_END_OF_LIST (),
> +};
This doesn't need to be a portio list, it can be a simple MemoryRegionOps.
> +
> SerialState *serial_init(int base, qemu_irq irq, int baudbase,
> CharDriverState *chr)
> {
> SerialState *s;
> + PortioList *serial_port_list = g_new(PortioList, 1);
>
Into SerialState.
> s = g_malloc0(sizeof(SerialState));
>
> @@ -820,8 +828,9 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase,
>
> vmstate_register(NULL, base, &vmstate_serial, s);
>
> - register_ioport_write(base, 8, 1, serial_ioport_write, s);
> - register_ioport_read(base, 8, 1, serial_ioport_read, s);
> + portio_list_init(serial_port_list, serial_portio_list, s, "serial-io");
> + portio_list_add(serial_port_list, get_system_io(), base);
> +
Should we just remove serial_init() and replace it with the serial-isa
QOM class?
If not, just pass the io address space from the caller.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] Memory: unify ioport registration
2012-04-02 14:37 [Qemu-devel] [PATCH] Memory: unify ioport registration Julien Grall
2012-04-03 7:51 ` Avi Kivity
@ 2012-04-03 9:34 ` Andreas Färber
2012-04-03 10:11 ` Avi Kivity
1 sibling, 1 reply; 8+ messages in thread
From: Andreas Färber @ 2012-04-03 9:34 UTC (permalink / raw)
To: Julien Grall, avi; +Cc: stefano.stabellini, qemu-devel, julian.pidancet
Am 02.04.2012 16:37, schrieb Julien Grall:
> Replace register_ioport* by portio_list_*.
[snip]
Are these changes guaranteed to not change the addresses in some way?
We've had really subtle bugs with offsets added / not added in the past.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] Memory: unify ioport registration
2012-04-03 7:51 ` Avi Kivity
@ 2012-04-03 9:38 ` Julien Grall
2012-04-03 10:09 ` Avi Kivity
2012-04-04 15:55 ` Julien Grall
1 sibling, 1 reply; 8+ messages in thread
From: Julien Grall @ 2012-04-03 9:38 UTC (permalink / raw)
To: Avi Kivity
Cc: Julian Pidancet, qemu-devel, Anthony Liguori, Stefano Stabellini
On 04/03/2012 08:51 AM, Avi Kivity wrote:
> On 04/02/2012 05:37 PM, Julien Grall wrote:
>
>> if (!inited) {
>> inited = 1;
>> @@ -2814,19 +2830,8 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci,
>> s->bustype = CIRRUS_BUSTYPE_ISA;
>> }
>>
>> - register_ioport_write(0x3c0, 16, 1, cirrus_vga_ioport_write, s);
>> -
>> - register_ioport_write(0x3b4, 2, 1, cirrus_vga_ioport_write, s);
>> - register_ioport_write(0x3d4, 2, 1, cirrus_vga_ioport_write, s);
>> - register_ioport_write(0x3ba, 1, 1, cirrus_vga_ioport_write, s);
>> - register_ioport_write(0x3da, 1, 1, cirrus_vga_ioport_write, s);
>> -
>> - register_ioport_read(0x3c0, 16, 1, cirrus_vga_ioport_read, s);
>> -
>> - register_ioport_read(0x3b4, 2, 1, cirrus_vga_ioport_read, s);
>> - register_ioport_read(0x3d4, 2, 1, cirrus_vga_ioport_read, s);
>> - register_ioport_read(0x3ba, 1, 1, cirrus_vga_ioport_read, s);
>> - register_ioport_read(0x3da, 1, 1, cirrus_vga_ioport_read, s);
>> + portio_list_init(cirrus_port_list, cirrus_portio_list, s, "cirrus-io");
>> + portio_list_add(cirrus_port_list, get_system_io(), 0x3b0);
>>
>>
> Please pass either pci_address_space_io() or isa_io_address_space()
> (you'll have to write the latter) to cirrus_init_common() from its
> callers. We really want to avoid get_system_io().
>
>
isa_io_address_space doesn't exist. I will create it, but which
memory region we need to return ? get_system_io () ?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] Memory: unify ioport registration
2012-04-03 9:38 ` Julien Grall
@ 2012-04-03 10:09 ` Avi Kivity
0 siblings, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2012-04-03 10:09 UTC (permalink / raw)
To: Julien Grall
Cc: Julian Pidancet, qemu-devel, Anthony Liguori, Stefano Stabellini
On 04/03/2012 12:38 PM, Julien Grall wrote:
>> Please pass either pci_address_space_io() or isa_io_address_space()
>> (you'll have to write the latter) to cirrus_init_common() from its
>> callers. We really want to avoid get_system_io().
>>
>>
> isa_io_address_space doesn't exist. I will create it, but which
> memory region we need to return ? get_system_io () ?
>
Yes. The point it that we can later remove that get_system_io() in one
place, instead of many.
Please add isa_io_address_space() in a separate patch.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] Memory: unify ioport registration
2012-04-03 9:34 ` Andreas Färber
@ 2012-04-03 10:11 ` Avi Kivity
0 siblings, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2012-04-03 10:11 UTC (permalink / raw)
To: Andreas Färber
Cc: Julien Grall, stefano.stabellini, qemu-devel, julian.pidancet
On 04/03/2012 12:34 PM, Andreas Färber wrote:
> Am 02.04.2012 16:37, schrieb Julien Grall:
> > Replace register_ioport* by portio_list_*.
> [snip]
>
> Are these changes guaranteed to not change the addresses in some way?
Yes (modulo those subtle bugs).
> We've had really subtle bugs with offsets added / not added in the past.
Those were bugs in the implementation of the portio functions and the
memory core, not the conversions IIRC.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] Memory: unify ioport registration
2012-04-03 7:51 ` Avi Kivity
2012-04-03 9:38 ` Julien Grall
@ 2012-04-04 15:55 ` Julien Grall
2012-04-05 9:58 ` Avi Kivity
1 sibling, 1 reply; 8+ messages in thread
From: Julien Grall @ 2012-04-04 15:55 UTC (permalink / raw)
To: Avi Kivity
Cc: Julian Pidancet, qemu-devel, Anthony Liguori, Stefano Stabellini
On 04/03/2012 08:51 AM, Avi Kivity wrote:
> On 04/02/2012 05:37 PM, Julien Grall wrote:
>
>> s = g_malloc0(sizeof(SerialState));
>>
>> @@ -820,8 +828,9 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase,
>>
>> vmstate_register(NULL, base,&vmstate_serial, s);
>>
>> - register_ioport_write(base, 8, 1, serial_ioport_write, s);
>> - register_ioport_read(base, 8, 1, serial_ioport_read, s);
>> + portio_list_init(serial_port_list, serial_portio_list, s, "serial-io");
>> + portio_list_add(serial_port_list, get_system_io(), base);
>> +
>>
> Should we just remove serial_init() and replace it with the serial-isa
> QOM class?
>
After few researchs, it's seems this function is not used in the
source code. Is that right ?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] Memory: unify ioport registration
2012-04-04 15:55 ` Julien Grall
@ 2012-04-05 9:58 ` Avi Kivity
0 siblings, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2012-04-05 9:58 UTC (permalink / raw)
To: Julien Grall
Cc: Julian Pidancet, qemu-devel, Anthony Liguori, Stefano Stabellini
On 04/04/2012 06:55 PM, Julien Grall wrote:
>> Should we just remove serial_init() and replace it with the serial-isa
>> QOM class?
>>
> After few researchs, it's seems this function is not used in the
> source code. Is that right ?
>
>
It's used in mips_mipssim.c.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-04-05 9:58 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 14:37 [Qemu-devel] [PATCH] Memory: unify ioport registration Julien Grall
2012-04-03 7:51 ` Avi Kivity
2012-04-03 9:38 ` Julien Grall
2012-04-03 10:09 ` Avi Kivity
2012-04-04 15:55 ` Julien Grall
2012-04-05 9:58 ` Avi Kivity
2012-04-03 9:34 ` Andreas Färber
2012-04-03 10:11 ` Avi Kivity
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.