diff options
author | Maxim Levitsky <mlevitsk@redhat.com> | 2020-09-21 13:38:05 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-09-24 20:35:07 +0300 |
commit | ee6fa053019478918ca15eadaa93e516ddb9da8d (patch) | |
tree | 573530d8d44b5c9a4a49fafdc6ab547e9cd307a4 /arch/um | |
parent | 18391e5e9cf59226354a864e5befa3c764eb8903 (diff) | |
download | linux-ee6fa053019478918ca15eadaa93e516ddb9da8d.tar.xz |
KVM: x86: fix MSR_IA32_TSC read for nested migration
MSR reads/writes should always access the L1 state, since the (nested)
hypervisor should intercept all the msrs it wants to adjust, and these
that it doesn't should be read by the guest as if the host had read it.
However IA32_TSC is an exception. Even when not intercepted, guest still
reads the value + TSC offset.
The write however does not take any TSC offset into account.
This is documented in Intel's SDM and seems also to happen on AMD as well.
This creates a problem when userspace wants to read the IA32_TSC value and then
write it. (e.g for migration)
In this case it reads L2 value but write is interpreted as an L1 value.
To fix this make the userspace initiated reads of IA32_TSC return L1 value
as well.
Huge thanks to Dave Gilbert for helping me understand this very confusing
semantic of MSR writes.
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20200921103805.9102-2-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/um')
0 files changed, 0 insertions, 0 deletions