mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
kvm: use kvfree() in kvm_arch_free_vm()
By switching from kfree() to kvfree() in kvm_arch_free_vm() Arm64 can use the common variant. This can be accomplished by adding another macro __KVM_HAVE_ARCH_VM_FREE, which will be used only by x86 for now. Further simplification can be achieved by adding __kvm_arch_free_vm() doing the common part. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juergen Gross <jgross@suse.com> Message-Id: <20210903130808.30142-5-jgross@suse.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b73a54321a
commit
78b497f2e6
5 changed files with 11 additions and 11 deletions
|
@ -1081,10 +1081,17 @@ static inline struct kvm *kvm_arch_alloc_vm(void)
|
|||
{
|
||||
return kzalloc(sizeof(struct kvm), GFP_KERNEL);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void __kvm_arch_free_vm(struct kvm *kvm)
|
||||
{
|
||||
kvfree(kvm);
|
||||
}
|
||||
|
||||
#ifndef __KVM_HAVE_ARCH_VM_FREE
|
||||
static inline void kvm_arch_free_vm(struct kvm *kvm)
|
||||
{
|
||||
kfree(kvm);
|
||||
__kvm_arch_free_vm(kvm);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue