s390x/kvm: move KVM declarations and stubs to separate files
Let's do it just like the other architectures. Introduce kvm-stub.c for stubs and kvm_s390x.h for the declarations. Change license to GPL2+ and keep copyright notice. As we are dropping the sysemu/kvm.h include from cpu.h, fix up includes. Suggested-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20170818114353.13455-18-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
5e7164c50c
commit
f16bbb9bbd
@ -13,6 +13,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu-common.h"
|
||||
#include "cpu.h"
|
||||
#include "kvm_s390x.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "sysemu/kvm.h"
|
||||
#include "exec/ram_addr.h"
|
||||
#include "cpu.h"
|
||||
#include "kvm_s390x.h"
|
||||
|
||||
Object *kvm_s390_stattrib_create(void)
|
||||
{
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "hw/s390x/adapter.h"
|
||||
#include "hw/s390x/s390_flic.h"
|
||||
#include "hw/s390x/ioinst.h"
|
||||
#include "sysemu/kvm.h"
|
||||
|
||||
/* Channel subsystem constants. */
|
||||
#define MAX_DEVNO 65535
|
||||
|
@ -3,6 +3,7 @@ obj-$(CONFIG_TCG) += translate.o cc_helper.o excp_helper.o fpu_helper.o
|
||||
obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o
|
||||
obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o diag.o
|
||||
obj-$(CONFIG_KVM) += kvm.o
|
||||
obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
|
||||
|
||||
# build and run feature list generator
|
||||
feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include "qapi/error.h"
|
||||
#include "cpu.h"
|
||||
#include "internal.h"
|
||||
#include "kvm_s390x.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/timer.h"
|
||||
|
@ -213,8 +213,6 @@ static inline S390CPU *s390_env_get_cpu(CPUS390XState *env)
|
||||
extern const struct VMStateDescription vmstate_s390_cpu;
|
||||
#endif
|
||||
|
||||
#include "sysemu/kvm.h"
|
||||
|
||||
/* distinguish between 24 bit and 31 bit addressing */
|
||||
#define HIGH_ORDER_BIT 0x80000000
|
||||
|
||||
@ -407,39 +405,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
|
||||
void kvm_s390_service_interrupt(uint32_t parm);
|
||||
void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq);
|
||||
void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq);
|
||||
int kvm_s390_inject_flic(struct kvm_s390_irq *irq);
|
||||
void kvm_s390_access_exception(S390CPU *cpu, uint16_t code, uint64_t te_code);
|
||||
int kvm_s390_mem_op(S390CPU *cpu, vaddr addr, uint8_t ar, void *hostbuf,
|
||||
int len, bool is_write);
|
||||
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 void kvm_s390_service_interrupt(uint32_t parm)
|
||||
{
|
||||
}
|
||||
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 int kvm_s390_mem_op(S390CPU *cpu, vaddr addr, uint8_t ar,
|
||||
void *hostbuf, int len, bool is_write)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
static inline void kvm_s390_access_exception(S390CPU *cpu, uint16_t code,
|
||||
uint64_t te_code)
|
||||
{
|
||||
}
|
||||
#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);
|
||||
|
||||
@ -704,90 +669,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_program_interrupt(S390CPU *cpu, uint16_t code);
|
||||
void kvm_s390_io_interrupt(uint16_t subchannel_id,
|
||||
uint16_t subchannel_nr, uint32_t io_int_parm,
|
||||
uint32_t io_int_word);
|
||||
void kvm_s390_crw_mchk(void);
|
||||
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(void);
|
||||
int kvm_s390_cmma_active(void);
|
||||
void kvm_s390_cmma_reset(void);
|
||||
int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state);
|
||||
void kvm_s390_reset_vcpu(S390CPU *cpu);
|
||||
int kvm_s390_set_mem_limit(uint64_t new_limit, uint64_t *hw_limit);
|
||||
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);
|
||||
void kvm_s390_crypto_reset(void);
|
||||
#else
|
||||
static inline void kvm_s390_program_interrupt(S390CPU *cpu, uint16_t code)
|
||||
{
|
||||
}
|
||||
static inline void kvm_s390_io_interrupt(uint16_t subchannel_id,
|
||||
uint16_t subchannel_nr,
|
||||
uint32_t io_int_parm,
|
||||
uint32_t io_int_word)
|
||||
{
|
||||
}
|
||||
static inline void kvm_s390_crw_mchk(void)
|
||||
{
|
||||
}
|
||||
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(void)
|
||||
{
|
||||
return MAX_AVAIL_SLOTS;
|
||||
}
|
||||
static inline int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
static inline void kvm_s390_reset_vcpu(S390CPU *cpu)
|
||||
{
|
||||
}
|
||||
static inline int kvm_s390_set_mem_limit(uint64_t new_limit, uint64_t *hw_limit)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu)
|
||||
{
|
||||
}
|
||||
static inline int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int kvm_s390_get_ri(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int kvm_s390_get_gs(void)
|
||||
{
|
||||
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);
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "cpu.h"
|
||||
#include "internal.h"
|
||||
#include "kvm_s390x.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "gen-features.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/visitor.h"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/log.h"
|
||||
#include "cpu.h"
|
||||
#include "kvm_s390x.h"
|
||||
#include "internal.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "sysemu/kvm.h"
|
||||
|
111
target/s390x/kvm-stub.c
Normal file
111
target/s390x/kvm-stub.c
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* QEMU KVM support -- s390x specific function stubs.
|
||||
*
|
||||
* Copyright (c) 2009 Ulrich Hecht
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu-common.h"
|
||||
#include "cpu.h"
|
||||
#include "kvm_s390x.h"
|
||||
|
||||
void kvm_s390_service_interrupt(uint32_t parm)
|
||||
{
|
||||
}
|
||||
|
||||
void kvm_s390_access_exception(S390CPU *cpu, uint16_t code, uint64_t te_code)
|
||||
{
|
||||
}
|
||||
|
||||
int kvm_s390_mem_op(S390CPU *cpu, vaddr addr, uint8_t ar, void *hostbuf,
|
||||
int len, bool is_write)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
void kvm_s390_program_interrupt(S390CPU *cpu, uint16_t code)
|
||||
{
|
||||
}
|
||||
|
||||
void kvm_s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr,
|
||||
uint32_t io_int_parm, uint32_t io_int_word)
|
||||
{
|
||||
}
|
||||
|
||||
void kvm_s390_crw_mchk(void)
|
||||
{
|
||||
}
|
||||
|
||||
int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu)
|
||||
{
|
||||
}
|
||||
|
||||
int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int kvm_s390_get_ri(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int kvm_s390_get_gs(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
void kvm_s390_enable_css_support(S390CPU *cpu)
|
||||
{
|
||||
}
|
||||
|
||||
int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch,
|
||||
int vq, bool assign)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int kvm_s390_cpu_restart(S390CPU *cpu)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
void kvm_s390_cmma_reset(void)
|
||||
{
|
||||
}
|
||||
|
||||
int kvm_s390_get_memslot_count(void)
|
||||
{
|
||||
return MAX_AVAIL_SLOTS;
|
||||
}
|
||||
|
||||
void kvm_s390_reset_vcpu(S390CPU *cpu)
|
||||
{
|
||||
}
|
||||
|
||||
int kvm_s390_set_mem_limit(uint64_t new_limit, uint64_t *hw_limit)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void kvm_s390_crypto_reset(void)
|
||||
{
|
||||
}
|
@ -30,6 +30,7 @@
|
||||
#include "qemu-common.h"
|
||||
#include "cpu.h"
|
||||
#include "internal.h"
|
||||
#include "kvm_s390x.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/timer.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
|
47
target/s390x/kvm_s390x.h
Normal file
47
target/s390x/kvm_s390x.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* QEMU KVM support -- s390x specific functions.
|
||||
*
|
||||
* Copyright (c) 2009 Ulrich Hecht
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#ifndef KVM_S390X_H
|
||||
#define KVM_S390X_H
|
||||
|
||||
struct kvm_s390_irq;
|
||||
|
||||
void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq);
|
||||
void kvm_s390_service_interrupt(uint32_t parm);
|
||||
void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq);
|
||||
void kvm_s390_access_exception(S390CPU *cpu, uint16_t code, uint64_t te_code);
|
||||
int kvm_s390_mem_op(S390CPU *cpu, vaddr addr, uint8_t ar, void *hostbuf,
|
||||
int len, bool is_write);
|
||||
void kvm_s390_program_interrupt(S390CPU *cpu, uint16_t code);
|
||||
void kvm_s390_io_interrupt(uint16_t subchannel_id,
|
||||
uint16_t subchannel_nr, uint32_t io_int_parm,
|
||||
uint32_t io_int_word);
|
||||
void kvm_s390_crw_mchk(void);
|
||||
int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state);
|
||||
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_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(void);
|
||||
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(uint64_t new_limit, uint64_t *hw_limit);
|
||||
void kvm_s390_crypto_reset(void);
|
||||
|
||||
/* implemented outside of target/s390x/ */
|
||||
int kvm_s390_inject_flic(struct kvm_s390_irq *irq);
|
||||
|
||||
#endif /* KVM_S390X_H */
|
@ -18,6 +18,7 @@
|
||||
#include "hw/hw.h"
|
||||
#include "cpu.h"
|
||||
#include "internal.h"
|
||||
#include "kvm_s390x.h"
|
||||
#include "sysemu/kvm.h"
|
||||
|
||||
static int cpu_post_load(void *opaque, int version_id)
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "exec/address-spaces.h"
|
||||
#include "cpu.h"
|
||||
#include "internal.h"
|
||||
#include "kvm_s390x.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "trace.h"
|
||||
#include "hw/s390x/storage-keys.h"
|
||||
|
Loading…
Reference in New Issue
Block a user