From: David Hildenbrand <david@redhat.com>
To: qemu-devel@nongnu.org
Cc: rth@twiddle.net, Aurelien Jarno <aurelien@aurel32.net>,
thuth@redhat.com, cohuck@redhat.com, david@redhat.com,
borntraeger@de.ibm.com
Subject: [Qemu-devel] [PATCH RFC 2/5] target/s390x: move a couple of functions to cpu.c
Date: Fri, 11 Aug 2017 09:46:49 +0200 [thread overview]
Message-ID: <20170811074652.31474-3-david@redhat.com> (raw)
In-Reply-To: <20170811074652.31474-1-david@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
target/s390x/cpu.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++
target/s390x/cpu.h | 88 +++++++-----------------------------------------------
2 files changed, 90 insertions(+), 78 deletions(-)
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index dadd383..81165e8 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -392,6 +392,86 @@ 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(kvm_state, 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(KVMState *s)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_get_memslot_count(s);
+ } 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 1ab88ad..a9acef6 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -421,25 +421,8 @@ static inline int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
}
#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);
@@ -750,69 +733,18 @@ 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(kvm_state, 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(KVMState *s)
-{
- if (kvm_enabled()) {
- return kvm_s390_get_memslot_count(s);
- } 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(KVMState *s);
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,
+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;
-}
+ bool assign);
+void s390_crypto_reset(void);
+bool s390_get_squash_mcss(void);
/* machine check interruption code */
--
2.9.4
next prev parent reply other threads:[~2017-08-11 7:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 7:46 [Qemu-devel] [PATCH RFC 0/5] target/s390x: introduce internal.h and cleanup cpu.h David Hildenbrand
2017-08-11 7:46 ` [Qemu-devel] [PATCH RFC 1/5] target/s390x: introduce internal.h David Hildenbrand
2017-08-11 13:15 ` Richard Henderson
2017-08-11 13:21 ` David Hildenbrand
2017-08-11 14:00 ` Thomas Huth
2017-08-11 14:21 ` David Hildenbrand
2017-08-11 14:39 ` Thomas Huth
2017-08-11 16:11 ` David Hildenbrand
2017-08-11 16:29 ` Thomas Huth
2017-08-11 14:14 ` Thomas Huth
2017-08-11 14:16 ` David Hildenbrand
2017-08-11 7:46 ` David Hildenbrand [this message]
2017-08-11 13:17 ` [Qemu-devel] [PATCH RFC 2/5] target/s390x: move a couple of functions to cpu.c Richard Henderson
2017-08-11 14:09 ` Thomas Huth
2017-08-11 7:46 ` [Qemu-devel] [PATCH RFC 3/5] s390x: avoid calling kvm_ functions outside of target/s390x/ David Hildenbrand
2017-08-11 13:18 ` Richard Henderson
2017-08-11 14:19 ` Thomas Huth
2017-08-11 7:46 ` [Qemu-devel] [PATCH RFC 4/5] target/s390x: remove all CONFIG_KVM from cpu.h David Hildenbrand
2017-08-11 13:19 ` Richard Henderson
2017-08-11 14:19 ` Thomas Huth
2017-08-11 16:11 ` David Hildenbrand
2017-08-11 17:18 ` Richard Henderson
2017-08-11 18:42 ` David Hildenbrand
2017-08-11 7:46 ` [Qemu-devel] [PATCH RFC 5/5] target/s390x: cleanup cpu.h David Hildenbrand
2017-08-11 13:20 ` Richard Henderson
2017-08-11 8:04 ` [Qemu-devel] [PATCH RFC 0/5] target/s390x: introduce internal.h and " no-reply
2017-08-11 8:53 ` David Hildenbrand
2017-08-11 15:15 ` Cornelia Huck
2017-08-11 15:30 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170811074652.31474-3-david@redhat.com \
--to=david@redhat.com \
--cc=aurelien@aurel32.net \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).