-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
…/git/s390/linux Pull more s390 updates from Martin Schwidefsky: - some cleanup for the hugetlbfs pte/pmd conversion functions - the code to check for the minimum CPU type is converted from assembler to C and an informational message is added in case the CPU is not new enough to run the kernel - bug fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/ftrace/jprobes: Fix conflict between jprobes and function graph tracing s390: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO s390/zcrypt: fix possible memory leak in ap_module_init() s390/numa: only set possible nodes within node_possible_map s390/als: fix compile with gcov enabled s390/facilities: do not generate DWORDS define anymore s390/als: print missing facilities on facility mismatch s390/als: print machine type on facility mismatch s390/als: convert architecture level set code to C s390/sclp: move uninitialized data to data section s390/zcrypt: Fix zcrypt suspend/resume behavior s390/cio: fix premature wakeup during chp configure s390/cio: convert cfg_lock mutex to spinlock s390/mm: clean up pte/pmd encoding
- Loading branch information
Showing
20 changed files
with
305 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
|
||
#define AT_SYSINFO_EHDR 33 | ||
|
||
#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* | ||
* Copyright IBM Corp. 2016 | ||
*/ | ||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <asm/processor.h> | ||
#include <asm/facility.h> | ||
#include <asm/lowcore.h> | ||
#include <asm/sclp.h> | ||
#include "entry.h" | ||
|
||
/* | ||
* The code within this file will be called very early. It may _not_ | ||
* access anything within the bss section, since that is not cleared | ||
* yet and may contain data (e.g. initrd) that must be saved by other | ||
* code. | ||
* For temporary objects the stack (16k) should be used. | ||
*/ | ||
|
||
static unsigned long als[] __initdata = { FACILITIES_ALS }; | ||
|
||
static void __init u16_to_hex(char *str, u16 val) | ||
{ | ||
int i, num; | ||
|
||
for (i = 1; i <= 4; i++) { | ||
num = (val >> (16 - 4 * i)) & 0xf; | ||
if (num >= 10) | ||
num += 7; | ||
*str++ = '0' + num; | ||
} | ||
*str = '\0'; | ||
} | ||
|
||
static void __init print_machine_type(void) | ||
{ | ||
static char mach_str[80] __initdata = "Detected machine-type number: "; | ||
char type_str[5]; | ||
struct cpuid id; | ||
|
||
get_cpu_id(&id); | ||
u16_to_hex(type_str, id.machine); | ||
strcat(mach_str, type_str); | ||
_sclp_print_early(mach_str); | ||
} | ||
|
||
static void __init u16_to_decimal(char *str, u16 val) | ||
{ | ||
int div = 1; | ||
|
||
while (div * 10 <= val) | ||
div *= 10; | ||
while (div) { | ||
*str++ = '0' + val / div; | ||
val %= div; | ||
div /= 10; | ||
} | ||
*str = '\0'; | ||
} | ||
|
||
static void __init print_missing_facilities(void) | ||
{ | ||
static char als_str[80] __initdata = "Missing facilities: "; | ||
unsigned long val; | ||
char val_str[6]; | ||
int i, j, first; | ||
|
||
first = 1; | ||
for (i = 0; i < ARRAY_SIZE(als); i++) { | ||
val = ~S390_lowcore.stfle_fac_list[i] & als[i]; | ||
for (j = 0; j < BITS_PER_LONG; j++) { | ||
if (!(val & (1UL << (BITS_PER_LONG - 1 - j)))) | ||
continue; | ||
if (!first) | ||
strcat(als_str, ","); | ||
/* | ||
* Make sure we stay within one line. Consider that | ||
* each facility bit adds up to five characters and | ||
* z/VM adds a four character prefix. | ||
*/ | ||
if (strlen(als_str) > 70) { | ||
_sclp_print_early(als_str); | ||
*als_str = '\0'; | ||
} | ||
u16_to_decimal(val_str, i * BITS_PER_LONG + j); | ||
strcat(als_str, val_str); | ||
first = 0; | ||
} | ||
} | ||
_sclp_print_early(als_str); | ||
_sclp_print_early("See Principles of Operations for facility bits"); | ||
} | ||
|
||
static void __init facility_mismatch(void) | ||
{ | ||
_sclp_print_early("The Linux kernel requires more recent processor hardware"); | ||
print_machine_type(); | ||
print_missing_facilities(); | ||
disabled_wait(0x8badcccc); | ||
} | ||
|
||
void __init verify_facilities(void) | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < ARRAY_SIZE(S390_lowcore.stfle_fac_list); i++) | ||
S390_lowcore.stfle_fac_list[i] = 0; | ||
asm volatile( | ||
" stfl 0(0)\n" | ||
: "=m" (S390_lowcore.stfl_fac_list)); | ||
S390_lowcore.stfle_fac_list[0] = (u64)S390_lowcore.stfl_fac_list << 32; | ||
if (S390_lowcore.stfl_fac_list & 0x01000000) { | ||
register unsigned long reg0 asm("0") = ARRAY_SIZE(als) - 1; | ||
|
||
asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */ | ||
: "+d" (reg0) | ||
: "a" (&S390_lowcore.stfle_fac_list) | ||
: "memory", "cc"); | ||
} | ||
for (i = 0; i < ARRAY_SIZE(als); i++) { | ||
if ((S390_lowcore.stfle_fac_list[i] & als[i]) != als[i]) | ||
facility_mismatch(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.