Re: [PATCH] KVM: x86/xen: Fix runstate updates to be atomic when preempting vCPU

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

 



On 23/10/21 21:47, Woodhouse, David wrote:
I almost switched to using a gfn_to_pfn_cache here and bailing out if
kvm_map_gfn() fails, like kvm_steal_time_set_preempted() does — but on
closer inspection it looks like kvm_map_gfn() will*always*  fail in
atomic context for a page in IOMEM, which means it will silently fail
to make the update every single time for such guests, AFAICT. So I
didn't do it that way after all. And will probably fix that one too.

Not every single time, only if the cache is absent, stale or not initialized.

In the case of steal time, record_steal_time can update the cache because it's never called from atomic context, while kvm_steal_time_set_preempted is just advisory and therefore can fail just fine.

One possible solution (which I even have unfinished patches for) is to put all the gfn_to_pfn_caches on a list, and refresh them when the MMU notifier receives an invalidation.

Paolo




[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