[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <356ec46b00073d765d3f57ac8325e8cd13bb3eac.camel@infradead.org>
Date: Wed, 23 Feb 2022 17:01:39 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>
Cc: David Hildenbrand <david@...hat.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] KVM: Don't actually set a request when evicting
vCPUs for GFN cache invd
On Wed, 2022-02-23 at 16:53 +0000, Sean Christopherson wrote:
> Don't actually set a request bit in vcpu->requests when making a request
> purely to force a vCPU to exit the guest. Logging a request but not
> actually consuming it would cause the vCPU to get stuck in an infinite
> loop during KVM_RUN because KVM would see the pending request and bail
> from VM-Enter to service the request.
>
> Note, it's currently impossible for KVM to set KVM_REQ_GPC_INVALIDATE as
> nothing in KVM is wired up to set guest_uses_pa=true. But, it'd be all
> too easy for arch code to introduce use of kvm_gfn_to_pfn_cache_init()
> without implementing handling of the request, especially since getting
> test coverage of MMU notifier interaction with specific KVM features
> usually requires a directed test.
>
> Opportunistically rename gfn_to_pfn_cache_invalidate_start()'s wake_vcpus
> to evict_vcpus. The purpose of the request is to get vCPUs out of guest
> mode, it's supposed to _avoid_ waking vCPUs that are blocking.
>
> Opportunistically rename KVM_REQ_GPC_INVALIDATE to be more specific as to
> what it wants to accomplish, and to genericize the name so that it can
> used for similar but unrelated scenarios, should they arise in the future.
> Add a comment and documentation to explain why the "no action" request
> exists.
>
> Add compile-time assertions to help detect improper usage. Use the inner
> assertless helper in the one s390 path that makes requests without a
> hardcoded request.
>
> Cc: David Woodhouse <dwmw@...zon.co.uk>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
>
> v2:
> - Rewrite changelog and drop Fixes:, no bug currently exists. [David]
> - Rebase to kvm/queue.
Acked-by: David Woodhouse <dwmw@...zon.co.uk>
But please could you rebase it on your other patch, which I have
included into my xen-evtchn-kernel branch
https://git.infradead.org/users/dwmw2/linux.git/commitdiff/48bc5fddd6ed
https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/xen-evtchn-kernel
I'll be sending that out as a proper 'v1' series just as soon as I've
finished writing the unit tests; the rest I think is ready (and working
with actual guests in testing).
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5965 bytes)
Powered by blists - more mailing lists