summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci/pci_insn.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2017-10-30 14:38:58 +0100
committerHeiko Carstens <heiko.carstens@de.ibm.com>2017-11-08 09:47:39 +0100
commit48070c73058be6de9c0d754d441ed7092dfc8f12 (patch)
treec8496aa6e3177a1114fa3431f83e38ab6cb517f3 /arch/s390/pci/pci_insn.c
parent30e8eb867122183076b7994f9b83920f9ec5451b (diff)
downloadop-kernel-dev-48070c73058be6de9c0d754d441ed7092dfc8f12.zip
op-kernel-dev-48070c73058be6de9c0d754d441ed7092dfc8f12.tar.gz
s390/pci: do not require AIS facility
As of today QEMU does not provide the AIS facility to its guest. This prevents Linux guests from using PCI devices as the ais facility is checked during init. As this is just a performance optimization, we can move the ais check into the code where we need it (calling the SIC instruction). This is used at initialization and on interrupt. Both places do not require any serialization, so we can simply skip the instruction. Since we will now get all interrupts, we can also avoid the 2nd scan. As we can have multiple interrupts in parallel we might trigger spurious irqs more often for the non-AIS case but the core code can handle that. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com> Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'arch/s390/pci/pci_insn.c')
-rw-r--r--arch/s390/pci/pci_insn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/s390/pci/pci_insn.c b/arch/s390/pci/pci_insn.c
index ea34086..81b840b 100644
--- a/arch/s390/pci/pci_insn.c
+++ b/arch/s390/pci/pci_insn.c
@@ -7,6 +7,7 @@
#include <linux/export.h>
#include <linux/errno.h>
#include <linux/delay.h>
+#include <asm/facility.h>
#include <asm/pci_insn.h>
#include <asm/pci_debug.h>
#include <asm/processor.h>
@@ -91,11 +92,14 @@ int zpci_refresh_trans(u64 fn, u64 addr, u64 range)
}
/* Set Interruption Controls */
-void zpci_set_irq_ctrl(u16 ctl, char *unused, u8 isc)
+int zpci_set_irq_ctrl(u16 ctl, char *unused, u8 isc)
{
+ if (!test_facility(72))
+ return -EIO;
asm volatile (
" .insn rsy,0xeb00000000d1,%[ctl],%[isc],%[u]\n"
: : [ctl] "d" (ctl), [isc] "d" (isc << 27), [u] "Q" (*unused));
+ return 0;
}
/* PCI Load */
OpenPOWER on IntegriCloud