[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 37/44] target/s390x: move a couple of functions to cp
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 37/44] target/s390x: move a couple of functions to cpu.c |
Date: |
Wed, 30 Aug 2017 18:52:45 +0200 |
From: David Hildenbrand <address@hidden>
Prepare to move more stuff (especially KVM related) from cpu.h to
internal.h.
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/cpu.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++
target/s390x/cpu.h | 89 ++++++------------------------------------------------
2 files changed, 89 insertions(+), 79 deletions(-)
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index dadd383d90..90e2db7b1f 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -392,6 +392,85 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU
*cpu)
return s390_count_running_cpus();
}
+
+int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_get_clock(tod_high, tod_low);
+ }
+ /* Fixme TCG */
+ *tod_high = 0;
+ *tod_low = 0;
+ return 0;
+}
+
+int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_set_clock(tod_high, tod_low);
+ }
+ /* Fixme TCG */
+ return 0;
+}
+
+int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_set_mem_limit(new_limit, hw_limit);
+ }
+ return 0;
+}
+
+void s390_cmma_reset(void)
+{
+ if (kvm_enabled()) {
+ kvm_s390_cmma_reset();
+ }
+}
+
+int s390_cpu_restart(S390CPU *cpu)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_cpu_restart(cpu);
+ }
+ return -ENOSYS;
+}
+
+int s390_get_memslot_count(void)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_get_memslot_count();
+ } else {
+ return MAX_AVAIL_SLOTS;
+ }
+}
+
+int s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch_id,
+ int vq, bool assign)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign);
+ } else {
+ return 0;
+ }
+}
+
+void s390_crypto_reset(void)
+{
+ if (kvm_enabled()) {
+ kvm_s390_crypto_reset();
+ }
+}
+
+bool s390_get_squash_mcss(void)
+{
+ if (object_property_get_bool(OBJECT(qdev_get_machine()),
"s390-squash-mcss",
+ NULL)) {
+ return true;
+ }
+
+ return false;
+}
#endif
static gchar *s390_gdb_arch_name(CPUState *cs)
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index af941f8e51..a2cefb7a0c 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -439,25 +439,8 @@ static inline void kvm_s390_access_exception(S390CPU *cpu,
uint16_t code,
}
#endif
-static inline int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
-{
- if (kvm_enabled()) {
- return kvm_s390_get_clock(tod_high, tod_low);
- }
- /* Fixme TCG */
- *tod_high = 0;
- *tod_low = 0;
- return 0;
-}
-
-static inline int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
-{
- if (kvm_enabled()) {
- return kvm_s390_set_clock(tod_high, tod_low);
- }
- /* Fixme TCG */
- return 0;
-}
+int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low);
+int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low);
S390CPU *s390_cpu_addr2state(uint16_t cpu_addr);
unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu);
@@ -805,69 +788,17 @@ static inline void kvm_s390_crypto_reset(void)
}
#endif
-static inline int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit)
-{
- if (kvm_enabled()) {
- return kvm_s390_set_mem_limit(new_limit, hw_limit);
- }
- return 0;
-}
-
-static inline void s390_cmma_reset(void)
-{
- if (kvm_enabled()) {
- kvm_s390_cmma_reset();
- }
-}
-
-static inline int s390_cpu_restart(S390CPU *cpu)
-{
- if (kvm_enabled()) {
- return kvm_s390_cpu_restart(cpu);
- }
- return -ENOSYS;
-}
-
-static inline int s390_get_memslot_count(void)
-{
- if (kvm_enabled()) {
- return kvm_s390_get_memslot_count();
- } else {
- return MAX_AVAIL_SLOTS;
- }
-}
-
+int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit);
+void s390_cmma_reset(void);
+int s390_cpu_restart(S390CPU *cpu);
+int s390_get_memslot_count(void);
void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr,
uint32_t io_int_parm, uint32_t io_int_word);
void s390_crw_mchk(void);
-
-static inline int s390_assign_subch_ioeventfd(EventNotifier *notifier,
- uint32_t sch_id, int vq,
- bool assign)
-{
- if (kvm_enabled()) {
- return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign);
- } else {
- return 0;
- }
-}
-
-static inline void s390_crypto_reset(void)
-{
- if (kvm_enabled()) {
- kvm_s390_crypto_reset();
- }
-}
-
-static inline bool s390_get_squash_mcss(void)
-{
- if (object_property_get_bool(OBJECT(qdev_get_machine()),
"s390-squash-mcss",
- NULL)) {
- return true;
- }
-
- return false;
-}
+int s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch_id,
+ int vq, bool assign);
+void s390_crypto_reset(void);
+bool s390_get_squash_mcss(void);
/* machine check interruption code */
--
2.13.5
- [Qemu-devel] [PULL 28/44] s390x/cpumodel: factor out determination of default model name, (continued)
- [Qemu-devel] [PULL 28/44] s390x/cpumodel: factor out determination of default model name, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 29/44] s390x: drop inclusion of sysemu/kvm.h from some files, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 30/44] target/s390x: move gtod_*() declarations to s390-virtio.h, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 32/44] target/s390x: move cpu_mmu_idx_to_asc() to excp_helper.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 31/44] target/s390x: move cc_name() to helper.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 33/44] target/s390x: move psw_key_valid() to mem_helper.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 34/44] target/s390x: move s390_do_cpu_reset() to diag.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 35/44] target/s390x: move get_per_in_range() to misc_helper.c, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 36/44] target/s390x: introduce internal.h, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 38/44] s390x: avoid calling kvm_ functions outside of target/s390x/, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 37/44] target/s390x: move a couple of functions to cpu.c,
Cornelia Huck <=
- [Qemu-devel] [PULL 39/44] s390x/kvm: move KVM declarations and stubs to separate files, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 41/44] s390x/s390-stattrib: Mark the storage attribute as not user_creatable, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 42/44] s390-ccw: Fix alignment for CCW1, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 40/44] target/s390x: cleanup cpu.h, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 44/44] s390x/pci: fixup trap_msix(), Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 43/44] pc-bios/s390-ccw.img: update image, Cornelia Huck, 2017/08/30
- Re: [Qemu-devel] [PULL 00/44] first batch of s390x patches for 2.11, Peter Maydell, 2017/08/31