summaryrefslogtreecommitdiffstats
path: root/crypto/adiantum.c
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-02-18 22:07:26 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-03-16 17:57:22 +0100
commit5c0b4f3d5ccc2ced94b01c3256db1cf79dc95b81 (patch)
treea9ab598b5c2c35163cfa8bd3ed900f52612d6726 /crypto/adiantum.c
parentKVM: x86: Free arrays for old memslot when moving memslot's base gfn (diff)
downloadlinux-5c0b4f3d5ccc2ced94b01c3256db1cf79dc95b81.tar.xz
linux-5c0b4f3d5ccc2ced94b01c3256db1cf79dc95b81.zip
KVM: Move memslot deletion to helper function
Move memslot deletion into its own routine so that the success path for other memslot updates does not need to use kvm_free_memslot(), i.e. can explicitly destroy the dirty bitmap when necessary. This paves the way for dropping @dont from kvm_free_memslot(), i.e. all callers now pass NULL for @dont. Add a comment above the code to make a copy of the existing memslot prior to deletion, it is not at all obvious that the pointer will become stale during sorting and/or installation of new memslots. Note, kvm_arch_commit_memory_region() allows an architecture to free resources when moving a memslot or changing its flags, e.g. x86 frees its arch specific memslot metadata during commit_memory_region(). Acked-by: Christoffer Dall <christoffer.dall@arm.com> Tested-by: Christoffer Dall <christoffer.dall@arm.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'crypto/adiantum.c')
0 files changed, 0 insertions, 0 deletions