qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/5] hw/s390x/pv: Un-inline s390_pv_init()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 2/5] hw/s390x/pv: Un-inline s390_pv_init()
Date: Sat, 17 Dec 2022 00:27:49 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

On 16/12/22 23:04, Philippe Mathieu-Daudé wrote:
There is no point in having s390_pv_init() inlined.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  hw/s390x/pv.c         | 13 +++++++++++++
  include/hw/s390x/pv.h | 14 +-------------
  2 files changed, 14 insertions(+), 13 deletions(-)


diff --git a/include/hw/s390x/pv.h b/include/hw/s390x/pv.h
index 9360aa1091..5bca5bcaf1 100644
--- a/include/hw/s390x/pv.h
+++ b/include/hw/s390x/pv.h
@@ -12,7 +12,6 @@
  #ifndef HW_S390_PV_H
  #define HW_S390_PV_H
-#include "qapi/error.h"
  #include "sysemu/kvm.h"
#ifdef CONFIG_KVM
@@ -78,17 +77,6 @@ static inline int kvm_s390_dump_completion_data(void *buff) 
{ return 0; }
  #endif /* CONFIG_KVM */
int s390_pv_kvm_init(ConfidentialGuestSupport *cgs, Error **errp);
-static inline int s390_pv_init(ConfidentialGuestSupport *cgs, Error **errp)
-{
-    if (!cgs) {
-        return 0;
-    }
-    if (kvm_enabled()) {
-        return s390_pv_kvm_init(cgs, errp);
-    }
-
-    error_setg(errp, "Protected Virtualization requires KVM");
-    return -1;
-}
+int s390_pv_init(ConfidentialGuestSupport *cgs, Error **errp);

OK I understood why this function is inlined. It is called from:

$ git grep s390_pv_init
hw/s390x/pv.c:29:int s390_pv_init(ConfidentialGuestSupport *cgs, Error **errp)
hw/s390x/s390-virtio-ccw.c:259:    s390_pv_init(machine->cgs, &error_fatal);
include/hw/s390x/pv.h:86:int s390_pv_init(ConfidentialGuestSupport *cgs, Error **errp);

Now note in meson.build:

s390x_ss.add(when: 'CONFIG_KVM', if_true: files(
  'tod-kvm.c',
  's390-skeys-kvm.c',
  's390-stattrib-kvm.c',
  'pv.c',
  's390-pci-kvm.c',
))

So when CONFIG_KVM=false s390-virtio-ccw.c doesn't have to link with
the kvm-specific pv.o.

I'll rework this patch.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]