[PATCH 3/5] target/arm/kvm: Exit on error from acpi_ghes_memory_errors()

Gavin Shan posted 5 patches 2 days, 9 hours ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Dongjiu Geng <gengdongjiu1@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH 3/5] target/arm/kvm: Exit on error from acpi_ghes_memory_errors()
Posted by Gavin Shan 2 days, 9 hours ago
A core dump is no sense as there isn't programming bugs related to
errors from acpi_ghes_memory_errors().

Exit instead of abort when the function returns errors, and the
excessive error message is also dropped.

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
---
 target/arm/kvm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 0d57081e69..acda0b3fb4 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -2460,8 +2460,7 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)
                                              paddr)) {
                     kvm_inject_arm_sea(c);
                 } else {
-                    error_report("failed to record the error");
-                    abort();
+                    exit(1);
                 }
             }
             return;
-- 
2.51.1
Re: [PATCH 3/5] target/arm/kvm: Exit on error from acpi_ghes_memory_errors()
Posted by Igor Mammedov 20 hours ago
On Thu, 27 Nov 2025 10:44:33 +1000
Gavin Shan <gshan@redhat.com> wrote:

> A core dump is no sense as there isn't programming bugs related to
> errors from acpi_ghes_memory_errors().
> 
> Exit instead of abort when the function returns errors, and the
> excessive error message is also dropped.
> 
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
>  target/arm/kvm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/target/arm/kvm.c b/target/arm/kvm.c
> index 0d57081e69..acda0b3fb4 100644
> --- a/target/arm/kvm.c
> +++ b/target/arm/kvm.c
> @@ -2460,8 +2460,7 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)
>                                               paddr)) {
>                      kvm_inject_arm_sea(c);
>                  } else {
> -                    error_report("failed to record the error");

so with message gone, user will just see qemu silently exit?

> -                    abort();
> +                    exit(1);
>                  }
>              }
>              return;
Re: [PATCH 3/5] target/arm/kvm: Exit on error from acpi_ghes_memory_errors()
Posted by Markus Armbruster 19 hours ago
Igor Mammedov <imammedo@redhat.com> writes:

> On Thu, 27 Nov 2025 10:44:33 +1000
> Gavin Shan <gshan@redhat.com> wrote:
>
>> A core dump is no sense as there isn't programming bugs related to
>> errors from acpi_ghes_memory_errors().
>> 
>> Exit instead of abort when the function returns errors, and the
>> excessive error message is also dropped.
>> 
>> Suggested-by: Igor Mammedov <imammedo@redhat.com>
>> Suggested-by: Markus Armbruster <armbru@redhat.com>
>> Signed-off-by: Gavin Shan <gshan@redhat.com>
>> ---
>>  target/arm/kvm.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>> 
>> diff --git a/target/arm/kvm.c b/target/arm/kvm.c
>> index 0d57081e69..acda0b3fb4 100644
>> --- a/target/arm/kvm.c
>> +++ b/target/arm/kvm.c
>> @@ -2460,8 +2460,7 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)
>>                                               paddr)) {
>>                      kvm_inject_arm_sea(c);
>>                  } else {
>> -                    error_report("failed to record the error");
>
> so with message gone, user will just see qemu silently exit?

No: acpi_ghes_memory_errors() reports with error_report().

But the stub doesn't.  If it can be called, it needs a suitable
error_report().  It it can't be called, it should abort().

>> -                    abort();
>> +                    exit(1);
>>                  }
>>              }
>>              return;