From patchwork Tue Mar 30 19:16:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Lock X-Patchwork-Id: 49018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DE9CEB6F11 for ; Wed, 31 Mar 2010 06:29:24 +1100 (EST) Received: from localhost ([127.0.0.1]:49103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwh3v-00083k-MH for incoming@patchwork.ozlabs.org; Tue, 30 Mar 2010 15:25:19 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nwh2i-00083e-2I for qemu-devel@nongnu.org; Tue, 30 Mar 2010 15:24:04 -0400 Received: from [140.186.70.92] (port=49579 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwh2g-00083V-NV for qemu-devel@nongnu.org; Tue, 30 Mar 2010 15:24:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nwh2c-0005NQ-H0 for qemu-devel@nongnu.org; Tue, 30 Mar 2010 15:24:02 -0400 Received: from gelbbaer.kn-bremen.de ([78.46.108.116]:44938 helo=smtp.kn-bremen.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwh2c-0005Mb-5a for qemu-devel@nongnu.org; Tue, 30 Mar 2010 15:23:58 -0400 Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 9E5021E00172; Tue, 30 Mar 2010 21:23:55 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id o2UJGU7N096148; Tue, 30 Mar 2010 21:16:30 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id o2UJGTTS096147; Tue, 30 Mar 2010 21:16:30 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Tue, 30 Mar 2010 21:16:29 +0200 To: Blue Swirl Subject: Re: [Qemu-devel] qemu git head 20100323 on FreeBSD - qemu-devel port update for testing Message-ID: <20100330191629.GA95521@triton8.kn-bremen.de> References: <20100325204423.GA46954@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: qemu-devel@nongnu.org, freebsd-emulation@freebsd.org, Toni , Juergen Lock , Andreas Tobler X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Tue, Mar 30, 2010 at 09:04:28PM +0300, Blue Swirl wrote: > On 3/25/10, Juergen Lock wrote: > > Hi! > > > > Now that qemu git head works again (thanx Aurelien! :) I've finished > > the FreeBSD qemu-devel port update patch/shar that made me uncover > > the bug: > > http://people.freebsd.org/~nox/qemu/qemu-devel-20100323.patch > > resp. > > http://people.freebsd.org/~nox/qemu/qemu-devel-20100323.shar > > > > This also adds a few misc fixes (that I'll submit on the qemu list > > seperately), I have... > > > > . Fixed the FreeBSD executable path detection to work without /proc > > mounted (it usually isn't on FreeBSD), so you now no longer have to > > pass the path to the pc-bios dir with -L if you run qemu out of the > > build dir when another version is installed, like, > > work/qemu-snapshot-20100323_20/i386-softmmu/qemu ... > > > > (files/patch-vl.c in the shar/patch) > > > > . Fixed some more bsd-user bugs so all of i386-bsd-user, x86_64-bsd-user, > > and sparc64-bsd-user now run for me again on FreeBSD stable/8 amd64. > > (I didn't test sparc-bsd-user as I only tried -bsd freebsd and FreeBSD > > doesn't run on 32bit sparc.) - Yes bsd-user still needs more work but > > at least simple exectuables run. > > > > (files/patch-bsd-user-mmap.c, files/patch-exec.c) > > > > . Fixed the bsd-user host page protection code for FreeBSD hosts > > (using kinfo_getvmmap(3) on FeeBSD >= 7.x and /compat/linux/proc > > on older FreeBSD.) > > > > (files/patch-bsd-user-linproc) > > > > . Fixed some compilation warnings and a missing #include. > > > > (files/patch-qemu-char.c, files/patch-qemu-timer.c) > > > > Thanks, applied all except exec.c one. Oh, is there something wrong with it? You mean this one, right? Subject: [PATCH] Avoid page_set_flags() assert in qemu-user host page protection code Message-ID: <20100325211421.GA52572@triton8.kn-bremen.de> [...] I first tried to replace the endaddr in the !h2g_valid(endaddr) case with ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS) - 1 if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS (which comes from the condition of the assert in page_set_flags() that was triggered on the ~0ul value), but that caused the qemu process to grow into swap and made the box usuable when that code was reached and I had to kill qemu. (The box has 8 GB RAM.) And so I thought just leaving that page range unprotected if only the start address is valid was the lesser evil... ..and thanx for committing the other ones, :) Juergen --- a/exec.c +++ b/exec.c @@ -293,10 +293,13 @@ static void page_init(void) if (h2g_valid(endaddr)) { endaddr = h2g(endaddr); + page_set_flags(startaddr, endaddr, PAGE_RESERVED); } else { +#if TARGET_ABI_BITS <= L1_MAP_ADDR_SPACE_BITS endaddr = ~0ul; + page_set_flags(startaddr, endaddr, PAGE_RESERVED); +#endif } - page_set_flags(startaddr, endaddr, PAGE_RESERVED); } } while (!feof(f));