[Qemu-devel] [PATCH] hw/core/register: Log unimplemented access via the 'unimp' debug level

Philippe Mathieu-Daudé posted 1 patch 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180622124716.9179-1-f4bug@amsat.org
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
hw/core/register.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH] hw/core/register: Log unimplemented access via the 'unimp' debug level
Posted by Philippe Mathieu-Daudé 5 years, 10 months ago
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/core/register.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/core/register.c b/hw/core/register.c
index d2d1636250..8ed7c6b927 100644
--- a/hw/core/register.c
+++ b/hw/core/register.c
@@ -203,7 +203,7 @@ void register_write_memory(void *opaque, hwaddr addr,
     }
 
     if (!reg) {
-        qemu_log_mask(LOG_GUEST_ERROR, "%s: write to unimplemented register " \
+        qemu_log_mask(LOG_UNIMP, "%s: write to unimplemented register " \
                       "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
         return;
     }
@@ -232,7 +232,7 @@ uint64_t register_read_memory(void *opaque, hwaddr addr,
     }
 
     if (!reg) {
-        qemu_log_mask(LOG_GUEST_ERROR, "%s:  read to unimplemented register " \
+        qemu_log_mask(LOG_UNIMP, "%s:  read to unimplemented register " \
                       "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
         return 0;
     }
-- 
2.18.0.rc2


Re: [Qemu-devel] [PATCH] hw/core/register: Log unimplemented access via the 'unimp' debug level
Posted by Alistair Francis 5 years, 10 months ago
On Fri, Jun 22, 2018 at 5:47 AM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/core/register.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/core/register.c b/hw/core/register.c
> index d2d1636250..8ed7c6b927 100644
> --- a/hw/core/register.c
> +++ b/hw/core/register.c
> @@ -203,7 +203,7 @@ void register_write_memory(void *opaque, hwaddr addr,
>      }
>
>      if (!reg) {
> -        qemu_log_mask(LOG_GUEST_ERROR, "%s: write to unimplemented register " \
> +        qemu_log_mask(LOG_UNIMP, "%s: write to unimplemented register " \
>                        "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
>          return;
>      }
> @@ -232,7 +232,7 @@ uint64_t register_read_memory(void *opaque, hwaddr addr,
>      }
>
>      if (!reg) {
> -        qemu_log_mask(LOG_GUEST_ERROR, "%s:  read to unimplemented register " \
> +        qemu_log_mask(LOG_UNIMP, "%s:  read to unimplemented register " \
>                        "at address: %#" PRIx64 "\n", reg_array->prefix, addr);

I'm not sure this is correct. These can be unimplemented because there
are gaps in the register memory map, so it is a guest error.

Alistair

>          return 0;
>      }
> --
> 2.18.0.rc2
>
>

Re: [Qemu-devel] [PATCH] hw/core/register: Log unimplemented access via the 'unimp' debug level
Posted by Philippe Mathieu-Daudé 5 years, 10 months ago
On 06/22/2018 04:49 PM, Alistair Francis wrote:
> On Fri, Jun 22, 2018 at 5:47 AM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  hw/core/register.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/core/register.c b/hw/core/register.c
>> index d2d1636250..8ed7c6b927 100644
>> --- a/hw/core/register.c
>> +++ b/hw/core/register.c
>> @@ -203,7 +203,7 @@ void register_write_memory(void *opaque, hwaddr addr,
>>      }
>>
>>      if (!reg) {
>> -        qemu_log_mask(LOG_GUEST_ERROR, "%s: write to unimplemented register " \
>> +        qemu_log_mask(LOG_UNIMP, "%s: write to unimplemented register " \
>>                        "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
>>          return;
>>      }
>> @@ -232,7 +232,7 @@ uint64_t register_read_memory(void *opaque, hwaddr addr,
>>      }
>>
>>      if (!reg) {
>> -        qemu_log_mask(LOG_GUEST_ERROR, "%s:  read to unimplemented register " \
>> +        qemu_log_mask(LOG_UNIMP, "%s:  read to unimplemented register " \
>>                        "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
> 
> I'm not sure this is correct. These can be unimplemented because there
> are gaps in the register memory map, so it is a guest error.

This is exactly what I was wondering, thanks for your comment, I'll
probably add a comment about it.

> 
> Alistair
> 
>>          return 0;
>>      }
>> --
>> 2.18.0.rc2
>>
>>