From patchwork Tue Feb 7 22:56:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 140030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 60153B71A7 for ; Wed, 8 Feb 2012 09:57:11 +1100 (EST) Received: from localhost ([::1]:43768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RutyC-0000xo-Nt for incoming@patchwork.ozlabs.org; Tue, 07 Feb 2012 17:57:04 -0500 Received: from eggs.gnu.org ([140.186.70.92]:43114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruty6-0000xT-Of for qemu-devel@nongnu.org; Tue, 07 Feb 2012 17:57:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ruty3-000165-U5 for qemu-devel@nongnu.org; Tue, 07 Feb 2012 17:56:58 -0500 Received: from cantor2.suse.de ([195.135.220.15]:44868 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruty3-00015t-M8 for qemu-devel@nongnu.org; Tue, 07 Feb 2012 17:56:55 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 6E5858FC93; Tue, 7 Feb 2012 23:56:54 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1257) From: Alexander Graf In-Reply-To: <4F31A5E6.2090802@comstyle.com> Date: Tue, 7 Feb 2012 23:56:52 +0100 Message-Id: <02FE9DED-0602-44C9-AA0C-A9436DF03043@suse.de> References: <20120207125222.111560@gmx.net> <443210D1-C948-435B-9C58-D4E989591BC5@suse.de> <4F31A5E6.2090802@comstyle.com> To: Brad Smith X-Mailer: Apple Mail (2.1257) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Maurizio Caloro , malc , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] Help - `flush_icache_range' MacPPC X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 07.02.2012, at 23:29, Brad Smith wrote: > On 07/02/12 5:12 PM, malc wrote: >> On Tue, 7 Feb 2012, Alexander Graf wrote: >> >>> >>> On 07.02.2012, at 22:12, malc wrote: >>> >>>> On Tue, 7 Feb 2012, Alexander Graf wrote: >>>> >>>>> >>>>> On 07.02.2012, at 13:52, Maurizio Caloro wrote: >>>>> >>>>>> Hello Together >>>>>> Here i drive with me MiniMac G4 1.4Ghz and i try to run Qemu 1.0. i wan't run one Virt. MS Server2008 it's this realistic?. >>>>>> >>>>>> Unfortunitly from the first (other) Mailinglist i don't become any Answer. >>>>>> >>>>>> on a possible error recovery support, I would grateful to you. >>>>>> Thanks and best regards >>>>>> Mauri >>>>>> >>>>>>> NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC>2010 builds@b7.netbsd.org:/home/builds/ab/netbsd-5-1->RELEASE/macppc/201011061943Z-obj/home/builds/ab/netbsd-5-1->RELEASE/src/sys/arch/macppc/compile/GENERIC macppc >>>>>>> >>>>>>> # gmake >>>>>>> CC i386-softmmu/memory.o >>>>>>> LINK i386-softmmu/qemu-system-i386 >>>>>>> ld: warning: libintl.so.0, needed by /usr/pkg/lib/libgthread-2.0.so, may conflict with libintl.so.8 >>>>>>> tcg/tcg.o: In function `tcg_prologue_init': >>>>>>> /usr/source/qemu-1.0/tcg/tcg.c:268: undefined reference to `flush_icache_range' >>>>>>> tcg/tcg.o: In function `ppc_tb_set_jmp_target': >>>>>>> /usr/source/qemu-1.0/tcg/ppc/tcg-target.c:1291: undefined reference to `flush_icache_range' >>>>>>> tcg/tcg.o: In function `tcg_gen_code': >>>>>>> /usr/source/qemu-1.0/tcg/tcg.c:2191: undefined reference to `flush_icache_range' >>>>> >>>>> I'd say your gcc is too old / buggy. >>>> >>>> You probably missed the NetBSD part (anyway originally i did) >>> >>> Gcc on NetBSD doesn't implement the cache flush helpers? They're just a >>> bunch of instructions, so I don't see how that'd be target os specific. >>> >> >> Take a look at cache-utils.c, it conditionally (depending on the host OS >> type) tries to gigure out the cache line sizes, there's code to do that >> on Linux, OSX, AIX and FreeBSD. I have no idea if FreeBSD method works >> for Net/Open/Dragonfly.. so.. > > The FreeBSD method will not work with NetBSD. For NetBSD you have to use > the machdep.cacheinfo sysctl MIB. For OpenBSD this is the only local patch > we have since there is no sysctl (yet) to retrieve the cache line size. > DragonFly has no PowerPC support. Does this patch make it work for you? diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c index f5d9bf3..f55af96 100644 --- a/tcg/ppc/tcg-target.c +++ b/tcg/ppc/tcg-target.c @@ -1260,6 +1260,17 @@ static void tcg_out_brcond2 (TCGContext *s, const TCGArg *args, tcg_out_bc (s, (BC | BI (7, CR_EQ) | BO_COND_TRUE), args[5]); } +#ifdef __NetBSD__ +static void flush_icache_range(unsigned long begin, unsigned long end) +{ + unsigned int i = begin & ~15UL; + for (; i < end; i++) { + asm("icbi 0,%0" : : "r"(i)); + } + asm("isync"); +} +#endif + void ppc_tb_set_jmp_target (unsigned long jmp_addr, unsigned long addr) { uint32_t *ptr;