Skip to contentSkip to conversation

Help - `flush_icache_range' MacPPC

Qemu-devel Maurizio Caloro 5 participants 16 messages Feb 7, 2012 – Feb 8, 2012

lore
Share & tools
lore
#0 lore raw

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

Quoted 14 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC >2010 [email protected]:/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'
gmake[1]: *** [qemu-system-i386] Error 1
gmake: *** [subdir-i386-softmmu] Error 2

Regards
Mauri

Signature · 2 lines
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://www.gmx.net/de/go/freephone/
#1 lore raw
Quoted 23 lines · Maurizio Caloro

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

Quoted 14 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC >2010 [email protected]:/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'
gmake[1]: *** [qemu-system-i386] Error 1
gmake: *** [subdir-i386-softmmu] Error 2

Does follwing fix it?

cache-utils.c +1 -1
index 2db5af2..362c98e 100644
@@ -57,7 +57,7 @@ static void ppc_init_cacheline_sizes(void)
 }
 #endif
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
Signature · 1 line
mailto:[email protected]
#2 lore raw
In reply to Maurizio Caloro
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC >2010 [email protected]:/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.

Alex

#3 lore raw
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC >2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Signature · 1 line
mailto:[email protected]
#4 lore raw
Quoted 27 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC >2010 [email protected]:/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'
Quoted 3 lines
Quoted 1 line

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.

Alex

#5 lore raw
Quoted 30 lines · Alexander Graf
Quoted 27 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC >2010 [email protected]:/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'
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

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..

Signature · 1 line
mailto:[email protected]
#6 lore raw
Quoted 36 lines · malc
Quoted 34 lines · Alexander Graf
Quoted 30 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC >2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Quoted 8 lines
Quoted 3 lines

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..

Hrm, I wonder if we could ask some NetBSD enthusiast to help us out here. Christoph?

Alex

#7 lore raw
In reply to malc
Quoted 36 lines · malc
Quoted 34 lines · Alexander Graf
Quoted 30 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC>2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Quoted 8 lines
Quoted 3 lines

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.

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#8 lore raw
Quoted 46 lines · Brad Smith
Quoted 36 lines · malc
Quoted 34 lines · Alexander Graf
Quoted 30 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC>2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Quoted 8 lines
Quoted 3 lines

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..

Quoted 4 lines

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.

Ah, good, since you seem to know your way around the BSDs, mind to write up a patch?

Alex

#9 lore raw
In reply to Brad Smith
Quoted 46 lines · Brad Smith
Quoted 36 lines · malc
Quoted 34 lines · Alexander Graf
Quoted 30 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC>2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Quoted 8 lines
Quoted 3 lines

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..

Quoted 4 lines

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?

tcg/ppc/tcg-target.c +11 -0
index f5d9bf3..f55af96 100644
@@ -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;
#10 lore raw
In reply to Brad Smith
Quoted 46 lines · Brad Smith
Quoted 36 lines · malc
Quoted 34 lines · Alexander Graf
Quoted 30 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC>2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Quoted 8 lines
Quoted 3 lines

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..

Quoted 4 lines

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.

Eh, this patch:

tcg/ppc/tcg-target.c +11 -0
index f5d9bf3..f9793e6 100644
@@ -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+=16) {
+        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;

Alex

#11 lore raw

Am 07.02.2012 23:57, schrieb Alexander Graf:

Quoted 79 lines · Brad Smith
Quoted 47 lines · malc
Quoted 36 lines · Alexander Graf
Quoted 35 lines · malc
Quoted 31 lines · Alexander Graf
Quoted 26 lines · Maurizio Caloro
Quoted 22 lines

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC>2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Quoted 8 lines
Quoted 3 lines

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..

Quoted 4 lines

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.

Eh, this patch:

tcg/ppc/tcg-target.c +11 -0
index f5d9bf3..f9793e6 100644
@@ -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+=16) {
+        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;
Quoted 3 lines

Alex

Hello Alex
Yes i think this its running to end.... at the moment it's compiling :-) this pace of Code have you writen?, you are a genius !!!
i write you also if this compilation finish.
best regards and good night:-)

#12 lore raw
In reply to Alexander Graf
Quoted 64 lines · Alexander Graf
Quoted 46 lines · Brad Smith
Quoted 36 lines · malc
Quoted 34 lines · Alexander Graf
Quoted 30 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC>2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Quoted 8 lines
Quoted 3 lines

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..

Quoted 4 lines

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.

Eh, this patch:

tcg/ppc/tcg-target.c +0 -0
index f5d9bf3..f9793e6 100644
@@ -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]);
 }
 

tcg/ppc/tcg-target.c static void tcg_out_brcond2 (TCGContext *s, const TCGArg *args, · line 1272

Quoted 10 lines
tcg/ppc/tcg-target.c +10 -0
+#ifdef __NetBSD__
+static void flush_icache_range(unsigned long begin, unsigned long end)
+{
+    unsigned int i = begin & ~15UL;
+    for (; i < end; i+=16) {
+        asm("icbi 0,%0" : : "r"(i));
+    }
+    asm("isync");
+}
+#endif

What about flushing the data cache first, as the other flush_icache_range does?

Why isn't the cache-utils.h version of flush_icache_range being seen? It's only ppc_init_cacheline_sizes() that is OS-conditional -- shouldn't that be what the undefined reference is for? Is _ARCH_PPC failing to be defined?

-Scott

#13 lore raw
Quoted 65 lines · Scott Wood
Quoted 64 lines · Alexander Graf
Quoted 46 lines · Brad Smith
Quoted 36 lines · malc
Quoted 34 lines · Alexander Graf
Quoted 30 lines · malc
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Maurizio Caloro

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

Quoted 12 lines

NetBSD powermac.G4 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 17:09:11 UTC>2010 [email protected]:/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'
Quoted 1 line

I'd say your gcc is too old / buggy.

You probably missed the NetBSD part (anyway originally i did)

Quoted 8 lines
Quoted 3 lines

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..

Quoted 4 lines

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.

Eh, this patch:

tcg/ppc/tcg-target.c +0 -0
index f5d9bf3..f9793e6 100644
@@ -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]);
 }
 
Quoted 13 lines

tcg/ppc/tcg-target.c static void tcg_out_brcond2 (TCGContext *s, const TCGArg *args, · line 1272

Quoted 10 lines
tcg/ppc/tcg-target.c +10 -0
+#ifdef __NetBSD__
+static void flush_icache_range(unsigned long begin, unsigned long end)
+{
+    unsigned int i = begin & ~15UL;
+    for (; i < end; i+=16) {
+        asm("icbi 0,%0" : : "r"(i));
+    }
+    asm("isync");
+}
+#endif

What about flushing the data cache first, as the other flush_icache_range does?

I actually wrote this one from scratch. Ahem.

So why are we flushing the dcache on the other one? Does the icache always fill from memory or can it check if something's in the dcache and fetch it from there? If it's the former, then a dcache flush is crucial, right.

Quoted 4 lines

Why isn't the cache-utils.h version of flush_icache_range being seen? It's only ppc_init_cacheline_sizes() that is OS-conditional -- shouldn't that be what the undefined reference is for? Is _ARCH_PPC failing to be defined?

Oh, there is a cache flush function already there! Hah! I completely missed out on that one.

I would assume it's either because _ARCH_PPC is failing to be picked up (include order?) or because the header file is just not included. My motivation in digging into ppc NetBSD issues is rather small though.

Alex

#14 lore raw
Quoted 28 lines · Alexander Graf
Quoted 11 lines · Scott Wood
Quoted 10 lines · Alexander Graf

Eh, this patch:

tcg/ppc/tcg-target.c +0 -0
index f5d9bf3..f9793e6 100644
@@ -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]);
 }
 
Quoted 13 lines

tcg/ppc/tcg-target.c static void tcg_out_brcond2 (TCGContext *s, const TCGArg *args, · line 1272

Quoted 10 lines
tcg/ppc/tcg-target.c +10 -0
+#ifdef __NetBSD__
+static void flush_icache_range(unsigned long begin, unsigned long end)
+{
+    unsigned int i = begin & ~15UL;
+    for (; i < end; i+=16) {
+        asm("icbi 0,%0" : : "r"(i));
+    }
+    asm("isync");
+}
+#endif

What about flushing the data cache first, as the other flush_icache_range does?

Quoted 6 lines

I actually wrote this one from scratch. Ahem.

So why are we flushing the dcache on the other one? Does the icache always fill from memory or can it check if something's in the dcache and fetch it from there? If it's the former, then a dcache flush is crucial, right.

The icache is allowed to fill directly from memory, without snooping dcache. Where it actually fetches from and whether it snoops any data cache is implementation-dependent. On our implementations, instruction fetches do not snoop data cache. The fetch could hit in main memory, or in a shared cache such as L3/CPC (e500mc) or L2 (e500v2).

Quoted 11 lines
Quoted 4 lines

Why isn't the cache-utils.h version of flush_icache_range being seen? It's only ppc_init_cacheline_sizes() that is OS-conditional -- shouldn't that be what the undefined reference is for? Is _ARCH_PPC failing to be defined?

Oh, there is a cache flush function already there! Hah! I completely missed out on that one.

I would assume it's either because _ARCH_PPC is failing to be picked up (include order?) or because the header file is just not included. My motivation in digging into ppc NetBSD issues is rather small though.

It looks like GCC sets _ARCH_PPC. Apparently this isn't happening on this user's toolchain.

-Scott

#15 lore raw
Quoted 36 lines · Scott Wood
Quoted 28 lines · Alexander Graf
Quoted 11 lines · Scott Wood
Quoted 10 lines · Alexander Graf

Eh, this patch:

tcg/ppc/tcg-target.c +0 -0
index f5d9bf3..f9793e6 100644
@@ -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]);
 }
 
Quoted 13 lines

tcg/ppc/tcg-target.c static void tcg_out_brcond2 (TCGContext *s, const TCGArg *args, · line 1272

Quoted 10 lines
tcg/ppc/tcg-target.c +10 -0
+#ifdef __NetBSD__
+static void flush_icache_range(unsigned long begin, unsigned long end)
+{
+    unsigned int i = begin & ~15UL;
+    for (; i < end; i+=16) {
+        asm("icbi 0,%0" : : "r"(i));
+    }
+    asm("isync");
+}
+#endif

What about flushing the data cache first, as the other flush_icache_range does?

Quoted 6 lines

I actually wrote this one from scratch. Ahem.

So why are we flushing the dcache on the other one? Does the icache always fill from memory or can it check if something's in the dcache and fetch it from there? If it's the former, then a dcache flush is crucial, right.

Quoted 5 lines

The icache is allowed to fill directly from memory, without snooping dcache. Where it actually fetches from and whether it snoops any data cache is implementation-dependent. On our implementations, instruction fetches do not snoop data cache. The fetch could hit in main memory, or in a shared cache such as L3/CPC (e500mc) or L2 (e500v2).

I see. Then the implementation we have seems to do the right thing ;).

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

Why isn't the cache-utils.h version of flush_icache_range being seen? It's only ppc_init_cacheline_sizes() that is OS-conditional -- shouldn't that be what the undefined reference is for? Is _ARCH_PPC failing to be defined?

Oh, there is a cache flush function already there! Hah! I completely missed out on that one.

Quoted 7 lines
Quoted 4 lines

I would assume it's either because _ARCH_PPC is failing to be picked up (include order?) or because the header file is just not included. My motivation in digging into ppc NetBSD issues is rather small though.

It looks like GCC sets _ARCH_PPC. Apparently this isn't happening on this user's toolchain.

Broken NetBSD again :). I don't think we have to worry too much about it for now. As long as this is documented on the mailing list (which it is now) someone who cares about NetBSD can either

a) fix their toolchain
or
b) add a patch to match on something different

and then the 2 other people on this planet running NetBSD PPC will be happy :)

Alex