[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.
- [PATCH 0/5] target/s390x: Header cleanups around "cpu.h", Philippe Mathieu-Daudé, 2022/12/16
- [PATCH 1/5] exec/memory: Expose memory_region_access_valid(), Philippe Mathieu-Daudé, 2022/12/16
- [PATCH 2/5] hw/s390x/pv: Un-inline s390_pv_init(), Philippe Mathieu-Daudé, 2022/12/16
- Re: [PATCH 2/5] hw/s390x/pv: Un-inline s390_pv_init(),
Philippe Mathieu-Daudé <=
- [PATCH 3/5] hw/s390x/pv: Simplify s390_is_pv() for user emulation, Philippe Mathieu-Daudé, 2022/12/16
- [PATCH 5/5] target/s390x/tcg/excp_helper: Restrict system headers to sysemu, Philippe Mathieu-Daudé, 2022/12/16
- [PATCH 4/5] target/s390x/tcg/misc_helper: Remove unused "memory.h" include, Philippe Mathieu-Daudé, 2022/12/16