From owner-freebsd-arch@FreeBSD.ORG Mon May 30 02:33:01 2005 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF25116A41C for ; Mon, 30 May 2005 02:33:01 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from sp.dominia.org (efnet-math.org [69.60.109.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FD6E43D1F; Mon, 30 May 2005 02:33:01 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from [192.168.0.99] (pool-151-200-57-83.res.east.verizon.net [151.200.57.83]) (authenticated bits=0) by sp.dominia.org (8.13.1/8.13.1) with ESMTP id j4U2Wtwx020758 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Sun, 29 May 2005 22:33:00 -0400 In-Reply-To: <20050528150815.X29776@fledge.watson.org> References: <20050528150815.X29776@fledge.watson.org> Mime-Version: 1.0 (Apple Message framework v730) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <9001CAE4-ECF1-4417-91F3-BAC1FC0A03CE@FreeBSD.org> Content-Transfer-Encoding: 7bit From: Suleiman Souhlal Date: Sun, 29 May 2005 22:32:50 -0400 To: Robert Watson X-Mailer: Apple Mail (2.730) Cc: arch@FreeBSD.org Subject: Re: [PATCH] Stackgap X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2005 02:33:02 -0000 Hi, On May 28, 2005, at 10:10 AM, Robert Watson wrote: > > On Fri, 27 May 2005, Suleiman Souhlal wrote: > > >> You can find an implementation of stackgap from OpenBSD at http:// >> people.freebsd.org/~ssouhlal/testing/stackgap-20050527.diff >> >> You can control the range of the random stack gap with the >> kern.stackgap_random sysctl. A value of 0 disables it. Otherwise, >> it has to be a power of 2 and not too large. The default value is >> 64K. >> >> I've only had the chance to test this on i386. Could anyone test >> it on other architectures as well? >> >> Any comments/objections? >> > > In the past, substantial performance hits have been measured due to > poor stack alignment. Specifically, in combination with less > optimal compiler behavior, the results have been pretty nasty. > Have you tried micro-benchmarking a series of runs with this stack > offset randomness using floating point on stack arguments to see if > there's a measurable cost to moving the stack around? Hopefull if > all is well, there will be little or no difference, but a small > error here could result in a substantial performance hit... I've modified the patch to make sure that the random offset is always correctly aligned.. Do you think it would be safe to commit it (maybe having the stackgap off by default)? Bye. -- Suleiman Souhlal | ssouhlal@vt.edu The FreeBSD Project | ssouhlal@FreeBSD.org