[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 85/92] target/i386: kvm: do not use kvm_check_extension to find pa
From: |
Paolo Bonzini |
Subject: |
[PULL 85/92] target/i386: kvm: do not use kvm_check_extension to find paravirtual capabilities |
Date: |
Thu, 24 Sep 2020 05:23:07 -0400 |
Paravirtualized features have been listed in KVM_GET_SUPPORTED_CPUID since
Linux 2.6.35 (commit 84478c829d0f, "KVM: x86: export paravirtual cpuid flags
in KVM_GET_SUPPORTED_CPUID", 2010-05-19). It has been more than 10 years,
so remove the fallback code.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/kvm.c | 32 --------------------------------
1 file changed, 32 deletions(-)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 4fc6e8b9d5..f6dae4cfb6 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -284,30 +284,6 @@ static struct kvm_cpuid2 *get_supported_cpuid(KVMState *s)
return cpuid;
}
-static const struct kvm_para_features {
- int cap;
- int feature;
-} para_features[] = {
- { KVM_CAP_CLOCKSOURCE, KVM_FEATURE_CLOCKSOURCE },
- { KVM_CAP_NOP_IO_DELAY, KVM_FEATURE_NOP_IO_DELAY },
- { KVM_CAP_PV_MMU, KVM_FEATURE_MMU_OP },
- { KVM_CAP_ASYNC_PF, KVM_FEATURE_ASYNC_PF },
- { KVM_CAP_ASYNC_PF_INT, KVM_FEATURE_ASYNC_PF_INT },
-};
-
-static int get_para_features(KVMState *s)
-{
- int i, features = 0;
-
- for (i = 0; i < ARRAY_SIZE(para_features); i++) {
- if (kvm_check_extension(s, para_features[i].cap)) {
- features |= (1 << para_features[i].feature);
- }
- }
-
- return features;
-}
-
static bool host_tsx_broken(void)
{
int family, model, stepping;\
@@ -367,13 +343,11 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s,
uint32_t function,
struct kvm_cpuid2 *cpuid;
uint32_t ret = 0;
uint32_t cpuid_1_edx;
- bool found = false;
cpuid = get_supported_cpuid(s);
struct kvm_cpuid_entry2 *entry = cpuid_find_entry(cpuid, function, index);
if (entry) {
- found = true;
ret = cpuid_entry_get_reg(entry, reg);
}
@@ -448,12 +422,6 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s,
uint32_t function,
}
} else if (function == KVM_CPUID_FEATURES && reg == R_EDX) {
ret |= 1U << KVM_HINTS_REALTIME;
- found = 1;
- }
-
- /* fallback for older kernels */
- if ((function == KVM_CPUID_FEATURES) && !found) {
- ret = get_para_features(s);
}
return ret;
--
2.26.2
- [PULL 71/92] qom: Indent existing code examples, (continued)
- [PULL 71/92] qom: Indent existing code examples, Paolo Bonzini, 2020/09/24
- [PULL 72/92] qom: Add code block markup to all code blocks, Paolo Bonzini, 2020/09/24
- [PULL 73/92] docs: Create docs/devel/qom.rst, Paolo Bonzini, 2020/09/24
- [PULL 74/92] docs: Move object.h overview doc comment to qom.rst, Paolo Bonzini, 2020/09/24
- [PULL 75/92] hw/i386/xen: Rename X86/PC specific function as xen_hvm_init_pc(), Paolo Bonzini, 2020/09/24
- [PULL 80/92] checkpatch: Detect '%#' or '%0#' in printf-style format strings, Paolo Bonzini, 2020/09/24
- [PULL 87/92] hw/net/can: sja1000 ignore CAN FD frames, Paolo Bonzini, 2020/09/24
- [PULL 76/92] sysemu/xen: Add missing 'exec/cpu-common.h' header for ram_addr_t type, Paolo Bonzini, 2020/09/24
- [PULL 78/92] hw/xen: Split x86-specific declaration from generic hardware ones, Paolo Bonzini, 2020/09/24
- [PULL 77/92] stubs: Split accelerator / hardware related stubs, Paolo Bonzini, 2020/09/24
- [PULL 85/92] target/i386: kvm: do not use kvm_check_extension to find paravirtual capabilities,
Paolo Bonzini <=
- [PULL 86/92] net/can: Initial host SocketCan support for CAN FD., Paolo Bonzini, 2020/09/24
- [PULL 79/92] typedefs: Restrict PCMachineState to 'hw/i386/pc.h', Paolo Bonzini, 2020/09/24
- [PULL 82/92] target/i386: Fix VM migration when interrupt based APF is enabled, Paolo Bonzini, 2020/09/24
- [PULL 83/92] target/i386: always create kvmclock device, Paolo Bonzini, 2020/09/24
- [PULL 81/92] helper_syscall x86_64: clear exception_is_int, Paolo Bonzini, 2020/09/24
- [PULL 88/92] net/can: Add can_dlc2len and can_len2dlc for CAN FD., Paolo Bonzini, 2020/09/24
- [PULL 84/92] bios-tables-test: Remove kernel-irqchip=off option, Paolo Bonzini, 2020/09/24
- [PULL 92/92] hw/net/can: Correct Kconfig dependencies, Paolo Bonzini, 2020/09/24
- [PULL 89/92] hw/net/can/ctucafd: Add CTU CAN FD core register definitions., Paolo Bonzini, 2020/09/24
- [PULL 91/92] hw/net/can: Documentation for CTU CAN FD IP open hardware core emulation., Paolo Bonzini, 2020/09/24