Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268049AbUJLWro (ORCPT ); Tue, 12 Oct 2004 18:47:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268048AbUJLWro (ORCPT ); Tue, 12 Oct 2004 18:47:44 -0400 Received: from fmr03.intel.com ([143.183.121.5]:57774 "EHLO hermes.sc.intel.com") by vger.kernel.org with ESMTP id S268043AbUJLWrD (ORCPT ); Tue, 12 Oct 2004 18:47:03 -0400 Message-ID: <416C5ECF.6060402@intel.com> Date: Tue, 12 Oct 2004 15:46:39 -0700 From: Arun Sharma User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Woodhouse CC: Christoph Hellwig , linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org Subject: Re: [PATCH] Support ia32 exec domains without CONFIG_IA32_SUPPORT References: <41643EC0.1010505@intel.com> <20041007142710.A12688@infradead.org> <4165D4C9.2040804@intel.com> <41671696.1060706@intel.com> <416AF599.2060801@intel.com> <1097617824.5178.20.camel@localhost.localdomain> In-Reply-To: <1097617824.5178.20.camel@localhost.localdomain> Content-Type: multipart/mixed; boundary="------------080803090603090003000700" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7087 Lines: 120 This is a multi-part message in MIME format. --------------080803090603090003000700 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit David Woodhouse wrote: > If you make it generic so that qemu can use it for emulating i386 even > on machines like ppc64, perhaps it would be saner. > There is already an architecture independent solution to the problem - set_fs_altroot(). The only problem is that it's not easily accessible from userland. Accessing it via set_personality() works only if there are multiple exec domains. I can't see how anyone would accept a patch that adds linux-i386 exec domain in generic code. Christoph doesn't like the idea of adding exec-domains just for this purpose and has suggested adding a new system call to set the altroot. A prototype patch to do this already exists. I will be cleaning it up and posting it to LKML later this week. The main purpose of moving the discussion to LKML was to see how receptive people were to the proposed new system call. So far I haven't heard anyone complaining :) -Arun PS: Prototype patch with known bugs attached. --------------080803090603090003000700 Content-Type: text/plain; name="sys-altroot.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="sys-altroot.patch" SW5kZXg6IGxpbnV4LTIuNi1jdnMvYXJjaC9pYTY0L2tlcm5lbC9lbnRyeS5TCj09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT0KUkNTIGZpbGU6IC9ob21lL2Fkc2hhcm1hL2Rpc2syL2N2cy9saW51eC0yLjUvYXJj aC9pYTY0L2tlcm5lbC9lbnRyeS5TLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjQ5CmRpZmYg LXUgLXIxLjQ5IGVudHJ5LlMKLS0tIGxpbnV4LTIuNi1jdnMvYXJjaC9pYTY0L2tlcm5lbC9l bnRyeS5TCTI0IEF1ZyAyMDA0IDE4OjI3OjA3IC0wMDAwCTEuNDkKKysrIGxpbnV4LTIuNi1j dnMvYXJjaC9pYTY0L2tlcm5lbC9lbnRyeS5TCTggT2N0IDIwMDQgMTc6MzU6NTMgLTAwMDAK QEAgLTE1MjcsNyArMTUyNyw3IEBACiAJZGF0YTggc3lzX21xX2dldHNldGF0dHIKIAlkYXRh OCBzeXNfbmlfc3lzY2FsbAkJCS8vIHJlc2VydmVkIGZvciBrZXhlY19sb2FkCiAJZGF0YTgg c3lzX25pX3N5c2NhbGwKLQlkYXRhOCBzeXNfbmlfc3lzY2FsbAkJCS8vIDEyNzAKKwlkYXRh OCBzeXNfYWx0cm9vdAkJCS8vIDEyNzAKIAlkYXRhOCBzeXNfbmlfc3lzY2FsbAogCWRhdGE4 IHN5c19uaV9zeXNjYWxsCiAJZGF0YTggc3lzX25pX3N5c2NhbGwKSW5kZXg6IGxpbnV4LTIu Ni1jdnMvZnMvbmFtZWkuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT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XRfZnNfYWx0cm9vdCgpOworCXNldF9mc19hbHRyb290 KE5VTEwpOwogCiAJbW9kdWxlX3B1dChvZXAtPm1vZHVsZSk7CiAJcmV0dXJuIDA7Cg== --------------080803090603090003000700-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/