From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BbjCZ-0005Nf-Bx for qemu-devel@nongnu.org; Sat, 19 Jun 2004 13:00:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BbjCX-0005NF-Nw for qemu-devel@nongnu.org; Sat, 19 Jun 2004 13:00:23 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BbjCX-0005NC-M0 for qemu-devel@nongnu.org; Sat, 19 Jun 2004 13:00:21 -0400 Received: from [193.252.22.25] (helo=mwinf0602.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BbjBB-0006Rl-TR for qemu-devel@nongnu.org; Sat, 19 Jun 2004 12:58:58 -0400 Message-ID: <40D4716A.3080402@bellard.org> Date: Sat, 19 Jun 2004 19:01:30 +0200 From: Fabrice Bellard MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] linux-user sysinfo support & do_sigreturn fix for i386-user References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org François Guimond wrote: > First is the fix to signal handling. When I paid attention to strace's > changes in sigprocmask, I realize that masks entering linux-user's > signal processing handler would be wrong leaving the handler. Upon > further investigation I noticed that the mask was getting written in the > sig frame using __put_user but getting restored by simple assignment, so > in this case it would result in the wrong value as qemu-i386 was running > on a PowerPC with a different endianess than a x86. Looking around in > the code I saw the 'generic' do_sigreturn used __get_user properly to > retrieve it, so I copied over that bit of code into the x86 > do_sigreturn, and it fixed the deadlock problem I was experiencing > (which was caused by wrong sigprocmask). Here's the related patch: The code was buggy, but your patch is still not correct. I tried to make a correction. Try it ! > The next problem I was running into was the sysinfo not implemented > syscall. The problem would just run in a loop waiting to get a decent > result from it, so I had to implement (so far tested by me and two > others, all running PowerMac G3s with qemu-i386 as the target). OK. A small note: it is better now to use __get_user() and __put_user() to access to the target memory. Fabrice.