All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Help - `flush_icache_range' MacPPC
@ 2012-02-07 12:52 Maurizio Caloro
  2012-02-07 18:03 ` malc
  2012-02-07 20:01 ` Alexander Graf
  0 siblings, 2 replies; 16+ messages in thread
From: Maurizio Caloro @ 2012-02-07 12:52 UTC (permalink / raw)
  To: qemu-devel

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'
>gmake[1]: *** [qemu-system-i386] Error 1
>gmake: *** [subdir-i386-softmmu] Error 2

Regards
Mauri
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://www.gmx.net/de/go/freephone/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 12:52 [Qemu-devel] Help - `flush_icache_range' MacPPC Maurizio Caloro
@ 2012-02-07 18:03 ` malc
  2012-02-07 20:01 ` Alexander Graf
  1 sibling, 0 replies; 16+ messages in thread
From: malc @ 2012-02-07 18:03 UTC (permalink / raw)
  To: Maurizio Caloro; +Cc: qemu-devel

On Tue, 7 Feb 2012, 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'
> >gmake[1]: *** [qemu-system-i386] Error 1
> >gmake: *** [subdir-i386-softmmu] Error 2

Does follwing fix it?

diff --git a/cache-utils.c b/cache-utils.c
index 2db5af2..362c98e 100644
--- a/cache-utils.c
+++ b/cache-utils.c
@@ -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>

-- 
mailto:av1474@comtv.ru

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 12:52 [Qemu-devel] Help - `flush_icache_range' MacPPC Maurizio Caloro
  2012-02-07 18:03 ` malc
@ 2012-02-07 20:01 ` Alexander Graf
  2012-02-07 21:12   ` malc
  1 sibling, 1 reply; 16+ messages in thread
From: Alexander Graf @ 2012-02-07 20:01 UTC (permalink / raw)
  To: Maurizio Caloro; +Cc: qemu-devel


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.


Alex

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 20:01 ` Alexander Graf
@ 2012-02-07 21:12   ` malc
  2012-02-07 22:05     ` Alexander Graf
  0 siblings, 1 reply; 16+ messages in thread
From: malc @ 2012-02-07 21:12 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Maurizio Caloro, qemu-devel

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)

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 21:12   ` malc
@ 2012-02-07 22:05     ` Alexander Graf
  2012-02-07 22:12       ` malc
  0 siblings, 1 reply; 16+ messages in thread
From: Alexander Graf @ 2012-02-07 22:05 UTC (permalink / raw)
  To: malc; +Cc: Maurizio Caloro, qemu-devel


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.


Alex

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 22:05     ` Alexander Graf
@ 2012-02-07 22:12       ` malc
  2012-02-07 22:22         ` Alexander Graf
  2012-02-07 22:29         ` Brad Smith
  0 siblings, 2 replies; 16+ messages in thread
From: malc @ 2012-02-07 22:12 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Maurizio Caloro, qemu-devel

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

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 22:12       ` malc
@ 2012-02-07 22:22         ` Alexander Graf
  2012-02-07 22:29         ` Brad Smith
  1 sibling, 0 replies; 16+ messages in thread
From: Alexander Graf @ 2012-02-07 22:22 UTC (permalink / raw)
  To: malc; +Cc: Christoph Egger, Maurizio Caloro, qemu-devel Developers


On 07.02.2012, at 23:12, 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..

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


Alex

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 22:12       ` malc
  2012-02-07 22:22         ` Alexander Graf
@ 2012-02-07 22:29         ` Brad Smith
  2012-02-07 22:33           ` Alexander Graf
                             ` (2 more replies)
  1 sibling, 3 replies; 16+ messages in thread
From: Brad Smith @ 2012-02-07 22:29 UTC (permalink / raw)
  To: malc; +Cc: Maurizio Caloro, Alexander Graf, qemu-devel

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.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 22:29         ` Brad Smith
@ 2012-02-07 22:33           ` Alexander Graf
  2012-02-07 22:56           ` Alexander Graf
  2012-02-07 22:57           ` Alexander Graf
  2 siblings, 0 replies; 16+ messages in thread
From: Alexander Graf @ 2012-02-07 22:33 UTC (permalink / raw)
  To: Brad Smith; +Cc: Maurizio Caloro, malc, qemu-devel


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.

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

Alex

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 22:29         ` Brad Smith
  2012-02-07 22:33           ` Alexander Graf
@ 2012-02-07 22:56           ` Alexander Graf
  2012-02-07 22:57           ` Alexander Graf
  2 siblings, 0 replies; 16+ messages in thread
From: Alexander Graf @ 2012-02-07 22:56 UTC (permalink / raw)
  To: Brad Smith; +Cc: Maurizio Caloro, malc, qemu-devel


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;

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 22:29         ` Brad Smith
  2012-02-07 22:33           ` Alexander Graf
  2012-02-07 22:56           ` Alexander Graf
@ 2012-02-07 22:57           ` Alexander Graf
  2012-02-07 23:57             ` Maurizio Caloro
  2012-02-08 23:29             ` Scott Wood
  2 siblings, 2 replies; 16+ messages in thread
From: Alexander Graf @ 2012-02-07 22:57 UTC (permalink / raw)
  To: Brad Smith; +Cc: Maurizio Caloro, malc, qemu-devel


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.

Eh, this patch:

diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
index f5d9bf3..f9793e6 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+=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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 22:57           ` Alexander Graf
@ 2012-02-07 23:57             ` Maurizio Caloro
  2012-02-08 23:29             ` Scott Wood
  1 sibling, 0 replies; 16+ messages in thread
From: Maurizio Caloro @ 2012-02-07 23:57 UTC (permalink / raw)
  To: Alexander Graf; +Cc: malc, qemu-devel, Brad Smith

Am 07.02.2012 23:57, schrieb Alexander Graf:
> 
> 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.
> 
> Eh, this patch:
> 
> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
> index f5d9bf3..f9793e6 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+=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
> 
> 
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:-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-07 22:57           ` Alexander Graf
  2012-02-07 23:57             ` Maurizio Caloro
@ 2012-02-08 23:29             ` Scott Wood
  2012-02-08 23:42               ` Alexander Graf
  1 sibling, 1 reply; 16+ messages in thread
From: Scott Wood @ 2012-02-08 23:29 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Maurizio Caloro, qemu-devel, Brad Smith

On 02/07/2012 04:57 PM, Alexander Graf wrote:
> 
> 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.
> 
> Eh, this patch:
> 
> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
> index f5d9bf3..f9793e6 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+=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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-08 23:29             ` Scott Wood
@ 2012-02-08 23:42               ` Alexander Graf
  2012-02-08 23:54                 ` Scott Wood
  0 siblings, 1 reply; 16+ messages in thread
From: Alexander Graf @ 2012-02-08 23:42 UTC (permalink / raw)
  To: Scott Wood; +Cc: Maurizio Caloro, qemu-devel, Brad Smith


On 09.02.2012, at 00:29, Scott Wood wrote:

> On 02/07/2012 04:57 PM, Alexander Graf wrote:
>> 
>> 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.
>> 
>> Eh, this patch:
>> 
>> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
>> index f5d9bf3..f9793e6 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+=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.

> 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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-08 23:42               ` Alexander Graf
@ 2012-02-08 23:54                 ` Scott Wood
  2012-02-08 23:58                   ` Alexander Graf
  0 siblings, 1 reply; 16+ messages in thread
From: Scott Wood @ 2012-02-08 23:54 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Maurizio Caloro, qemu-devel, Brad Smith

On 02/08/2012 05:42 PM, Alexander Graf wrote:
> 
> On 09.02.2012, at 00:29, Scott Wood wrote:
> 
>> On 02/07/2012 04:57 PM, Alexander Graf wrote:
>>> Eh, this patch:
>>>
>>> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
>>> index f5d9bf3..f9793e6 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+=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.

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

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] Help - `flush_icache_range' MacPPC
  2012-02-08 23:54                 ` Scott Wood
@ 2012-02-08 23:58                   ` Alexander Graf
  0 siblings, 0 replies; 16+ messages in thread
From: Alexander Graf @ 2012-02-08 23:58 UTC (permalink / raw)
  To: Scott Wood; +Cc: Maurizio Caloro, qemu-devel, Brad Smith


On 09.02.2012, at 00:54, Scott Wood wrote:

> On 02/08/2012 05:42 PM, Alexander Graf wrote:
>> 
>> On 09.02.2012, at 00:29, Scott Wood wrote:
>> 
>>> On 02/07/2012 04:57 PM, Alexander Graf wrote:
>>>> Eh, this patch:
>>>> 
>>>> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
>>>> index f5d9bf3..f9793e6 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+=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.
> 
> 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 ;).

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

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-02-08 23:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-07 12:52 [Qemu-devel] Help - `flush_icache_range' MacPPC Maurizio Caloro
2012-02-07 18:03 ` malc
2012-02-07 20:01 ` Alexander Graf
2012-02-07 21:12   ` malc
2012-02-07 22:05     ` Alexander Graf
2012-02-07 22:12       ` malc
2012-02-07 22:22         ` Alexander Graf
2012-02-07 22:29         ` Brad Smith
2012-02-07 22:33           ` Alexander Graf
2012-02-07 22:56           ` Alexander Graf
2012-02-07 22:57           ` Alexander Graf
2012-02-07 23:57             ` Maurizio Caloro
2012-02-08 23:29             ` Scott Wood
2012-02-08 23:42               ` Alexander Graf
2012-02-08 23:54                 ` Scott Wood
2012-02-08 23:58                   ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.