[Top][All Lists]

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

[Qemu-commits] [qemu/qemu] aef92d: pseries: fix kvmppc_set_fwnmi()

From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] aef92d: pseries: fix kvmppc_set_fwnmi()
Date: Mon, 27 Jul 2020 02:30:30 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: aef92d87c59d257c0ff24ba1dc82506a03f1f522
  Author: Laurent Vivier <lvivier@redhat.com>
  Date:   2020-07-27 (Mon, 27 Jul 2020)

  Changed paths:
    M hw/ppc/spapr_rtas.c
    M target/ppc/kvm.c
    M target/ppc/kvm_ppc.h

  Log Message:
  pseries: fix kvmppc_set_fwnmi()

QEMU issues the ioctl(KVM_CAP_PPC_FWNMI) on the first vCPU.

If the first vCPU is currently running, the vCPU mutex is held
and the ioctl() cannot be done and waits until the mutex is released.
This never happens and the VM is stuck.

To avoid this deadlock, issue the ioctl on the same vCPU doing the
RTAS call.

The problem can be reproduced by booting a guest with several vCPUs
(the probability to have the problem is (n - 1) / n,  n = # of CPUs),
and then by triggering a kernel crash with "echo c >/proc/sysrq-trigger".

On the reboot, the kernel hangs after:

[    0.000000] -----------------------------------------------------
[    0.000000] ppc64_pft_size    = 0x0
[    0.000000] phys_mem_size     = 0x48000000
[    0.000000] dcache_bsize      = 0x80
[    0.000000] icache_bsize      = 0x80
[    0.000000] cpu_features      = 0x0001c06f8f4f91a7
[    0.000000]   possible        = 0x0003fbffcf5fb1a7
[    0.000000]   always          = 0x00000003800081a1
[    0.000000] cpu_user_features = 0xdc0065c2 0xaee00000
[    0.000000] mmu_features      = 0x3c006041
[    0.000000] firmware_features = 0x00000085455a445f
[    0.000000] physical_start    = 0x8000000
[    0.000000] -----------------------------------------------------
[    0.000000] numa:   NODE_DATA [mem 0x47f33c80-0x47f3ffff]

Fixes: ec010c00665b ("ppc/spapr: KVM FWNMI should not be enabled until guest 
requests it")
Cc: npiggin@gmail.com
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20200724083533.281700-1-lvivier@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

  Commit: 4215d3413272ad6d1c6c9d0234450b602e46a74c
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-07-27 (Mon, 27 Jul 2020)

  Changed paths:
    M hw/ppc/spapr_rtas.c
    M target/ppc/kvm.c
    M target/ppc/kvm_ppc.h

  Log Message:
  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200727' into 

ppc patch queue 2020-07-27

Only one patch in this batch, but it fixes a fairly important
regression, so we want it in qemu-5.1

# gpg: Signature made Mon 27 Jul 2020 06:51:57 BST
# gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" 
# gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" 
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-5.1-20200727:
  pseries: fix kvmppc_set_fwnmi()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Compare: https://github.com/qemu/qemu/compare/194f8ca82585...4215d3413272

reply via email to

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