Skip to content

Commit c501062

Browse files
Yongqiang Liusean-jc
authored andcommitted
KVM: SVM: Remove unnecessary GFP_KERNEL_ACCOUNT in svm_set_nested_state()
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>
1 parent 47ac09b commit c501062

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/svm/nested.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,8 +1693,8 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
16931693
return -EINVAL;
16941694

16951695
ret = -ENOMEM;
1696-
ctl = kzalloc(sizeof(*ctl), GFP_KERNEL_ACCOUNT);
1697-
save = kzalloc(sizeof(*save), GFP_KERNEL_ACCOUNT);
1696+
ctl = kzalloc(sizeof(*ctl), GFP_KERNEL);
1697+
save = kzalloc(sizeof(*save), GFP_KERNEL);
16981698
if (!ctl || !save)
16991699
goto out_free;
17001700

0 commit comments

Comments
 (0)