Re: [PATCH v3 1/2] KVM: s390x: some utility functions for migration

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

 



On Wed, 31 Jan 2018 09:57:35 +0100
Janosch Frank <frankja@xxxxxxxxxxxxxxxxxx> wrote:

> On 30.01.2018 19:52, Claudio Imbrenda wrote:
> > These are some utilty functions that will be used later on for
> > storage  
> 
> s/utilty/utility/

will fix


[...]

> > +static inline unsigned long *cmma_bitmap(struct kvm_memory_slot
> > *slot) +{
> > +	unsigned long len = kvm_dirty_bitmap_bytes(slot);
> > +
> > +	return slot->dirty_bitmap + len /
> > sizeof(*slot->dirty_bitmap); +}  
> 
> It seems like you forgot to remove this.

Oops, will fix

> > +
> >  /* implemented in interrupt.c */
> >  int kvm_s390_handle_wait(struct kvm_vcpu *vcpu);
> >  void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu);
> > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> > index 6bdd4b9..ea524a8 100644
> > --- a/include/linux/kvm_host.h
> > +++ b/include/linux/kvm_host.h
> > @@ -308,6 +308,13 @@ static inline unsigned long
> > kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memsl return
> > ALIGN(memslot->npages, BITS_PER_LONG) / 8; }
> > 
> > +static inline unsigned long *kvm_shadow_dirty_bitmap(struct
> > kvm_memory_slot *memslot)  
> 
> Hrm, it's only more or less a shadow for the generic dirty case which
> you touch below. I'd like to have an opinion from Paolo on this one as
> we touch common code.

yeah, I know, I also don't like it, but I couldn't figure a better name.
kvm_second_bitmap? kvm_second_dirty_bitmap? kvm_dirty_bitmap_end?

any suggestions?

Also I don't like the excessive length of all these names, but I guess
I'll have to live with it.

> Also I'd want to split this, taking the memslot stuff into the next
> patch and do the generic dirty bitmap helper in this one.

Will do

> > +{
> > +	unsigned long len = kvm_dirty_bitmap_bytes(memslot);
> > +
> > +	return memslot->dirty_bitmap + len /
> > sizeof(*memslot->dirty_bitmap); +}
> > +
> >  struct kvm_s390_adapter_int {
> >  	u64 ind_addr;
> >  	u64 summary_addr;
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 210bf82..9e18331 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -1158,7 +1158,7 @@ int kvm_get_dirty_log_protect(struct kvm *kvm,
> > 
> >  	n = kvm_dirty_bitmap_bytes(memslot);
> > 
> > -	dirty_bitmap_buffer = dirty_bitmap + n / sizeof(long);
> > +	dirty_bitmap_buffer = kvm_shadow_dirty_bitmap(memslot);
> >  	memset(dirty_bitmap_buffer, 0, n);
> > 
> >  	spin_lock(&kvm->mmu_lock);
> >   
> 
> 




[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