qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about edge-triggered interrupt


From: LIU Zhiwei
Subject: Re: Question about edge-triggered interrupt
Date: Fri, 12 Mar 2021 00:39:29 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0



On 2021/3/12 0:07, Peter Maydell wrote:
On Thu, 11 Mar 2021 at 16:01, LIU Zhiwei <zhiwei_liu@c-sky.com> wrote:
That's a case I can't understand.

1.  An device causes an edge-triggered interrupt A.
2.  The interrupt controller sample the interrupt A, and setting pending
bit for A.
3.  The interrupt controller select the interrupt  A to CPU and clean
the pending bit for A(according to the specification).
4.  CPU start to execute the A's service routine.
5.  Another device causes interrupt B.
6.  The interrupt controller sample the interrupt B, and setting pending
bit for B.
7.  As B's priority is lower than A, it can't preempt  A's service routine.
8.  A's service routine return.
9. No other interrupt comes after B.

After the sequence, B is pending in interrupt controller, and has no
chance to be selected by interrupt controller.
A's service routine will neither write interrupt controller's register
nor device's register.
I'm pretty sure that there is some interaction between the CPU and the
interrupt controller on a return-from-interrupt that you are
missing.
I have asked my CPU design workmates. They said, "you have to pull a pending interrupt at the interrupt return instruction".

But I don't want to do this way, because it influences the interrupt return instruction's behavior. The specification doesn't
point that explicitly. It's just our CPU implementation.

If I lock the iothread in interrupt return instruction helper function, and pull a pending interrupt. It really works, but I don't think
it will be appropriate for other CPU implementation.
There are several ways to do it in principle;
I am curious about the ways. If you like, a simple list please.
you need
a risc-v expert to answer your question more specifically.
Thanks for your advice.

Zhiwei

thanks
-- PMM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]