Re: [PATCH v5 08/12] KVM: Reinstate gfn_to_pfn_cache with invalidation support

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

 



On Fri, 2021-12-10 at 15:53 +0100, Paolo Bonzini wrote:
> On 12/10/21 13:25, David Woodhouse wrote:
> > On Thu, 2021-12-09 at 23:34 +0100, Paolo Bonzini wrote:
> > > Compared to the review it's missing this hunk:
> > > 
> > > @@ -265,7 +265,7 @@ void kvm_gfn_to_pfn_cache_unmap(struct kvm *kvm, struct gfn_to_pfn_cache *gpc)
> > > 
> > >          gpc->valid = false;
> > > 
> > > -       old_khva = gpc->khva;
> > > +       old_khva = (void *)((unsigned long)gpc->khva & ~PAGE_MASK);
> > >          old_dirty = gpc->dirty;
> > 
> > Do you know what? I couldn't bring myself to add that a second time. I
> > managed it once, but it made me sad.
> > 
> > Did it like this instead:
> > 
> > -       old_khva = gpc->khva;
> > +       old_khva = gpc->khva - offset_in_page(gpc->khva);
> 
> Very nice, and it would have deserved a macro in include/linux if there 
> wasn't a decent way to write it.

Indeed. I actually went hunting for such, which is where I found
offset_in_page().


> > I checked that for me at least, GCC is clever enough to just do the
> > mask.
> > 
> >          old_khva = gpc->khva - offset_in_page(gpc->khva);
> >   131:   48 8b 43 78             mov    0x78(%rbx),%rax
> >   135:   48 25 00 f0 ff ff       and    $0xfffffffffffff000,%rax
> > 
> > 
> > I still don't see the previous patches in kvm/next — is that an
> > automatic push after testing has passed, or is the kernel.org
> > infrastructure just *really* slow?
> 
> No, it's me really wanting to send out the -rc5 pull request before the 
> weekend.  Just wait five more minutes.

Ack. Thanks.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux