Commit 1b2be207 authored by Philipp Rudo's avatar Philipp Rudo Committed by Vasily Gorbik

s390/ipl: Fix detection of has_secure attribute

Use the correct bit for detection of the machine capability associated
with the has_secure attribute. It is expected that the underlying
platform (including hypervisors) unsets the bit when they don't provide
secure ipl for their guests.

Fixes: c9896acc ("s390/ipl: Provide has_secure sysfs attribute")
Cc: stable@vger.kernel.org # 5.2
Signed-off-by: default avatarPhilipp Rudo <prudo@linux.ibm.com>
Reviewed-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 5c4c2126
...@@ -80,7 +80,6 @@ struct sclp_info { ...@@ -80,7 +80,6 @@ struct sclp_info {
unsigned char has_gisaf : 1; unsigned char has_gisaf : 1;
unsigned char has_diag318 : 1; unsigned char has_diag318 : 1;
unsigned char has_sipl : 1; unsigned char has_sipl : 1;
unsigned char has_sipl_g2 : 1;
unsigned char has_dirq : 1; unsigned char has_dirq : 1;
unsigned int ibc; unsigned int ibc;
unsigned int mtid; unsigned int mtid;
......
...@@ -286,12 +286,7 @@ static struct kobj_attribute sys_ipl_secure_attr = ...@@ -286,12 +286,7 @@ static struct kobj_attribute sys_ipl_secure_attr =
static ssize_t ipl_has_secure_show(struct kobject *kobj, static ssize_t ipl_has_secure_show(struct kobject *kobj,
struct kobj_attribute *attr, char *page) struct kobj_attribute *attr, char *page)
{ {
if (MACHINE_IS_LPAR) return sprintf(page, "%i\n", !!sclp.has_sipl);
return sprintf(page, "%i\n", !!sclp.has_sipl);
else if (MACHINE_IS_VM)
return sprintf(page, "%i\n", !!sclp.has_sipl_g2);
else
return sprintf(page, "%i\n", 0);
} }
static struct kobj_attribute sys_ipl_has_secure_attr = static struct kobj_attribute sys_ipl_has_secure_attr =
......
...@@ -41,7 +41,6 @@ static void __init sclp_early_facilities_detect(struct read_info_sccb *sccb) ...@@ -41,7 +41,6 @@ static void __init sclp_early_facilities_detect(struct read_info_sccb *sccb)
sclp.has_hvs = !!(sccb->fac119 & 0x80); sclp.has_hvs = !!(sccb->fac119 & 0x80);
sclp.has_kss = !!(sccb->fac98 & 0x01); sclp.has_kss = !!(sccb->fac98 & 0x01);
sclp.has_sipl = !!(sccb->cbl & 0x02); sclp.has_sipl = !!(sccb->cbl & 0x02);
sclp.has_sipl_g2 = !!(sccb->cbl & 0x04);
if (sccb->fac85 & 0x02) if (sccb->fac85 & 0x02)
S390_lowcore.machine_flags |= MACHINE_FLAG_ESOP; S390_lowcore.machine_flags |= MACHINE_FLAG_ESOP;
if (sccb->fac91 & 0x40) if (sccb->fac91 & 0x40)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment