Re: [Qemu-devel] [PATCH V9 0/8] memory: unify ioport registration

2012-09-19 Thread Avi Kivity
On 09/04/2012 06:13 PM, Julien Grall wrote:
 This is the nineth version of patch series about ioport registration.
 
 Some part of QEMU still use register_ioport* functions to register ioport.
 These functions doesn't allow to use Memory Listener on it.

Jan't patch that dropped the debug ioports causes conflicts, please
rebase atop upstream.


-- 
error compiling committee.c: too many arguments to function



Re: [Qemu-devel] [PATCH V9 0/8] memory: unify ioport registration

2012-09-11 Thread Avi Kivity
On 09/04/2012 06:13 PM, Julien Grall wrote:
 This is the nineth version of patch series about ioport registration.
 
 Some part of QEMU still use register_ioport* functions to register ioport.
 These functions doesn't allow to use Memory Listener on it.

Thanks, applied all (w/ updated patch 4), will push shortly.


-- 
error compiling committee.c: too many arguments to function



Re: [Qemu-devel] [PATCH V9 0/8] memory: unify ioport registration

2012-09-11 Thread Avi Kivity
On 09/11/2012 12:15 PM, Avi Kivity wrote:
 On 09/04/2012 06:13 PM, Julien Grall wrote:
 This is the nineth version of patch series about ioport registration.
 
 Some part of QEMU still use register_ioport* functions to register ioport.
 These functions doesn't allow to use Memory Listener on it.
 
 Thanks, applied all (w/ updated patch 4), will push shortly.
 
 

Aborts with the command line

  qemu-system-x86_64 -device isa-debugcon,iobase=0x402,chardev=stdio -chardev 
stdio,id=stdio


-- 
error compiling committee.c: too many arguments to function



Re: [Qemu-devel] [PATCH V9 0/8] memory: unify ioport registration

2012-09-11 Thread Julien Grall

On 09/11/2012 10:25 AM, Avi Kivity wrote:

On 09/11/2012 12:15 PM, Avi Kivity wrote:
   

On 09/04/2012 06:13 PM, Julien Grall wrote:
 

This is the nineth version of patch series about ioport registration.

Some part of QEMU still use register_ioport* functions to register ioport.
These functions doesn't allow to use Memory Listener on it.
   

Thanks, applied all (w/ updated patch 4), will push shortly.


 

Aborts with the command line

   qemu-system-x86_64 -device isa-debugcon,iobase=0x402,chardev=stdio -chardev 
stdio,id=stdio


   


I have bisected and found the problem with bochs_bios_init in hw/pc.c.
Bosch already register the iport 0x402. I'm not sure that it's a bug.
In fact register_ioport_read/write check if the current ioport is used
with the opaque variable.
Before my patch, bochs_bios_init registered it's ioport with opaque
NULL, so if someone (like debugcon) wants to use the ioport there is
no problem. But now, I used portio_list_init to register bochs ioport,
so the opaque is not NULL.
I don't really know how to resolve this problem. Perhaps we could
just improve the debug message.

--
Julien Grall



Re: [Qemu-devel] [PATCH V9 0/8] memory: unify ioport registration

2012-09-11 Thread Jan Kiszka
On 2012-09-11 13:27, Julien Grall wrote:
 On 09/11/2012 10:25 AM, Avi Kivity wrote:
 On 09/11/2012 12:15 PM, Avi Kivity wrote:

 On 09/04/2012 06:13 PM, Julien Grall wrote:
  
 This is the nineth version of patch series about ioport registration.

 Some part of QEMU still use register_ioport* functions to register ioport.
 These functions doesn't allow to use Memory Listener on it.

 Thanks, applied all (w/ updated patch 4), will push shortly.


  
 Aborts with the command line

qemu-system-x86_64 -device isa-debugcon,iobase=0x402,chardev=stdio 
 -chardev stdio,id=stdio



 
 I have bisected and found the problem with bochs_bios_init in hw/pc.c.
 Bosch already register the iport 0x402. I'm not sure that it's a bug.
 In fact register_ioport_read/write check if the current ioport is used
 with the opaque variable.
 Before my patch, bochs_bios_init registered it's ioport with opaque
 NULL, so if someone (like debugcon) wants to use the ioport there is
 no problem. But now, I used portio_list_init to register bochs ioport,
 so the opaque is not NULL.
 I don't really know how to resolve this problem. Perhaps we could
 just improve the debug message.

My suggestion:

pc: Don't listen on debug ports by default

Only listen on debug ports when we also handle them. They are better
handled by debugcon these days which is runtime configurable.

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

diff --git a/hw/pc.c b/hw/pc.c
index 112739a..70abf0e 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -539,9 +539,9 @@ static void bochs_bios_write(void *opaque, uint32_t addr, 
uint32_t val)
 case 0x401:
 /* used to be panic, now unused */
 break;
+#ifdef DEBUG_BIOS
 case 0x402:
 case 0x403:
-#ifdef DEBUG_BIOS
 fprintf(stderr, %c, val);
 #endif
 break;

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux



Re: [Qemu-devel] [PATCH V9 0/8] memory: unify ioport registration

2012-09-04 Thread Julien Grall

My apologies for this double post,
I made a typing error on Jan's email.

On 09/04/2012 04:13 PM, Julien Grall wrote:

This is the nineth version of patch series about ioport registration.

Some part of QEMU still use register_ioport* functions to register ioport.
These functions doesn't allow to use Memory Listener on it.

Modifications between V1 and V2:
- Remove the use of get_system_io. Instead of use isa and pci IO
  address space;
- Avoid allocation of PortioList. Use the different device
  structure;
- Still remove register_ioport* (hw/dma.c, hw/apm.c, hw/acpi_piix4.c);
- Use MemoryRegion when we have only a range of ioport;
- For some functions, add IO address space as argument;
- Add isa_address_space_io function.

Modifications between V2 and V3:
- Remove some register_ioport_* on hw/vt82c686.c;
- Split smb ioport part in new patch;
- Still replace MemoryRegion when we have only a range of ioport;
- Fix read/write ioports prototype to  be compliant with memory callback.

Modifications between V3 and V4:
- Fix compilation in hw/dma.c;
- Fix address conversion (hw/dma.c, hw/acpi_piix4.c) with MemorySection.
  Indeed the new version use offset from MemorySection start instead of 0.

Modifications between V4 and V5:
- Rebase on qemu upstream;
- Forget some ioport_register_* in acpi_piix4.c;
- Register 0x3b0 - 0x3df range for cirrus instead of ioport by ioport.

Modifications between V5 and V6:
- Add read function on cirrus ioport (forget on the previous patch);
- Rework PM memory range handling;
- Fix PCI_BASE in acpi_piix4.c (wrong conversion during port);
- Rewrite isa_address_space_io to use ISA bus address space;
- Fix compilation in vt82c686.c.

Modifications between V6 and V7:
- acpi_piix4: use memory_region_set_enabled instead of a boolean. I'm not
  sure about this modification (adviced by Avi);
- Fix device endianness in acpi_piix4 (reported by Avi);
- Avoid dependencies between patches and reorder it (reported by Jan).
  Some code moved from acpi_piix4 patch to smb/apm patches;

Modifications between V7 and V8:
- Fix device endianness in smb patch, I forgot some on previous version;
- Register pm io region at initialization with default value instead
  of at first call to pm_io_space_update (reported by Jan).

Modifications between V8 and V9:
- Fix size constraint in pm_io_ops (reported by Jan).

Julien Grall (8):
   isa: add isa_address_space_io
   hw/apm.c: replace register_ioport*
   smb: replace_register_ioport*
   hw/acpi_piix4.c: replace register_ioport*
   hw/cirrus_vga.c: replace register_ioport*
   hw/serial.c: replace register_ioport*
   hw/pc.c: replace register_ioport*
   hw/dma.c: replace register_ioport*

  hw/acpi_piix4.c   |  165 +---
  hw/apm.c  |   24 ++--
  hw/apm.h  |5 +-
  hw/cirrus_vga.c   |   50 ++---
  hw/dma.c  |  108 +++
  hw/isa-bus.c  |9 +++
  hw/isa.h  |1 +
  hw/mips_mipssim.c |3 +-
  hw/pc.c   |   58 ++-
  hw/pc.h   |2 +-
  hw/pm_smbus.c |7 +-
  hw/pm_smbus.h |6 +-
  hw/serial.c   |8 ++-
  hw/vt82c686.c |   20 ++-
  14 files changed, 341 insertions(+), 125 deletions(-)

   





[Qemu-devel] [PATCH V9 0/8] memory: unify ioport registration

2012-09-04 Thread Julien Grall
This is the nineth version of patch series about ioport registration.

Some part of QEMU still use register_ioport* functions to register ioport.
These functions doesn't allow to use Memory Listener on it.

Modifications between V1 and V2:
   - Remove the use of get_system_io. Instead of use isa and pci IO
 address space;
   - Avoid allocation of PortioList. Use the different device
 structure;
   - Still remove register_ioport* (hw/dma.c, hw/apm.c, hw/acpi_piix4.c);
   - Use MemoryRegion when we have only a range of ioport;
   - For some functions, add IO address space as argument;
   - Add isa_address_space_io function.

Modifications between V2 and V3:
   - Remove some register_ioport_* on hw/vt82c686.c;
   - Split smb ioport part in new patch;
   - Still replace MemoryRegion when we have only a range of ioport;
   - Fix read/write ioports prototype to  be compliant with memory callback.

Modifications between V3 and V4:
   - Fix compilation in hw/dma.c;
   - Fix address conversion (hw/dma.c, hw/acpi_piix4.c) with MemorySection.
 Indeed the new version use offset from MemorySection start instead of 0.

Modifications between V4 and V5:
   - Rebase on qemu upstream;
   - Forget some ioport_register_* in acpi_piix4.c;
   - Register 0x3b0 - 0x3df range for cirrus instead of ioport by ioport.

Modifications between V5 and V6:
   - Add read function on cirrus ioport (forget on the previous patch);
   - Rework PM memory range handling;
   - Fix PCI_BASE in acpi_piix4.c (wrong conversion during port);
   - Rewrite isa_address_space_io to use ISA bus address space;
   - Fix compilation in vt82c686.c.

Modifications between V6 and V7:
   - acpi_piix4: use memory_region_set_enabled instead of a boolean. I'm not
 sure about this modification (adviced by Avi);
   - Fix device endianness in acpi_piix4 (reported by Avi);
   - Avoid dependencies between patches and reorder it (reported by Jan).
 Some code moved from acpi_piix4 patch to smb/apm patches;

Modifications between V7 and V8:
   - Fix device endianness in smb patch, I forgot some on previous version;
   - Register pm io region at initialization with default value instead
 of at first call to pm_io_space_update (reported by Jan).

Modifications between V8 and V9:
   - Fix size constraint in pm_io_ops (reported by Jan).

Julien Grall (8):
  isa: add isa_address_space_io
  hw/apm.c: replace register_ioport*
  smb: replace_register_ioport*
  hw/acpi_piix4.c: replace register_ioport*
  hw/cirrus_vga.c: replace register_ioport*
  hw/serial.c: replace register_ioport*
  hw/pc.c: replace register_ioport*
  hw/dma.c: replace register_ioport*

 hw/acpi_piix4.c   |  165 +---
 hw/apm.c  |   24 ++--
 hw/apm.h  |5 +-
 hw/cirrus_vga.c   |   50 ++---
 hw/dma.c  |  108 +++
 hw/isa-bus.c  |9 +++
 hw/isa.h  |1 +
 hw/mips_mipssim.c |3 +-
 hw/pc.c   |   58 ++-
 hw/pc.h   |2 +-
 hw/pm_smbus.c |7 +-
 hw/pm_smbus.h |6 +-
 hw/serial.c   |8 ++-
 hw/vt82c686.c |   20 ++-
 14 files changed, 341 insertions(+), 125 deletions(-)

-- 
Julien Grall