Re: [PATCH] KVM: dirty all pages in kvm_write_guest_cached()

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

 




On 08/04/2015 11:26, Radim Krčmář wrote:
> 2015-04-08 10:49+0200, Paolo Bonzini:
>> On 07/04/2015 22:34, Radim Krčmář wrote:
>>> We dirtied only one page because writes originally couldn't span more.
>>> Use improved syntax for '>> PAGE_SHIFT' while at it.
>>>
>>> Fixes: 8f964525a121 ("KVM: Allow cross page reads and writes from cached translations.")
>>> Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
>>
>> Cross-page reads and writes should never get here; they have
>> ghc->memslot set to NULL and go through the slow path in kvm_write_guest.
> 
> Only cross-memslot writes have NULL memslot.

The power of wrong comments...

Considering how kvm_gfn_to_hva_cache_init is used (one 1-byte field, two
4-byte fields, one 28-bytes struct that is 32-bytes aligned, one
32-bytes field that is in practice cacheline-aligned), I wonder if we
should just use ghc->memslot = NULL for cross page writes.  This would
bypass the bug you are fixing here, and avoid worries about partial writes.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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