Re: [PATCH] KVM: x86: Keep masked bits unmodified on kvm_set_shared_msr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 22, 2014, at 7:13 AM, Wanpeng Li <wanpeng.li@xxxxxxxxxxxxxxx> wrote:

> Hi Paolo,
> On Thu, Aug 21, 2014 at 01:56:46PM +0200, Paolo Bonzini wrote:
>> Il 21/08/2014 10:05, Wanpeng Li ha scritto:
>>> Hi Nadav,
>>> On Wed, Aug 20, 2014 at 03:11:51PM +0300, Nadav Amit wrote:
>>>> Currently, when an msr is updated using kvm_set_shared_msr the masked bits are
>>>> zeroed.  This behavior is currently valid since the only MSR with partial mask
>>> 
>>> Why zeroed? vmx_vcpu_setup() set all mask to -1ull.
>> 
>> He meant they are passed as zero in the WRMSR but actually they're not
> 
> I fail to understand "they are passed as zero". Could you explain more
> in details? ;-)

Let’s ignore what I wrongly said. ;-)

Anyhow, the current semantics of kvm_set_shared_msr is that the unmasked bits of the value are compared against the current MSR value.
If they are not equal, the value is set to the MSR. This behaviour requires that the caller would set the value given as parameter according to the guest/host value.
If the caller naively does so (not setting the bits which are not in the mask), it would get zero in the unmasked bits in the MSR.
Currently, the only caller to kvm_set_shared_msr with a mask which is not full does it, and sets the unmasked bits of the value according to the host MSR value.
I argued that this behaviour is general, so the semantics of kvm_set_shared_msr should change. 
Paolo said that there are no current other callers to the function with a mask which is not full.

Nadav

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux