lkml.org 
[lkml]   [2020]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 12/19] KVM: Move memslot deletion to helper function
On Fri, Feb 07, 2020 at 09:59:12AM -0800, Sean Christopherson wrote:
> On Thu, Feb 06, 2020 at 11:51:16AM -0500, Peter Xu wrote:
> > /*
> > * Make a full copy of the old memslot, the pointer will become stale
> > * when the memslots are re-sorted by update_memslots() in
> > * kvm_delete_memslot(), while to make the kvm_free_memslot() work as
> > * expected later on, we still need the cached memory slot.
> > */
>
> As above, it's more subtle than just the kvm_delete_memslot() case.
>
> /*
> * Make a full copy of the old memslot, the pointer will become stale
> * when the memslots are re-sorted by update_memslots() when deleting
> * or moving a memslot, and additional modifications to the old memslot
> * need to be made after calling update_memslots().
> */

Actually, that's not quite correct, as the same is true for all memslot
updates, and we still query @old after update_memslots() for CREATE and
FLAGS. This is better.

/*
* Make a full copy of the old memslot, the pointer will become stale
* when the memslots are re-sorted by update_memslots(), and the old
* memslot needs to be referenced after calling update_memslots(), e.g.
* to free its resources and for arch specific behavior.
*/

\
 
 \ /
  Last update: 2020-02-07 19:08    [W:0.082 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site