[Qemu-devel] [PATCH v5 0/2] Guest Support for DIAGNOSE 0x318

Collin Walling posted 2 patches 4 years, 10 months ago
Test docker-clang@ubuntu passed
Test s390x passed
Test asan passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1561475829-19202-1-git-send-email-walling@linux.ibm.com
Maintainers: Richard Henderson <rth@twiddle.net>, Paolo Bonzini <pbonzini@redhat.com>, Cornelia Huck <cohuck@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>
hw/s390x/Makefile.objs          |  1 +
hw/s390x/diag318.c              | 80 +++++++++++++++++++++++++++++++++++++++++
hw/s390x/diag318.h              | 38 ++++++++++++++++++++
hw/s390x/s390-virtio-ccw.c      | 17 +++++++++
hw/s390x/sclp.c                 |  3 ++
include/hw/s390x/sclp.h         |  2 ++
linux-headers/asm-s390/kvm.h    |  4 +++
target/s390x/cpu.h              |  8 ++++-
target/s390x/cpu_features.c     |  3 ++
target/s390x/cpu_features.h     |  1 +
target/s390x/cpu_features_def.h |  3 ++
target/s390x/gen-features.c     |  1 +
target/s390x/kvm-stub.c         | 10 ++++++
target/s390x/kvm.c              | 29 +++++++++++++++
target/s390x/kvm_s390x.h        |  2 ++
15 files changed, 201 insertions(+), 1 deletion(-)
create mode 100644 hw/s390x/diag318.c
create mode 100644 hw/s390x/diag318.h
[Qemu-devel] [PATCH v5 0/2] Guest Support for DIAGNOSE 0x318
Posted by Collin Walling 4 years, 10 months ago
Changelog:

    v5
        - split off header updates in kvm_s390x.h to a separate patch
        - implemented CPU model feature for this insn made available with
            zEC12-full and later models
        - s/cpc/diag318_info in order to make the relevant data more clear
        - reduced S390_MAX_CPUS from 248 to 247

The DIAGNOSE 0x318 instruction is a privileged instruction that is executed by the
linux kernel once and only once during setup. This requires interception by KVM to 
handle the instruction call safely. The instruction assists with determining the 
environment the VM is running in -- this is better described in the KVM patches.

The analogous KVM patches still under review can be found here:
https://marc.info/?l=linux-s390&m=156147521528818&w=2

Guest support for the diag 318 instruction is accomplished by implementing a device 
class, a cpu model feature, and adjusting the Read Info struct. The Read Info struct
adjustment coincidentally reduces the maximum number of VCPUs we can have by one.

A device class is used for this instruction in order to streamline the migration and 
reset of the DIAG 318 related data.

A CPU model feature is added for this instruction, appropriately named diag318.

The instruction is determined by a Read Info byte 134 bit 0. This is a new byte that
expands into the space of the Read Info SCCB that is also used to contain CPU entry
data. Due to this expansion, we lose space for one CPU entry and we must reduce the
maximum possible CPUs from 248 to 247. Hopefully this drawback does not affect many 
VMs.

Collin Walling (2):
  s390/kvm: header sync for diag318
  s390: diagnose 318 info reset and migration support

 hw/s390x/Makefile.objs          |  1 +
 hw/s390x/diag318.c              | 80 +++++++++++++++++++++++++++++++++++++++++
 hw/s390x/diag318.h              | 38 ++++++++++++++++++++
 hw/s390x/s390-virtio-ccw.c      | 17 +++++++++
 hw/s390x/sclp.c                 |  3 ++
 include/hw/s390x/sclp.h         |  2 ++
 linux-headers/asm-s390/kvm.h    |  4 +++
 target/s390x/cpu.h              |  8 ++++-
 target/s390x/cpu_features.c     |  3 ++
 target/s390x/cpu_features.h     |  1 +
 target/s390x/cpu_features_def.h |  3 ++
 target/s390x/gen-features.c     |  1 +
 target/s390x/kvm-stub.c         | 10 ++++++
 target/s390x/kvm.c              | 29 +++++++++++++++
 target/s390x/kvm_s390x.h        |  2 ++
 15 files changed, 201 insertions(+), 1 deletion(-)
 create mode 100644 hw/s390x/diag318.c
 create mode 100644 hw/s390x/diag318.h

-- 
2.7.4


Re: [Qemu-devel] [PATCH v5 0/2] Guest Support for DIAGNOSE 0x318
Posted by no-reply@patchew.org 4 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/1561475829-19202-1-git-send-email-walling@linux.ibm.com/



Hi,

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

Subject: [Qemu-devel] [PATCH v5 0/2] Guest Support for DIAGNOSE 0x318
Type: series
Message-id: 1561475829-19202-1-git-send-email-walling@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 ===

From https://github.com/patchew-project/qemu
 * [new tag]         patchew/1561475829-19202-1-git-send-email-walling@linux.ibm.com -> patchew/1561475829-19202-1-git-send-email-walling@linux.ibm.com
Switched to a new branch 'test'
2cd6021 s390: diagnose 318 info reset and migration support
f01785b s390/kvm: header sync for diag318

=== OUTPUT BEGIN ===
1/2 Checking commit f01785b90310 (s390/kvm: header sync for diag318)
2/2 Checking commit 2cd6021b6d2a (s390: diagnose 318 info reset and migration support)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#37: 
new file mode 100644

ERROR: adding a line without newline at end of file
#165: FILE: hw/s390x/diag318.h:38:
+#endif /* HW_DIAG318_H */

ERROR: line over 90 characters
#285: FILE: target/s390x/cpu_features.c:131:
+    FEAT_INIT("diag318", S390_FEAT_TYPE_SCLP_BYTE_134, 0, "Control program name and version codes"),

total: 2 errors, 1 warnings, 300 lines checked

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

=== OUTPUT END ===

Test command exited with code: 1


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