[RFC PATCH] target/s390x: Remove KVM stubs in cpu_models.h

Philippe Mathieu-Daudé posted 1 patch 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240419090631.48055-1-philmd@linaro.org
Maintainers: David Hildenbrand <david@redhat.com>, Thomas Huth <thuth@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>
target/s390x/cpu_models.h | 15 ---------------
1 file changed, 15 deletions(-)
[RFC PATCH] target/s390x: Remove KVM stubs in cpu_models.h
Posted by Philippe Mathieu-Daudé 2 weeks ago
Since the calls are elided when KVM is not available,
we can remove the stubs (which are never compiled).

Inspired-by: Thomas Huth <thuth@redhat.com>>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
RFC: untested =) Inspired by
https://lore.kernel.org/qemu-devel/0ae778e1-b4aa-4021-bdbc-4c6a663db41a@redhat.com/
---
 target/s390x/cpu_models.h | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h
index d7b8912989..a89c2a15ab 100644
--- a/target/s390x/cpu_models.h
+++ b/target/s390x/cpu_models.h
@@ -114,23 +114,8 @@ static inline uint64_t s390_cpuid_from_cpu_model(const S390CPUModel *model)
 S390CPUDef const *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga,
                                     S390FeatBitmap features);
 
-#ifdef CONFIG_KVM
 bool kvm_s390_cpu_models_supported(void);
 void kvm_s390_get_host_cpu_model(S390CPUModel *model, Error **errp);
 void kvm_s390_apply_cpu_model(const S390CPUModel *model,  Error **errp);
-#else
-static inline void kvm_s390_get_host_cpu_model(S390CPUModel *model,
-                                               Error **errp)
-{
-}
-static inline void kvm_s390_apply_cpu_model(const S390CPUModel *model,
-                                            Error **errp)
-{
-}
-static inline bool kvm_s390_cpu_models_supported(void)
-{
-    return false;
-}
-#endif
 
 #endif /* TARGET_S390X_CPU_MODELS_H */
-- 
2.41.0


Re: [PATCH] target/s390x: Remove KVM stubs in cpu_models.h
Posted by Philippe Mathieu-Daudé 2 weeks ago
On 19/4/24 11:06, Philippe Mathieu-Daudé wrote:
> Since the calls are elided when KVM is not available,
> we can remove the stubs (which are never compiled).
> 
> Inspired-by: Thomas Huth <thuth@redhat.com>>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> RFC: untested =)

Now tested!

Inspired by
> https://lore.kernel.org/qemu-devel/0ae778e1-b4aa-4021-bdbc-4c6a663db41a@redhat.com/
> ---
>   target/s390x/cpu_models.h | 15 ---------------
>   1 file changed, 15 deletions(-)