Re: [PATCH v5 10/21] KVM: s390: pci: add basic kvm_zdev structure

From: Matthew Rosato
Date: Tue Apr 05 2022 - 20:41:06 EST


On 4/5/22 4:20 AM, Niklas Schnelle wrote:
On Mon, 2022-04-04 at 13:43 -0400, Matthew Rosato wrote:
This structure will be used to carry kvm passthrough information related to
zPCI devices.

Signed-off-by: Matthew Rosato <mjrosato@xxxxxxxxxxxxx>
---
arch/s390/include/asm/pci.h | 3 +++
arch/s390/kvm/Makefile | 1 +
arch/s390/kvm/pci.c | 38 +++++++++++++++++++++++++++++++++++++
arch/s390/kvm/pci.h | 21 ++++++++++++++++++++
4 files changed, 63 insertions(+)
create mode 100644 arch/s390/kvm/pci.c
create mode 100644 arch/s390/kvm/pci.h

diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
index 4c5b8fbc2079..9eb20cebaa18 100644
--- a/arch/s390/include/asm/pci.h
+++ b/arch/s390/include/asm/pci.h
@@ -97,6 +97,7 @@ struct zpci_bar_struct {
};
struct s390_domain;
+struct kvm_zdev;
#define ZPCI_FUNCTIONS_PER_BUS 256
struct zpci_bus {
@@ -190,6 +191,8 @@ struct zpci_dev {
struct dentry *debugfs_dev;
struct s390_domain *s390_domain; /* s390 IOMMU domain data */
+
+ struct kvm_zdev *kzdev; /* passthrough data */
};

The struct zpci_dev tries to use semantic groups in its formatting.
It's not perfect and we probably need to clean this up to remove some
holes in the future. For now let's put the new kzdev without a blank
line together with s390_domain and add a "section comment" like
"IOMMU and passthrough".
Also I'd drop the "... data" part of the line end comment or even drop
it entirely, the name is pretty clear already when combined with the
section comment.

Sure, will do


With that Reviewed-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx>


Thanks!