diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-27 16:20:17 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-27 16:20:17 -0800 |
commit | 7981164791d18d5ed1dcdfa9598949ed158a5333 (patch) | |
tree | 6565e7406dd55eb5014efd3e54109159a47cb10e /drivers | |
parent | f1dd6ad599732fc89f36fdd65a2c2cf3c63a8711 (diff) | |
parent | a8d6356cdabf4495aaae7d3e89eb058b1909761c (diff) |
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (35 commits)
[S390] time: remove unused code
[S390] zcore: Add prefix registers to dump header
[S390] correct vdso version string
[S390] add support for compressed kernels
[S390] Define new s390 ELF note sections in elf.h
[S390] codepage conversion of kernel parameter line
[S390] seq_file: convert drivers/s390/
[S390] add z9-ec/z10 instruction to kernel disassembler
[S390] dasd: correct offline processing
[S390] dasd: fix refcounting.
[S390] dasd: fix online/offline race
[S390] use kprobes_built_in() in mm/fault code
[S390] bug: use relative pointers in bug table entries
[S390] Cleanup struct _lowcore usage and defines.
[S390] free_initmem: reduce code duplication
[S390] Replace ENOTSUPP usage with EOPNOTSUPP
[S390] spinlock: check virtual cpu running status
[S390] sysinfo: fix SYSIB 3,2,2 structure
[S390] add MACHINE_IS_LPAR flag
[S390] qdio: optimize cache line usage of struct qdio_irq
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/block/dasd.c | 48 | ||||
-rw-r--r-- | drivers/s390/block/dasd_devmap.c | 13 | ||||
-rw-r--r-- | drivers/s390/block/dasd_genhd.c | 1 | ||||
-rw-r--r-- | drivers/s390/block/dasd_int.h | 1 | ||||
-rw-r--r-- | drivers/s390/block/dasd_proc.c | 109 | ||||
-rw-r--r-- | drivers/s390/char/zcore.c | 163 | ||||
-rw-r--r-- | drivers/s390/cio/ccwreq.c | 2 | ||||
-rw-r--r-- | drivers/s390/cio/chsc.c | 2 | ||||
-rw-r--r-- | drivers/s390/cio/chsc_sch.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/cio.c | 14 | ||||
-rw-r--r-- | drivers/s390/cio/crw.c | 29 | ||||
-rw-r--r-- | drivers/s390/cio/css.c | 79 | ||||
-rw-r--r-- | drivers/s390/cio/css.h | 5 | ||||
-rw-r--r-- | drivers/s390/cio/device.c | 160 | ||||
-rw-r--r-- | drivers/s390/cio/device.h | 3 | ||||
-rw-r--r-- | drivers/s390/cio/device_fsm.c | 43 | ||||
-rw-r--r-- | drivers/s390/cio/qdio.h | 92 | ||||
-rw-r--r-- | drivers/s390/cio/qdio_debug.c | 23 | ||||
-rw-r--r-- | drivers/s390/cio/qdio_main.c | 28 | ||||
-rw-r--r-- | drivers/s390/cio/qdio_setup.c | 20 | ||||
-rw-r--r-- | drivers/s390/cio/qdio_thinint.c | 4 | ||||
-rw-r--r-- | drivers/s390/crypto/zcrypt_api.c | 158 | ||||
-rw-r--r-- | drivers/s390/kvm/kvm_virtio.c | 4 |
23 files changed, 562 insertions, 443 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 5905936c7c6..9ab1ae40565 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -20,6 +20,7 @@ #include <linux/buffer_head.h> #include <linux/hdreg.h> #include <linux/async.h> +#include <linux/mutex.h> #include <asm/ccwdev.h> #include <asm/ebcdic.h> @@ -112,6 +113,7 @@ struct dasd_device *dasd_alloc_device(void) INIT_WORK(&device->restore_device, do_restore_device); device->state = DASD_STATE_NEW; device->target = DASD_STATE_NEW; + mutex_init(&device->state_mutex); return device; } @@ -321,8 +323,8 @@ static int dasd_state_ready_to_basic(struct dasd_device *device) device->state = DASD_STATE_READY; return rc; } - dasd_destroy_partitions(block); dasd_flush_request_queue(block); + dasd_destroy_partitions(block); block->blocks = 0; block->bp_block = 0; block->s2b_shift = 0; @@ -484,10 +486,8 @@ static void dasd_change_state(struct dasd_device *device) if (rc) device->target = device->state; - if (device->state == device->target) { + if (device->state == device->target) wake_up(&dasd_init_waitq); - dasd_put_device(device); - } /* let user-space know that the device status changed */ kobject_uevent(&device->cdev->dev.kobj, KOBJ_CHANGE); @@ -502,7 +502,9 @@ static void dasd_change_state(struct dasd_device *device) static void do_kick_device(struct work_struct *work) { struct dasd_device *device = container_of(work, struct dasd_device, kick_work); + mutex_lock(&device->state_mutex); dasd_change_state(device); + mutex_unlock(&device->state_mutex); dasd_schedule_device_bh(device); dasd_put_device(device); } @@ -539,18 +541,19 @@ void dasd_restore_device(struct dasd_device *device) void dasd_set_target_state(struct dasd_device *device, int target) { dasd_get_device(device); + mutex_lock(&device->state_mutex); /* If we are in probeonly mode stop at DASD_STATE_READY. */ if (dasd_probeonly && target > DASD_STATE_READY) target = DASD_STATE_READY; if (device->target != target) { - if (device->state == target) { + if (device->state == target) wake_up(&dasd_init_waitq); - dasd_put_device(device); - } device->target = target; } if (device->state != device->target) dasd_change_state(device); + mutex_unlock(&device->state_mutex); + dasd_put_device(device); } /* @@ -1000,12 +1003,20 @@ static void dasd_handle_killed_request(struct ccw_device *cdev, return; } - device = (struct dasd_device *) cqr->startdev; - if (device == NULL || - device != dasd_device_from_cdev_locked(cdev) || - strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { + device = dasd_device_from_cdev_locked(cdev); + if (IS_ERR(device)) { + DBF_EVENT_DEVID(DBF_DEBUG, cdev, "%s", + "unable to get device from cdev"); + return; + } + + if (!cqr->startdev || + device != cqr->startdev || + strncmp(cqr->startdev->discipline->ebcname, + (char *) &cqr->magic, 4)) { DBF_EVENT_DEVID(DBF_DEBUG, cdev, "%s", "invalid device in request"); + dasd_put_device(device); return; } @@ -1692,7 +1703,6 @@ int dasd_cancel_req(struct dasd_ccw_req *cqr) cqr, rc); } else { cqr->stopclk = get_clock(); - rc = 1; } break; default: /* already finished or clear pending - do nothing */ @@ -2170,9 +2180,13 @@ static void dasd_flush_request_queue(struct dasd_block *block) static int dasd_open(struct block_device *bdev, fmode_t mode) { struct dasd_block *block = bdev->bd_disk->private_data; - struct dasd_device *base = block->base; + struct dasd_device *base; int rc; + if (!block) + return -ENODEV; + + base = block->base; atomic_inc(&block->open_count); if (test_bit(DASD_FLAG_OFFLINE, &base->flags)) { rc = -ENODEV; @@ -2285,11 +2299,6 @@ static void dasd_generic_auto_online(void *data, async_cookie_t cookie) if (ret) pr_warning("%s: Setting the DASD online failed with rc=%d\n", dev_name(&cdev->dev), ret); - else { - struct dasd_device *device = dasd_device_from_cdev(cdev); - wait_event(dasd_init_waitq, _wait_for_device(device)); - dasd_put_device(device); - } } /* @@ -2424,6 +2433,9 @@ int dasd_generic_set_online(struct ccw_device *cdev, } else pr_debug("dasd_generic device %s found\n", dev_name(&cdev->dev)); + + wait_event(dasd_init_waitq, _wait_for_device(device)); + dasd_put_device(device); return rc; } diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index 4cac5b54f26..d49766f3b94 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c @@ -874,12 +874,19 @@ dasd_discipline_show(struct device *dev, struct device_attribute *attr, ssize_t len; device = dasd_device_from_cdev(to_ccwdev(dev)); - if (!IS_ERR(device) && device->discipline) { + if (IS_ERR(device)) + goto out; + else if (!device->discipline) { + dasd_put_device(device); + goto out; + } else { len = snprintf(buf, PAGE_SIZE, "%s\n", device->discipline->name); dasd_put_device(device); - } else - len = snprintf(buf, PAGE_SIZE, "none\n"); + return len; + } +out: + len = snprintf(buf, PAGE_SIZE, "none\n"); return len; } diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index d3198303b93..94f92a1247f 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c @@ -88,6 +88,7 @@ void dasd_gendisk_free(struct dasd_block *block) if (block->gdp) { del_gendisk(block->gdp); block->gdp->queue = NULL; + block->gdp->private_data = NULL; put_disk(block->gdp); block->gdp = NULL; } diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index e4c2143dabf..ed73ce55082 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h @@ -368,6 +368,7 @@ struct dasd_device { /* Device state and target state. */ int state, target; + struct mutex state_mutex; int stopped; /* device (ccw_device_start) was stopped */ /* reference count. */ diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index 71f95f54866..f13a0bdd148 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c @@ -165,51 +165,32 @@ static const struct file_operations dasd_devices_file_ops = { .release = seq_release, }; -static int -dasd_calc_metrics(char *page, char **start, off_t off, - int count, int *eof, int len) -{ - len = (len > off) ? len - off : 0; - if (len > count) - len = count; - if (len < count) - *eof = 1; - *start = page + off; - return len; -} - #ifdef CONFIG_DASD_PROFILE -static char * -dasd_statistics_array(char *str, unsigned int *array, int factor) +static void dasd_statistics_array(struct seq_file *m, unsigned int *array, int factor) { int i; for (i = 0; i < 32; i++) { - str += sprintf(str, "%7d ", array[i] / factor); + seq_printf(m, "%7d ", array[i] / factor); if (i == 15) - str += sprintf(str, "\n"); + seq_putc(m, '\n'); } - str += sprintf(str,"\n"); - return str; + seq_putc(m, '\n'); } #endif /* CONFIG_DASD_PROFILE */ -static int -dasd_statistics_read(char *page, char **start, off_t off, - int count, int *eof, void *data) +static int dasd_stats_proc_show(struct seq_file *m, void *v) { - unsigned long len; #ifdef CONFIG_DASD_PROFILE struct dasd_profile_info_t *prof; - char *str; int factor; /* check for active profiling */ if (dasd_profile_level == DASD_PROFILE_OFF) { - len = sprintf(page, "Statistics are off - they might be " + seq_printf(m, "Statistics are off - they might be " "switched on using 'echo set on > " "/proc/dasd/statistics'\n"); - return dasd_calc_metrics(page, start, off, count, eof, len); + return 0; } prof = &dasd_global_profile; @@ -217,47 +198,49 @@ dasd_statistics_read(char *page, char **start, off_t off, for (factor = 1; (prof->dasd_io_reqs / factor) > 9999999; factor *= 10); - str = page; - str += sprintf(str, "%d dasd I/O requests\n", prof->dasd_io_reqs); - str += sprintf(str, "with %u sectors(512B each)\n", + seq_printf(m, "%d dasd I/O requests\n", prof->dasd_io_reqs); + seq_printf(m, "with %u sectors(512B each)\n", prof->dasd_io_sects); - str += sprintf(str, "Scale Factor is %d\n", factor); - str += sprintf(str, + seq_printf(m, "Scale Factor is %d\n", factor); + seq_printf(m, " __<4 ___8 __16 __32 __64 _128 " " _256 _512 __1k __2k __4k __8k " " _16k _32k _64k 128k\n"); - str += sprintf(str, + seq_printf(m, " _256 _512 __1M __2M __4M __8M " " _16M _32M _64M 128M 256M 512M " " __1G __2G __4G " " _>4G\n"); - str += sprintf(str, "Histogram of sizes (512B secs)\n"); - str = dasd_statistics_array(str, prof->dasd_io_secs, factor); - str += sprintf(str, "Histogram of I/O times (microseconds)\n"); - str = dasd_statistics_array(str, prof->dasd_io_times, factor); - str += sprintf(str, "Histogram of I/O times per sector\n"); - str = dasd_statistics_array(str, prof->dasd_io_timps, factor); - str += sprintf(str, "Histogram of I/O time till ssch\n"); - str = dasd_statistics_array(str, prof->dasd_io_time1, factor); - str += sprintf(str, "Histogram of I/O time between ssch and irq\n"); - str = dasd_statistics_array(str, prof->dasd_io_time2, factor); - str += sprintf(str, "Histogram of I/O time between ssch " + seq_printf(m, "Histogram of sizes (512B secs)\n"); + dasd_statistics_array(m, prof->dasd_io_secs, factor); + seq_printf(m, "Histogram of I/O times (microseconds)\n"); + dasd_statistics_array(m, prof->dasd_io_times, factor); + seq_printf(m, "Histogram of I/O times per sector\n"); + dasd_statistics_array(m, prof->dasd_io_timps, factor); + seq_printf(m, "Histogram of I/O time till ssch\n"); + dasd_statistics_array(m, prof->dasd_io_time1, factor); + seq_printf(m, "Histogram of I/O time between ssch and irq\n"); + dasd_statistics_array(m, prof->dasd_io_time2, factor); + seq_printf(m, "Histogram of I/O time between ssch " "and irq per sector\n"); - str = dasd_statistics_array(str, prof->dasd_io_time2ps, factor); - str += sprintf(str, "Histogram of I/O time between irq and end\n"); - str = dasd_statistics_array(str, prof->dasd_io_time3, factor); - str += sprintf(str, "# of req in chanq at enqueuing (1..32) \n"); - str = dasd_statistics_array(str, prof->dasd_io_nr_req, factor); - len = str - page; + dasd_statistics_array(m, prof->dasd_io_time2ps, factor); + seq_printf(m, "Histogram of I/O time between irq and end\n"); + dasd_statistics_array(m, prof->dasd_io_time3, factor); + seq_printf(m, "# of req in chanq at enqueuing (1..32) \n"); + dasd_statistics_array(m, prof->dasd_io_nr_req, factor); #else - len = sprintf(page, "Statistics are not activated in this kernel\n"); + seq_printf(m, "Statistics are not activated in this kernel\n"); #endif - return dasd_calc_metrics(page, start, off, count, eof, len); + return 0; } -static int -dasd_statistics_write(struct file *file, const char __user *user_buf, - unsigned long user_len, void *data) +static int dasd_stats_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, dasd_stats_proc_show, NULL); +} + +static ssize_t dasd_stats_proc_write(struct file *file, + const char __user *user_buf, size_t user_len, loff_t *pos) { #ifdef CONFIG_DASD_PROFILE char *buffer, *str; @@ -308,6 +291,15 @@ out_error: #endif /* CONFIG_DASD_PROFILE */ } +static const struct file_operations dasd_stats_proc_fops = { + .owner = THIS_MODULE, + .open = dasd_stats_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .write = dasd_stats_proc_write, +}; + /* * Create dasd proc-fs entries. * In case creation failed, cleanup and return -ENOENT. @@ -324,13 +316,12 @@ dasd_proc_init(void) &dasd_devices_file_ops); if (!dasd_devices_entry) goto out_nodevices; - dasd_statistics_entry = create_proc_entry("statistics", - S_IFREG | S_IRUGO | S_IWUSR, - dasd_proc_root_entry); + dasd_statistics_entry = proc_create("statistics", + S_IFREG | S_IRUGO | S_IWUSR, + dasd_proc_root_entry, + &dasd_stats_proc_fops); if (!dasd_statistics_entry) goto out_nostatistics; - dasd_statistics_entry->read_proc = dasd_statistics_read; - dasd_statistics_entry->write_proc = dasd_statistics_write; return 0; out_nostatistics: diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index 82daa3c1dc9..3438658b66b 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c @@ -15,6 +15,7 @@ #include <linux/init.h> #include <linux/miscdevice.h> #include <linux/debugfs.h> +#include <asm/asm-offsets.h> #include <asm/ipl.h> #include <asm/sclp.h> #include <asm/setup.h> @@ -40,12 +41,12 @@ enum arch_id { /* dump system info */ struct sys_info { - enum arch_id arch; - unsigned long sa_base; - u32 sa_size; - int cpu_map[NR_CPUS]; - unsigned long mem_size; - union save_area lc_mask; + enum arch_id arch; + unsigned long sa_base; + u32 sa_size; + int cpu_map[NR_CPUS]; + unsigned long mem_size; + struct save_area lc_mask; }; struct ipib_info { @@ -183,52 +184,9 @@ static int memcpy_real_user(void __user *dest, unsigned long src, size_t count) return 0; } -#ifdef __s390x__ -/* - * Convert s390x (64 bit) cpu info to s390 (32 bit) cpu info - */ -static void __init s390x_to_s390_regs(union save_area *out, union save_area *in, - int cpu) -{ - int i; - - for (i = 0; i < 16; i++) { - out->s390.gp_regs[i] = in->s390x.gp_regs[i] & 0x00000000ffffffff; - out->s390.acc_regs[i] = in->s390x.acc_regs[i]; - out->s390.ctrl_regs[i] = - in->s390x.ctrl_regs[i] & 0x00000000ffffffff; - } - /* locore for 31 bit has only space for fpregs 0,2,4,6 */ - out->s390.fp_regs[0] = in->s390x.fp_regs[0]; - out->s390.fp_regs[1] = in->s390x.fp_regs[2]; - out->s390.fp_regs[2] = in->s390x.fp_regs[4]; - out->s390.fp_regs[3] = in->s390x.fp_regs[6]; - memcpy(&(out->s390.psw[0]), &(in->s390x.psw[0]), 4); - out->s390.psw[1] |= 0x8; /* set bit 12 */ - memcpy(&(out->s390.psw[4]),&(in->s390x.psw[12]), 4); - out->s390.psw[4] |= 0x80; /* set (31bit) addressing bit */ - out->s390.pref_reg = in->s390x.pref_reg; - out->s390.timer = in->s390x.timer; - out->s390.clk_cmp = in->s390x.clk_cmp; -} - -static void __init s390x_to_s390_save_areas(void) -{ - int i = 1; - static union save_area tmp; - - while (zfcpdump_save_areas[i]) { - s390x_to_s390_regs(&tmp, zfcpdump_save_areas[i], i); - memcpy(zfcpdump_save_areas[i], &tmp, sizeof(tmp)); - i++; - } -} - -#endif /* __s390x__ */ - static int __init init_cpu_info(enum arch_id arch) { - union save_area *sa; + struct save_area *sa; /* get info for boot cpu from lowcore, stored in the HSA */ @@ -241,20 +199,12 @@ static int __init init_cpu_info(enum arch_id arch) return -EIO; } zfcpdump_save_areas[0] = sa; - -#ifdef __s390x__ - /* convert s390x regs to s390, if we are dumping an s390 Linux */ - - if (arch == ARCH_S390) - s390x_to_s390_save_areas(); -#endif - return 0; } static DEFINE_MUTEX(zcore_mutex); -#define DUMP_VERSION 0x3 +#define DUMP_VERSION 0x5 #define DUMP_MAGIC 0xa8190173618f23fdULL #define DUMP_ARCH_S390X 2 #define DUMP_ARCH_S390 1 @@ -279,7 +229,14 @@ struct zcore_header { u32 volnr; u32 build_arch; u64 rmem_size; - char pad2[4016]; + u8 mvdump; + u16 cpu_cnt; + u16 real_cpu_cnt; + u8 end_pad1[0x200-0x061]; + u64 mvdump_sign; + u64 mvdump_zipl_time; + u8 end_pad2[0x800-0x210]; + u32 lc_vec[512]; } __attribute__((packed,__aligned__(16))); static struct zcore_header zcore_header = { @@ -289,7 +246,7 @@ static struct zcore_header zcore_header = { .dump_level = 0, .page_size = PAGE_SIZE, .mem_start = 0, -#ifdef __s390x__ +#ifdef CONFIG_64BIT .build_arch = DUMP_ARCH_S390X, #else .build_arch = DUMP_ARCH_S390, @@ -340,11 +297,7 @@ static int zcore_add_lc(char __user *buf, unsigned long start, size_t count) unsigned long prefix; unsigned long sa_off, len, buf_off; - if (sys_info.arch == ARCH_S390) - prefix = zfcpdump_save_areas[i]->s390.pref_reg; - else - prefix = zfcpdump_save_areas[i]->s390x.pref_reg; - + prefix = zfcpdump_save_areas[i]->pref_reg; sa_start = prefix + sys_info.sa_base; sa_end = prefix + sys_info.sa_base + sys_info.sa_size; @@ -561,34 +514,39 @@ static const struct file_operations zcore_reipl_fops = { .release = zcore_reipl_release, }; +#ifdef CONFIG_32BIT -static void __init set_s390_lc_mask(union save_area *map) +static void __init set_lc_mask(struct save_area *map) { - memset(&map->s390.ext_save, 0xff, sizeof(map->s390.ext_save)); - memset(&map->s390.timer, 0xff, sizeof(map->s390.timer)); - memset(&map->s390.clk_cmp, 0xff, sizeof(map->s390.clk_cmp)); - memset(&map->s390.psw, 0xff, sizeof(map->s390.psw)); - memset(&map->s390.pref_reg, 0xff, sizeof(map->s390.pref_reg)); - memset(&map->s390.acc_regs, 0xff, sizeof(map->s390.acc_regs)); - memset(&map->s390.fp_regs, 0xff, sizeof(map->s390.fp_regs)); - memset(&map->s390.gp_regs, 0xff, sizeof(map->s390.gp_regs)); - memset(&map->s390.ctrl_regs, 0xff, sizeof(map->s390.ctrl_regs)); + memset(&map->ext_save, 0xff, sizeof(map->ext_save)); + memset(&map->timer, 0xff, sizeof(map->timer)); + memset(&map->clk_cmp, 0xff, sizeof(map->clk_cmp)); + memset(&map->psw, 0xff, sizeof(map->psw)); + memset(&map->pref_reg, 0xff, sizeof(map->pref_reg)); + memset(&map->acc_regs, 0xff, sizeof(map->acc_regs)); + memset(&map->fp_regs, 0xff, sizeof(map->fp_regs)); + memset(&map->gp_regs, 0xff, sizeof(map->gp_regs)); + memset(&map->ctrl_regs, 0xff, sizeof(map->ctrl_regs)); } -static void __init set_s390x_lc_mask(union save_area *map) +#else /* CONFIG_32BIT */ + +static void __init set_lc_mask(struct save_area *map) { - memset(&map->s390x.fp_regs, 0xff, sizeof(map->s390x.fp_regs)); - memset(&map->s390x.gp_regs, 0xff, sizeof(map->s390x.gp_regs)); - memset(&map->s390x.psw, 0xff, sizeof(map->s390x.psw)); - memset(&map->s390x.pref_reg, 0xff, sizeof(map->s390x.pref_reg)); - memset(&map->s390x.fp_ctrl_reg, 0xff, sizeof(map->s390x.fp_ctrl_reg)); - memset(&map->s390x.tod_reg, 0xff, sizeof(map->s390x.tod_reg)); - memset(&map->s390x.timer, 0xff, sizeof(map->s390x.timer)); - memset(&map->s390x.clk_cmp, 0xff, sizeof(map->s390x.clk_cmp)); - memset(&map->s390x.acc_regs, 0xff, sizeof(map->s390x.acc_regs)); - memset(&map->s390x.ctrl_regs, 0xff, sizeof(map->s390x.ctrl_regs)); + memset(&map->fp_regs, 0xff, sizeof(map->fp_regs)); + memset(&map->gp_regs, 0xff, sizeof(map->gp_regs)); + memset(&map->psw, 0xff, sizeof(map->psw)); + memset(&map->pref_reg, 0xff, sizeof(map->pref_reg)); + memset(&map->fp_ctrl_reg, 0xff, sizeof(map->fp_ctrl_reg)); + memset(&map->tod_reg, 0xff, sizeof(map->tod_reg)); + memset(&map->timer, 0xff, sizeof(map->timer)); + memset(&map->clk_cmp, 0xff, sizeof(map->clk_cmp)); + memset(&map->acc_regs, 0xff, sizeof(map->acc_regs)); + memset(&map->ctrl_regs, 0xff, sizeof(map->ctrl_regs)); } +#endif /* CONFIG_32BIT */ + /* * Initialize dump globals for a given architecture */ @@ -599,21 +557,18 @@ static int __init sys_info_init(enum arch_id arch) switch (arch) { case ARCH_S390X: pr_alert("DETECTED 'S390X (64 bit) OS'\n"); - sys_info.sa_base = SAVE_AREA_BASE_S390X; - sys_info.sa_size = sizeof(struct save_area_s390x); - set_s390x_lc_mask(&sys_info.lc_mask); break; case ARCH_S390: pr_alert("DETECTED 'S390 (32 bit) OS'\n"); - sys_info.sa_base = SAVE_AREA_BASE_S390; - sys_info.sa_size = sizeof(struct save_area_s390); - set_s390_lc_mask(&sys_info.lc_mask); break; default: pr_alert("0x%x is an unknown architecture.\n",arch); return -EINVAL; } + sys_info.sa_base = SAVE_AREA_BASE; + sys_info.sa_size = sizeof(struct save_area); sys_info.arch = arch; + set_lc_mask(&sys_info.lc_mask); rc = init_cpu_info(arch); if (rc) return rc; @@ -660,8 +615,9 @@ static int __init get_mem_size(unsigned long *mem) static int __init zcore_header_init(int arch, struct zcore_header *hdr) { - int rc; + int rc, i; unsigned long memory = 0; + u32 prefix; if (arch == ARCH_S390X) hdr->arch_id = DUMP_ARCH_S390X; @@ -676,6 +632,14 @@ static int __init zcore_header_init(int arch, struct zcore_header *hdr) hdr->num_pages = memory / PAGE_SIZE; hdr->tod = get_clock(); get_cpu_id(&hdr->cpu_id); + for (i = 0; zfcpdump_save_areas[i]; i++) { + prefix = zfcpdump_save_areas[i]->pref_reg; + hdr->real_cpu_cnt++; + if (!prefix) + continue; + hdr->lc_vec[hdr->cpu_cnt] = prefix; + hdr->cpu_cnt++; + } return 0; } @@ -741,14 +705,21 @@ static int __init zcore_init(void) if (rc) goto fail; -#ifndef __s390x__ +#ifdef CONFIG_64BIT + if (arch == ARCH_S390) { + pr_alert("The 64-bit dump tool cannot be used for a " + "32-bit system\n"); + rc = -EINVAL; + goto fail; + } +#else /* CONFIG_64BIT */ if (arch == ARCH_S390X) { pr_alert("The 32-bit dump tool cannot be used for a " "64-bit system\n"); rc = -EINVAL; goto fail; } -#endif +#endif /* CONFIG_64BIT */ rc = sys_info_init(arch); if (rc) diff --git a/drivers/s390/cio/ccwreq.c b/drivers/s390/cio/ccwreq.c index 7a28a3029a3..37df42af05e 100644 --- a/drivers/s390/cio/ccwreq.c +++ b/drivers/s390/cio/ccwreq.c @@ -224,8 +224,8 @@ static void ccwreq_log_status(struct ccw_device *cdev, enum io_status status) */ void ccw_request_handler(struct ccw_device *cdev) { + struct irb *irb = (struct irb *)&S390_lowcore.irb; struct ccw_request *req = &cdev->private->req; - struct irb *irb = (struct irb *) __LC_IRB; enum io_status status; int rc = -EOPNOTSUPP; diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 1ecd3e56764..4038f5b4f14 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -574,7 +574,7 @@ int __chsc_do_secm(struct channel_subsystem *css, int enable, void *page) secm_area->request.length = 0x0050; secm_area->request.code = 0x0016; - secm_area->key = PAGE_DEFAULT_KEY; + secm_area->key = PAGE_DEFAULT_KEY >> 4; secm_area->cub_addr1 = (u64)(unsigned long)css->cub_addr1; secm_area->cub_addr2 = (u64)(unsigned long)css->cub_addr2; diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index c84ac944307..852612f5dba 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c @@ -51,7 +51,7 @@ static void chsc_subchannel_irq(struct subchannel *sch) { struct chsc_private *private = sch->private; struct chsc_request *request = private->request; - struct irb *irb = (struct irb *)__LC_IRB; + struct irb *irb = (struct irb *)&S390_lowcore.irb; CHSC_LOG(4, "irb"); CHSC_LOG_HEX(4, irb, sizeof(*irb)); @@ -237,7 +237,7 @@ static int chsc_async(struct chsc_async_area *chsc_area, int ret = -ENODEV; char dbf[10]; - chsc_area->header.key = PAGE_DEFAULT_KEY; + chsc_area->header.key = PAGE_DEFAULT_KEY >> 4; while ((sch = chsc_get_next_subchannel(sch))) { spin_lock(sch->lock); private = sch->private; diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 126f240715a..f736cdcf08a 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -625,8 +625,8 @@ void __irq_entry do_IRQ(struct pt_regs *regs) /* * Get interrupt information from lowcore */ - tpi_info = (struct tpi_info *) __LC_SUBCHANNEL_ID; - irb = (struct irb *) __LC_IRB; + tpi_info = (struct tpi_info *)&S390_lowcore.subchannel_id; + irb = (struct irb *)&S390_lowcore.irb; do { kstat_cpu(smp_processor_id()).irqs[IO_INTERRUPT]++; /* @@ -661,7 +661,7 @@ void __irq_entry do_IRQ(struct pt_regs *regs) * We don't do this for VM because a tpi drops the cpu * out of the sie which costs more cycles than it saves. */ - } while (!MACHINE_IS_VM && tpi (NULL) != 0); + } while (MACHINE_IS_LPAR && tpi(NULL) != 0); irq_exit(); set_irq_regs(old_regs); } @@ -682,10 +682,10 @@ static int cio_tpi(void) struct irb *irb; int irq_context; - tpi_info = (struct tpi_info *) __LC_SUBCHANNEL_ID; + tpi_info = (struct tpi_info *)&S390_lowcore.subchannel_id; if (tpi(NULL) != 1) return 0; - irb = (struct irb *) __LC_IRB; + irb = (struct irb *)&S390_lowcore.irb; /* Store interrupt response block to lowcore. */ if (tsch(tpi_info->schid, irb) != 0) /* Not status pending or not operational. */ @@ -885,7 +885,7 @@ __clear_io_subchannel_easy(struct subchannel_id schid) struct tpi_info ti; if (tpi(&ti)) { - tsch(ti.schid, (struct irb *)__LC_IRB); + tsch(ti.schid, (struct irb *)&S390_lowcore.irb); if (schid_equal(&ti.schid, &schid)) return 0; } @@ -1083,7 +1083,7 @@ int __init cio_get_iplinfo(struct cio_iplinfo *iplinfo) struct subchannel_id schid; struct schib schib; - schid = *(struct subchannel_id *)__LC_SUBCHANNEL_ID; + schid = *(struct subchannel_id *)&S390_lowcore.subchannel_id; if (!schid.one) return -ENODEV; if (stsch(schid, &schib)) diff --git a/drivers/s390/cio/crw.c b/drivers/s390/cio/crw.c index d157665d0e7..425f741a280 100644 --- a/drivers/s390/cio/crw.c +++ b/drivers/s390/cio/crw.c @@ -8,15 +8,16 @@ * Heiko Carstens <heiko.carstens@de.ibm.com>, */ -#include <linux/semaphore.h> #include <linux/mutex.h> #include <linux/kthread.h> #include <linux/init.h> +#include <linux/wait.h> #include <asm/crw.h> -static struct semaphore crw_semaphore; static DEFINE_MUTEX(crw_handler_mutex); static crw_handler_t crw_handlers[NR_RSCS]; +static atomic_t crw_nr_req = ATOMIC_INIT(0); +static DECLARE_WAIT_QUEUE_HEAD(crw_handler_wait_q); /** * crw_register_handler() - register a channel report word handler @@ -59,12 +60,14 @@ void crw_unregister_handler(int rsc) static int crw_collect_info(void *unused) { struct crw crw[2]; - int ccode; + int ccode, signal; unsigned int chain; - int ignore; repeat: - ignore = down_interruptible(&crw_semaphore); + signal = wait_event_interruptible(crw_handler_wait_q, + atomic_read(&crw_nr_req) > 0); + if (unlikely(signal)) + atomic_inc(&crw_nr_req); chain = 0; while (1) { crw_handler_t handler; @@ -122,25 +125,23 @@ repeat: /* chain is always 0 or 1 here. */ chain = crw[chain].chn ? chain + 1 : 0; } + if (atomic_dec_and_test(&crw_nr_req)) + wake_up(&crw_handler_wait_q); goto repeat; return 0; } void crw_handle_channel_report(void) { - up(&crw_semaphore); + atomic_inc(&crw_nr_req); + wake_up(&crw_handler_wait_q); } -/* - * Separate initcall needed for semaphore initialization since - * crw_handle_channel_report might be called before crw_machine_check_init. - */ -static int __init crw_init_semaphore(void) +void crw_wait_for_channel_report(void) { - init_MUTEX_LOCKED(&crw_semaphore); - return 0; + crw_handle_channel_report(); + wait_event(crw_handler_wait_q, atomic_read(&crw_nr_req) == 0); } -pure_initcall(crw_init_semaphore); /* * Machine checks for the channel subsystem must be enabled diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 7679aee6fa1..2769da54f2b 100644 --- a/drivers/s390/cio/css.c +++ b/ |