From owner-freebsd-amd64@FreeBSD.ORG Tue Jul 20 21:22:28 2010 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D79CB1065673 for ; Tue, 20 Jul 2010 21:22:28 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id AD4E08FC18 for ; Tue, 20 Jul 2010 21:22:28 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 99629582CB; Tue, 20 Jul 2010 15:49:11 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id LzFL7D12HjIb; Tue, 20 Jul 2010 15:49:11 -0500 (CDT) Received: from wanderer.tachypleus.net (mar92-14-88-173-196-182.fbx.proxad.net [88.173.196.182]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 61990582C8; Tue, 20 Jul 2010 15:49:10 -0500 (CDT) Message-ID: <4C460BB9.1060009@freebsd.org> Date: Tue, 20 Jul 2010 15:48:57 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.10) Gecko/20100627 Thunderbird/3.0.5 MIME-Version: 1.0 To: John Baldwin References: <20100719213054.GB2381@deviant.kiev.zoral.com.ua> <201007200907.24715.jhb@freebsd.org> In-Reply-To: <201007200907.24715.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: amd64@freebsd.org, freebsd-arch@freebsd.org Subject: Re: uname -m/-p for compat32 binaries X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 21:22:28 -0000 On 07/20/10 08:07, John Baldwin wrote: > On Monday, July 19, 2010 5:30:54 pm Kostik Belousov wrote: > >> Hi, >> I intend to commit the following change, that makes sysctls >> hw.machine_arch and hw.machine to return "i386" for 32 bit >> binaries run on amd64. In particular, 32 bit uname -m and uname -p >> print "i386", that is good for i386 jails on amd64 kernels. >> >> I find the change very useful for me, but I wonder why such trivial >> modification is not yet done. Can anybody note a possible fallout from >> it ? >> > Presumably ia64 and powerpc64 would need a similar change as well? It looks > fine to me. I suspect Y! used the UNAME_* approach as it didn't add yet- > another local diff to maintain in the kernel, and the uname fixes at Y! might > have predated SCTL_MASK32. > Maybe it makes sense to define a MACHINE_ARCH32 in machine/param.h, as is done for ELF_ARCH32 in machine/elf.h? This would keep the MI code in the kernel MI, and ever-so-slightly simplify implementation for ia64, mips, and powerpc64. Thanks for doing this! -Nathan