From owner-freebsd-mips@FreeBSD.ORG Wed Oct 5 12:26:11 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1C011065673 for ; Wed, 5 Oct 2011 12:26:11 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 617B98FC1A for ; Wed, 5 Oct 2011 12:26:10 +0000 (UTC) Received: by wwe3 with SMTP id 3so2289804wwe.31 for ; Wed, 05 Oct 2011 05:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mKJ84q0ap8Xx0kxD7LodKo2z8ioUXr0ymdo0fyVQiLA=; b=tdJwBHyMW3qDPHIpojgkatxhJCd0i/ZFrxAQBZkAjZUPl5BH36FNRClWoXihIKDiAi Tk7106CoLz9IehS582C94XW7wriV205I0u8d9H0QOsJcGO2qEQT9mO0PFSDlXpKxkfLC gi3ZW6MPa+q6GyFpYO78wbIIlNP0E104nIPAw= MIME-Version: 1.0 Received: by 10.216.137.36 with SMTP id x36mr3047385wei.41.1317817570162; Wed, 05 Oct 2011 05:26:10 -0700 (PDT) Received: by 10.216.29.78 with HTTP; Wed, 5 Oct 2011 05:26:10 -0700 (PDT) In-Reply-To: References: <20111004211144.GW1511@deviant.kiev.zoral.com.ua> <20111004215218.GY1511@deviant.kiev.zoral.com.ua> Date: Wed, 5 Oct 2011 17:56:10 +0530 Message-ID: From: "Jayachandran C." To: Kostik Belousov Content-Type: multipart/mixed; boundary=0016e6de181e25f75804ae8c506c Cc: mips@freebsd.org Subject: Re: Mips syscall entry point X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2011 12:26:12 -0000 --0016e6de181e25f75804ae8c506c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Oct 5, 2011 at 5:05 PM, Jayachandran C. wrote: > On Wed, Oct 5, 2011 at 3:22 AM, Kostik Belousov wro= te: >> On Wed, Oct 05, 2011 at 12:11:44AM +0300, Kostik Belousov wrote: >>> Hi, >>> below is the patch, test-compiled for XLP64 only, which converts the >>> only remaining architecture MIPS to the new syscall entry sequence. >>> The advantage of the conversion is sharing most of the code with all >>> other architectures and avoiding duplication. Also, the implementation >>> automatically feels the missed features for the MIPS, see the BUGS >> s/feels/fills/, sorry >>> section in the ptrace(2). >> For the same reason, capsicum shall not work on MIPS. >> >>> >>> I am asking for you help to debug and test the patch. Please keep me >>> on Cc:, I am not on the list. >>> >>> Thank you. >>> >>> diff --git a/sys/mips/include/proc.h b/sys/mips/include/proc.h >>> index 11a1f8e..4c0b0b6 100644 [...] > > This gives me a crash when I test it on XLR (32bit compile). =A0The > crash does not look obvious - I am looking at it, hope to resolve this > soon. Actually it is fairly obvious :) the elf*_machdep.c has to be updated for using the cpu_fetch_syscall_args. With that change it comes up on 32 bit - will do a few more tests on 64 bit to see how that goes. The other minor issue I saw was the locr0 usage in trap(), in call to trapdebug_enter, it is fine now since TRAP_DEBUG is not defined. JC. --0016e6de181e25f75804ae8c506c Content-Type: text/x-patch; charset=US-ASCII; name="elf-syscall-fix.diff" Content-Disposition: attachment; filename="elf-syscall-fix.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gteakctf0 ZGlmZiAtLWdpdCBhL3N5cy9taXBzL21pcHMvZWxmNjRfbWFjaGRlcC5jIGIvc3lzL21pcHMvbWlw cy9lbGY2NF9tYWNoZGVwLmMKaW5kZXggOWZhMzFmYS4uZWUyNWVmNCAxMDA2NDQKLS0tIGEvc3lz L21pcHMvbWlwcy9lbGY2NF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