[PATCH] RISC-V: Resurrect the MMIO timer implementation for M-mode systems

Damien Le Moal Damien.LeMoal at wdc.com
Tue Oct 27 00:25:58 EDT 2020


On 2020/10/27 13:12, Atish Patra wrote:
> On Tue, Sep 15, 2020 at 12:02 AM Damien Le Moal <Damien.LeMoal at wdc.com> wrote:
>>
>> On 2020/09/15 15:51, hch at infradead.org wrote:
>>> On Tue, Sep 15, 2020 at 06:50:24AM +0000, Damien Le Moal wrote:
>>>> On 2020/09/15 14:47, Christoph Hellwig wrote:
>>>>> I won't have time to set up the K210, but this fixes the timer issues
>>>>> on older Qemu versions that don't implement the time CSR.  Although I
>>>>> also need to revert the binfmt_flat patch to actually get to userspace.
>>>>
>>>> So revert is needed ? Digging in the flatbin format, I do not see why the offset
>>>> you removed would be needed, and it does not seem to affect other arch anyway.
>>>> So I am really suspecting a problem with riscv uclibcb or elf2flt, but can't
>>>> quite yet figure out what may be wrong there.
>>>
>>> I did not have time to find out if what we did in RISC-V nommu was
>>> correct or wrong.  But to get my existing userspace to work I had to
>>> revert the revert.  I'll try to find some time to dig into the binfmt
>>> flat issue and elf2flt soon.
>>
>> OK. Thanks. I will keep digging too when I have time.
>>
> 
> Is there a solution to this ? As Christoph pointed out, we need to
> revert the revert to get into user space for nommu kernel (v5.9 or
> v5.10-rc1).
> This commit was introduced between 5.9-rc2 & 5.9-rc3.

And it was back-ported to 5.8.5 and above too.

> 
> The concerned commit here is:
> 2217b982624680d19a80ebb4600d05c8586c4f96: binfmt_flat: revert
> "binfmt_flat: don't offset the data start"

Nope, I do not have any solution yet. Inspecting in more details the riscv
elf2flt code and uclibc is needed I think to understand what is going on. Not
clear at this moment what the root cause of the problem is. I have been busy
finishing the Kendryte board support (SD card, I2C, GPIO, clocks, resets,
pinctrl). Now that this is mostly done, fixing this flatbin user space problem
is mandatory. Help welcome on this.


-- 
Damien Le Moal
Western Digital Research



More information about the linux-riscv mailing list