qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 16/23] hyperv: map overlay pages after updating


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 16/23] hyperv: map overlay pages after updating msrs
Date: Wed, 14 Jun 2017 13:12:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0


On 06/06/2017 20:19, Roman Kagan wrote:
> There is a design flaw in the Hyper-V SynIC implementation in KVM: when
> message page or event flags page is enabled by setting the corresponding
> msr, KVM zeroes it out.  This violates the spec in general (per spec,
> the pages have to be overlay ones and only zeroed at cpu reset), but
> it's non-fatal in normal operation because the user exit happens after
> the page is zeroed, so it's the underlying guest page which is zeroed
> out, and sane guests don't depend on its contents to be preserved while
> it's overlaid.
> 
> However, in the case of vmstate load the overlay pages are set up before
> msrs are set so the contents of those pages get lost.
> 
> To work it around, avoid setting up overlay pages in .post_load.
> Instead, postpone it until after the msrs are pushed to KVM.  As a
> result, KVM just zeroes out the underlying guest pages similar to how it
> happens during guest-initiated msr writes, which is tolerable.

Why not disable the zeroing for host-initiated MSR writes?  This is
pretty clearly a KVM bug, we can push it to stable kernels too.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]