diff mbox series

[6/6] hw/pci-host/sabre: Log reserved address accesses as GUEST_ERROR

Message ID 20201012170950.3491912-7-f4bug@amsat.org
State New
Headers show
Series hw/pci-host/sabre: Report UNIMP/GUEST_ERROR accesses | expand

Commit Message

Philippe Mathieu-Daudé Oct. 12, 2020, 5:09 p.m. UTC
Report accesses to reserved registers using qemu_log_mask(GUEST_ERROR).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/pci-host/sabre.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Mark Cave-Ayland Oct. 19, 2020, 9:58 p.m. UTC | #1
On 12/10/2020 18:09, Philippe Mathieu-Daudé wrote:

> Report accesses to reserved registers using qemu_log_mask(GUEST_ERROR).
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   hw/pci-host/sabre.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c
> index 67699ac9058..cc97c266a57 100644
> --- a/hw/pci-host/sabre.c
> +++ b/hw/pci-host/sabre.c
> @@ -189,7 +189,11 @@ static void sabre_config_write(void *opaque, hwaddr addr,
>       case 0xa800 ... 0xa80f: /* Interrupt diagnostics */
>       case 0xf000 ... 0xf01f: /* FFB config, memory control */
>           /* we don't care */
> +        break;
>       default:
> +        qemu_log_mask(LOG_GUEST_ERROR,
> +                      "%s: Register 0x%04" HWADDR_PRIX " is reserved\n",
> +                      __func__, addr);
>           break;
>       }
>   }
> @@ -235,7 +239,11 @@ static uint64_t sabre_config_read(void *opaque,
>       case 0xa800 ... 0xa80f: /* Interrupt diagnostics */
>       case 0xf000 ... 0xf01f: /* FFB config, memory control */
>           /* we don't care */
> +        break;
>       default:
> +        qemu_log_mask(LOG_GUEST_ERROR,
> +                      "%s: Register 0x%04" HWADDR_PRIX " is reserved\n",
> +                      __func__, addr);
>           break;
>       }
>       trace_sabre_config_read(addr, val);

As per my comment on patch 4, I think these should be logged at LOG_UNIMP and the 
message changed to "is unimplemented". Other than that:

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.
diff mbox series

Patch

diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c
index 67699ac9058..cc97c266a57 100644
--- a/hw/pci-host/sabre.c
+++ b/hw/pci-host/sabre.c
@@ -189,7 +189,11 @@  static void sabre_config_write(void *opaque, hwaddr addr,
     case 0xa800 ... 0xa80f: /* Interrupt diagnostics */
     case 0xf000 ... 0xf01f: /* FFB config, memory control */
         /* we don't care */
+        break;
     default:
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: Register 0x%04" HWADDR_PRIX " is reserved\n",
+                      __func__, addr);
         break;
     }
 }
@@ -235,7 +239,11 @@  static uint64_t sabre_config_read(void *opaque,
     case 0xa800 ... 0xa80f: /* Interrupt diagnostics */
     case 0xf000 ... 0xf01f: /* FFB config, memory control */
         /* we don't care */
+        break;
     default:
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: Register 0x%04" HWADDR_PRIX " is reserved\n",
+                      __func__, addr);
         break;
     }
     trace_sabre_config_read(addr, val);