mirror of https://github.com/xqemu/xqemu.git
target/s390x: move a couple of functions to cpu.c
Prepare to move more stuff (especially KVM related) from cpu.h to internal.h. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20170818114353.13455-16-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
4e58b838dd
commit
b6089b059c
|
@ -392,6 +392,85 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
|
||||||
|
|
||||||
return s390_count_running_cpus();
|
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
|
#endif
|
||||||
|
|
||||||
static gchar *s390_gdb_arch_name(CPUState *cs)
|
static gchar *s390_gdb_arch_name(CPUState *cs)
|
||||||
|
|
|
@ -439,25 +439,8 @@ static inline void kvm_s390_access_exception(S390CPU *cpu, uint16_t code,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
|
int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low);
|
||||||
{
|
int s390_set_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
S390CPU *s390_cpu_addr2state(uint16_t cpu_addr);
|
S390CPU *s390_cpu_addr2state(uint16_t cpu_addr);
|
||||||
unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu);
|
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
|
#endif
|
||||||
|
|
||||||
static inline int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit)
|
int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit);
|
||||||
{
|
void s390_cmma_reset(void);
|
||||||
if (kvm_enabled()) {
|
int s390_cpu_restart(S390CPU *cpu);
|
||||||
return kvm_s390_set_mem_limit(new_limit, hw_limit);
|
int s390_get_memslot_count(void);
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr,
|
void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr,
|
||||||
uint32_t io_int_parm, uint32_t io_int_word);
|
uint32_t io_int_parm, uint32_t io_int_word);
|
||||||
void s390_crw_mchk(void);
|
void s390_crw_mchk(void);
|
||||||
|
int s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch_id,
|
||||||
static inline int s390_assign_subch_ioeventfd(EventNotifier *notifier,
|
int vq, bool assign);
|
||||||
uint32_t sch_id, int vq,
|
void s390_crypto_reset(void);
|
||||||
bool assign)
|
bool s390_get_squash_mcss(void);
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* machine check interruption code */
|
/* machine check interruption code */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue