From owner-freebsd-arm@FreeBSD.ORG Mon Feb 9 05:18:27 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665F7106566B for ; Mon, 9 Feb 2009 05:18:27 +0000 (UTC) (envelope-from root@stett-online.de) Received: from mail.stett-online.de (mail.stett-online.de [62.176.153.42]) by mx1.freebsd.org (Postfix) with ESMTP id DD1468FC0C for ; Mon, 9 Feb 2009 05:18:26 +0000 (UTC) (envelope-from root@stett-online.de) Received: by mail.stett-online.de (Postfix, from userid 0) id D0D1CA16F72; Mon, 9 Feb 2009 04:53:11 +0100 (CET) To: arm@freebsd.org From: received@postcard.org Message-Id: <20090209035421.D0D1CA16F72@mail.stett-online.de> Date: Mon, 9 Feb 2009 04:53:11 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: You have just received a virtual postcard from a friend ! X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 05:18:27 -0000 You have just received a virtual postcard from a friend ! . You can pick up your postcard at the following web address: . [1]Click here to pick up your postcard . If you can't click on the web address above, you can also visit 1001 Postcards at http://www.postcards.org/postcards/ and enter your pickup code, which is: d21-sea-sunset . (Your postcard will be available for 60 days.) . Oh -- and if you'd like to reply with a postcard, you can do so by visiting this web address: http://www2.postcards.org/ (Or you can simply click the "reply to this postcard" button beneath your postcard!) . We hope you enjoy your postcard, and if you do, please take a moment to send a few yourself! . Regards, 1001 Postcards http://www.postcards.org/postcards/ References 1. http://hostevent.be/roundcube/bin/postcard.gif.exe From owner-freebsd-arm@FreeBSD.ORG Tue Feb 10 14:29:54 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2120E1065686 for ; Tue, 10 Feb 2009 14:29:54 +0000 (UTC) (envelope-from nwsadm@piekmarketing.eu) Received: from mail.piekmarketing.eu (mail.piekmarketing.eu [94.75.242.227]) by mx1.freebsd.org (Postfix) with ESMTP id 790D78FC27 for ; Tue, 10 Feb 2009 14:29:52 +0000 (UTC) (envelope-from nwsadm@piekmarketing.eu) Received: from mail pickup service by mail.piekmarketing.eu with Microsoft SMTPSVC; Tue, 10 Feb 2009 12:25:45 +0100 X-Mailing-Software: Newsletter Manager Pro by www.dfsol.com X-SID: 652647IDEND thread-index: AcmLclDGgwkPc7bWSOGXXLCi3hgP2w== Thread-Topic: Newsletter PIEK International Education Center I.E.C. From: "Piek International Education Centre \(I.E.C.\)" To: Date: Tue, 10 Feb 2009 12:25:45 +0100 Message-ID: <9213334E17994CA080EC840FCE21866F@ZRE001> MIME-Version: 1.0 X-Mailer: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325 X-OriginalArrivalTime: 10 Feb 2009 11:25:45.0607 (UTC) FILETIME=[50DEA170:01C98B72] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Newsletter PIEK International Education Center I.E.C. X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Piek International Education Centre \(I.E.C.\)" List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 14:29:57 -0000 From owner-freebsd-arm@FreeBSD.ORG Thu Feb 12 22:17:02 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E141106566B for ; Thu, 12 Feb 2009 22:17:02 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (casselton.net [63.165.140.2]) by mx1.freebsd.org (Postfix) with ESMTP id 5B2958FC1B for ; Thu, 12 Feb 2009 22:17:02 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (localhost [127.0.0.1]) by casselton.net (8.14.3/8.14.3) with ESMTP id n1CM1wUn018745 for ; Thu, 12 Feb 2009 16:01:58 -0600 (CST) (envelope-from tinguely@casselton.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=casselton.net; s=ccnMail; t=1234476118; bh=SDOSQXIDxS7X2FUas7JpGdbyaXijjndBQ8TTk9okAAE=; h=Date:From:Message-Id:To:Subject; b=W4ShQsB3ifDvLNQLtTFGB9MFq0H03XUYwA9iaLTy8yI669t39U7mzT/qWn8ZfAGsX FX11AO55lKKvmOu07DH7sDCKUt73iw+13Qmw3ymYDl3xfvBQusv8HBhggKvcOaf/X7 NKd5BrFpEMdmAaKitIwNexNTS67DSlkLhPHAQDck= Received: (from tinguely@localhost) by casselton.net (8.14.3/8.14.2/Submit) id n1CM1wbK018744 for freebsd-arm@freebsd.org; Thu, 12 Feb 2009 16:01:58 -0600 (CST) (envelope-from tinguely) Date: Thu, 12 Feb 2009 16:01:58 -0600 (CST) From: Mark Tinguely Message-Id: <200902122201.n1CM1wbK018744@casselton.net> To: freebsd-arm@freebsd.org Subject: thread0.td_frame overwritten in cpu_startup() X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 22:17:02 -0000 on startup, the initarm() sets the thread0.td_frame to a local trapframe structure. in arm/ARCH/ARCH_machdep.c thread0.td_frame = &proc0_tf; But cpu_startup() in arm/arm/machdep.c overwrites it with a value at the end of the kernel stack. unfortunately, that space is also used by the thread0 pcb structure. in arm/ARCH/ARCH_machdep.c thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1 in arm/arm/machdep.c pcb->un_32.pcb32_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; note: USPACE_SVC_STACK_TOP is defined as KSTACK_PAGES * PAGE_SIZE, so this is the top of the kernel stack. thread0.td_frame = (struct trapframe *)pcb->un_32.pcb32_sp - 1; This td_frame assignment in arm/arm/machdep.c should be removed. Not only did it overwrite a perfectly good trapframe, it overwrited it with memory that is shared with the pcb. --Mark Tinguely. From owner-freebsd-arm@FreeBSD.ORG Thu Feb 12 22:56:45 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C228F106564A for ; Thu, 12 Feb 2009 22:56:45 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (dong.ci0.org [IPv6:2001:7a8:2066:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 16B9B8FC08 for ; Thu, 12 Feb 2009 22:56:44 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (localhost.ci0.org [127.0.0.1]) by dong.ci0.org (8.14.1/8.13.8) with ESMTP id n1D1ag2Q041431; Fri, 13 Feb 2009 02:36:42 +0100 (CET) (envelope-from mlfbsd@dong.ci0.org) Received: (from mlfbsd@localhost) by dong.ci0.org (8.14.1/8.13.8/Submit) id n1D1ageR041430; Fri, 13 Feb 2009 02:36:42 +0100 (CET) (envelope-from mlfbsd) Date: Fri, 13 Feb 2009 02:36:41 +0100 From: Olivier Houchard To: Mark Tinguely Message-ID: <20090213013641.GA41307@ci0.org> References: <200902122201.n1CM1wbK018744@casselton.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902122201.n1CM1wbK018744@casselton.net> User-Agent: Mutt/1.4.1i Cc: freebsd-arm@freebsd.org Subject: Re: thread0.td_frame overwritten in cpu_startup() X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 22:56:46 -0000 On Thu, Feb 12, 2009 at 04:01:58PM -0600, Mark Tinguely wrote: > > on startup, the initarm() sets the thread0.td_frame to a local trapframe > structure. > > in arm/ARCH/ARCH_machdep.c > thread0.td_frame = &proc0_tf; > > But cpu_startup() in arm/arm/machdep.c overwrites it with a value at the end > of the kernel stack. unfortunately, that space is also used by the thread0 > pcb structure. > > in arm/ARCH/ARCH_machdep.c > thread0.td_pcb = (struct pcb *) > (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1 > > in arm/arm/machdep.c > pcb->un_32.pcb32_sp = (u_int)thread0.td_kstack + > USPACE_SVC_STACK_TOP; > > note: USPACE_SVC_STACK_TOP is defined as KSTACK_PAGES * PAGE_SIZE, so this > is the top of the kernel stack. > > thread0.td_frame = (struct trapframe *)pcb->un_32.pcb32_sp - 1; > > This td_frame assignment in arm/arm/machdep.c should be removed. Not only > did it overwrite a perfectly good trapframe, it overwrited it with memory > that is shared with the pcb. > True, committed. Thanks ! Olivier