Re: [Consult] cris: arch-v10: About $dtp0 register

From: Hans-Peter Nilsson
Date: Tue Jul 07 2015 - 08:05:37 EST


> From: Chen Gang <xili_gchen_5257@xxxxxxxxxxx>
> Date: Sun, 5 Jul 2015 00:30:48 +0200

> Hello Maintainers:
>
> I want to consult, whether arch-v10 supports $dtp0 register:

Use your favorite search engine for "Axis ETRAX 100 LX
programmers manual". I just did and got the good news that the
inteded PDF was the top item found. This document has all the
details you'll ever need for CRIS up to and including CRIS v10
(yes, that's the canonical spelling, not "CRISv10"). In chapter
"1.1 Registers", the special registers are listed. Neither DTP0
nor DTP1 are mentioned there. There is an appendix titled "The
ETRAX 4", listing details to a predecessor version. The DTP0
register is mentioned there in "7.2 Special Registers"; it's
special register P12.

To cut the story short for most, this is an ETRAX 4 register
connected to DMA logic, not supported by ETRAX 100 LX. If you
for some reason need to refer to the special register *as such*,
it can be accessed by the name P12, but the issue here is
actually with BAR, the breakpoint address register.

> - Kernel has already used it in arch/cris/arch-v10/kernel/kgdb.c.

If you also read the comment there, at both uses (assuming you
read the same as the downstream I read), it says "P12, register
BAR, assembler might not know BAR". It apparently alludes to
special register BAR not being accessible in the assembler at
that time (possibly by speculation rather than inspection; I
guess that's the case). So, IMHO a better question for your
intentions would have focused on the code in kgdb.c, not asking
about the DTP0 register as such.

If you change the $dtp0 to $bar or $p12, I believe you will get
the intended result. The "$bar" name has worked for at least 11
years, probably 15, with the -march=v10 option but likely also
without it. Cf. opcodes/cris-opc.c in the shared gdb and
binutils git for history. (Yes, the CVS history *was* carried
over at the git conversion.)

>
> - But upstream gas 2.25.51 can not recognize it for arch-v10, for the
> same kgdb.s file which contents $dtp0:
>
> "/upstream/release-cris/bin/cris-gchen-linux-as ./kgdb.s -o kgdb.o" will be ok.
> "/upstream/release-cris/bin/cris-gchen-linux-as --march=v10 ./kgdb.s -o kgdb.o" will cause "Error: Illegal operands".

I'm guessing "recent" changes (later than the last ten years ;-)
somehow added an -march=v10 directly or indirectly, such that
$dtp0 was no longer accepted (as it isn't "supported" for CRIS v10).

> For me, I guess, it is upstream toolchain's issue, but I have no the
> related ISA documentations (common ISA and v10 special ISA), so at
> present I can not be sure about it (related informations are welcomed).

It's a downstream use issue, which could be fixed without prior
knowledge using only web resources. More things are, than people
usually believe.

> And after this issue, excluding warnings, the cris next-20150702 can
> pass allmodconfig with the current latest upstream master branch
> toolchain. :-)
>
>
> Welcome any ideas, suggestions and completions.

As a collateral, can I have an "upstream" GIT (slug and) commit
id I can use to compile a CRIS v10 kernel, possibly modulo this
issue? I need to use the kernel as a test-case for a gcc issue.
I'll use Segher Boessenkool "buildall" kernelbuild scripts, but
I'm missing a compilable kernel commit-id. (No, I haven't
actually followed my own advice but by your email I'm guessing
CRIS v10 isn't currently compilable.)

>
> Thanks.
> --
> Chen Gang
>
> Open, share, and attitude like air, water, and life which God blessed
>

brgds, H-P
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/