From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754643AbYJCJZD (ORCPT ); Fri, 3 Oct 2008 05:25:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752835AbYJCJYx (ORCPT ); Fri, 3 Oct 2008 05:24:53 -0400 Received: from nf-out-0910.google.com ([64.233.182.187]:37090 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752393AbYJCJYw (ORCPT ); Fri, 3 Oct 2008 05:24:52 -0400 Date: Fri, 3 Oct 2008 12:25:52 +0300 From: "Kirill A. Shutemov" To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Morton Subject: Re: [PATCH] x86_64: Implement personality ADDR_LIMIT_32BIT Message-ID: <20081003092550.GA8669@localhost.localdomain> References: <1223017469-5158-1-git-send-email-kirill@shutemov.name> <20081003080244.GC25408@elte.hu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <20081003080244.GC25408@elte.hu> User-Agent: Mutt/1.5.18 (2008-05-29) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 03, 2008 at 10:02:44AM +0200, Ingo Molnar wrote: >=20 > * Kirill A. Shutemov wrote: >=20 > > - /* for MAP_32BIT mappings we force the legact mmap base */ > > - if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT)) > > + /* for MAP_32BIT mappings and ADDR_LIMIT_32BIT personality we force t= he > > + * legact mmap base > > + */ >=20 > please use the customary multi-line comment style: >=20 > /* > * Comment ..... > * ...... goes here: > */ >=20 > and you might use the opportunity to fix the s/legact/legacy typo as=20 > well. Ok, I'll fix it. >=20 > but more generally, we already have ADDR_LIMIT_3GB support on x86. Does ADDR_LIMIT_3GB really work? $ cat 1.c #include #include #include #include #define ADDR_LIMIT_3GB 0x8000000 int main(void) { int id; void *shm; personality(ADDR_LIMIT_3GB); id =3D shmget(0x123456, 1, IPC_CREAT | 0600); shm =3D shmat(id, NULL, 0); printf("shm: %p\n", shm); shmdt(shm); return 0; } $ gcc -Wall 1.c $ sudo ./a.out=20 shm: 0x7f4fca755000 > Why=20 > should support for ADDR_LIMIT_32BIT be added? It's useful for user mode qemu when you try emulate 32-bit target on=20 x86_64. For example, if shmat(2) return addres above 32-bit, target will get SIGSEGV on access to it. --=20 Regards, Kirill A. Shutemov + Belarus, Minsk + ALT Linux Team, http://www.altlinux.com/ --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkjl5R4ACgkQbWYnhzC5v6phHgCfUVMJE9tqR47xaAQXaw1z4W9R jZkAn1y1ty3SgfLEgaG+E0h2+SPUEdAZ =vsUG -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT--