Commit 9186d7a9 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[S390] topology: clean up facility detection

Move cpu topology facility detection to early setup code where it
should be.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 14375bc4
...@@ -73,6 +73,7 @@ extern unsigned int user_mode; ...@@ -73,6 +73,7 @@ extern unsigned int user_mode;
#define MACHINE_FLAG_PFMF (1UL << 11) #define MACHINE_FLAG_PFMF (1UL << 11)
#define MACHINE_FLAG_LPAR (1UL << 12) #define MACHINE_FLAG_LPAR (1UL << 12)
#define MACHINE_FLAG_SPP (1UL << 13) #define MACHINE_FLAG_SPP (1UL << 13)
#define MACHINE_FLAG_TOPOLOGY (1UL << 14)
#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
...@@ -90,6 +91,7 @@ extern unsigned int user_mode; ...@@ -90,6 +91,7 @@ extern unsigned int user_mode;
#define MACHINE_HAS_HPAGE (0) #define MACHINE_HAS_HPAGE (0)
#define MACHINE_HAS_PFMF (0) #define MACHINE_HAS_PFMF (0)
#define MACHINE_HAS_SPP (0) #define MACHINE_HAS_SPP (0)
#define MACHINE_HAS_TOPOLOGY (0)
#else /* __s390x__ */ #else /* __s390x__ */
#define MACHINE_HAS_IEEE (1) #define MACHINE_HAS_IEEE (1)
#define MACHINE_HAS_CSP (1) #define MACHINE_HAS_CSP (1)
...@@ -100,6 +102,7 @@ extern unsigned int user_mode; ...@@ -100,6 +102,7 @@ extern unsigned int user_mode;
#define MACHINE_HAS_HPAGE (S390_lowcore.machine_flags & MACHINE_FLAG_HPAGE) #define MACHINE_HAS_HPAGE (S390_lowcore.machine_flags & MACHINE_FLAG_HPAGE)
#define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF) #define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
#define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP) #define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP)
#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
#endif /* __s390x__ */ #endif /* __s390x__ */
#define ZFCPDUMP_HSA_SIZE (32UL<<20) #define ZFCPDUMP_HSA_SIZE (32UL<<20)
......
...@@ -382,6 +382,8 @@ static __init void detect_machine_facilities(void) ...@@ -382,6 +382,8 @@ static __init void detect_machine_facilities(void)
S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE; S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
if (test_facility(8)) if (test_facility(8))
S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF; S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
if (test_facility(11))
S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
if (test_facility(27)) if (test_facility(27))
S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS; S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
if (test_facility(40)) if (test_facility(40))
......
...@@ -66,7 +66,6 @@ struct mask_info { ...@@ -66,7 +66,6 @@ struct mask_info {
static int topology_enabled = 1; static int topology_enabled = 1;
static void topology_work_fn(struct work_struct *work); static void topology_work_fn(struct work_struct *work);
static struct tl_info *tl_info; static struct tl_info *tl_info;
static int machine_has_topology;
static struct timer_list topology_timer; static struct timer_list topology_timer;
static void set_topology_timer(void); static void set_topology_timer(void);
static DECLARE_WORK(topology_work, topology_work_fn); static DECLARE_WORK(topology_work, topology_work_fn);
...@@ -88,7 +87,7 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu) ...@@ -88,7 +87,7 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)
cpumask_t mask; cpumask_t mask;
cpus_clear(mask); cpus_clear(mask);
if (!topology_enabled || !machine_has_topology) if (!topology_enabled || !MACHINE_HAS_TOPOLOGY)
return cpu_possible_map; return cpu_possible_map;
while (info) { while (info) {
if (cpu_isset(cpu, info->mask)) { if (cpu_isset(cpu, info->mask)) {
...@@ -186,7 +185,6 @@ static void tl_to_cores(struct tl_info *info) ...@@ -186,7 +185,6 @@ static void tl_to_cores(struct tl_info *info)
break; break;
default: default:
clear_masks(); clear_masks();
machine_has_topology = 0;
goto out; goto out;
} }
tle = next_tle(tle); tle = next_tle(tle);
...@@ -223,7 +221,7 @@ int topology_set_cpu_management(int fc) ...@@ -223,7 +221,7 @@ int topology_set_cpu_management(int fc)
int cpu; int cpu;
int rc; int rc;
if (!machine_has_topology) if (!MACHINE_HAS_TOPOLOGY)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (fc) if (fc)
rc = ptf(PTF_VERTICAL); rc = ptf(PTF_VERTICAL);
...@@ -269,7 +267,7 @@ int arch_update_cpu_topology(void) ...@@ -269,7 +267,7 @@ int arch_update_cpu_topology(void)
struct sys_device *sysdev; struct sys_device *sysdev;
int cpu; int cpu;
if (!machine_has_topology) { if (!MACHINE_HAS_TOPOLOGY) {
update_cpu_core_map(); update_cpu_core_map();
topology_update_polarization_simple(); topology_update_polarization_simple();
return 0; return 0;
...@@ -323,7 +321,7 @@ static int __init init_topology_update(void) ...@@ -323,7 +321,7 @@ static int __init init_topology_update(void)
int rc; int rc;
rc = 0; rc = 0;
if (!machine_has_topology) { if (!MACHINE_HAS_TOPOLOGY) {
topology_update_polarization_simple(); topology_update_polarization_simple();
goto out; goto out;
} }
...@@ -354,10 +352,8 @@ void __init s390_init_cpu_topology(void) ...@@ -354,10 +352,8 @@ void __init s390_init_cpu_topology(void)
struct tl_info *info; struct tl_info *info;
int i; int i;
if (!test_facility(2) || !test_facility(11)) if (!MACHINE_HAS_TOPOLOGY)
return; return;
machine_has_topology = 1;
tl_info = alloc_bootmem_pages(PAGE_SIZE); tl_info = alloc_bootmem_pages(PAGE_SIZE);
info = tl_info; info = tl_info;
store_topology(info); store_topology(info);
......
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