[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 49/53] target/i386/kvm: Simplify kvm_get_mce_cap_supported()
From: |
Paolo Bonzini |
Subject: |
[PULL 49/53] target/i386/kvm: Simplify kvm_get_mce_cap_supported() |
Date: |
Mon, 6 Jul 2020 12:41:51 -0400 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
As the MCE supported capabilities should be the same for
all VMs, it is safe to directly use the global kvm_state.
Remove the unnecessary KVMState* argument.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200623105052.1700-7-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/kvm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 14be9917f4..cfb6bc15aa 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -530,7 +530,7 @@ uint64_t kvm_arch_get_supported_msr_feature(KVMState *s,
uint32_t index)
}
}
-static int kvm_get_mce_cap_supported(KVMState *s, uint64_t *mce_cap,
+static int kvm_get_mce_cap_supported(uint64_t *mce_cap,
int *max_banks)
{
int r;
@@ -538,7 +538,7 @@ static int kvm_get_mce_cap_supported(KVMState *s, uint64_t
*mce_cap,
r = kvm_check_extension(KVM_CAP_MCE);
if (r > 0) {
*max_banks = r;
- return kvm_ioctl(s, KVM_X86_GET_MCE_CAP_SUPPORTED, mce_cap);
+ return kvm_ioctl(kvm_state, KVM_X86_GET_MCE_CAP_SUPPORTED, mce_cap);
}
return -ENOSYS;
}
@@ -1737,7 +1737,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
int banks;
int ret;
- ret = kvm_get_mce_cap_supported(cs->kvm_state, &mcg_cap, &banks);
+ ret = kvm_get_mce_cap_supported(&mcg_cap, &banks);
if (ret < 0) {
fprintf(stderr, "kvm_get_mce_cap_supported: %s", strerror(-ret));
return ret;
--
2.26.2
- [PULL 32/53] target/i386: sev: provide proper error reporting for query-sev-capabilities, (continued)
- [PULL 32/53] target/i386: sev: provide proper error reporting for query-sev-capabilities, Paolo Bonzini, 2020/07/06
- [PULL 26/53] accel/Kconfig: Add the TCG selector, Paolo Bonzini, 2020/07/06
- [PULL 40/53] pc: fix leak in pc_system_flash_cleanup_unused, Paolo Bonzini, 2020/07/06
- [PULL 29/53] target/i386: remove gen_io_end, Paolo Bonzini, 2020/07/06
- [PULL 33/53] target/i386: sev: fail query-sev-capabilities if QEMU cannot use SEV, Paolo Bonzini, 2020/07/06
- [PULL 35/53] iscsi: return -EIO when sense fields are meaningless, Paolo Bonzini, 2020/07/06
- [PULL 37/53] checkpatch: Change occurences of 'kernel' to 'qemu' in user messages, Paolo Bonzini, 2020/07/06
- [PULL 38/53] target/i386: Correct the warning message of Intel PT, Paolo Bonzini, 2020/07/06
- [PULL 41/53] softmmu: move softmmu only files from root, Paolo Bonzini, 2020/07/06
- [PULL 27/53] accel/tcg: Add stub for probe_access(), Paolo Bonzini, 2020/07/06
- [PULL 49/53] target/i386/kvm: Simplify kvm_get_mce_cap_supported(),
Paolo Bonzini <=
- [PULL 53/53] scripts: improve message when TAP based tests fail, Paolo Bonzini, 2020/07/06
- [PULL 46/53] accel/kvm: Simplify kvm_check_extension(), Paolo Bonzini, 2020/07/06
- [PULL 47/53] accel/kvm: Simplify kvm_check_extension_list(), Paolo Bonzini, 2020/07/06
- [PULL 45/53] accel/kvm: Let kvm_check_extension use global KVM state, Paolo Bonzini, 2020/07/06
- [PULL 28/53] Makefile: simplify MINIKCONF rules, Paolo Bonzini, 2020/07/06
[PULL 36/53] chardev/tcp: fix error message double free error, Paolo Bonzini, 2020/07/06