]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: TDX: Remove redundant __GFP_ZERO
authorQianfeng Rong <rongqianfeng@vivo.com>
Fri, 8 Aug 2025 07:45:32 +0000 (15:45 +0800)
committerSean Christopherson <seanjc@google.com>
Tue, 19 Aug 2025 18:51:25 +0000 (11:51 -0700)
Remove the redundant __GFP_ZERO flag from kcalloc() since kcalloc()
inherently zeroes memory.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20250808074532.215098-1-rongqianfeng@vivo.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/tdx.c

index 66744f5768c8eb8d439680fe7ddaabf8e5ca9171..6784aaaced87b23ae3896acebf1eebb44bfa1050 100644 (file)
@@ -2480,7 +2480,7 @@ static int __tdx_td_init(struct kvm *kvm, struct td_params *td_params,
        /* TDVPS = TDVPR(4K page) + TDCX(multiple 4K pages), -1 for TDVPR. */
        kvm_tdx->td.tdcx_nr_pages = tdx_sysinfo->td_ctrl.tdvps_base_size / PAGE_SIZE - 1;
        tdcs_pages = kcalloc(kvm_tdx->td.tdcs_nr_pages, sizeof(*kvm_tdx->td.tdcs_pages),
-                            GFP_KERNEL | __GFP_ZERO);
+                            GFP_KERNEL);
        if (!tdcs_pages)
                goto free_tdr;