diff mbox

[RFC,4/5] target/s390x: remove all CONFIG_KVM from cpu.h

Message ID 20170811074652.31474-5-david@redhat.com
State New
Headers show

Commit Message

David Hildenbrand Aug. 11, 2017, 7:46 a.m. UTC
Let's move everything into internal.h

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/cpu.h      | 62 -------------------------------------------------
 target/s390x/internal.h | 52 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 62 deletions(-)

Comments

Richard Henderson Aug. 11, 2017, 1:19 p.m. UTC | #1
On 08/11/2017 12:46 AM, David Hildenbrand wrote:
> Let's move everything into internal.h
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/cpu.h      | 62 -------------------------------------------------
>  target/s390x/internal.h | 52 +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 52 insertions(+), 62 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Thomas Huth Aug. 11, 2017, 2:19 p.m. UTC | #2
On 11.08.2017 09:46, David Hildenbrand wrote:
> Let's move everything into internal.h

Or kvm_s390x.h ? ;-)

 Thomas
David Hildenbrand Aug. 11, 2017, 4:11 p.m. UTC | #3
On 11.08.2017 16:19, Thomas Huth wrote:
> On 11.08.2017 09:46, David Hildenbrand wrote:
>> Let's move everything into internal.h
> 
> Or kvm_s390x.h ? ;-)

And even kvm-stubs.c!

> 
>  Thomas
> 
>
Richard Henderson Aug. 11, 2017, 5:18 p.m. UTC | #4
It's not all kvm related, so I'd prefer the more general name.

r~

On August 11, 2017 9:19:52 AM CDT, Thomas Huth <thuth@redhat.com> wrote:
>On 11.08.2017 09:46, David Hildenbrand wrote:
>> Let's move everything into internal.h
>
>Or kvm_s390x.h ? ;-)
>
> Thomas
David Hildenbrand Aug. 11, 2017, 6:42 p.m. UTC | #5
On 11.08.2017 19:18, Richard Henderson wrote:
> It's not all kvm related, so I'd prefer the more general name.

Thomas suggested to have both, internal.h and kvm_s390x.h

All KVM stuff goes into kvm_s390x.h. I even moved the stubs to
kvm-stubs.c (that's the way e.g. x86 handles it).

End result looks pretty clean, will send it out shortly.

Thanks!

> 
> r~
> 
> On August 11, 2017 9:19:52 AM CDT, Thomas Huth <thuth@redhat.com> wrote:
> 
>     On 11.08.2017 09:46, David Hildenbrand wrote:
> 
>         Let's move everything into internal.h
> 
> 
>     Or kvm_s390x.h ? ;-)
> 
>      Thomas
> 
> 
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
diff mbox

Patch

diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 87dea80..dc1eb77 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -406,22 +406,6 @@  int cpu_s390x_signal_handler(int host_signum, void *pinfo,
 
 void s390_enable_css_support(S390CPU *cpu);
 int s390_virtio_hypercall(CPUS390XState *env);
-
-#ifdef CONFIG_KVM
-int kvm_s390_inject_flic(struct kvm_s390_irq *irq);
-int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_clock);
-int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_clock);
-#else
-static inline int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
-{
-    return -ENOSYS;
-}
-static inline int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
-{
-    return -ENOSYS;
-}
-#endif
-
 int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low);
 int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low);
 
@@ -688,52 +672,6 @@  int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf,
 #define ILEN_AUTO                   0xff
 void program_interrupt(CPUS390XState *env, uint32_t code, int ilen);
 
-#ifdef CONFIG_KVM
-void kvm_s390_enable_css_support(S390CPU *cpu);
-int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch,
-                                    int vq, bool assign);
-int kvm_s390_cpu_restart(S390CPU *cpu);
-int kvm_s390_get_memslot_count(KVMState *s);
-int kvm_s390_cmma_active(void);
-void kvm_s390_cmma_reset(void);
-void kvm_s390_reset_vcpu(S390CPU *cpu);
-int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit);
-void kvm_s390_crypto_reset(void);
-#else
-
-static inline void kvm_s390_enable_css_support(S390CPU *cpu)
-{
-}
-static inline int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier,
-                                                  uint32_t sch, int vq,
-                                                  bool assign)
-{
-    return -ENOSYS;
-}
-static inline int kvm_s390_cpu_restart(S390CPU *cpu)
-{
-    return -ENOSYS;
-}
-static inline void kvm_s390_cmma_reset(void)
-{
-}
-static inline int kvm_s390_get_memslot_count(KVMState *s)
-{
-  return MAX_AVAIL_SLOTS;
-}
-static inline void kvm_s390_reset_vcpu(S390CPU *cpu)
-{
-}
-static inline int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit,
-                                         uint64_t *hw_limit)
-{
-    return 0;
-}
-static inline void kvm_s390_crypto_reset(void)
-{
-}
-#endif
-
 int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit);
 void s390_cmma_reset(void);
 int s390_cpu_restart(S390CPU *cpu);
diff --git a/target/s390x/internal.h b/target/s390x/internal.h
index 9a55271..c3e98b4 100644
--- a/target/s390x/internal.h
+++ b/target/s390x/internal.h
@@ -491,6 +491,19 @@  void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu);
 int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu);
 int kvm_s390_get_ri(void);
 int kvm_s390_get_gs(void);
+int kvm_s390_inject_flic(struct kvm_s390_irq *irq);
+int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_clock);
+int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_clock);
+void kvm_s390_enable_css_support(S390CPU *cpu);
+int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch,
+                                    int vq, bool assign);
+int kvm_s390_cpu_restart(S390CPU *cpu);
+int kvm_s390_get_memslot_count(KVMState *s);
+int kvm_s390_cmma_active(void);
+void kvm_s390_cmma_reset(void);
+void kvm_s390_reset_vcpu(S390CPU *cpu);
+int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit);
+void kvm_s390_crypto_reset(void);
 #else
 static inline void kvm_s390_service_interrupt(uint32_t parm)
 {
@@ -535,6 +548,45 @@  static inline int kvm_s390_get_gs(void)
 {
     return 0;
 }
+static inline int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
+{
+    return -ENOSYS;
+}
+static inline int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
+{
+    return -ENOSYS;
+}
+static inline void kvm_s390_enable_css_support(S390CPU *cpu)
+{
+}
+static inline int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier,
+                                                  uint32_t sch, int vq,
+                                                  bool assign)
+{
+    return -ENOSYS;
+}
+static inline int kvm_s390_cpu_restart(S390CPU *cpu)
+{
+    return -ENOSYS;
+}
+static inline void kvm_s390_cmma_reset(void)
+{
+}
+static inline int kvm_s390_get_memslot_count(KVMState *s)
+{
+  return MAX_AVAIL_SLOTS;
+}
+static inline void kvm_s390_reset_vcpu(S390CPU *cpu)
+{
+}
+static inline int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit,
+                                         uint64_t *hw_limit)
+{
+    return 0;
+}
+static inline void kvm_s390_crypto_reset(void)
+{
+}
 #endif /* CONFIG_KVM */