Skip to content

Commit

Permalink
[S390] kernel: always keep machine flags in lowcore
Browse files Browse the repository at this point in the history
Eleminate the local variable machine_flags and always change machine
flags directly in the lowcore.
This avoids confusion about when and why the two variables have to be
synchronized.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Sep 11, 2009
1 parent 04a95f6 commit d3135e0
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

char kernel_nss_name[NSS_NAME_SIZE + 1];

static unsigned long machine_flags;

static void __init setup_boot_command_line(void);

/*
Expand Down Expand Up @@ -206,12 +204,9 @@ static noinline __init void detect_machine_type(void)

/* Running under KVM? If not we assume z/VM */
if (!memcmp(vmms.vm[0].cpi, "\xd2\xe5\xd4", 3))
machine_flags |= MACHINE_FLAG_KVM;
S390_lowcore.machine_flags |= MACHINE_FLAG_KVM;
else
machine_flags |= MACHINE_FLAG_VM;

/* Store machine flags for setting up lowcore early */
S390_lowcore.machine_flags = machine_flags;
S390_lowcore.machine_flags |= MACHINE_FLAG_VM;
}

static __init void early_pgm_check_handler(void)
Expand Down Expand Up @@ -246,7 +241,7 @@ static noinline __init void setup_hpage(void)
facilities = stfl();
if (!(facilities & (1UL << 23)) || !(facilities & (1UL << 29)))
return;
machine_flags |= MACHINE_FLAG_HPAGE;
S390_lowcore.machine_flags |= MACHINE_FLAG_HPAGE;
__ctl_set_bit(0, 23);
#endif
}
Expand All @@ -264,7 +259,7 @@ static __init void detect_mvpg(void)
EX_TABLE(0b,1b)
: "=d" (rc) : "0" (-EOPNOTSUPP), "a" (0) : "memory", "cc", "0");
if (!rc)
machine_flags |= MACHINE_FLAG_MVPG;
S390_lowcore.machine_flags |= MACHINE_FLAG_MVPG;
#endif
}

Expand All @@ -280,7 +275,7 @@ static __init void detect_ieee(void)
EX_TABLE(0b,1b)
: "=d" (rc), "=d" (tmp): "0" (-EOPNOTSUPP) : "cc");
if (!rc)
machine_flags |= MACHINE_FLAG_IEEE;
S390_lowcore.machine_flags |= MACHINE_FLAG_IEEE;
#endif
}

Expand All @@ -299,7 +294,7 @@ static __init void detect_csp(void)
EX_TABLE(0b,1b)
: "=d" (rc) : "0" (-EOPNOTSUPP) : "cc", "0", "1", "2");
if (!rc)
machine_flags |= MACHINE_FLAG_CSP;
S390_lowcore.machine_flags |= MACHINE_FLAG_CSP;
#endif
}

Expand All @@ -316,7 +311,7 @@ static __init void detect_diag9c(void)
EX_TABLE(0b,1b)
: "=d" (rc) : "0" (-EOPNOTSUPP), "d" (cpu_address) : "cc");
if (!rc)
machine_flags |= MACHINE_FLAG_DIAG9C;
S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG9C;
}

static __init void detect_diag44(void)
Expand All @@ -331,7 +326,7 @@ static __init void detect_diag44(void)
EX_TABLE(0b,1b)
: "=d" (rc) : "0" (-EOPNOTSUPP) : "cc");
if (!rc)
machine_flags |= MACHINE_FLAG_DIAG44;
S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG44;
#endif
}

Expand All @@ -342,11 +337,11 @@ static __init void detect_machine_facilities(void)

facilities = stfl();
if (facilities & (1 << 28))
machine_flags |= MACHINE_FLAG_IDTE;
S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
if (facilities & (1 << 23))
machine_flags |= MACHINE_FLAG_PFMF;
S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
if (facilities & (1 << 4))
machine_flags |= MACHINE_FLAG_MVCOS;
S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
#endif
}

Expand Down Expand Up @@ -428,7 +423,6 @@ void __init startup_init(void)
setup_hpage();
sclp_facilities_detect();
detect_memory_layout(memory_chunk);
S390_lowcore.machine_flags = machine_flags;
#ifdef CONFIG_DYNAMIC_FTRACE
S390_lowcore.ftrace_func = (unsigned long)ftrace_caller;
#endif
Expand Down

0 comments on commit d3135e0

Please sign in to comment.