[PATCH v3 21/68] accel/whpx: Convert ops::synchronize_pre_resume() -> pre_resume_vm()

Philippe Mathieu-Daudé posted 68 patches 4 months, 2 weeks ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <rbolshakov@ddn.com>, Phil Dennis-Jordan <phil@philjordan.eu>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Paul Durrant <paul@xen.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Dr. David Alan Gilbert" <dave@treblig.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Reinoud Zandijk <reinoud@netbsd.org>, Sunil Muthuswamy <sunilmut@microsoft.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, David Hildenbrand <david@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Alexander Graf <agraf@csgraf.de>
There is a newer version of this series
[PATCH v3 21/68] accel/whpx: Convert ops::synchronize_pre_resume() -> pre_resume_vm()
Posted by Philippe Mathieu-Daudé 4 months, 2 weeks ago
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/i386/whpx/whpx-accel-ops.h | 1 -
 target/i386/whpx/whpx-accel-ops.c | 1 -
 target/i386/whpx/whpx-all.c       | 3 ++-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/target/i386/whpx/whpx-accel-ops.h b/target/i386/whpx/whpx-accel-ops.h
index e6cf15511d4..54cfc25a147 100644
--- a/target/i386/whpx/whpx-accel-ops.h
+++ b/target/i386/whpx/whpx-accel-ops.h
@@ -21,7 +21,6 @@ void whpx_cpu_synchronize_state(CPUState *cpu);
 void whpx_cpu_synchronize_post_reset(CPUState *cpu);
 void whpx_cpu_synchronize_post_init(CPUState *cpu);
 void whpx_cpu_synchronize_pre_loadvm(CPUState *cpu);
-void whpx_cpu_synchronize_pre_resume(bool step_pending);
 
 /* state subset only touched by the VCPU itself during runtime */
 #define WHPX_SET_RUNTIME_STATE   1
diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c
index b8bebe403c9..011810b5e50 100644
--- a/target/i386/whpx/whpx-accel-ops.c
+++ b/target/i386/whpx/whpx-accel-ops.c
@@ -95,7 +95,6 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, const void *data)
     ops->synchronize_post_init = whpx_cpu_synchronize_post_init;
     ops->synchronize_state = whpx_cpu_synchronize_state;
     ops->synchronize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm;
-    ops->synchronize_pre_resume = whpx_cpu_synchronize_pre_resume;
 }
 
 static const TypeInfo whpx_accel_ops_type = {
diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
index f0be840b7db..821167a2a77 100644
--- a/target/i386/whpx/whpx-all.c
+++ b/target/i386/whpx/whpx-all.c
@@ -2106,7 +2106,7 @@ void whpx_cpu_synchronize_pre_loadvm(CPUState *cpu)
     run_on_cpu(cpu, do_whpx_cpu_synchronize_pre_loadvm, RUN_ON_CPU_NULL);
 }
 
-void whpx_cpu_synchronize_pre_resume(bool step_pending)
+static void whpx_pre_resume_vm(AccelState *as, bool step_pending)
 {
     whpx_global.step_pending = step_pending;
 }
@@ -2703,6 +2703,7 @@ static void whpx_accel_class_init(ObjectClass *oc, const void *data)
     AccelClass *ac = ACCEL_CLASS(oc);
     ac->name = "WHPX";
     ac->init_machine = whpx_accel_init;
+    ac->pre_resume_vm = whpx_pre_resume_vm;
     ac->allowed = &whpx_allowed;
 
     object_class_property_add(oc, "kernel-irqchip", "on|off|split",
-- 
2.49.0


Re: [PATCH v3 21/68] accel/whpx: Convert ops::synchronize_pre_resume() -> pre_resume_vm()
Posted by Philippe Mathieu-Daudé 4 months, 2 weeks ago
On 1/7/25 16:39, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/i386/whpx/whpx-accel-ops.h | 1 -
>   target/i386/whpx/whpx-accel-ops.c | 1 -
>   target/i386/whpx/whpx-all.c       | 3 ++-
>   3 files changed, 2 insertions(+), 3 deletions(-)

> diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c
> index b8bebe403c9..011810b5e50 100644
> --- a/target/i386/whpx/whpx-accel-ops.c
> +++ b/target/i386/whpx/whpx-accel-ops.c
> @@ -95,7 +95,6 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, const void *data)
>       ops->synchronize_post_init = whpx_cpu_synchronize_post_init;
>       ops->synchronize_state = whpx_cpu_synchronize_state;
>       ops->synchronize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm;
> -    ops->synchronize_pre_resume = whpx_cpu_synchronize_pre_resume;
>   }

> @@ -2703,6 +2703,7 @@ static void whpx_accel_class_init(ObjectClass *oc, const void *data)
>       AccelClass *ac = ACCEL_CLASS(oc);
>       ac->name = "WHPX";
>       ac->init_machine = whpx_accel_init;
> +    ac->pre_resume_vm = whpx_pre_resume_vm;
>       ac->allowed = &whpx_allowed;
>   
>       object_class_property_add(oc, "kernel-irqchip", "on|off|split",

If preferred I can squash 20-22. The point here is this method does not
belong to AccelOpsClass (with vcpu argument) but AccelClass because only
requiring the (unique) AccelState argument.

Re: [PATCH v3 21/68] accel/whpx: Convert ops::synchronize_pre_resume() -> pre_resume_vm()
Posted by Richard Henderson 4 months, 2 weeks ago
On 7/2/25 01:20, Philippe Mathieu-Daudé wrote:
> On 1/7/25 16:39, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   target/i386/whpx/whpx-accel-ops.h | 1 -
>>   target/i386/whpx/whpx-accel-ops.c | 1 -
>>   target/i386/whpx/whpx-all.c       | 3 ++-
>>   3 files changed, 2 insertions(+), 3 deletions(-)
> 
>> diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c
>> index b8bebe403c9..011810b5e50 100644
>> --- a/target/i386/whpx/whpx-accel-ops.c
>> +++ b/target/i386/whpx/whpx-accel-ops.c
>> @@ -95,7 +95,6 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, const void *data)
>>       ops->synchronize_post_init = whpx_cpu_synchronize_post_init;
>>       ops->synchronize_state = whpx_cpu_synchronize_state;
>>       ops->synchronize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm;
>> -    ops->synchronize_pre_resume = whpx_cpu_synchronize_pre_resume;
>>   }
> 
>> @@ -2703,6 +2703,7 @@ static void whpx_accel_class_init(ObjectClass *oc, const void *data)
>>       AccelClass *ac = ACCEL_CLASS(oc);
>>       ac->name = "WHPX";
>>       ac->init_machine = whpx_accel_init;
>> +    ac->pre_resume_vm = whpx_pre_resume_vm;
>>       ac->allowed = &whpx_allowed;
>>       object_class_property_add(oc, "kernel-irqchip", "on|off|split",
> 
> If preferred I can squash 20-22. The point here is this method does not
> belong to AccelOpsClass (with vcpu argument) but AccelClass because only
> requiring the (unique) AccelState argument.

That might be nicer.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~