diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 44b1a7ab71..798e299db1 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -1169,7 +1169,7 @@ 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(KVMState *s, uint64_t new_limit, uint64_t *hw_limit); +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); @@ -1215,8 +1215,7 @@ static inline int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state) 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) +static inline int kvm_s390_set_mem_limit(uint64_t new_limit, uint64_t *hw_limit) { return 0; } @@ -1243,7 +1242,7 @@ static inline void kvm_s390_crypto_reset(void) 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 kvm_s390_set_mem_limit(new_limit, hw_limit); } return 0; } diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index d961fcf18b..23109a7c76 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -145,7 +145,7 @@ static int active_cmma; static void *legacy_s390_alloc(size_t size, uint64_t *align); -static int kvm_s390_query_mem_limit(KVMState *s, uint64_t *memory_limit) +static int kvm_s390_query_mem_limit(uint64_t *memory_limit) { struct kvm_device_attr attr = { .group = KVM_S390_VM_MEM_CTRL, @@ -153,10 +153,10 @@ static int kvm_s390_query_mem_limit(KVMState *s, uint64_t *memory_limit) .addr = (uint64_t) memory_limit, }; - return kvm_vm_ioctl(s, KVM_GET_DEVICE_ATTR, &attr); + return kvm_vm_ioctl(kvm_state, KVM_GET_DEVICE_ATTR, &attr); } -int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit) +int kvm_s390_set_mem_limit(uint64_t new_limit, uint64_t *hw_limit) { int rc; @@ -166,18 +166,18 @@ int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit) .addr = (uint64_t) &new_limit, }; - if (!kvm_vm_check_mem_attr(s, KVM_S390_VM_MEM_LIMIT_SIZE)) { + if (!kvm_vm_check_mem_attr(kvm_state, KVM_S390_VM_MEM_LIMIT_SIZE)) { return 0; } - rc = kvm_s390_query_mem_limit(s, hw_limit); + rc = kvm_s390_query_mem_limit(hw_limit); if (rc) { return rc; } else if (*hw_limit < new_limit) { return -E2BIG; } - return kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &attr); + return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr); } int kvm_s390_cmma_active(void)