qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* How to synchronize CPUs on MMIO read?
@ 2023-08-16 16:31 Igor Lesik
  2023-08-16 18:16 ` Alex Bennée
  2023-08-17 21:51 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Igor Lesik @ 2023-08-16 16:31 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

Hi.
I need to model some custom HW that synchronizes CPUs when they read MMIO register N: MMIO read does not return until another CPU writes to MMIO register M. I modeled this behavior with a) on MMIO read of N, save CPU into a list of waiting CPUs and put it asleep with cpu_interrupt(current_cpu, CPU_INTERRUPT_HALT) and b) on MMIO write to M, wake all waiting CPUs with cpu->halted = 0; qemu_cpu_kick(cpu). It seems to work fine. However, this HW has a twist: MMIO read of N returns a value that was written by MMIO write to M. Can anyone please advise how this could be done?

Thanks!
Igor

[-- Attachment #2: Type: text/html, Size: 2235 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-17 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-16 16:31 How to synchronize CPUs on MMIO read? Igor Lesik
2023-08-16 18:16 ` Alex Bennée
2023-08-17 21:51 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).