Pre-amption in RISC-V PLIC

41 views
Skip to first unread message

Ahsan Ali

unread,
Feb 26, 2023, 2:11:54 AM2/26/23
to RISC-V ISA Dev
Hi All,

Do RISC-V Architecture support Pre-amption? 

Pre-amptiom is: [Low priority interrupt (LPI) is being serviced and a new high priority interrupt (HPI) came, should the execution of LPI be paused and execution of HPI starts?]

Please guide according to single core as well as multi-core concept.

Thanks and Regards,
Ahsan

Tommy Murphy

unread,
Feb 26, 2023, 4:41:03 AM2/26/23
to Ahsan Ali, RISC-V ISA Dev
I presume that you actually mean "pre-Emption"?

You should probably have a look at the work in progress CLIC specification.


And maybe also look up the PLIC and CLINT interrupt mechanisms that are deployed in some existing RISC-V implementions.

Allen Baum

unread,
Feb 27, 2023, 2:58:16 AM2/27/23
to Tommy Murphy, Ahsan Ali, RISC-V ISA Dev
The current CLINT cannot do that without a bit of state saving at the beginning of the low priority interrupt handler, 
and restoration at the end, with no interrupts being allowed while that state save/restore takes place.
(there is some nuance here, depending on which privilege level is service the LPI and HPI. If HPI is serviced by Mmode and LPI by Smode,
 then you don't need to do the save/restore)
OTherwise you can tolerate that amount of latency, you could argue that it can preempt, but I suspect that's not what you have in mind.
The new CLIC spec should enable what you are looking for.

--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/LO0P265MB68660C27D793561A84880E11F9AE9%40LO0P265MB6866.GBRP265.PROD.OUTLOOK.COM.

Ahsan Ali

unread,
Feb 27, 2023, 4:29:17 AM2/27/23
to Allen Baum, RISC-V ISA Dev, Tommy Murphy
Can we have support of that in our PLIC if we want to do at our own? Although it is against RISCV architecture.

Palmer Dabbelt

unread,
Feb 28, 2023, 12:54:44 PM2/28/23
to 2019...@gmail.com, allen...@esperantotech.com, isa...@groups.riscv.org, tommy_...@hotmail.com
On Mon, 27 Feb 2023 01:29:03 PST (-0800), 2019...@gmail.com wrote:
> Can we have support of that in our PLIC if we want to do at our own?
> Although it is against RISCV architecture.

Generally in RISC-V land you can do whatever you want, the question is
just whether software is going to support it. That really depends on
the project, but at least for stuff like Linux and GCC there's a pretty
strong precedent that we support whatever's in the hardware. It'd
really depend on what things look like, but we have some way uglier
stuff that's supported so my guess is it'd be viable. It'd still be a
headache for everyone, though.

We'd really need to see the hardware/spec/code to know for sure, though.
>>> <https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/LO0P265MB68660C27D793561A84880E11F9AE9%40LO0P265MB6866.GBRP265.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
> To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAEYwkxS9QPiDeHULe5%2BzfB8vpkq%3DvA27pnc1kzKC5p%2BTwcdiyw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages