Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08fab50d authored by Fei Li's avatar Fei Li Committed by Christian Borntraeger
Browse files

KVM: s390: interface for suppressible I/O adapters



In order to properly implement adapter-interruption suppression, we
need a way for userspace to specify which adapters are subject to
suppression. Let's convert the existing (and unused) 'pad' field into
a 'flags' field and define a flag value for suppressible adapters.

Besides, add documentation for the interface.

Signed-off-by: default avatarFei Li <sherrylf@linux.vnet.ibm.com>
Reviewed-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 4e0b1ab7
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -64,12 +64,18 @@ struct kvm_s390_io_adapter {
	__u8 isc;
	__u8 maskable;
	__u8 swap;
	__u8 pad;
	__u8 flags;
};

   id contains the unique id for the adapter, isc the I/O interruption subclass
   to use, maskable whether this adapter may be masked (interrupts turned off)
   and swap whether the indicators need to be byte swapped.
   to use, maskable whether this adapter may be masked (interrupts turned off),
   swap whether the indicators need to be byte swapped, and flags contains
   further characteristics of the adapter.
   Currently defined values for 'flags' are:
   - KVM_S390_ADAPTER_SUPPRESSIBLE: adapter is subject to AIS
     (adapter-interrupt-suppression) facility. This flag only has an effect if
     the AIS capability is enabled.
   Unknown flag values are ignored.


  KVM_DEV_FLIC_ADAPTER_MODIFY
+1 −0
Original line number Diff line number Diff line
@@ -621,6 +621,7 @@ struct s390_io_adapter {
	bool maskable;
	bool masked;
	bool swap;
	bool suppressible;
	struct rw_semaphore maps_lock;
	struct list_head maps;
	atomic_t nr_maps;
+3 −1
Original line number Diff line number Diff line
@@ -41,9 +41,11 @@ struct kvm_s390_io_adapter {
	__u8 isc;
	__u8 maskable;
	__u8 swap;
	__u8 pad;
	__u8 flags;
};

#define KVM_S390_ADAPTER_SUPPRESSIBLE 0x01

#define KVM_S390_IO_ADAPTER_MASK 1
#define KVM_S390_IO_ADAPTER_MAP 2
#define KVM_S390_IO_ADAPTER_UNMAP 3
+2 −0
Original line number Diff line number Diff line
@@ -1997,6 +1997,8 @@ static int register_io_adapter(struct kvm_device *dev,
	adapter->maskable = adapter_info.maskable;
	adapter->masked = false;
	adapter->swap = adapter_info.swap;
	adapter->suppressible = (adapter_info.flags) &
				KVM_S390_ADAPTER_SUPPRESSIBLE;
	dev->kvm->arch.adapters[adapter->id] = adapter;

	return 0;