From owner-p4-projects@FreeBSD.ORG Sun Jun 4 20:49:58 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0C83216AC9D; Sun, 4 Jun 2006 20:49:58 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E6A416ABE8 for ; Sun, 4 Jun 2006 20:49:55 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F27A43D48 for ; Sun, 4 Jun 2006 20:49:55 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k54KmEBp060415 for ; Sun, 4 Jun 2006 20:48:14 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k54KmE53060412 for perforce@freebsd.org; Sun, 4 Jun 2006 20:48:14 GMT (envelope-from kmacy@freebsd.org) Date: Sun, 4 Jun 2006 20:48:14 GMT Message-Id: <200606042048.k54KmE53060412@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 98502 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jun 2006 20:50:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=98502 Change 98502 by kmacy@kmacy_storage:sun4v_work on 2006/06/04 20:48:09 force pcpu to be 64-byte aligned Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/pcpu.h#14 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/machdep.c#24 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/pcpu.h#14 (text+ko) ==== @@ -78,7 +78,8 @@ u_int pc_kwbuf_full; \ struct rwindow pc_tsbwbuf[2]; \ u_int pc_node; \ - uint16_t pc_cpulist[MAXCPU] + uint16_t pc_cpulist[MAXCPU]; \ + uint64_t pad[6]; /* XXX SUN4V_FIXME - as we access the *_ra and *_size fields in quick * succession we _really_ want them to be L1 cache line size aligned ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/machdep.c#24 (text+ko) ==== @@ -181,6 +181,7 @@ CTASSERT(sizeof(struct pcb) <= ((KSTACK_PAGES * PAGE_SIZE) / 8)); CTASSERT(sizeof(struct pcpu) <= ((PCPU_PAGES * PAGE_SIZE) / 2)); +CTASSERT((sizeof(struct pcpu) & ((1<<6)-1)) == 0); static void cpu_startup(void *arg) @@ -377,7 +378,9 @@ proc0.p_md.md_utrap = NULL; frame0.tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_PRIV; thread0.td_frame = &frame0; - + if ((u_long)thread0.td_frame & 0x3f) { + panic("unaligned frame0"); + } /* * Prime our per-cpu data page for use. Note, we are using it for our * stack, so don't pass the real size (PAGE_SIZE) to pcpu_init or @@ -412,6 +415,11 @@ thread0.td_pcb = (struct pcb *)TLB_PHYS_TO_DIRECT(vtophys((vm_offset_t)thread0.td_pcb)); pc->pc_curpcb = thread0.td_pcb; + if (((thread0.td_pcb->pcb_kstack + SPOFF) & 0x3f) != 0) { + printf("unaligned stack pcb_kstack & 0x3f == 0x%lx\n", + ((thread0.td_pcb->pcb_kstack + SPOFF) & 0x3f)); + } + /* * Update PCPU_REG to point to direct address * to support easy phys <-> virt translation in trap handler @@ -697,10 +705,7 @@ #ifdef SMP cpu_mp_shutdown(); #endif -#ifdef notyet -/* XXX SUN4V_FIXME */ - openfirmware_exit(args); -#endif + OF_exit(); } /* Get current clock frequency for the given cpu id. */