diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-02-26 07:53:47 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-03-04 04:29:55 -0500 |
commit | 86044c8c14b618b11558d3cba96aa0548c81274d (patch) | |
tree | 7f086f7a95e223e5e3d47427e43a7f393cb19876 /arch | |
parent | ed6f76b464ab53e59adc7ec6cc8428d3d6ade1a5 (diff) |
KVM: s390/cpacf: Fix kernel bug under z/VM
Under z/VM PQAP might trigger an operation exception if no crypto cards
are defined via APVIRTUAL or APDEDICATED.
[ 386.098666] Kernel BUG at 0000000000135c56 [verbose debug info unavailable]
[ 386.098693] illegal operation: 0001 ilc:2 [#1] SMP
[...]
[ 386.098751] Krnl PSW : 0704c00180000000 0000000000135c56 (kvm_s390_apxa_installed+0x46/0x98)
[...]
[ 386.098804] [<000000000013627c>] kvm_arch_init_vm+0x29c/0x358
[ 386.098806] [<000000000012d008>] kvm_dev_ioctl+0xc0/0x460
[ 386.098809] [<00000000002c639a>] do_vfs_ioctl+0x332/0x508
[ 386.098811] [<00000000002c660e>] SyS_ioctl+0x9e/0xb0
[ 386.098814] [<000000000070476a>] system_call+0xd6/0x258
[ 386.098815] [<000003fffc7400a2>] 0x3fffc7400a2
Lets add an extable entry and provide a zeroed config in that case.
Reported-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Tested-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index b4d2030c22eb..18965f91d39e 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -778,15 +778,18 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
778 | static int kvm_s390_query_ap_config(u8 *config) | 778 | static int kvm_s390_query_ap_config(u8 *config) |
779 | { | 779 | { |
780 | u32 fcn_code = 0x04000000UL; | 780 | u32 fcn_code = 0x04000000UL; |
781 | u32 cc; | 781 | u32 cc = 0; |
782 | 782 | ||
783 | memset(config, 0, 128); | ||
783 | asm volatile( | 784 | asm volatile( |
784 | "lgr 0,%1\n" | 785 | "lgr 0,%1\n" |
785 | "lgr 2,%2\n" | 786 | "lgr 2,%2\n" |
786 | ".long 0xb2af0000\n" /* PQAP(QCI) */ | 787 | ".long 0xb2af0000\n" /* PQAP(QCI) */ |
787 | "ipm %0\n" | 788 | "0: ipm %0\n" |
788 | "srl %0,28\n" | 789 | "srl %0,28\n" |
789 | : "=r" (cc) | 790 | "1:\n" |
791 | EX_TABLE(0b, 1b) | ||
792 | : "+r" (cc) | ||
790 | : "r" (fcn_code), "r" (config) | 793 | : "r" (fcn_code), "r" (config) |
791 | : "cc", "0", "2", "memory" | 794 | : "cc", "0", "2", "memory" |
792 | ); | 795 | ); |