qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Launchpad Bug Tracker <1850378@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Bug 1850378] Re: RISC-V unreliable IPIs
Date: Tue, 22 Jun 2021 04:18:38 -0000	[thread overview]
Message-ID: <162433551901.20423.11256606073448271554.malone@loganberry.canonical.com> (raw)
In-Reply-To: 157235518365.28116.9958641157871998206.malonedeb@chaenomeles.canonical.com

[Expired for QEMU because there has been no activity for 60 days.]

** Changed in: qemu
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1850378

Title:
  RISC-V unreliable IPIs

Status in QEMU:
  Expired

Bug description:
  I am working on a project with custom inter processor interrupts (IPIs) on the RISC-V virt machine.
  After upgrading from version 3.1.0 to 4.1.0 which fixes a related issue (https://github.com/riscv/riscv-qemu/issues/132) I am able to use the CPU hotplug feature.

  However, if I try to use IPIs for communication between two cores, the
  wfi instruction behaves strangely. Either it does not return, or it
  returns on timer interrupts, even though they are disabled. The code,
  I use on one core to wait for an interrupt is the following.

   csr_clear(sie, SIE_SEIE | SIE_STIE);
   do {
    wait_for_interrupt();
    sipval = csr_read(sip);
    sieval = csr_read(sie);
    scauseval = csr_read(scause) & 0xFF;
   /* only break if wfi returns for an software interrupt */
   } while ((sipval & sieval) == 0 && scauseval != 1);
   csr_set(sie, SIE_SEIE | SIE_STIE);

  Since the resulting sequence does not seem to be deterministic, my
  guess is, that it has something to do with the communication of qemu's
  threads for the different cores.

  Update:
  The exact same setup works fine in spike (the actual sim, not the qemu board), which might give a hint, that it is related to the interrupt controller implementation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1850378/+subscriptions


      parent reply	other threads:[~2021-06-22  4:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 13:19 [Bug 1850378] [NEW] RISC-V unreliable IPIs tm
2019-10-29 15:21 ` [Bug 1850378] " Palmer Dabbelt
2019-10-29 17:44 ` tm
2019-10-30  9:44 ` tm
2021-04-22  8:45 ` Thomas Huth
2021-06-22  4:18 ` Launchpad Bug Tracker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=162433551901.20423.11256606073448271554.malone@loganberry.canonical.com \
    --to=1850378@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).