Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shouldn't clean vector pending before CPU really handle it #3

Open
rasoft opened this issue Feb 16, 2022 · 1 comment
Open

Shouldn't clean vector pending before CPU really handle it #3

rasoft opened this issue Feb 16, 2022 · 1 comment

Comments

@rasoft
Copy link

rasoft commented Feb 16, 2022

I see you clean pending status of edge vector in
riscv_clic_next_interrupt(void *opaque, int hartid)

it is not correctly! since before the edge vector is really handled, latter IRQ may come and override it, and the edge vector (such as tspend, systick) will not be handled forever.

I think you could clean them when cpu really handle it, for example in
if (enable) branch of bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request)

thx
alan

@romanheros
Copy link
Collaborator

Thanks, alan. I think you are right. I don't know why we didn't cover it.
Your adivce about how to fix it is also good. Another way may be register a bh function or event notifier for CLIC, which will make the work for CLIC de-couple with the target.

Do you have a test case? It will be very helpful.

Thanks again,
Zhiwei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants