Re: [PATCH] kvm: fix to update memslots properly

2015-03-10 Thread Paolo Bonzini
>>> This suggests another fix. We can change the insertion to use a ">=" >>> comparison, as in your first patch. Alone it is not correct, but we >>> only need to take some care and avoid breaking the case of deleting a >>> memslot. >>> >>> It's enough to wrap the second loop (that you patched) w

Re: [PATCH] kvm: fix to update memslots properly

2015-03-09 Thread Chen, Tiejun
On 2015/3/10 4:54, Marcelo Tosatti wrote: On Sat, Dec 27, 2014 at 09:41:45PM +0100, Paolo Bonzini wrote: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f528343..6e52f3f 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -672,6 +672,7 @@ static void update_memslots(struct

Re: [PATCH] kvm: fix to update memslots properly

2015-03-09 Thread Marcelo Tosatti
On Sat, Dec 27, 2014 at 09:41:45PM +0100, Paolo Bonzini wrote: > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index f528343..6e52f3f 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@ -672,6 +672,7 @@ static void update_memslots(struct kvm_memslots *slots, > >

Re: [PATCH] kvm: fix to update memslots properly

2014-12-28 Thread Chen, Tiejun
On 2014/12/28 4:41, Paolo Bonzini wrote: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f528343..6e52f3f 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -672,6 +672,7 @@ static void update_memslots(struct kvm_memslots *slots, WARN_ON(mslots[i].id != id);

Re: [PATCH] kvm: fix to update memslots properly

2014-12-27 Thread Jamie Heilman
Paolo Bonzini wrote: > This suggests another fix. We can change the insertion to use a ">=" > comparison, as in your first patch. Alone it is not correct, but we > only need to take some care and avoid breaking the case of deleting a > memslot. > > It's enough to wrap the second loop (that you p

Re: [PATCH] kvm: fix to update memslots properly

2014-12-27 Thread Paolo Bonzini
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index f528343..6e52f3f 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -672,6 +672,7 @@ static void update_memslots(struct kvm_memslots *slots, > WARN_ON(mslots[i].id != id); > if (!new->npages) { >

[PATCH] kvm: fix to update memslots properly

2014-12-25 Thread Tiejun Chen
After commit, 0e60b0799fed, "kvm: change memslot sorting rule from size to GFN" is introduced, we're missing but need to consider such a case, (!new->base_gfn && !mslots[i - 1].base_gfn && !mslots[i - 1].npages), then re-sort kvm_memslots wrong in next case to issue the following, KVM internal err