Re: [PATCH v2 1/1] KVM: x86: fix MSR_IA32_TSC read for nested migration

2020-09-30 Thread Maxim Levitsky
On Thu, 2020-09-24 at 19:33 +0200, Paolo Bonzini wrote: > On 21/09/20 12:38, Maxim Levitsky wrote: > > 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

Re: [PATCH v2 1/1] KVM: x86: fix MSR_IA32_TSC read for nested migration

2020-09-24 Thread Paolo Bonzini
On 21/09/20 12:38, Maxim Levitsky wrote: > 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

Re: [PATCH v2 1/1] KVM: x86: fix MSR_IA32_TSC read for nested migration

2020-09-22 Thread Paolo Bonzini
On 22/09/20 17:39, Maxim Levitsky wrote: >>> I'll talk to Maxim and see if he can work on the kvmclock migration stuff. > > We talked about this on IRC and now I am also convinced that we should > implement > proper TSC migration instead, so I guess I'll drop this patch and I will > implement

Re: [PATCH v2 1/1] KVM: x86: fix MSR_IA32_TSC read for nested migration

2020-09-22 Thread Maxim Levitsky
On Tue, 2020-09-22 at 17:50 +0300, Maxim Levitsky wrote: > On Tue, 2020-09-22 at 14:50 +0200, Paolo Bonzini wrote: > > On 21/09/20 18:23, Sean Christopherson wrote: > > > Avoid "should" in code comments and describe what the code is doing, not > > > what > > > it should be doing. The only

Re: [PATCH v2 1/1] KVM: x86: fix MSR_IA32_TSC read for nested migration

2020-09-22 Thread Maxim Levitsky
On Tue, 2020-09-22 at 14:50 +0200, Paolo Bonzini wrote: > On 21/09/20 18:23, Sean Christopherson wrote: > > Avoid "should" in code comments and describe what the code is doing, not > > what > > it should be doing. The only exception for this is when the code has a > > known > > flaw/gap, e.g.

Re: [PATCH v2 1/1] KVM: x86: fix MSR_IA32_TSC read for nested migration

2020-09-22 Thread Paolo Bonzini
On 21/09/20 18:23, Sean Christopherson wrote: > Avoid "should" in code comments and describe what the code is doing, not what > it should be doing. The only exception for this is when the code has a known > flaw/gap, e.g. "KVM should do X, but because of Y, KVM actually does Z". > >> +

[PATCH v2 1/1] KVM: x86: fix MSR_IA32_TSC read for nested migration

2020-09-21 Thread Maxim Levitsky
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