[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 08 Aug 2022 13:42:58 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, Metin Kaya <metikaya@...zon.co.uk>
Cc: Dave Young <ruyang@...hat.com>, Xiaoying Yan <yiyan@...hat.com>,
"Dr . David Alan Gilbert" <dgilbert@...hat.com>,
stable@...r.kernel.org
Subject: Re: [EXTERNAL] [PATCH] KVM: x86: revalidate steal time cache if MSR
value changes
On Thu, 2022-08-04 at 15:28 +0200, Paolo Bonzini wrote:
> @@ -3397,13 +3398,12 @@ static void record_steal_time(struct kvm_vcpu *vcpu)=
> slots = kvm_memslots(vcpu->kvm);
>
> if (unlikely(slots->generation != ghc->generation ||
> + gpa != ghc->gpa ||
> kvm_is_error_hva(ghc->hva) || !ghc->memslot)) {
If we have to fix the same bug in two open-coded versions of the same
thing then surely it's time for something like...
static inline bool kvm_gfn_to_hva_cache_valid(struct kvm *kvm,
struct gfn_to_hva_cache *ghc,
gpa_t gpa)
{
struct kvm_memslots *slots = kvm_memslots(kvm);
return !unlikely(slots->generation != ghc->generation ||
gpa != ghc->gpa ||
kvm_is_error_hva(ghc->hva) || !ghc->memslot);
}
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5965 bytes)
Powered by blists - more mailing lists