* [PATCH] KVM: TDX: Remove redundant __GFP_ZERO
@ 2025-08-08 7:45 Qianfeng Rong
2025-08-13 11:22 ` Huang, Kai
2025-08-19 23:12 ` Sean Christopherson
0 siblings, 2 replies; 3+ messages in thread
From: Qianfeng Rong @ 2025-08-08 7:45 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, kvm,
linux-kernel
Cc: Qianfeng Rong
Remove the redundant __GFP_ZERO flag from kcalloc() since kcalloc()
inherently zeroes memory.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
arch/x86/kvm/vmx/tdx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
index 573d6f7d1694..c44c8f0a4190 100644
--- a/arch/x86/kvm/vmx/tdx.c
+++ b/arch/x86/kvm/vmx/tdx.c
@@ -2483,7 +2483,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;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: TDX: Remove redundant __GFP_ZERO
2025-08-08 7:45 [PATCH] KVM: TDX: Remove redundant __GFP_ZERO Qianfeng Rong
@ 2025-08-13 11:22 ` Huang, Kai
2025-08-19 23:12 ` Sean Christopherson
1 sibling, 0 replies; 3+ messages in thread
From: Huang, Kai @ 2025-08-13 11:22 UTC (permalink / raw)
To: rongqianfeng@vivo.com, seanjc@google.com,
dave.hansen@linux.intel.com, bp@alien8.de, x86@kernel.org,
mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com,
pbonzini@redhat.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
On Fri, 2025-08-08 at 15:45 +0800, Qianfeng Rong wrote:
> Remove the redundant __GFP_ZERO flag from kcalloc() since kcalloc()
> inherently zeroes memory.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> ---
> arch/x86/kvm/vmx/tdx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
> index 573d6f7d1694..c44c8f0a4190 100644
> --- a/arch/x86/kvm/vmx/tdx.c
> +++ b/arch/x86/kvm/vmx/tdx.c
> @@ -2483,7 +2483,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;
>
Reviewed-by: Kai Huang <kai.huang@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: TDX: Remove redundant __GFP_ZERO
2025-08-08 7:45 [PATCH] KVM: TDX: Remove redundant __GFP_ZERO Qianfeng Rong
2025-08-13 11:22 ` Huang, Kai
@ 2025-08-19 23:12 ` Sean Christopherson
1 sibling, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2025-08-19 23:12 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, kvm,
linux-kernel, Qianfeng Rong
On Fri, 08 Aug 2025 15:45:32 +0800, Qianfeng Rong wrote:
> Remove the redundant __GFP_ZERO flag from kcalloc() since kcalloc()
> inherently zeroes memory.
Applied to kvm-x86 vmx, thanks!
[1/1] KVM: TDX: Remove redundant __GFP_ZERO
https://github.com/kvm-x86/linux/commit/7cbb14d361bd
--
https://github.com/kvm-x86/linux/tree/next
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-19 23:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-08 7:45 [PATCH] KVM: TDX: Remove redundant __GFP_ZERO Qianfeng Rong
2025-08-13 11:22 ` Huang, Kai
2025-08-19 23:12 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).