diff options
author | Peter Maydell | 2020-10-16 23:46:28 +0200 |
---|---|---|
committer | Peter Maydell | 2020-10-16 23:46:28 +0200 |
commit | e12ce85b2c79d83a340953291912875c30b3af06 (patch) | |
tree | ef80f92436abe095cd3a401e273f5bb36bde3f7e /target/i386 | |
parent | Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (diff) | |
parent | i386: Mark Icelake-Client CPU models deprecated (diff) | |
download | qemu-e12ce85b2c79d83a340953291912875c30b3af06.tar.gz qemu-e12ce85b2c79d83a340953291912875c30b3af06.tar.xz qemu-e12ce85b2c79d83a340953291912875c30b3af06.zip |
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
x86 queue, 2020-10-15
Cleanups:
* Drop x86_cpu_get_supported_feature_word() forward declaration
(Vitaly Kuznetsov)
* Delete kvm_allows_irq0_override() (Eduardo Habkost)
* Correct documentation of kvm_irqchip_*() (Eduardo Habkost)
* Fix FEATURE_HYPERV_EDX value in hyperv_passthrough case (Zhenyu Wang)
Deprecation:
* CPU model deprecation API (Robert Hoo)
* Mark Icelake-Client CPU models deprecated (Robert Hoo)
Bug fixes:
* Remove core_id assert check in CPUID 0x8000001E (Babu Moger)
# gpg: Signature made Thu 15 Oct 2020 17:43:58 BST
# gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg: issuer "ehabkost@redhat.com"
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6
* remotes/ehabkost/tags/x86-next-pull-request:
i386: Mark Icelake-Client CPU models deprecated
cpu: Introduce CPU model deprecation API
kvm: Correct documentation of kvm_irqchip_*()
i386/kvm: Delete kvm_allows_irq0_override()
i386/kvm: Remove IRQ routing support checks
i386/kvm: Require KVM_CAP_IRQ_ROUTING
target/i386: Remove core_id assert check in CPUID 0x8000001E
i386/kvm: fix FEATURE_HYPERV_EDX value in hyperv_passthrough case
i386: drop x86_cpu_get_supported_feature_word() forward declaration
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/i386')
-rw-r--r-- | target/i386/cpu.c | 32 | ||||
-rw-r--r-- | target/i386/kvm-stub.c | 5 | ||||
-rw-r--r-- | target/i386/kvm.c | 19 | ||||
-rw-r--r-- | target/i386/kvm_i386.h | 1 |
4 files changed, 29 insertions, 28 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 5d713c8528..0d8606958e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1633,6 +1633,7 @@ typedef struct X86CPUDefinition { * If NULL, version 1 will be registered automatically. */ const X86CPUVersionDefinition *versions; + const char *deprecation_note; } X86CPUDefinition; /* Reference to a specific CPU model version */ @@ -3357,10 +3358,13 @@ static X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x80000008, .model_id = "Intel Core Processor (Icelake)", .versions = (X86CPUVersionDefinition[]) { - { .version = 1 }, + { + .version = 1, + .note = "deprecated" + }, { .version = 2, - .note = "no TSX", + .note = "no TSX, deprecated", .alias = "Icelake-Client-noTSX", .props = (PropValue[]) { { "hle", "off" }, @@ -3369,7 +3373,8 @@ static X86CPUDefinition builtin_x86_defs[] = { }, }, { /* end of list */ } - } + }, + .deprecation_note = "use Icelake-Server instead" }, { .name = "Icelake-Server", @@ -4180,9 +4185,6 @@ void x86_cpu_change_kvm_default(const char *prop, const char *value) assert(pv->prop); } -static uint64_t x86_cpu_get_supported_feature_word(FeatureWord w, - bool migratable_only); - static bool lmce_supported(void) { uint64_t mce_cap = 0; @@ -4993,6 +4995,11 @@ static void x86_cpu_definition_entry(gpointer data, gpointer user_data) info->migration_safe = cc->migration_safe; info->has_migration_safe = true; info->q_static = cc->static_model; + if (cc->model && cc->model->cpudef->deprecation_note) { + info->deprecated = true; + } else { + info->deprecated = false; + } /* * Old machine types won't report aliases, so that alias translation * doesn't break compatibility with previous QEMU versions. @@ -5383,9 +5390,11 @@ static void x86_cpu_cpudef_class_init(ObjectClass *oc, void *data) { X86CPUModel *model = data; X86CPUClass *xcc = X86_CPU_CLASS(oc); + CPUClass *cc = CPU_CLASS(oc); xcc->model = model; xcc->migration_safe = true; + cc->deprecation_note = model->cpudef->deprecation_note; } static void x86_register_cpu_model_type(const char *name, X86CPUModel *model) @@ -5913,9 +5922,14 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, } break; case 0x8000001E: - assert(cpu->core_id <= 255); - encode_topo_cpuid8000001e(cpu, &topo_info, - eax, ebx, ecx, edx); + if (cpu->core_id <= 255) { + encode_topo_cpuid8000001e(cpu, &topo_info, eax, ebx, ecx, edx); + } else { + *eax = 0; + *ebx = 0; + *ecx = 0; + *edx = 0; + } break; case 0xC0000000: *eax = env->cpuid_xlevel2; diff --git a/target/i386/kvm-stub.c b/target/i386/kvm-stub.c index 872ef7df4c..92f49121b8 100644 --- a/target/i386/kvm-stub.c +++ b/target/i386/kvm-stub.c @@ -13,11 +13,6 @@ #include "cpu.h" #include "kvm_i386.h" -bool kvm_allows_irq0_override(void) -{ - return 1; -} - #ifndef __OPTIMIZE__ bool kvm_has_smm(void) { diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 8b12387d30..cf46259534 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -154,11 +154,6 @@ bool kvm_has_exception_payload(void) return has_exception_payload; } -bool kvm_allows_irq0_override(void) -{ - return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing(); -} - static bool kvm_x2apic_api_set_flags(uint64_t flags) { KVMState *s = KVM_STATE(current_accel()); @@ -1214,7 +1209,7 @@ static int hyperv_handle_properties(CPUState *cs, if (c) { env->features[FEAT_HYPERV_EAX] = c->eax; env->features[FEAT_HYPERV_EBX] = c->ebx; - env->features[FEAT_HYPERV_EDX] = c->eax; + env->features[FEAT_HYPERV_EDX] = c->edx; } c = cpuid_find_entry(cpuid, HV_CPUID_ENLIGHTMENT_INFO, 0); if (c) { @@ -2114,6 +2109,11 @@ int kvm_arch_init(MachineState *ms, KVMState *s) int ret; struct utsname utsname; + if (!kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) { + error_report("kvm: KVM_CAP_IRQ_ROUTING not supported by KVM"); + return -ENOTSUP; + } + has_xsave = kvm_check_extension(s, KVM_CAP_XSAVE); has_xcrs = kvm_check_extension(s, KVM_CAP_XCRS); has_pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2); @@ -4547,13 +4547,6 @@ bool kvm_arch_stop_on_emulation_error(CPUState *cs) void kvm_arch_init_irq_routing(KVMState *s) { - if (!kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) { - /* If kernel can't do irq routing, interrupt source - * override 0->2 cannot be set up as required by HPET. - * So we have to disable it. - */ - no_hpet = 1; - } /* We know at this point that we're using the in-kernel * irqchip, so we can use irqfds, and on x86 we know * we can use msi via irqfd and GSI routing. diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index 0fce4e51d2..a4a619cebb 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -32,7 +32,6 @@ #endif /* CONFIG_KVM */ -bool kvm_allows_irq0_override(void); bool kvm_has_smm(void); bool kvm_has_adjust_clock(void); bool kvm_has_adjust_clock_stable(void); |