qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 044897: target/ppc: Fix system lockups caused


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 044897: target/ppc: Fix system lockups caused by interrupt...
Date: Tue, 05 Dec 2017 03:12:00 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 044897ef4a22af89aecb8df509477beba0a2e0ce
      
https://github.com/qemu/qemu/commit/044897ef4a22af89aecb8df509477beba0a2e0ce
  Author: Richard Purdie <address@hidden>
  Date:   2017-12-05 (Tue, 05 Dec 2017)

  Changed paths:
    M target/ppc/excp_helper.c
    M target/ppc/helper_regs.h

  Log Message:
  -----------
  target/ppc: Fix system lockups caused by interrupt_request state corruption

Occasionally in Linux guests on x86_64 we're seeing logs like:

ppc_set_irq: 0x55b4e0d562f0 n_IRQ 8 level 1 => pending 00000100req 00000004

when they should read:

ppc_set_irq: 0x55b4e0d562f0 n_IRQ 8 level 1 => pending 00000100req 00000002

The "00000004" is CPU_INTERRUPT_EXITTB yet the code calls
cpu_interrupt(cs, CPU_INTERRUPT_HARD) ("00000002") in this function
just before the log message. Something is causing the HARD bit setting
to get lost.

The knock on effect of losing that bit is the decrementer timer interrupts
don't get delivered which causes the guest to sit idle in its idle handler
and 'hang'.

The issue occurs due to races from code which sets CPU_INTERRUPT_EXITTB.

Rather than poking directly into cs->interrupt_request, that code needs to:

a) hold BQL
b) use the cpu_interrupt() helper

This patch fixes the call sites to do this, fixing the hang. The calls
are made from a variety of contexts so a helper function is added to handle
the necessary locking. This can likely be improved and optimised in the future
but it ensures the code is correct and doesn't lockup as it stands today.

Signed-off-by: Richard Purdie <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 88f714aa5a9a08bb029024c4ebd3857e3b63b7db
      
https://github.com/qemu/qemu/commit/88f714aa5a9a08bb029024c4ebd3857e3b63b7db
  Author: Peter Maydell <address@hidden>
  Date:   2017-12-05 (Tue, 05 Dec 2017)

  Changed paths:
    M target/ppc/excp_helper.c
    M target/ppc/helper_regs.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.11-20171205' 
into staging

ppc patch queue 2017-12-05

Alas, this is yet another fix for ppc that I think it's worth
squeezing into 2.11.  It's a really ugly fix for some pretty ugly
code, but it does seem to address a real problem.  It's also a problem
that's appeared relatively recently, since it was either created by,
or made much easier to trigger by, by the merge of MTTCG.

# gpg: Signature made Tue 05 Dec 2017 05:24:04 GMT
# gpg:                using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <address@hidden>"
# gpg:                 aka "David Gibson (Red Hat) <address@hidden>"
# gpg:                 aka "David Gibson (ozlabs.org) <address@hidden>"
# gpg:                 aka "David Gibson (kernel.org) <address@hidden>"
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.11-20171205:
  target/ppc: Fix system lockups caused by interrupt_request state corruption

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/2a4c7e839101...88f714aa5a9a

reply via email to

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