aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-12-30 06:54:14 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-04-22 07:24:38 -0400
commit217a440683b51463f53e397cfdda27d7e92bf275 (patch)
treefbfb79903b5d5e69d59cbb9adda551c5de000604
parent2293897805c2fea69e45aca31b3589d4590af89d (diff)
KVM: s390/sclp: correctly set eca siif bit
Check if siif is available before setting. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-rw-r--r--arch/s390/include/asm/sclp.h7
-rw-r--r--arch/s390/kvm/kvm-s390.c4
-rw-r--r--drivers/s390/char/sclp_early.c22
3 files changed, 30 insertions, 3 deletions
diff --git a/arch/s390/include/asm/sclp.h b/arch/s390/include/asm/sclp.h
index 2f5e9932b4de..943d43451116 100644
--- a/arch/s390/include/asm/sclp.h
+++ b/arch/s390/include/asm/sclp.h
@@ -28,7 +28,11 @@ struct sclp_ipl_info {
28 28
29struct sclp_cpu_entry { 29struct sclp_cpu_entry {
30 u8 address; 30 u8 address;
31 u8 reserved0[13]; 31 u8 reserved0[2];
32 u8 : 3;
33 u8 siif : 1;
34 u8 : 4;
35 u8 reserved2[10];
32 u8 type; 36 u8 type;
33 u8 reserved1; 37 u8 reserved1;
34} __attribute__((packed)); 38} __attribute__((packed));
@@ -61,5 +65,6 @@ int sclp_pci_deconfigure(u32 fid);
61int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode); 65int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode);
62unsigned long sclp_get_hsa_size(void); 66unsigned long sclp_get_hsa_size(void);
63void sclp_early_detect(void); 67void sclp_early_detect(void);
68int sclp_has_siif(void);
64 69
65#endif /* _ASM_S390_SCLP_H */ 70#endif /* _ASM_S390_SCLP_H */
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 4b1df682e5c3..927ba7361da9 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -625,7 +625,9 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
625 vcpu->arch.sie_block->ecb |= 0x10; 625 vcpu->arch.sie_block->ecb |= 0x10;
626 626
627 vcpu->arch.sie_block->ecb2 = 8; 627 vcpu->arch.sie_block->ecb2 = 8;
628 vcpu->arch.sie_block->eca = 0xC1002001U; 628 vcpu->arch.sie_block->eca = 0xC1002000U;
629 if (sclp_has_siif())
630 vcpu->arch.sie_block->eca |= 1;
629 vcpu->arch.sie_block->fac = (int) (long) vfacilities; 631 vcpu->arch.sie_block->fac = (int) (long) vfacilities;
630 vcpu->arch.sie_block->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE; 632 vcpu->arch.sie_block->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE;
631 if (kvm_s390_cmma_enabled(vcpu->kvm)) { 633 if (kvm_s390_cmma_enabled(vcpu->kvm)) {
diff --git a/drivers/s390/char/sclp_early.c b/drivers/s390/char/sclp_early.c
index 14196ea0fdf3..b57fe0efb422 100644
--- a/drivers/s390/char/sclp_early.c
+++ b/drivers/s390/char/sclp_early.c
@@ -22,7 +22,8 @@ struct read_info_sccb {
22 u8 rnsize; /* 10 */ 22 u8 rnsize; /* 10 */
23 u8 _reserved0[16 - 11]; /* 11-15 */ 23 u8 _reserved0[16 - 11]; /* 11-15 */
24 u16 ncpurl; /* 16-17 */ 24 u16 ncpurl; /* 16-17 */
25 u8 _reserved7[24 - 18]; /* 18-23 */ 25 u16 cpuoff; /* 18-19 */
26 u8 _reserved7[24 - 20]; /* 20-23 */
26 u8 loadparm[8]; /* 24-31 */ 27 u8 loadparm[8]; /* 24-31 */
27 u8 _reserved1[48 - 32]; /* 32-47 */ 28 u8 _reserved1[48 - 32]; /* 32-47 */
28 u64 facilities; /* 48-55 */ 29 u64 facilities; /* 48-55 */
@@ -45,6 +46,7 @@ static unsigned int sclp_con_has_linemode __initdata;
45static unsigned long sclp_hsa_size; 46static unsigned long sclp_hsa_size;
46static unsigned int sclp_max_cpu; 47static unsigned int sclp_max_cpu;
47static struct sclp_ipl_info sclp_ipl_info; 48static struct sclp_ipl_info sclp_ipl_info;
49static unsigned char sclp_siif;
48 50
49u64 sclp_facilities; 51u64 sclp_facilities;
50u8 sclp_fac84; 52u8 sclp_fac84;
@@ -96,6 +98,9 @@ static int __init sclp_read_info_early(struct read_info_sccb *sccb)
96 98
97static void __init sclp_facilities_detect(struct read_info_sccb *sccb) 99static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
98{ 100{
101 struct sclp_cpu_entry *cpue;
102 u16 boot_cpu_address, cpu;
103
99 if (sclp_read_info_early(sccb)) 104 if (sclp_read_info_early(sccb))
100 return; 105 return;
101 106
@@ -116,6 +121,15 @@ static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
116 sclp_max_cpu = sccb->hcpua + 1; 121 sclp_max_cpu = sccb->hcpua + 1;
117 } 122 }
118 123
124 boot_cpu_address = stap();
125 cpue = (void *)sccb + sccb->cpuoff;
126 for (cpu = 0; cpu < sccb->ncpurl; cpue++, cpu++) {
127 if (boot_cpu_address != cpue->address)
128 continue;
129 sclp_siif = cpue->siif;
130 break;
131 }
132
119 /* Save IPL information */ 133 /* Save IPL information */
120 sclp_ipl_info.is_valid = 1; 134 sclp_ipl_info.is_valid = 1;
121 if (sccb->flags & 0x2) 135 if (sccb->flags & 0x2)
@@ -148,6 +162,12 @@ unsigned int sclp_get_max_cpu(void)
148 return sclp_max_cpu; 162 return sclp_max_cpu;
149} 163}
150 164
165int sclp_has_siif(void)
166{
167 return sclp_siif;
168}
169EXPORT_SYMBOL(sclp_has_siif);
170
151/* 171/*
152 * This function will be called after sclp_facilities_detect(), which gets 172 * This function will be called after sclp_facilities_detect(), which gets
153 * called from early.c code. The sclp_facilities_detect() function retrieves 173 * called from early.c code. The sclp_facilities_detect() function retrieves