Skip to contentSkip to conversation

kvm selftest 'msr' fails on some skylake cpus

DISCUSSION Maxim Levitsky 3 participants 5 messages Jun 14, 2024 – Jun 26, 2024 KVM

lore
Share & tools
lore
#0 lore raw

Hi!

This kvm unit test tests that all reserved bits of the MSR_IA32_FLUSH_CMD #GP, but apparently on some systems this test fails.

For example I reproduced this on:

model name : Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz
stepping : 3
microcode : 0xf0

As I see in the 'vmx_vcpu_after_set_cpuid', we passthough this msr to the guest AS IS, thus the unit test tests the microcode.

So I suspect that the test actually caught a harmless microcode bug.

What do you think we should do to workaround this? Maybe disable this check on affected cpus or turn it into a warning because MSR_IA32_FLUSH_CMD reserved bits test doesn't test KVM?

Best regards,
Maxim Levitsky

#1 lore raw
Quoted 12 lines · Maxim Levitsky

Hi!

This kvm unit test tests that all reserved bits of the MSR_IA32_FLUSH_CMD #GP, but apparently on some systems this test fails.

For example I reproduced this on:

model name : Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz
stepping : 3
microcode : 0xf0

Quoted 4 lines

As I see in the 'vmx_vcpu_after_set_cpuid', we passthough this msr to the guest AS IS, thus the unit test tests the microcode.

So I suspect that the test actually caught a harmless microcode bug.

Yeah, we encountered the same thing and came to the same conclusion.

Quoted 3 lines

What do you think we should do to workaround this? Maybe disable this check on affected cpus or turn it into a warning because MSR_IA32_FLUSH_CMD reserved bits test doesn't test KVM?

Ya, Mingwei posted a patch[*] to force KVM to emulate the faulting accesses, which more or less does exactly that, but preserves a bit of KVM coverage. I'll get a KUT pull request sent to Paolo today, I've got a sizeable number of changes ready.

[*] https://lore.kernel.org/all/[email protected]

#2 lore raw
Quoted 24 lines · Sean Christopherson
Quoted 12 lines · Maxim Levitsky

Hi!

This kvm unit test tests that all reserved bits of the MSR_IA32_FLUSH_CMD #GP, but apparently on some systems this test fails.

For example I reproduced this on:

model name : Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz
stepping : 3
microcode : 0xf0

Quoted 4 lines

As I see in the 'vmx_vcpu_after_set_cpuid', we passthough this msr to the guest AS IS, thus the unit test tests the microcode.

So I suspect that the test actually caught a harmless microcode bug.

Yeah, we encountered the same thing and came to the same conclusion.

Quoted 3 lines

What do you think we should do to workaround this? Maybe disable this check on affected cpus or turn it into a warning because MSR_IA32_FLUSH_CMD reserved bits test doesn't test KVM?

Quoted 6 lines

Ya, Mingwei posted a patch[*] to force KVM to emulate the faulting accesses, which more or less does exactly that, but preserves a bit of KVM coverage. I'll get a KUT pull request sent to Paolo today, I've got a sizeable number of changes ready.

[*] https://lore.kernel.org/all/[email protected]

This works for me.
Thanks,

Best regards,
Maxim Levitsky

#3 lore raw
Quoted 30 lines · Maxim Levitsky
Quoted 28 lines · Sean Christopherson
Quoted 12 lines · Maxim Levitsky

Hi!

This kvm unit test tests that all reserved bits of the MSR_IA32_FLUSH_CMD #GP, but apparently on some systems this test fails.

For example I reproduced this on:

model name : Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz
stepping : 3
microcode : 0xf0

Quoted 4 lines

As I see in the 'vmx_vcpu_after_set_cpuid', we passthough this msr to the guest AS IS, thus the unit test tests the microcode.

So I suspect that the test actually caught a harmless microcode bug.

Yeah, we encountered the same thing and came to the same conclusion.

Quoted 3 lines

What do you think we should do to workaround this? Maybe disable this check on affected cpus or turn it into a warning because MSR_IA32_FLUSH_CMD reserved bits test doesn't test KVM?

Ya, Mingwei posted a patch[*] to force KVM to emulate the faulting accesses, which more or less does exactly that, but preserves a bit of KVM coverage. I'll get a KUT pull request sent to Paolo today, I've got a sizeable number of changes ready.

Quoted 8 lines
Quoted 2 lines

[*] https://lore.kernel.org/all/[email protected]

This works for me.
Thanks,

Best regards,
Maxim Levitsky

Sean and/or Paolo,

I'm still waiting for this to show up. :)

#4 lore raw
Quoted 37 lines · Jim Mattson
Quoted 36 lines · Maxim Levitsky
Quoted 24 lines · Sean Christopherson
Quoted 12 lines · Maxim Levitsky

Hi!

This kvm unit test tests that all reserved bits of the MSR_IA32_FLUSH_CMD #GP, but apparently on some systems this test fails.

For example I reproduced this on:

model name : Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz
stepping : 3
microcode : 0xf0

Quoted 4 lines

As I see in the 'vmx_vcpu_after_set_cpuid', we passthough this msr to the guest AS IS, thus the unit test tests the microcode.

So I suspect that the test actually caught a harmless microcode bug.

Yeah, we encountered the same thing and came to the same conclusion.

Quoted 3 lines

What do you think we should do to workaround this? Maybe disable this check on affected cpus or turn it into a warning because MSR_IA32_FLUSH_CMD reserved bits test doesn't test KVM?

Quoted 6 lines

Ya, Mingwei posted a patch[*] to force KVM to emulate the faulting accesses, which more or less does exactly that, but preserves a bit of KVM coverage. I'll get a KUT pull request sent to Paolo today, I've got a sizeable number of changes ready.

[*] https://lore.kernel.org/all/[email protected]

This works for me.
Thanks,

Quoted 6 lines
Quoted 2 lines

Best regards,
Maxim Levitsky

Sean and/or Paolo,

I'm still waiting for this to show up. :)

13a12056be1e4939dadbd0d2cfb65df400832905 x86: msr: testing MSR_IA32_FLUSH_CMD reserved bits only in KVM emulation 51b87946279cf6e9248ceacf0f27833b6ebeef5e x86: Add FEP support on read/write register instructions

/drop mic