[S390] kernel: Add z/VM LGR detection
[deliverable/linux.git] / arch / s390 / kernel / early.c
index 52098d6dfaa71dabed19f287aaa225672aba6c55..578eb4e6d1577ebcbe641533481bfdc2101e6832 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/sysinfo.h>
 #include <asm/cpcmd.h>
 #include <asm/sclp.h>
+#include <asm/system.h>
 #include "entry.h"
 
 /*
@@ -262,25 +263,8 @@ static noinline __init void setup_lowcore_early(void)
 
 static noinline __init void setup_facility_list(void)
 {
-       unsigned long nr;
-
-       S390_lowcore.stfl_fac_list = 0;
-       asm volatile(
-               "       .insn   s,0xb2b10000,0(0)\n" /* stfl */
-               "0:\n"
-               EX_TABLE(0b,0b) : "=m" (S390_lowcore.stfl_fac_list));
-       memcpy(&S390_lowcore.stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
-       nr = 4;                         /* # bytes stored by stfl */
-       if (test_facility(7)) {
-               /* More facility bits available with stfle */
-               register unsigned long reg0 asm("0") = MAX_FACILITY_BIT/64 - 1;
-               asm volatile(".insn s,0xb2b00000,%0" /* stfle */
-                            : "=m" (S390_lowcore.stfle_fac_list), "+d" (reg0)
-                            : : "cc");
-               nr = (reg0 + 1) * 8;    /* # bytes stored by stfle */
-       }
-       memset((char *) S390_lowcore.stfle_fac_list + nr, 0,
-              MAX_FACILITY_BIT/8 - nr);
+       stfle(S390_lowcore.stfle_fac_list,
+             ARRAY_SIZE(S390_lowcore.stfle_fac_list));
 }
 
 static noinline __init void setup_hpage(void)
This page took 0.028244 seconds and 5 git commands to generate.