Skip to content

Commit 7b46848

Browse files
author
Martin Schwidefsky
committed
[S390] eliminate cpuinfo_S390 structure
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 2938af5 commit 7b46848

File tree

7 files changed

+52
-75
lines changed

7 files changed

+52
-75
lines changed

arch/s390/include/asm/lowcore.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
#define __LC_USER_ASCE 0xC50
8181
#define __LC_PANIC_STACK 0xC54
8282
#define __LC_CPUID 0xC60
83-
#define __LC_CPUADDR 0xC68
8483
#define __LC_IPLDEV 0xC7C
8584
#define __LC_CURRENT 0xC90
8685
#define __LC_INT_CLOCK 0xC98
@@ -102,7 +101,6 @@
102101
#define __LC_USER_ASCE 0xD60
103102
#define __LC_PANIC_STACK 0xD68
104103
#define __LC_CPUID 0xD80
105-
#define __LC_CPUADDR 0xD88
106104
#define __LC_IPLDEV 0xDB8
107105
#define __LC_CURRENT 0xDD8
108106
#define __LC_INT_CLOCK 0xDE8
@@ -273,8 +271,10 @@ struct _lowcore
273271
__u32 user_exec_asce; /* 0xc58 */
274272
__u8 pad10[0xc60-0xc5c]; /* 0xc5c */
275273
/* entry.S sensitive area start */
276-
struct cpuinfo_S390 cpu_data; /* 0xc60 */
277-
__u32 ipl_device; /* 0xc7c */
274+
cpuid_t cpu_id; /* 0xc60 */
275+
__u32 cpu_nr; /* 0xc68 */
276+
__u32 ipl_device; /* 0xc6c */
277+
__u8 pad_0xc70[0xc80-0xc70]; /* 0xc70 */
278278
/* entry.S sensitive area end */
279279

280280
/* SMP info area: defined by DJB */
@@ -366,9 +366,10 @@ struct _lowcore
366366
__u64 user_exec_asce; /* 0xd70 */
367367
__u8 pad10[0xd80-0xd78]; /* 0xd78 */
368368
/* entry.S sensitive area start */
369-
struct cpuinfo_S390 cpu_data; /* 0xd80 */
370-
__u32 ipl_device; /* 0xdb8 */
371-
__u32 pad11; /* 0xdbc */
369+
cpuid_t cpu_id; /* 0xd80 */
370+
__u32 cpu_nr; /* 0xd88 */
371+
__u32 ipl_device; /* 0xd8c */
372+
__u8 pad_0xd90[0xdc0-0xd90]; /* 0xd90 */
372373
/* entry.S sensitive area end */
373374

374375
/* SMP info area: defined by DJB */

arch/s390/include/asm/processor.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,8 @@ static inline void get_cpu_id(cpuid_t *ptr)
4242
asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr));
4343
}
4444

45-
struct cpuinfo_S390
46-
{
47-
cpuid_t cpu_id;
48-
__u16 cpu_addr;
49-
__u16 cpu_nr;
50-
unsigned long loops_per_jiffy;
51-
unsigned long *pgd_quick;
52-
#ifdef __s390x__
53-
unsigned long *pmd_quick;
54-
#endif /* __s390x__ */
55-
unsigned long *pte_quick;
56-
unsigned long pgtable_cache_sz;
57-
};
58-
5945
extern void s390_adjust_jiffies(void);
60-
extern void print_cpu_info(struct cpuinfo_S390 *);
46+
extern void print_cpu_info(void);
6147
extern int get_cpu_capability(unsigned int *);
6248

6349
/*

arch/s390/include/asm/smp.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,7 @@ extern void machine_power_off_smp(void);
5050

5151
#define PROC_CHANGE_PENALTY 20 /* Schedule penalty */
5252

53-
#define raw_smp_processor_id() (S390_lowcore.cpu_data.cpu_nr)
54-
55-
static inline __u16 hard_smp_processor_id(void)
56-
{
57-
return stap();
58-
}
53+
#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
5954

6055
/*
6156
* returns 1 if cpu is in stopped/check stopped state or not operational

arch/s390/kernel/processor.c

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
#include <asm/lowcore.h>
1919
#include <asm/param.h>
2020

21-
void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo)
21+
void __cpuinit print_cpu_info(void)
2222
{
2323
pr_info("Processor %d started, address %d, identification %06X\n",
24-
cpuinfo->cpu_nr, cpuinfo->cpu_addr, cpuinfo->cpu_id.ident);
24+
S390_lowcore.cpu_nr, S390_lowcore.cpu_addr,
25+
S390_lowcore.cpu_id.ident);
2526
}
2627

2728
/*
@@ -34,44 +35,42 @@ static int show_cpuinfo(struct seq_file *m, void *v)
3435
"esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp",
3536
"edat"
3637
};
37-
struct cpuinfo_S390 *cpuinfo;
38-
unsigned long n = (unsigned long) v - 1;
39-
int i;
38+
struct _lowcore *lc;
39+
unsigned long n = (unsigned long) v - 1;
40+
int i;
4041

41-
s390_adjust_jiffies();
42-
preempt_disable();
43-
if (!n) {
44-
seq_printf(m, "vendor_id : IBM/S390\n"
45-
"# processors : %i\n"
46-
"bogomips per cpu: %lu.%02lu\n",
47-
num_online_cpus(), loops_per_jiffy/(500000/HZ),
48-
(loops_per_jiffy/(5000/HZ))%100);
49-
seq_puts(m, "features\t: ");
50-
for (i = 0; i < 8; i++)
51-
if (hwcap_str[i] && (elf_hwcap & (1UL << i)))
52-
seq_printf(m, "%s ", hwcap_str[i]);
53-
seq_puts(m, "\n");
54-
}
42+
s390_adjust_jiffies();
43+
preempt_disable();
44+
if (!n) {
45+
seq_printf(m, "vendor_id : IBM/S390\n"
46+
"# processors : %i\n"
47+
"bogomips per cpu: %lu.%02lu\n",
48+
num_online_cpus(), loops_per_jiffy/(500000/HZ),
49+
(loops_per_jiffy/(5000/HZ))%100);
50+
seq_puts(m, "features\t: ");
51+
for (i = 0; i < 8; i++)
52+
if (hwcap_str[i] && (elf_hwcap & (1UL << i)))
53+
seq_printf(m, "%s ", hwcap_str[i]);
54+
seq_puts(m, "\n");
55+
}
5556

56-
if (cpu_online(n)) {
57+
if (cpu_online(n)) {
5758
#ifdef CONFIG_SMP
58-
if (smp_processor_id() == n)
59-
cpuinfo = &S390_lowcore.cpu_data;
60-
else
61-
cpuinfo = &lowcore_ptr[n]->cpu_data;
59+
lc = (smp_processor_id() == n) ?
60+
&S390_lowcore : lowcore_ptr[n];
6261
#else
63-
cpuinfo = &S390_lowcore.cpu_data;
62+
lc = &S390_lowcore;
6463
#endif
65-
seq_printf(m, "processor %li: "
66-
"version = %02X, "
67-
"identification = %06X, "
68-
"machine = %04X\n",
69-
n, cpuinfo->cpu_id.version,
70-
cpuinfo->cpu_id.ident,
71-
cpuinfo->cpu_id.machine);
72-
}
73-
preempt_enable();
74-
return 0;
64+
seq_printf(m, "processor %li: "
65+
"version = %02X, "
66+
"identification = %06X, "
67+
"machine = %04X\n",
68+
n, lc->cpu_id.version,
69+
lc->cpu_id.ident,
70+
lc->cpu_id.machine);
71+
}
72+
preempt_enable();
73+
return 0;
7574
}
7675

7776
static void *c_start(struct seq_file *m, loff_t *pos)

arch/s390/kernel/setup.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,10 @@ static struct resource data_resource = {
121121
*/
122122
void __cpuinit cpu_init(void)
123123
{
124-
int addr = hard_smp_processor_id();
125-
126124
/*
127125
* Store processor id in lowcore (used e.g. in timer_interrupt)
128126
*/
129-
get_cpu_id(&S390_lowcore.cpu_data.cpu_id);
130-
S390_lowcore.cpu_data.cpu_addr = addr;
127+
get_cpu_id(&S390_lowcore.cpu_id);
131128

132129
/*
133130
* Force FPU initialization:
@@ -686,7 +683,6 @@ setup_memory(void)
686683
static void __init setup_hwcaps(void)
687684
{
688685
static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 };
689-
struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data;
690686
unsigned long long facility_list_extended;
691687
unsigned int facility_list;
692688
int i;
@@ -732,7 +728,7 @@ static void __init setup_hwcaps(void)
732728
if (MACHINE_HAS_HPAGE)
733729
elf_hwcap |= 1UL << 7;
734730

735-
switch (cpuinfo->cpu_id.machine) {
731+
switch (S390_lowcore.cpu_id.machine) {
736732
case 0x9672:
737733
#if !defined(CONFIG_64BIT)
738734
default: /* Use "g5" as default for 31 bit kernels. */
@@ -825,7 +821,7 @@ setup_arch(char **cmdline_p)
825821
setup_lowcore();
826822

827823
cpu_init();
828-
__cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr;
824+
__cpu_logical_map[0] = stap();
829825
s390_init_cpu_topology();
830826

831827
/*

arch/s390/kernel/smp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static void __init smp_detect_cpus(void)
372372

373373
c_cpus = 1;
374374
s_cpus = 0;
375-
boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr;
375+
boot_cpu_addr = __cpu_logical_map[0];
376376
info = kmalloc(sizeof(*info), GFP_KERNEL);
377377
if (!info)
378378
panic("smp_detect_cpus failed to allocate memory\n");
@@ -446,7 +446,7 @@ int __cpuinit start_secondary(void *cpuvoid)
446446
/* Switch on interrupts */
447447
local_irq_enable();
448448
/* Print info about this processor */
449-
print_cpu_info(&S390_lowcore.cpu_data);
449+
print_cpu_info();
450450
/* cpu_idle will call schedule for us */
451451
cpu_idle();
452452
return 0;
@@ -564,7 +564,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
564564
: : "a" (&cpu_lowcore->access_regs_save_area) : "memory");
565565
cpu_lowcore->percpu_offset = __per_cpu_offset[cpu];
566566
cpu_lowcore->current_task = (unsigned long) idle;
567-
cpu_lowcore->cpu_data.cpu_nr = cpu;
567+
cpu_lowcore->cpu_nr = cpu;
568568
cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce;
569569
cpu_lowcore->ipl_device = S390_lowcore.ipl_device;
570570
eieio();
@@ -656,7 +656,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
656656
/* request the 0x1201 emergency signal external interrupt */
657657
if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0)
658658
panic("Couldn't request external interrupt 0x1201");
659-
print_cpu_info(&S390_lowcore.cpu_data);
659+
print_cpu_info();
660660

661661
/* Reallocate current lowcore, but keep its contents. */
662662
lc_order = sizeof(long) == 8 ? 1 : 0;

drivers/s390/cio/css.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ css_generate_pgid(struct channel_subsystem *css, u32 tod_high)
655655
css->global_pgid.pgid_high.ext_cssid.cssid = css->cssid;
656656
} else {
657657
#ifdef CONFIG_SMP
658-
css->global_pgid.pgid_high.cpu_addr = hard_smp_processor_id();
658+
css->global_pgid.pgid_high.cpu_addr = stap();
659659
#else
660660
css->global_pgid.pgid_high.cpu_addr = 0;
661661
#endif

0 commit comments

Comments
 (0)