Skip to contentSkip to conversation

xen/x86: drop redundant zeroing from cpu_initialize_context()

PATCH Applied Jan Beulich 3 participants 3 messages Sep 16, 2021 – Sep 20, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/x86: drop redundant zeroing from cpu_initialize_context()

Just after having obtained the pointer from kzalloc() there's no reason at all to set part of the area to all zero yet another time. Similarly there's no point explicitly clearing "ldt_ents".

arch/x86/xen/smp_pv.c +0 -4
@@ -290,8 +290,6 @@ cpu_initialize_context(unsigned int cpu,
 
 	gdt = get_cpu_gdt_rw(cpu);
 
-	memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
-
 	/*
 	 * Bring up the CPU in cpu_bringup_and_idle() with the stack
 	 * pointing just below where pt_regs would be if it were a normal
@@ -308,8 +306,6 @@ cpu_initialize_context(unsigned int cpu,
 
 	xen_copy_trap_info(ctxt->trap_ctxt);
 
-	ctxt->ldt_ents = 0;
-
 	BUG_ON((unsigned long)gdt & ~PAGE_MASK);
 
 	gdt_mfn = arbitrary_virt_to_mfn(gdt);
maintainer Applied
#2 lore raw
In reply to Jan Beulich
Quoted 5 lines · Jan Beulich

Just after having obtained the pointer from kzalloc() there's no reason at all to set part of the area to all zero yet another time. Similarly there's no point explicitly clearing "ldt_ents".

Pushed to xen/tip.git for-linus-5.15b

Juergen