x86/sev: Remove unnecessary GFP_KERNEL_ACCOUNT for temporary variables
PATCH 1/1 x86/sev: Remove unnecessary GFP_KERNEL_ACCOUNT for temporary variables
From: Peng Hao <[email protected]>
Some variables allocated in sev_send_update_data are released when the function exits, so there is no need to set GFP_KERNEL_ACCOUNT.
Signed-off-by Peng Hao <[email protected]>
--- arch/x86/kvm/svm/sev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/sev.c +2 -2
@@ -1608,11 +1608,11 @@ static int sev_send_update_data(struct kvm *kvm, struct kvm_sev_cmd *argp)/* allocate memory for header and transport buffer */ ret = -ENOMEM ; - hdr =kzalloc (params.hdr_len,GFP_KERNEL_ACCOUNT ); + hdr =kzalloc (params.hdr_len,GFP_KERNEL );if (!hdr) goto e_unpin; - trans_data =kzalloc (params.trans_len,GFP_KERNEL_ACCOUNT ); + trans_data =kzalloc (params.trans_len,GFP_KERNEL );if (!trans_data) goto e_free_hdr;
Signature · 1 line
2.27.0
Quoted 2 lines · On Mon, 28 Apr 2025 14:30:13 +0800, [email protected] wrote:
Some variables allocated in
sev_send_update_dataare released when the function exits, so there is no need to setGFP_KERNEL_ACCOUNT.
Applied to kvm-x86 svm, thanks!
[1/1] x86/sev: Remove unnecessary GFP_KERNEL_ACCOUNT for temporary variables
https://github.com/kvm-x86/linux/commit/e0136112e99d