Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] vmlogrdr function annotation.
  [S390] s390: rename CPU_IDLE to S390_CPU_IDLE
  [S390] cio: Remove prototype for non-existing function cmf_reset().
  [S390] zcrypt: fix request timeout handling
  [S390] system call optimization.
  [S390] dasd: Avoid compile warnings on !CONFIG_DASD_PROFILE
  [S390] Remove volatile from atomic_t
  [S390] Program check in diag 210 under 31 bit
  [S390] Bogomips calculation for 64 bit.
  [S390] smp: Merge smp_count_cpus() and smp_get_save_areas().
  [S390] zcore: Fix __user annotation.
  [S390] fixed cdl-format detection.
  [S390] sclp: Test facility list before executing a service call.
  [S390] sclp: introduce some new interfaces.
  [S390] Fixed comment typo.
  [S390] vmcp cleanup
  • Loading branch information
Linus Torvalds committed Jul 10, 2007
2 parents 1b21f45 + f60d891 commit 9f9d763
Show file tree
Hide file tree
Showing 31 changed files with 459 additions and 348 deletions.
2 changes: 1 addition & 1 deletion arch/s390/crypto/crypt_s390.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define CRYPT_S390_PRIORITY 300
#define CRYPT_S390_COMPOSITE_PRIORITY 400

/* s930 cryptographic operations */
/* s390 cryptographic operations */
enum crypt_s390_operations {
CRYPT_S390_KM = 0x0100,
CRYPT_S390_KMC = 0x0200,
Expand Down
45 changes: 12 additions & 33 deletions arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,37 +171,6 @@ static inline int memory_fast_detect(void)
}
#endif

#define ADDR2G (1UL << 31)

static noinline __init unsigned long sclp_memory_detect(void)
{
struct sclp_readinfo_sccb *sccb;
unsigned long long memsize;

sccb = &s390_readinfo_sccb;

if (sccb->header.response_code != 0x10)
return 0;

if (sccb->rnsize)
memsize = sccb->rnsize << 20;
else
memsize = sccb->rnsize2 << 20;
if (sccb->rnmax)
memsize *= sccb->rnmax;
else
memsize *= sccb->rnmax2;
#ifndef CONFIG_64BIT
/*
* Can't deal with more than 2G in 31 bit addressing mode, so
* limit the value in order to avoid strange side effects.
*/
if (memsize > ADDR2G)
memsize = ADDR2G;
#endif
return (unsigned long) memsize;
}

static inline __init unsigned long __tprot(unsigned long addr)
{
int cc = -1;
Expand All @@ -218,6 +187,7 @@ static inline __init unsigned long __tprot(unsigned long addr)

/* Checking memory in 128KB increments. */
#define CHUNK_INCR (1UL << 17)
#define ADDR2G (1UL << 31)

static noinline __init void find_memory_chunks(unsigned long memsize)
{
Expand Down Expand Up @@ -293,7 +263,7 @@ static noinline __init void setup_lowcore_early(void)
*/
void __init startup_init(void)
{
unsigned long memsize;
unsigned long long memsize;

ipl_save_parameters();
clear_bss_section();
Expand All @@ -305,8 +275,17 @@ void __init startup_init(void)
sort_main_extable();
setup_lowcore_early();
sclp_readinfo_early();
sclp_facilities_detect();
memsize = sclp_memory_detect();
#ifndef CONFIG_64BIT
/*
* Can't deal with more than 2G in 31 bit addressing mode, so
* limit the value in order to avoid strange side effects.
*/
if (memsize > ADDR2G)
memsize = ADDR2G;
#endif
if (memory_fast_detect() < 0)
find_memory_chunks(memsize);
find_memory_chunks((unsigned long) memsize);
lockdep_on();
}
7 changes: 6 additions & 1 deletion arch/s390/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ STACK_SIZE = 1 << STACK_SHIFT
l %r13,__LC_SVC_NEW_PSW+4 # load &system_call to %r13
.endm

.macro SAVE_ALL_SVC psworg,savearea
la %r12,\psworg
l %r15,__LC_KERNEL_STACK # problem state -> load ksp
.endm

.macro SAVE_ALL_SYNC psworg,savearea
la %r12,\psworg
tm \psworg+1,0x01 # test problem state bit
Expand Down Expand Up @@ -218,7 +223,7 @@ system_call:
STORE_TIMER __LC_SYNC_ENTER_TIMER
sysc_saveall:
SAVE_ALL_BASE __LC_SAVE_AREA
SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
lh %r7,0x8a # get svc number from lowcore
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Expand Down
7 changes: 6 additions & 1 deletion arch/s390/kernel/entry64.S
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
larl %r13,system_call
.endm

.macro SAVE_ALL_SVC psworg,savearea
la %r12,\psworg
lg %r15,__LC_KERNEL_STACK # problem state -> load ksp
.endm

.macro SAVE_ALL_SYNC psworg,savearea
la %r12,\psworg
tm \psworg+1,0x01 # test problem state bit
Expand Down Expand Up @@ -207,7 +212,7 @@ system_call:
STORE_TIMER __LC_SYNC_ENTER_TIMER
sysc_saveall:
SAVE_ALL_BASE __LC_SAVE_AREA
SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Expand Down
17 changes: 8 additions & 9 deletions arch/s390/kernel/ipl.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

#define IPL_PARM_BLOCK_VERSION 0

#define SCCB_VALID (s390_readinfo_sccb.header.response_code == 0x10)
#define SCCB_LOADPARM (&s390_readinfo_sccb.loadparm)
#define SCCB_FLAG (s390_readinfo_sccb.flags)

#define IPL_UNKNOWN_STR "unknown"
#define IPL_CCW_STR "ccw"
#define IPL_FCP_STR "fcp"
Expand Down Expand Up @@ -146,6 +142,8 @@ static struct ipl_parameter_block *dump_block_ccw;

static enum shutdown_action on_panic_action = SHUTDOWN_STOP;

static struct sclp_ipl_info sclp_ipl_info;

int diag308(unsigned long subcode, void *addr)
{
register unsigned long _addr asm("0") = (unsigned long) addr;
Expand Down Expand Up @@ -375,9 +373,9 @@ static ssize_t ipl_ccw_loadparm_show(struct kset *kset, char *page)
{
char loadparm[LOADPARM_LEN + 1] = {};

if (!SCCB_VALID)
if (!sclp_ipl_info.is_valid)
return sprintf(page, "#unknown#\n");
memcpy(loadparm, SCCB_LOADPARM, LOADPARM_LEN);
memcpy(loadparm, &sclp_ipl_info.loadparm, LOADPARM_LEN);
EBCASC(loadparm, LOADPARM_LEN);
strstrip(loadparm);
return sprintf(page, "%s\n", loadparm);
Expand Down Expand Up @@ -910,9 +908,9 @@ static int __init reipl_ccw_init(void)
reipl_block_ccw->hdr.blk0_len = IPL_PARM_BLK0_CCW_LEN;
reipl_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW;
/* check if read scp info worked and set loadparm */
if (SCCB_VALID)
if (sclp_ipl_info.is_valid)
memcpy(reipl_block_ccw->ipl_info.ccw.load_param,
SCCB_LOADPARM, LOADPARM_LEN);
&sclp_ipl_info.loadparm, LOADPARM_LEN);
else
/* read scp info failed: set empty loadparm (EBCDIC blanks) */
memset(reipl_block_ccw->ipl_info.ccw.load_param, 0x40,
Expand Down Expand Up @@ -1007,7 +1005,7 @@ static int __init dump_fcp_init(void)
{
int rc;

if(!(SCCB_FLAG & 0x2) || !SCCB_VALID)
if (!sclp_ipl_info.has_dump)
return 0; /* LDIPL DUMP is not installed */
if (!diag308_set_works)
return 0;
Expand Down Expand Up @@ -1088,6 +1086,7 @@ static int __init s390_ipl_init(void)
{
int rc;

sclp_get_ipl_info(&sclp_ipl_info);
reipl_probe();
rc = ipl_init();
if (rc)
Expand Down
6 changes: 3 additions & 3 deletions arch/s390/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ void do_monitor_call(struct pt_regs *regs, long interruption_code)
/* disable monitor call class 0 */
__ctl_clear_bit(8, 15);

atomic_notifier_call_chain(&idle_chain, CPU_NOT_IDLE,
(void *)(long) smp_processor_id());
atomic_notifier_call_chain(&idle_chain, S390_CPU_NOT_IDLE,
(void *)(long) smp_processor_id());
}

extern void s390_handle_mcck(void);
Expand All @@ -115,7 +115,7 @@ static void default_idle(void)
}

rc = atomic_notifier_call_chain(&idle_chain,
CPU_IDLE, (void *)(long) cpu);
S390_CPU_IDLE, (void *)(long) cpu);
if (rc != NOTIFY_OK && rc != NOTIFY_DONE)
BUG();
if (rc != NOTIFY_OK) {
Expand Down
63 changes: 21 additions & 42 deletions arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,58 +410,40 @@ EXPORT_SYMBOL(smp_ctl_clear_bit);
unsigned int zfcpdump_prefix_array[NR_CPUS + 1] \
__attribute__((__section__(".data")));

static void __init smp_get_save_areas(void)
static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
{
unsigned int cpu, cpu_num, rc;
__u16 boot_cpu_addr;

if (ipl_info.type != IPL_TYPE_FCP_DUMP)
return;
boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr;
cpu_num = 1;
for (cpu = 0; cpu <= 65535; cpu++) {
if ((u16) cpu == boot_cpu_addr)
continue;
__cpu_logical_map[1] = (__u16) cpu;
if (signal_processor(1, sigp_sense) == sigp_not_operational)
continue;
if (cpu_num >= NR_CPUS) {
printk("WARNING: Registers for cpu %i are not "
"saved, since dump kernel was compiled with"
"NR_CPUS=%i!\n", cpu_num, NR_CPUS);
continue;
}
zfcpdump_save_areas[cpu_num] =
alloc_bootmem(sizeof(union save_area));
while (1) {
rc = signal_processor(1, sigp_stop_and_store_status);
if (rc != sigp_busy)
break;
cpu_relax();
}
memcpy(zfcpdump_save_areas[cpu_num],
(void *)(unsigned long) store_prefix() +
SAVE_AREA_BASE, SAVE_AREA_SIZE);
#ifdef __s390x__
/* copy original prefix register */
zfcpdump_save_areas[cpu_num]->s390x.pref_reg =
zfcpdump_prefix_array[cpu_num];
#endif
cpu_num++;
if (cpu >= NR_CPUS) {
printk(KERN_WARNING "Registers for cpu %i not saved since dump "
"kernel was compiled with NR_CPUS=%i\n", cpu, NR_CPUS);
return;
}
zfcpdump_save_areas[cpu] = alloc_bootmem(sizeof(union save_area));
__cpu_logical_map[1] = (__u16) phy_cpu;
while (signal_processor(1, sigp_stop_and_store_status) == sigp_busy)
cpu_relax();
memcpy(zfcpdump_save_areas[cpu],
(void *)(unsigned long) store_prefix() + SAVE_AREA_BASE,
SAVE_AREA_SIZE);
#ifdef CONFIG_64BIT
/* copy original prefix register */
zfcpdump_save_areas[cpu]->s390x.pref_reg = zfcpdump_prefix_array[cpu];
#endif
}

union save_area *zfcpdump_save_areas[NR_CPUS + 1];
EXPORT_SYMBOL_GPL(zfcpdump_save_areas);

#else
#define smp_get_save_areas() do { } while (0)
#endif

static inline void smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { }

#endif /* CONFIG_ZFCPDUMP || CONFIG_ZFCPDUMP_MODULE */

/*
* Lets check how many CPUs we have.
*/

static unsigned int __init smp_count_cpus(void)
{
unsigned int cpu, num_cpus;
Expand All @@ -470,7 +452,6 @@ static unsigned int __init smp_count_cpus(void)
/*
* cpu 0 is the boot cpu. See smp_prepare_boot_cpu.
*/

boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr;
current_thread_info()->cpu = 0;
num_cpus = 1;
Expand All @@ -480,12 +461,11 @@ static unsigned int __init smp_count_cpus(void)
__cpu_logical_map[1] = (__u16) cpu;
if (signal_processor(1, sigp_sense) == sigp_not_operational)
continue;
smp_get_save_area(num_cpus, cpu);
num_cpus++;
}

printk("Detected %d CPU's\n", (int) num_cpus);
printk("Boot cpu address %2X\n", boot_cpu_addr);

return num_cpus;
}

Expand Down Expand Up @@ -606,7 +586,6 @@ void __init smp_setup_cpu_possible_map(void)
{
unsigned int phy_cpus, pos_cpus, cpu;

smp_get_save_areas();
phy_cpus = smp_count_cpus();
pos_cpus = min(phy_cpus + additional_cpus, (unsigned int) NR_CPUS);

Expand Down
4 changes: 2 additions & 2 deletions arch/s390/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ static int nohz_idle_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
switch (action) {
case CPU_IDLE:
case S390_CPU_IDLE:
stop_hz_timer();
break;
case CPU_NOT_IDLE:
case S390_CPU_NOT_IDLE:
start_hz_timer();
break;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/kernel/vtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ static int vtimer_idle_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
switch (action) {
case CPU_IDLE:
case S390_CPU_IDLE:
stop_cpu_timer();
break;
case CPU_NOT_IDLE:
case S390_CPU_NOT_IDLE:
start_cpu_timer();
break;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

EXTRA_AFLAGS := -traditional

lib-y += delay.o string.o uaccess_std.o uaccess_pt.o qrnnd.o
obj-$(CONFIG_32BIT) += div64.o
lib-y += delay.o string.o uaccess_std.o uaccess_pt.o
obj-$(CONFIG_32BIT) += div64.o qrnnd.o
lib-$(CONFIG_64BIT) += uaccess_mvcos.o
lib-$(CONFIG_SMP) += spinlock.o
4 changes: 4 additions & 0 deletions drivers/s390/block/dasd_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ static struct proc_dir_entry *dasd_proc_root_entry = NULL;
static struct proc_dir_entry *dasd_devices_entry = NULL;
static struct proc_dir_entry *dasd_statistics_entry = NULL;

#ifdef CONFIG_DASD_PROFILE
static char *
dasd_get_user_string(const char __user *user_buf, size_t user_len)
{
Expand All @@ -47,6 +48,7 @@ dasd_get_user_string(const char __user *user_buf, size_t user_len)
buffer[user_len] = 0;
return buffer;
}
#endif /* CONFIG_DASD_PROFILE */

static int
dasd_devices_show(struct seq_file *m, void *v)
Expand Down Expand Up @@ -167,6 +169,7 @@ dasd_calc_metrics(char *page, char **start, off_t off,
return len;
}

#ifdef CONFIG_DASD_PROFILE
static char *
dasd_statistics_array(char *str, unsigned int *array, int shift)
{
Expand All @@ -180,6 +183,7 @@ dasd_statistics_array(char *str, unsigned int *array, int shift)
str += sprintf(str,"\n");
return str;
}
#endif /* CONFIG_DASD_PROFILE */

static int
dasd_statistics_read(char *page, char **start, off_t off,
Expand Down
Loading

0 comments on commit 9f9d763

Please sign in to comment.