aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2019-02-27 17:36:35 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2019-03-01 08:00:42 +0100
commit6d85dac2ab9292956b5864daee8e11c4e158a566 (patch)
tree51036ea7962b147d4a0bb7d95033d5479df2ae3a /arch/s390
parents390: allow overriding facilities via command line (diff)
downloadlinux-dev-6d85dac2ab9292956b5864daee8e11c4e158a566.tar.xz
linux-dev-6d85dac2ab9292956b5864daee8e11c4e158a566.zip
s390: warn about clearing als implied facilities
Add a warning about removing required architecture level set facilities via "facilities=" command line option. Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/boot/als.c5
-rw-r--r--arch/s390/boot/boot.h1
-rw-r--r--arch/s390/boot/ipl_parm.c16
3 files changed, 20 insertions, 2 deletions
diff --git a/arch/s390/boot/als.c b/arch/s390/boot/als.c
index 322e386bd9d0..f902215e9cd9 100644
--- a/arch/s390/boot/als.c
+++ b/arch/s390/boot/als.c
@@ -7,6 +7,7 @@
#include <asm/facility.h>
#include <asm/lowcore.h>
#include <asm/sclp.h>
+#include "boot.h"
/*
* The code within this file will be called very early. It may _not_
@@ -58,7 +59,7 @@ static void u16_to_decimal(char *str, u16 val)
*str = '\0';
}
-static void print_missing_facilities(void)
+void print_missing_facilities(void)
{
static char als_str[80] = "Missing facilities: ";
unsigned long val;
@@ -90,7 +91,6 @@ static void print_missing_facilities(void)
}
strcat(als_str, "\n");
sclp_early_printk(als_str);
- sclp_early_printk("See Principles of Operations for facility bits\n");
}
static void facility_mismatch(void)
@@ -98,6 +98,7 @@ static void facility_mismatch(void)
sclp_early_printk("The Linux kernel requires more recent processor hardware\n");
print_machine_type();
print_missing_facilities();
+ sclp_early_printk("See Principles of Operations for facility bits\n");
disabled_wait(0x8badcccc);
}
diff --git a/arch/s390/boot/boot.h b/arch/s390/boot/boot.h
index 8665497fd335..82bc06346e05 100644
--- a/arch/s390/boot/boot.h
+++ b/arch/s390/boot/boot.h
@@ -8,5 +8,6 @@ void store_ipl_parmblock(void);
void setup_boot_command_line(void);
void parse_boot_command_line(void);
void setup_memory_end(void);
+void print_missing_facilities(void);
#endif /* BOOT_BOOT_H */
diff --git a/arch/s390/boot/ipl_parm.c b/arch/s390/boot/ipl_parm.c
index 94e5374c3630..36beb56de021 100644
--- a/arch/s390/boot/ipl_parm.c
+++ b/arch/s390/boot/ipl_parm.c
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
+#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/ctype.h>
#include <asm/ebcdic.h>
@@ -152,6 +153,20 @@ static void modify_facility(unsigned long nr, bool clear)
__set_facility(nr, S390_lowcore.stfle_fac_list);
}
+static void check_cleared_facilities(void)
+{
+ unsigned long als[] = { FACILITIES_ALS };
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(als); i++) {
+ if ((S390_lowcore.stfle_fac_list[i] & als[i]) != als[i]) {
+ sclp_early_printk("Warning: The Linux kernel requires facilities cleared via command line option\n");
+ print_missing_facilities();
+ break;
+ }
+ }
+}
+
static void modify_fac_list(char *str)
{
unsigned long val, endval;
@@ -185,6 +200,7 @@ static void modify_fac_list(char *str)
break;
str++;
}
+ check_cleared_facilities();
}
static char command_line_buf[COMMAND_LINE_SIZE] __section(.data);