From: Palmer Dabbelt <palmer@sifive.com>
To: andrew.burgess@embecosm.com
Cc: Jim Wilson <jimw@sifive.com>,
jhb@freebsd.org, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/4] Fall back to a default value of 0 for the MISA register.
Date: Fri, 28 Sep 2018 18:25:00 -0000 [thread overview]
Message-ID: <mhng-9b47017d-37c0-4a94-b6d9-07040f46e477@palmer-si-x1c4> (raw)
In-Reply-To: <20180928094355.GS5952@embecosm.com>
On Fri, 28 Sep 2018 02:43:55 PDT (-0700), andrew.burgess@embecosm.com wrote:
> * Jim Wilson <jimw@sifive.com> [2018-09-21 10:25:47 -0700]:
>
>> On Fri, Sep 21, 2018 at 2:27 AM Andrew Burgess
>> <andrew.burgess@embecosm.com> wrote:
>> > Jim: Given that we agree that targets should definitely provide a
>> > value for misa, at a minimum just returning the constant 0. But,
>> > given that GDB already defaults to 0 in some cases anyway. And the
>> > spec is quite clear that 0 is the right default value in the absence
>> > of anything better, would you be OK with a patch that does return a
>> > default of 0?
>>
>> The patch to decode an instruction to decide whether to use a
>> compressed breakpoint or not solves my main problem. There is also
>> the issue of finding FP register size, but since we only support
>> rv64gc at the moment, it isn't a serious problem.
>
> I regularly test embeded RiscV against:
>
> rv32im rv32imc rv32imf rv32imfc
>
> rv64im rv64imc rv64imfd rv64imfdc
>
> with the last one of those being closes to rv64gc. The pass rate is
> broadly the same against all of these targets, so right now I consider
> these equally supported for baremetal.
For those uniniated in RISC-V, "rv64gc" is the same as "rv64imafdc" (the G is
short for IMAFD). Importantly it's probably close enough for embedded GDB
testing, as all you're missing is the A extension and GDB doesn't really care
about atomics.
> I understand Linux support might be different.
Right now all that's really supported in Linux land is rv64gc. The kernel
should also build on rv64imac, rv32gc, and rv32imac but they're much less
mature. The upstream glibc port supports rv64gc and rv64imac, but we test
those only on rv64gc kernels.
We try our best to avoid breaking the other targets, but until we get some
better CI up and running I'd expect that non-rv64gc targets do keep falling
apart. We're working on it :)
On Linux you should be able to look at the HWCAP in the auxvec, which is meant
to tell you what user state is available. The code to fill this out is here
https://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux.git/tree/arch/riscv/kernel/cpufeature.c#n26
>
> Thanks,
>
> Andrew
>
>
>> Also, I think the
>> linker kernel may already be passing FP info via auxvec/hwcap, so I
>> think we already have an alternate solution for that which just needs
>> to be implemented. I haven't looked at that yet. So yes, I think it
>> is OK to start defaulting misa to 0.
>>
>> FYI I have a qemu patch, which I may someday finish, that adds XML
>> register support to the RISC-V qemu system-mode port, which allows
>> qemu to provide a correct value of misa. We know that misa accesses
>> already work with embedded targets via OpenOCD. So it is just linux
>> and freebsd that need to worry about misa.
>>
>> The qemu patch is here, though it looks like github is confused by
>> rebasing and the patch isn't readable anymore.
>> https://github.com/riscv/riscv-qemu/pull/160
>> I'll have to figure out how to fix that.
>>
>> Jim
next prev parent reply other threads:[~2018-09-28 18:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-19 23:20 [PATCH 0/4] Initial support for FreeBSD/riscv John Baldwin
2018-09-19 23:21 ` [PATCH 2/4] Fall back to a default value of 0 for the MISA register John Baldwin
2018-09-20 0:09 ` Jim Wilson
2018-09-20 0:40 ` John Baldwin
2018-09-20 20:31 ` John Baldwin
2018-09-20 20:57 ` Jim Wilson
2018-09-20 22:55 ` John Baldwin
2018-09-20 21:51 ` Andrew Burgess
2018-09-20 23:01 ` John Baldwin
2018-09-21 9:27 ` Andrew Burgess
2018-09-21 17:26 ` Jim Wilson
2018-09-28 9:44 ` Andrew Burgess
2018-09-28 18:25 ` Palmer Dabbelt [this message]
2018-09-24 20:35 ` John Baldwin
2018-09-19 23:21 ` [PATCH 3/4] Add FreeBSD/riscv architecture John Baldwin
2018-09-19 23:21 ` [PATCH 1/4] Add helper functions to trad_frame to support register cache maps John Baldwin
2018-09-19 23:29 ` [PATCH 4/4] Add native target for FreeBSD/riscv John Baldwin
2018-09-20 4:19 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mhng-9b47017d-37c0-4a94-b6d9-07040f46e477@palmer-si-x1c4 \
--to=palmer@sifive.com \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=jhb@freebsd.org \
--cc=jimw@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox