This is the mail archive of the
mailing list for the GCC project.
clear_cache on Alpha architecture not implemented?
- From: Witold Baryluk <baryluk at smp dot if dot uj dot edu dot pl>
- To: Camm Maguire <camm at maguirefamily dot org>
- Cc: gcc at gcc dot gnu dot org, linux-alpha at vger dot kernel dot org, debian-alpha at lists dot debian dot org
- Date: Thu, 3 May 2012 19:25:09 +0200
- Subject: clear_cache on Alpha architecture not implemented?
- References: <firstname.lastname@example.org> <20120501154228.GI26837@smp.if.uj.edu.pl> <email@example.com> <20120501205443.GJ26837@smp.if.uj.edu.pl> <firstname.lastname@example.org> <20120502153115.GK26837@smp.if.uj.edu.pl> <email@example.com> <20120502194308.GL26837@smp.if.uj.edu.pl> <firstname.lastname@example.org>
On 05-03 09:19, Camm Maguire wrote:
> Greetings! The build succeeded, which, alas, means the failure at
> is again unreproducible, like the kfree_amd64 and ppc examples. Sigh.
> Are there known differences in the cpu cache clearing instructions
> between imago and your machine?
> In any case, can one upload by hand builds to debian-ports like one can
> into the official repository?
> Take care,
> Camm Maguire email@example.com
> "The earth is but one country, and mankind its citizens." -- Baha'u'llah
After lots of investigation, it looks that imb (I-cache memory barrier,
used for flushing instruction cache on single cpu), is not emited or
called when doing __builtin___clear_cache!
It shouldn't be hard to add, for example using (define_expand
"clear_cache" ... in gcc/config/alpha/alpha.md in gcc, or in libgcc/config/alpha/linux.h
as #define CLEAR_INSN_CACHE(beg, end) ...
Either of them should just emit, "call_pal 0x86". It is better than
"imb" because imb is not implemented in Tru64 assembler, and better than
"call_pal pal_imb", because pal_imb (which is equal 134), requires
Beyond that it would be naccassary to update kernel, to detect that user
code called imb, by checking if proper flag in HWPCB structure is set,
and call smp_imb() if naccassary on multi-processor system (probably
when rescheduling this process on different cpu) and clear hwpcb flag,
becuause imb invalidated Icache only on running cpu.
Build of axiom package successed on my machine probably by luck, and by
the fact it is single CPU machine with smaller cache than imago (and
older subarchitecture, thus probably less agressive caching).
What alpha maintainers thinks?