lkml.org 
[lkml]   [2022]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 6/8] KVM: Fix multiple races in gfn=>pfn cache refresh
On Thu, Apr 28, 2022, Lai Jiangshan wrote:
> On Wed, Apr 27, 2022 at 7:16 PM Sean Christopherson <seanjc@google.com> wrote:
>
> > @@ -159,10 +249,23 @@ int kvm_gfn_to_pfn_cache_refresh(struct kvm *kvm, struct gfn_to_pfn_cache *gpc,
> >
>
> The following code of refresh_in_progress is somewhat like mutex.
>
> + mutex_lock(&gpc->refresh_in_progress); // before write_lock_irq(&gpc->lock);
>
> Is it fit for the intention?

Yeah, I mutex should work. Not sure why I shied away from a mutex...

\
 
 \ /
  Last update: 2022-04-28 16:34    [W:0.076 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site