[PATCH v5 0/6] target/loongarch: Fix some issues reported from coccinelle

Bibo Mao posted 6 patches 1 week, 6 days ago
There is a newer version of this series
hw/loongarch/virt.c               | 60 +++++++++++++++++--------------
target/loongarch/kvm/kvm.c        |  8 +++--
target/loongarch/tcg/tlb_helper.c |  5 ++-
3 files changed, 42 insertions(+), 31 deletions(-)
[PATCH v5 0/6] target/loongarch: Fix some issues reported from coccinelle
Posted by Bibo Mao 1 week, 6 days ago
This patch set solves errors reported by coccinelle tool with commands:
  spatch --sp-file scripts/coccinelle/*.cocci --dir target/loongarch/
  spatch --sp-file scripts/coccinelle/*.cocci --dir hw/loongarch/

The main problem is that qemu should fail to run when feature is forced
to enabled however KVM does not support it, rather than report error and
continue to run.

Also there is fixup for cpu plug and unplug. If there is error when cpu
is plug/unplug at runtime,  system should restore to previous state and
continue to run.

---
  v4 ... v5:
    1. Split patch2 in v4 into three small patches, two are fixup for error
       handing when cpu plug/unplug fails so that system can continue to
       run, one is to remove error_propagate() and refresh title.
    2. Refresh changelog in last patch and remove fixes information
       since it is impossible to happen.

  v3 ... v4:
    1. Add missed this cleanup with error and remove some local error
       object.
    2. Replace local error object with error_abort object in
       virt_cpu_irq_init(), since its return value is not checked.

  v2 ... v3:
    1. Add missing modification replacing error_propagate() + error_setg()
      with error_setg().
    2. Some enhancement about error handling, handling error
       symmetrically in many places

  v1 ... v2:
    1. Add fixes tag and change title with fix prefix in patch 1.
    2. Replace error_propagate() with error_setg(), and return directly
       for any error.
---
Bibo Mao (6):
  target/loongarch: Fix error handling of KVM feature checks
  hw/loongarch/virt: Fix error handling in cpu plug
  hw/loongarch/virt: Fix error handling in cpu unplug
  hw/loongarch/virt: Eliminate error_propagate()
  target/loongarch: Remove unnecessary temporary variable assignment
  target/loongarch: Clean up virt_cpu_irq_init() error handling

 hw/loongarch/virt.c               | 60 +++++++++++++++++--------------
 target/loongarch/kvm/kvm.c        |  8 +++--
 target/loongarch/tcg/tlb_helper.c |  5 ++-
 3 files changed, 42 insertions(+), 31 deletions(-)


base-commit: 1dae461a913f9da88df05de6e2020d3134356f2e
-- 
2.39.3
Re: [PATCH v5 0/6] target/loongarch: Fix some issues reported from coccinelle
Posted by Markus Armbruster 1 week, 6 days ago
Bibo Mao <maobibo@loongson.cn> writes:

> This patch set solves errors reported by coccinelle tool with commands:
>   spatch --sp-file scripts/coccinelle/*.cocci --dir target/loongarch/
>   spatch --sp-file scripts/coccinelle/*.cocci --dir hw/loongarch/
>
> The main problem is that qemu should fail to run when feature is forced
> to enabled however KVM does not support it, rather than report error and
> continue to run.
>
> Also there is fixup for cpu plug and unplug. If there is error when cpu
> is plug/unplug at runtime,  system should restore to previous state and
> continue to run.

PACTH 2 and 3 are still being discussed.

Since I already have a few error-handling patches queued up, I'm queuing
the remainder of this series for 10.0.  Thanks!
Re: [PATCH v5 0/6] target/loongarch: Fix some issues reported from coccinelle
Posted by bibo mao 1 week, 6 days ago

On 2025/3/20 下午3:01, Markus Armbruster wrote:
> Bibo Mao <maobibo@loongson.cn> writes:
> 
>> This patch set solves errors reported by coccinelle tool with commands:
>>    spatch --sp-file scripts/coccinelle/*.cocci --dir target/loongarch/
>>    spatch --sp-file scripts/coccinelle/*.cocci --dir hw/loongarch/
>>
>> The main problem is that qemu should fail to run when feature is forced
>> to enabled however KVM does not support it, rather than report error and
>> continue to run.
>>
>> Also there is fixup for cpu plug and unplug. If there is error when cpu
>> is plug/unplug at runtime,  system should restore to previous state and
>> continue to run.
> 
> PACTH 2 and 3 are still being discussed.
> 
> Since I already have a few error-handling patches queued up, I'm queuing
> the remainder of this series for 10.0.  Thanks!
Sure, that is ok.
And thanks for taking time to review this.

Regards
Bibo Mao