From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM8vf-0006Ds-I7 for qemu-devel@nongnu.org; Fri, 13 Feb 2015 00:36:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YM8va-0002AG-Ej for qemu-devel@nongnu.org; Fri, 13 Feb 2015 00:36:39 -0500 Received: from out1134-243.mail.aliyun.com ([42.120.134.243]:25059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM8va-0002A4-42 for qemu-devel@nongnu.org; Fri, 13 Feb 2015 00:36:34 -0500 Message-ID: <54DD8F2F.2090703@sunrus.com.cn> Date: Fri, 13 Feb 2015 13:44:15 +0800 From: Chen Gang S MIME-Version: 1.0 References: <54DBED38.4060005@sunrus.com.cn> <54DBEFD3.1070609@sunrus.com.cn> <54DBF2D2.3000802@ezchip.com> <54DC1EC7.9000808@sunrus.com.cn> <54DD29BA.4040003@ezchip.com> <54DD80D7.1020500@sunrus.com.cn> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] tile: Can load elf64 tilegx binary successfully for linux-user. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "walt@tilera.com" , Chris Metcalf , Riku Voipio , qemu-devel On 2/13/15 12:56, Peter Maydell wrote: > On 13 February 2015 at 04:43, Chen Gang S wrote: >> Originally, I have tried to remove TARGET_NR_open and others, they can >> not pass building, and I also noticed about NR_openat. But at last, I >> still remain TARGET_NR_open and others (with related comments): >> >> - Another platforms (e.g. microblaze, arm64) defined them, too. >> >> - It is only for linux-user, can bypass Linux tile kernel. So it is >> still correct. > > The question is, does the Linux kernel for this architecture implement > a particular syscall (eg NR_open)? (That is, is there a syscall number > defined, and if you try to execute a syscall with this syscall number, > does it work, or does it fail?) If it does implement it, then you need to > #define TARGET_NR_open appropriately. If not, then don't define that. > If QEMU doesn't build as a result, this probably means our linux-user > code doesn't expect a target architecture with no implementation of > that syscall. In that case you should fix the linux-user code (eg > by adding ifdefs). > The tilegx 64-bit Linux kernel doesn't support TARGET_NR_open and others. >> - It really wastes memory and storage a little, but for me, the related >> maintainers (not me) need to consider about whether let the code more >> complex or save memory a little. > > Neither code complexity nor memory use are important here. It is an > issue of correctness. > Which issue of correctness will occur? I can not enum it. For me, they are only the waste code: - linux-user already bypasses target linux kernel, and libc for tilegx can not generate these calls (not defined for libc, either). - For any informal using, linux-user can still operate NR_open and others, it is harmless. - It is about compatible (not about correctness issues). I guess, tilegx is the new processor than most of others within Tilera, so it does not want to compatible with the old calls (then can save memory and spaces, also can let things a little simpler). Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed