* [PATCH] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR
@ 2020-02-11 17:55 Paolo Bonzini
2020-02-11 18:36 ` no-reply
2020-02-11 23:42 ` Alex Williamson
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2020-02-11 17:55 UTC (permalink / raw)
To: qemu-devel; +Cc: Alex Williamson
Even though MSR_IA32_UCODE_REV has been available long before Linux 5.6,
which added it to the emulated MSR list, a bug caused the microcode
version to revert to 0x100000000 on INIT. As a result, processors other
than the bootstrap processor would not see the host microcode revision;
some Windows version complain loudly about this and crash with a
fairly explicit MICROCODE REVISION MISMATCH error.
[If running 5.6 prereleases, the kernel fix "KVM: x86: do not reset
microcode version on INIT or RESET" should also be applied.]
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/kvm.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 6ef291d580..69eb43d796 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -105,6 +105,7 @@ static bool has_msr_smi_count;
static bool has_msr_arch_capabs;
static bool has_msr_core_capabs;
static bool has_msr_vmx_vmfunc;
+static bool has_msr_ucode_rev;
static uint32_t has_architectural_pmu_version;
static uint32_t num_architectural_pmu_gp_counters;
@@ -2056,6 +2057,9 @@ static int kvm_get_supported_msrs(KVMState *s)
case MSR_IA32_VMX_VMFUNC:
has_msr_vmx_vmfunc = true;
break;
+ case MSR_IA32_UCODE_REV:
+ has_msr_ucode_rev = true;
+ break;
}
}
}
@@ -2696,8 +2700,7 @@ static void kvm_init_msrs(X86CPU *cpu)
env->features[FEAT_CORE_CAPABILITY]);
}
- if (kvm_arch_get_supported_msr_feature(kvm_state,
- MSR_IA32_UCODE_REV)) {
+ if (has_msr_ucode_rev) {
kvm_msr_entry_add(cpu, MSR_IA32_UCODE_REV, cpu->ucode_rev);
}
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR
2020-02-11 17:55 [PATCH] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR Paolo Bonzini
@ 2020-02-11 18:36 ` no-reply
2020-02-11 23:42 ` Alex Williamson
1 sibling, 0 replies; 3+ messages in thread
From: no-reply @ 2020-02-11 18:36 UTC (permalink / raw)
To: pbonzini; +Cc: alex.williamson, qemu-devel
Patchew URL: https://patchew.org/QEMU/20200211175516.10716-1-pbonzini@redhat.com/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
**
ERROR:/tmp/qemu-test/src/tests/qtest/migration-helpers.c:119:check_migration_status: assertion failed (current_status != "completed"): ("completed" != "completed")
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/migration-helpers.c:119:check_migration_status: assertion failed (current_status != "completed"): ("completed" != "completed")
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
TEST iotest-qcow2: 080
TEST iotest-qcow2: 086
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=d748fb87e54b44e9b5b34d972c31e104', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-c7iuy0ol/src/docker-src.2020-02-11-13.25.06.6305:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=d748fb87e54b44e9b5b34d972c31e104
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-c7iuy0ol/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 11m40.275s
user 0m8.531s
The full log is available at
http://patchew.org/logs/20200211175516.10716-1-pbonzini@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR
2020-02-11 17:55 [PATCH] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR Paolo Bonzini
2020-02-11 18:36 ` no-reply
@ 2020-02-11 23:42 ` Alex Williamson
1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2020-02-11 23:42 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Tue, 11 Feb 2020 18:55:16 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:
> Even though MSR_IA32_UCODE_REV has been available long before Linux 5.6,
> which added it to the emulated MSR list, a bug caused the microcode
> version to revert to 0x100000000 on INIT. As a result, processors other
> than the bootstrap processor would not see the host microcode revision;
> some Windows version complain loudly about this and crash with a
> fairly explicit MICROCODE REVISION MISMATCH error.
>
> [If running 5.6 prereleases, the kernel fix "KVM: x86: do not reset
> microcode version on INIT or RESET" should also be applied.]
>
> Reported-by: Alex Williamson <alex.williamson@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> target/i386/kvm.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
Fixed! Thanks,
Alex
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index 6ef291d580..69eb43d796 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -105,6 +105,7 @@ static bool has_msr_smi_count;
> static bool has_msr_arch_capabs;
> static bool has_msr_core_capabs;
> static bool has_msr_vmx_vmfunc;
> +static bool has_msr_ucode_rev;
>
> static uint32_t has_architectural_pmu_version;
> static uint32_t num_architectural_pmu_gp_counters;
> @@ -2056,6 +2057,9 @@ static int kvm_get_supported_msrs(KVMState *s)
> case MSR_IA32_VMX_VMFUNC:
> has_msr_vmx_vmfunc = true;
> break;
> + case MSR_IA32_UCODE_REV:
> + has_msr_ucode_rev = true;
> + break;
> }
> }
> }
> @@ -2696,8 +2700,7 @@ static void kvm_init_msrs(X86CPU *cpu)
> env->features[FEAT_CORE_CAPABILITY]);
> }
>
> - if (kvm_arch_get_supported_msr_feature(kvm_state,
> - MSR_IA32_UCODE_REV)) {
> + if (has_msr_ucode_rev) {
> kvm_msr_entry_add(cpu, MSR_IA32_UCODE_REV, cpu->ucode_rev);
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-11 23:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-11 17:55 [PATCH] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR Paolo Bonzini
2020-02-11 18:36 ` no-reply
2020-02-11 23:42 ` Alex Williamson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).