[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 6/7] target/i386/kvm: Simplify kvm_get_mce_cap_supported()
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 6/7] target/i386/kvm: Simplify kvm_get_mce_cap_supported() |
Date: |
Tue, 23 Jun 2020 12:50:51 +0200 |
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>
---
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 19d3db657a..626cb04d88 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -536,7 +536,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;
@@ -544,7 +544,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;
}
@@ -1707,7 +1707,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.21.3
- [PATCH 0/7] accel/kvm: Simplify few functions that can use global kvm_state, Philippe Mathieu-Daudé, 2020/06/23
- [PATCH 1/7] accel/kvm: Let kvm_check_extension use global KVM state, Philippe Mathieu-Daudé, 2020/06/23
- [PATCH 2/7] accel/kvm: Simplify kvm_check_extension(), Philippe Mathieu-Daudé, 2020/06/23
- [PATCH 3/7] accel/kvm: Simplify kvm_check_extension_list(), Philippe Mathieu-Daudé, 2020/06/23
- [RFC PATCH 4/7] accel/kvm: Simplify kvm_set_sigmask_len(), Philippe Mathieu-Daudé, 2020/06/23
- [PATCH 5/7] target/i386/kvm: Simplify get_para_features(), Philippe Mathieu-Daudé, 2020/06/23
- [RFC PATCH 6/7] target/i386/kvm: Simplify kvm_get_mce_cap_supported(),
Philippe Mathieu-Daudé <=
- [RFC PATCH 7/7] target/i386/kvm: Simplify kvm_get_supported_[feature]_msrs(), Philippe Mathieu-Daudé, 2020/06/23