]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: SVM: Remove unnecessary GFP_KERNEL_ACCOUNT in svm_set_nested_state()
authorYongqiang Liu <liuyongqiang13@huawei.com>
Wed, 21 Aug 2024 11:27:37 +0000 (19:27 +0800)
committerSean Christopherson <seanjc@google.com>
Thu, 22 Aug 2024 18:35:09 +0000 (11:35 -0700)
The fixed size temporary variables vmcb_control_area and vmcb_save_area
allocated in svm_set_nested_state() are released when the function exits.
Meanwhile, svm_set_nested_state() also have vcpu mutex held to avoid
massive concurrency allocation, so we don't need to set GFP_KERNEL_ACCOUNT.

Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com>
Link: https://lore.kernel.org/r/20240821112737.3649937-1-liuyongqiang13@huawei.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/nested.c

index 6f704c1037e5147376ce3e78fbd63dabeee3e08c..d5314cb7dff4ca2524b3dba584c94f7fad18b02b 100644 (file)
@@ -1693,8 +1693,8 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
                return -EINVAL;
 
        ret  = -ENOMEM;
-       ctl  = kzalloc(sizeof(*ctl),  GFP_KERNEL_ACCOUNT);
-       save = kzalloc(sizeof(*save), GFP_KERNEL_ACCOUNT);
+       ctl  = kzalloc(sizeof(*ctl),  GFP_KERNEL);
+       save = kzalloc(sizeof(*save), GFP_KERNEL);
        if (!ctl || !save)
                goto out_free;