[PATCH v15 0/7] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests

Ganesh Goudar posted 7 patches 1 week ago
Test asan passed
Test checkpatch failed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20191009091010.16467-1-ganeshgr@linux.ibm.com
Maintainers: Richard Henderson <rth@twiddle.net>, David Gibson <david@gibson.dropbear.id.au>, Paolo Bonzini <pbonzini@redhat.com>
cpus.c                   |   5 +
hw/ppc/spapr.c           |  51 ++++++++
hw/ppc/spapr_caps.c      |  34 +++++
hw/ppc/spapr_events.c    | 269 +++++++++++++++++++++++++++++++++++++++
hw/ppc/spapr_rtas.c      |  85 +++++++++++++
include/hw/ppc/spapr.h   |  25 +++-
include/qemu/main-loop.h |   8 ++
target/ppc/kvm.c         |  24 ++++
target/ppc/kvm_ppc.h     |   8 ++
target/ppc/trace-events  |   1 +
10 files changed, 508 insertions(+), 2 deletions(-)

[PATCH v15 0/7] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests

Posted by Ganesh Goudar 1 week ago
This patch set adds support for FWNMI in PowerKVM guests.

System errors such as SLB multihit and memory errors
that cannot be corrected by hardware is passed on to
the kernel for handling by raising machine check
exception (an NMI). Upon such machine check exceptions,
if the address in error belongs to guest then KVM
invokes guests' 0x200 interrupt vector if the guest
is not FWNMI capable. For FWNMI capable guest
KVM passes the control to QEMU by exiting the guest.

This patch series adds functionality to QEMU to pass
on such machine check exceptions to the FWNMI capable
guest kernel by building an error log and invoking
the guest registered machine check handling routine.

The KVM changes are now part of the upstream kernel
(commit e20bbd3d). This series contain QEMU changes.

Change Log v15:
  - Removed cap_ppc_fwnmi
  - Moved fwnmi registeration to .apply hook
  - Assume SLOF has allocated enough room for rtas error log
  - Using ARRAY_SIZE to end the loop
  - Do not set FWNMI cap in post_load, now its done in .apply hook

Change Log v14:
  - Feature activation moved to a separate patch
  - Fixed issues with migration blocker

Change Log v13:
  - Minor fixes (mostly nits)
  - Moved FWNMI guest registration check from patch 4 to 3.

Change Log v12:
  - Rebased to latest ppc-for-4.2 (SHA b1e8156743)

Change Log v11:
  - Moved FWNMI SPAPR cap defaults to 4.2 class option
  - Fixed issues with handling fwnmi KVM capability

Change Log v10:
  - Reshuffled the patch sequence + minor fixes

Change Log v9:
  - Fixed kvm cap and spapr cap issues

Change Log v8:
  - Added functionality to check FWNMI capability during
    VM migration

---

Aravinda Prasad (7):
  Wrapper function to wait on condition for the main loop mutex
  ppc: spapr: Introduce FWNMI capability
  target/ppc: Handle NMI guest exit
  target/ppc: Build rtas error log upon an MCE
  ppc: spapr: Handle "ibm,nmi-register" and "ibm,nmi-interlock" RTAS
    calls
  migration: Include migration support for machine check handling
  ppc: spapr: Activate the FWNMI functionality

 cpus.c                   |   5 +
 hw/ppc/spapr.c           |  51 ++++++++
 hw/ppc/spapr_caps.c      |  34 +++++
 hw/ppc/spapr_events.c    | 269 +++++++++++++++++++++++++++++++++++++++
 hw/ppc/spapr_rtas.c      |  85 +++++++++++++
 include/hw/ppc/spapr.h   |  25 +++-
 include/qemu/main-loop.h |   8 ++
 target/ppc/kvm.c         |  24 ++++
 target/ppc/kvm_ppc.h     |   8 ++
 target/ppc/trace-events  |   1 +
 10 files changed, 508 insertions(+), 2 deletions(-)

-- 
2.17.2


Re: [PATCH v15 0/7] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests

Posted by no-reply@patchew.org 1 week ago
Patchew URL: https://patchew.org/QEMU/20191009091010.16467-1-ganeshgr@linux.ibm.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH v15 0/7] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests
Type: series
Message-id: 20191009091010.16467-1-ganeshgr@linux.ibm.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
d37252c ppc: spapr: Activate the FWNMI functionality
c352637 migration: Include migration support for machine check handling
c1e0472 ppc: spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls
dafd3ab target/ppc: Build rtas error log upon an MCE
1de975f target/ppc: Handle NMI guest exit
c494871 ppc: spapr: Introduce FWNMI capability
bbd8d5f Wrapper function to wait on condition for the main loop mutex

=== OUTPUT BEGIN ===
1/7 Checking commit bbd8d5f4d77b (Wrapper function to wait on condition for the main loop mutex)
2/7 Checking commit c494871610b8 (ppc: spapr: Introduce FWNMI capability)
WARNING: line over 80 characters
#57: FILE: hw/ppc/spapr_caps.c:511:
+        warn_report("Firmware Assisted Non-Maskable Interrupts not supported in TCG");

total: 0 errors, 1 warnings, 97 lines checked

Patch 2/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/7 Checking commit 1de975f99e45 (target/ppc: Handle NMI guest exit)
4/7 Checking commit dafd3ab0fcdd (target/ppc: Build rtas error log upon an MCE)
ERROR: space required after that close brace '}'
#98: FILE: hw/ppc/spapr_events.c:282:
+  RTAS_LOG_INITIATOR_CPU, RTAS_LOG_SEVERITY_ERROR_SYNC, }};

ERROR: space required after that close brace '}'
#127: FILE: hw/ppc/spapr_events.c:311:
+  RTAS_LOG_INITIATOR_CPU, RTAS_LOG_SEVERITY_ERROR_SYNC, }};

total: 2 errors, 0 warnings, 304 lines checked

Patch 4/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

5/7 Checking commit c1e0472642b1 (ppc: spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls)
ERROR: code indent should never use tabs
#39: FILE: hw/ppc/spapr_caps.c:513:
+^Iif (!kvmppc_set_fwnmi()) {$

ERROR: code indent should never use tabs
#40: FILE: hw/ppc/spapr_caps.c:514:
+^I    /* Register ibm,nmi-register and ibm,nmi-interlock RTAS calls */$

ERROR: code indent should never use tabs
#41: FILE: hw/ppc/spapr_caps.c:515:
+^I    spapr_fwnmi_register();$

ERROR: code indent should never use tabs
#42: FILE: hw/ppc/spapr_caps.c:516:
+^I} else {$

ERROR: code indent should never use tabs
#43: FILE: hw/ppc/spapr_caps.c:517:
+^I    error_setg(errp,$

ERROR: code indent should never use tabs
#45: FILE: hw/ppc/spapr_caps.c:519:
+^I}$

total: 6 errors, 0 warnings, 101 lines checked

Patch 5/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

6/7 Checking commit c352637397ca (migration: Include migration support for machine check handling)
7/7 Checking commit d37252c76320 (ppc: spapr: Activate the FWNMI functionality)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20191009091010.16467-1-ganeshgr@linux.ibm.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com