Index: arch/amd64/amd64/cpu.c
===================================================================
RCS file: /home/vcs/cvs/openbsd/src/sys/arch/amd64/amd64/cpu.c,v
retrieving revision 1.44
diff -u -p -r1.44 cpu.c
--- arch/amd64/amd64/cpu.c 13 Apr 2011 02:49:12 -0000 1.44
+++ arch/amd64/amd64/cpu.c 9 Aug 2011 23:01:15 -0000
@@ -268,7 +268,7 @@ cpu_attach(struct device *parent, struct
/*
* Allocate UPAGES contiguous pages for the idle PCB and stack.
*/
- kstack = uvm_km_alloc (kernel_map, USPACE);
+ kstack = uvm_km_zalloc(kernel_map, USPACE);
if (kstack == 0) {
if (caa->cpu_role != CPU_ROLE_AP) {
panic("cpu_attach: unable to allocate idle stack for"
@@ -279,7 +279,6 @@ cpu_attach(struct device *parent, struct
return;
}
pcb = ci->ci_idle_pcb = (struct pcb *) kstack;
- memset(pcb, 0, USPACE);
pcb->pcb_kstack = kstack + USPACE - 16;
pcb->pcb_rbp = pcb->pcb_rsp = kstack + USPACE - 16;
Index: arch/i386/i386/cpu.c
===================================================================
RCS file: /home/vcs/cvs/openbsd/src/sys/arch/i386/i386/cpu.c,v
retrieving revision 1.42
diff -u -p -r1.42 cpu.c
--- arch/i386/i386/cpu.c 27 Nov 2010 13:03:04 -0000 1.42
+++ arch/i386/i386/cpu.c 9 Aug 2011 23:01:15 -0000
@@ -217,7 +217,7 @@ cpu_attach(struct device *parent, struct
* Allocate UPAGES contiguous pages for the idle PCB and stack.
*/
- kstack = uvm_km_alloc(kernel_map, USPACE);
+ kstack = uvm_km_zalloc(kernel_map, USPACE);
if (kstack == 0) {
if (cpunum == 0) { /* XXX */
panic("cpu_attach: unable to allocate idle stack for"
@@ -228,7 +228,6 @@ cpu_attach(struct device *parent, struct
return;
}
pcb = ci->ci_idle_pcb = (struct pcb *)kstack;
- memset(pcb, 0, USPACE);
pcb->pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
pcb->pcb_tss.tss_esp0 = kstack + USPACE - 16 -