Patchwork [2/2] pc: remove DEBUG_BIOS define and QEMU exit I/O ports

login
register
mail settings
Submitter Hervé Poussineau
Date July 6, 2012, 9:53 p.m.
Message ID <1341611595-9847-2-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/169543/
State New
Headers show

Comments

Hervé Poussineau - July 6, 2012, 9:53 p.m.
Debug output ports (enabled by DEBUG_BIOS define) can be replaced by:
-chardev stdio,id=debugcon,mux=on
-device isa-debugcon,iobase=0x402,chardev=debugcon
-device isa-debugcon,iobase=0x403,chardev=debugcon
-device isa-debugcon,iobase=0x500,chardev=debugcon
-device isa-debugcon,iobase=0x503,chardev=debugcon

QEMU exit (which can be guest trigged) can be replaced by:
-device isa-debugexit,iobase=0x501
-device isa-debugexit,iobase=0x501,access-size=2
-device isa-debugexit,iobase=0x502,access-size=2

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---

Anthony, this patch is a follow-up of a patch I sent in March 2012:
http://lists.gnu.org/archive/html/qemu-devel/2012-03/msg00031.html

Will you accept this approach, where your regression suite will require
a new parameter "-device isa-debugexit,iobase=0x501" ?

 hw/pc.c |   35 -----------------------------------
 1 file changed, 35 deletions(-)
Hervé Poussineau - July 29, 2012, 11:33 a.m.
Ping.

Hervé Poussineau a écrit :
> Debug output ports (enabled by DEBUG_BIOS define) can be replaced by:
> -chardev stdio,id=debugcon,mux=on
> -device isa-debugcon,iobase=0x402,chardev=debugcon
> -device isa-debugcon,iobase=0x403,chardev=debugcon
> -device isa-debugcon,iobase=0x500,chardev=debugcon
> -device isa-debugcon,iobase=0x503,chardev=debugcon
> 
> QEMU exit (which can be guest trigged) can be replaced by:
> -device isa-debugexit,iobase=0x501
> -device isa-debugexit,iobase=0x501,access-size=2
> -device isa-debugexit,iobase=0x502,access-size=2
> 
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
> 
> Anthony, this patch is a follow-up of a patch I sent in March 2012:
> http://lists.gnu.org/archive/html/qemu-devel/2012-03/msg00031.html
> 
> Will you accept this approach, where your regression suite will require
> a new parameter "-device isa-debugexit,iobase=0x501" ?
> 
>  hw/pc.c |   35 -----------------------------------
>  1 file changed, 35 deletions(-)
> 
> diff --git a/hw/pc.c b/hw/pc.c
> index c7e9ab3..a328fb2 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -49,9 +49,6 @@
>  #include "exec-memory.h"
>  #include "arch_init.h"
>  
> -/* output Bochs bios info messages */
> -//#define DEBUG_BIOS
> -
>  /* debug PC/ISA interrupts */
>  //#define DEBUG_IRQ
>  
> @@ -540,17 +537,6 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val)
>      static int shutdown_index = 0;
>  
>      switch(addr) {
> -        /* Bochs BIOS messages */
> -    case 0x400:
> -    case 0x401:
> -        /* used to be panic, now unused */
> -        break;
> -    case 0x402:
> -    case 0x403:
> -#ifdef DEBUG_BIOS
> -        fprintf(stderr, "%c", val);
> -#endif
> -        break;
>      case 0x8900:
>          /* same as Bochs power off */
>          if (val == shutdown_str[shutdown_index]) {
> @@ -563,17 +549,6 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val)
>              shutdown_index = 0;
>          }
>          break;
> -
> -        /* LGPL'ed VGA BIOS messages */
> -    case 0x501:
> -    case 0x502:
> -        exit((val << 1) | 1);
> -    case 0x500:
> -    case 0x503:
> -#ifdef DEBUG_BIOS
> -        fprintf(stderr, "%c", val);
> -#endif
> -        break;
>      }
>  }
>  
> @@ -602,18 +577,8 @@ static void *bochs_bios_init(void)
>      uint64_t *numa_fw_cfg;
>      int i, j;
>  
> -    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);
> -
>      fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
>  
>      fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
Anthony Liguori - Aug. 1, 2012, 1:59 p.m.
On 07/06/2012 04:53 PM, Hervé Poussineau wrote:
> Debug output ports (enabled by DEBUG_BIOS define) can be replaced by:
> -chardev stdio,id=debugcon,mux=on
> -device isa-debugcon,iobase=0x402,chardev=debugcon
> -device isa-debugcon,iobase=0x403,chardev=debugcon
> -device isa-debugcon,iobase=0x500,chardev=debugcon
> -device isa-debugcon,iobase=0x503,chardev=debugcon
>
> QEMU exit (which can be guest trigged) can be replaced by:
> -device isa-debugexit,iobase=0x501
> -device isa-debugexit,iobase=0x501,access-size=2
> -device isa-debugexit,iobase=0x502,access-size=2
>
> Signed-off-by: Hervé Poussineau<hpoussin@reactos.org>
> ---
>
> Anthony, this patch is a follow-up of a patch I sent in March 2012:
> http://lists.gnu.org/archive/html/qemu-devel/2012-03/msg00031.html
>
> Will you accept this approach, where your regression suite will require
> a new parameter "-device isa-debugexit,iobase=0x501" ?
>
>   hw/pc.c |   35 -----------------------------------
>   1 file changed, 35 deletions(-)
>
> diff --git a/hw/pc.c b/hw/pc.c
> index c7e9ab3..a328fb2 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -49,9 +49,6 @@
>   #include "exec-memory.h"
>   #include "arch_init.h"
>
> -/* output Bochs bios info messages */
> -//#define DEBUG_BIOS
> -
>   /* debug PC/ISA interrupts */
>   //#define DEBUG_IRQ
>
> @@ -540,17 +537,6 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val)
>       static int shutdown_index = 0;
>
>       switch(addr) {
> -        /* Bochs BIOS messages */
> -    case 0x400:
> -    case 0x401:
> -        /* used to be panic, now unused */
> -        break;
> -    case 0x402:
> -    case 0x403:
> -#ifdef DEBUG_BIOS
> -        fprintf(stderr, "%c", val);
> -#endif
> -        break;
>       case 0x8900:
>           /* same as Bochs power off */
>           if (val == shutdown_str[shutdown_index]) {
> @@ -563,17 +549,6 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val)
>               shutdown_index = 0;
>           }
>           break;
> -
> -        /* LGPL'ed VGA BIOS messages */
> -    case 0x501:
> -    case 0x502:
> -        exit((val<<  1) | 1);
> -    case 0x500:
> -    case 0x503:
> -#ifdef DEBUG_BIOS
> -        fprintf(stderr, "%c", val);
> -#endif
> -        break;
>       }
>   }
>
> @@ -602,18 +577,8 @@ static void *bochs_bios_init(void)
>       uint64_t *numa_fw_cfg;
>       int i, j;
>
> -    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);
> -
>       fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
>
>       fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);

Removing this from the default PC breaks compatibility.  I don't mind having a 
way to disable it but it needs to be there by default.

Among other things, my test suite depends on these ports.

Regards,

Anthony Liguori
Hervé Poussineau - Aug. 1, 2012, 3:21 p.m.
Anthony Liguori a écrit :
> On 07/06/2012 04:53 PM, Hervé Poussineau wrote:
>> Debug output ports (enabled by DEBUG_BIOS define) can be replaced by:
>> -chardev stdio,id=debugcon,mux=on
>> -device isa-debugcon,iobase=0x402,chardev=debugcon
>> -device isa-debugcon,iobase=0x403,chardev=debugcon
>> -device isa-debugcon,iobase=0x500,chardev=debugcon
>> -device isa-debugcon,iobase=0x503,chardev=debugcon
>>
>> QEMU exit (which can be guest triggered) can be replaced by:
>> -device isa-debugexit,iobase=0x501
>> -device isa-debugexit,iobase=0x501,access-size=2
>> -device isa-debugexit,iobase=0x502,access-size=2
>>
>> Signed-off-by: Hervé Poussineau<hpoussin@reactos.org>
>> ---
>>
>> Anthony, this patch is a follow-up of a patch I sent in March 2012:
>> http://lists.gnu.org/archive/html/qemu-devel/2012-03/msg00031.html
>>
>> Will you accept this approach, where your regression suite will require
>> a new parameter "-device isa-debugexit,iobase=0x501" ?
>>

[...]

>>
>> @@ -602,18 +577,8 @@ static void *bochs_bios_init(void)
>>       uint64_t *numa_fw_cfg;
>>       int i, j;
>>
>> -    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);
>> -
>>       fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
>>
>>       fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
> 
> Removing this from the default PC breaks compatibility.  I don't mind 
> having a way to disable it but it needs to be there by default.
> 
> Among other things, my test suite depends on these ports.
> 

OK for keeping them on compat PC machines.
However, for current ones (1.2 or later), I don't want to have them by 
default as it is an QEMU exit which is guest triggerable.
Will you accept this approach, where your regression suite will require
a new parameter "-device isa-debugexit,iobase=0x501" ?

Regards,

Hervé
Anthony Liguori - Aug. 1, 2012, 3:37 p.m.
Hervé Poussineau <hpoussin@reactos.org> writes:

> Anthony Liguori a écrit :
>> On 07/06/2012 04:53 PM, Hervé Poussineau wrote:
>>> Debug output ports (enabled by DEBUG_BIOS define) can be replaced by:
>>> -chardev stdio,id=debugcon,mux=on
>>> -device isa-debugcon,iobase=0x402,chardev=debugcon
>>> -device isa-debugcon,iobase=0x403,chardev=debugcon
>>> -device isa-debugcon,iobase=0x500,chardev=debugcon
>>> -device isa-debugcon,iobase=0x503,chardev=debugcon
>>>
>>> QEMU exit (which can be guest triggered) can be replaced by:
>>> -device isa-debugexit,iobase=0x501
>>> -device isa-debugexit,iobase=0x501,access-size=2
>>> -device isa-debugexit,iobase=0x502,access-size=2
>>>
>>> Signed-off-by: Hervé Poussineau<hpoussin@reactos.org>
>>> ---
>>>
>>> Anthony, this patch is a follow-up of a patch I sent in March 2012:
>>> http://lists.gnu.org/archive/html/qemu-devel/2012-03/msg00031.html
>>>
>>> Will you accept this approach, where your regression suite will require
>>> a new parameter "-device isa-debugexit,iobase=0x501" ?
>>>
>
> [...]
>
>>>
>>> @@ -602,18 +577,8 @@ static void *bochs_bios_init(void)
>>>       uint64_t *numa_fw_cfg;
>>>       int i, j;
>>>
>>> -    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);
>>> -
>>>       fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
>>>
>>>       fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
>> 
>> Removing this from the default PC breaks compatibility.  I don't mind 
>> having a way to disable it but it needs to be there by default.
>> 
>> Among other things, my test suite depends on these ports.
>> 
>
> OK for keeping them on compat PC machines.
> However, for current ones (1.2 or later), I don't want to have them by 
> default as it is an QEMU exit which is guest triggerable.
> Will you accept this approach, where your regression suite will require
> a new parameter "-device isa-debugexit,iobase=0x501" ?

Yes although I'd prefer the iobase not be required to be explicitly
specified.

Regards,

Anthony Liguori

>
> Regards,
>
> Hervé
Hervé Poussineau - Aug. 1, 2012, 3:48 p.m.
Anthony Liguori a écrit :
> Hervé Poussineau <hpoussin@reactos.org> writes:
> 
>> Anthony Liguori a écrit :
>>> On 07/06/2012 04:53 PM, Hervé Poussineau wrote:
>>>> QEMU exit (which can be guest triggered) can be replaced by:
>>>> -device isa-debugexit,iobase=0x501
>>>> -device isa-debugexit,iobase=0x501,access-size=2
>>>> -device isa-debugexit,iobase=0x502,access-size=2
>>>>

[...]

>> However, for current ones (1.2 or later), I don't want to have them by 
>> default as it is an QEMU exit which is guest triggerable.
>> Will you accept this approach, where your regression suite will require
>> a new parameter "-device isa-debugexit,iobase=0x501" ?
> 
> Yes although I'd prefer the iobase not be required to be explicitly
> specified.

Which one are you using? iobase 0x501 or 0x502? And with access size 1 or 2?

Regards,

Hervé
Andreas Färber - Sept. 11, 2012, 2:50 p.m.
Am 01.08.2012 17:48, schrieb Hervé Poussineau:
> Anthony Liguori a écrit :
>> Hervé Poussineau <hpoussin@reactos.org> writes:
>>
>>> Anthony Liguori a écrit :
>>>> On 07/06/2012 04:53 PM, Hervé Poussineau wrote:
>>>>> QEMU exit (which can be guest triggered) can be replaced by:
>>>>> -device isa-debugexit,iobase=0x501
>>>>> -device isa-debugexit,iobase=0x501,access-size=2
>>>>> -device isa-debugexit,iobase=0x502,access-size=2
>>>>>
> 
> [...]
> 
>>> However, for current ones (1.2 or later), I don't want to have them
>>> by default as it is an QEMU exit which is guest triggerable.
>>> Will you accept this approach, where your regression suite will require
>>> a new parameter "-device isa-debugexit,iobase=0x501" ?
>>
>> Yes although I'd prefer the iobase not be required to be explicitly
>> specified.
> 
> Which one are you using? iobase 0x501 or 0x502? And with access size 1
> or 2?

This discussion seems to have died out without result... Hervé, do you
have a newer patchset with either of the two default addresses?

Andreas
Hervé Poussineau - Sept. 11, 2012, 6:30 p.m.
Andreas Färber a écrit :
> Am 01.08.2012 17:48, schrieb Hervé Poussineau:
>> Anthony Liguori a écrit :
>>> Hervé Poussineau <hpoussin@reactos.org> writes:
>>>
>>>> Anthony Liguori a écrit :
>>>>> On 07/06/2012 04:53 PM, Hervé Poussineau wrote:
>>>>>> QEMU exit (which can be guest triggered) can be replaced by:
>>>>>> -device isa-debugexit,iobase=0x501
>>>>>> -device isa-debugexit,iobase=0x501,access-size=2
>>>>>> -device isa-debugexit,iobase=0x502,access-size=2
>>>>>>
>> [...]
>>
>>>> However, for current ones (1.2 or later), I don't want to have them
>>>> by default as it is an QEMU exit which is guest triggerable.
>>>> Will you accept this approach, where your regression suite will require
>>>> a new parameter "-device isa-debugexit,iobase=0x501" ?
>>> Yes although I'd prefer the iobase not be required to be explicitly
>>> specified.
>> Which one are you using? iobase 0x501 or 0x502? And with access size 1
>> or 2?
> 
> This discussion seems to have died out without result... Hervé, do you
> have a newer patchset with either of the two default addresses?
> 
> Andreas
> 

I may only need to change the default iobase and access-size values in 
first patch. They are currently at 0x501 with an access size of 1, but I 
got no answer from Anthony if those are the values he wants.

Hervé

Patch

diff --git a/hw/pc.c b/hw/pc.c
index c7e9ab3..a328fb2 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -49,9 +49,6 @@ 
 #include "exec-memory.h"
 #include "arch_init.h"
 
-/* output Bochs bios info messages */
-//#define DEBUG_BIOS
-
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
 
@@ -540,17 +537,6 @@  static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val)
     static int shutdown_index = 0;
 
     switch(addr) {
-        /* Bochs BIOS messages */
-    case 0x400:
-    case 0x401:
-        /* used to be panic, now unused */
-        break;
-    case 0x402:
-    case 0x403:
-#ifdef DEBUG_BIOS
-        fprintf(stderr, "%c", val);
-#endif
-        break;
     case 0x8900:
         /* same as Bochs power off */
         if (val == shutdown_str[shutdown_index]) {
@@ -563,17 +549,6 @@  static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val)
             shutdown_index = 0;
         }
         break;
-
-        /* LGPL'ed VGA BIOS messages */
-    case 0x501:
-    case 0x502:
-        exit((val << 1) | 1);
-    case 0x500:
-    case 0x503:
-#ifdef DEBUG_BIOS
-        fprintf(stderr, "%c", val);
-#endif
-        break;
     }
 }
 
@@ -602,18 +577,8 @@  static void *bochs_bios_init(void)
     uint64_t *numa_fw_cfg;
     int i, j;
 
-    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);
-
     fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
 
     fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);