s390 patches for the 3.10 merge window #2
Subsystems (5)
Hi Linus,
please pull from the 'for-linus' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git for-linus
to receive the following updates:
This is the second batch of s390 patches for the 3.10 merge window. Heiko improved the memory detection, this fixes kdump for large memory sizes. Some kvm related memory management work, new ipldev/condev keywords in cio and bug fixes.
Heiko Carstens (11):
s390/uaccess: add "fallthrough" comments
s390/mem_detect: move memory detection code to mm folder s390/mem_detect: fix lockdep irq tracing
s390/mem_detect: add DAT sanity check
s390/zcore: calculate real memory size using own get_mem_size function
s390: get rid of odd global real_memory_size s390/kdump,bootmem: fix bootmem allocator bitmap size s390/mem_detect: limit memory detection loop to "mem=" parameter s390/memory hotplug: provide memory_block_size_bytes() function s390/memory hotplug,sclp: get rid of per memory increment usecount s390/mem_detect: remove artificial kdump memory types
Ingo Tuchscherer (1):
s390/zcrypt: ap bus rescan problem when toggle crypto adapters on/off
Martin Schwidefsky (1):
s390/mm: add pte invalidation notifier for kvm
Nick Wang (1):
s390/kvm: Change the virtual memory mapping location for Virtio devices
Sebastian Ott (3):
s390/cio: add ipldev keyword to cio_ignore s390/cio: add condev keyword to cio_ignore s390/zfcpdump: exploit new cio_ignore keywords
Documentation/s390/CommonIO | 12 ++-- arch/s390/include/asm/pgtable.h | 66 +++++++++++++++--- arch/s390/include/asm/setup.h | 9 +-- arch/s390/kernel/Makefile | 2 +- arch/s390/kernel/crash_dump.c | 6 +- arch/s390/kernel/early.c | 1 - arch/s390/kernel/mem_detect.c | 145 --------------------------------------- arch/s390/kernel/setup.c | 65 +++++++----------- arch/s390/lib/uaccess_pt.c | 3 + arch/s390/mm/Makefile | 2 +- arch/s390/mm/init.c | 11 +++ arch/s390/mm/mem_detect.c | 134 ++++++++++++++++++++++++++++++++++++ arch/s390/mm/pgtable.c | 121 ++++++++++++++++++++++++++++++-- arch/s390/mm/vmem.c | 8 +-- drivers/s390/char/sclp_cmd.c | 20 +----- drivers/s390/char/zcore.c | 34 ++++----- drivers/s390/cio/blacklist.c | 28 +++++++- drivers/s390/crypto/ap_bus.c | 17 ++--- drivers/s390/kvm/kvm_virtio.c | 11 +-- 19 files changed, 421 insertions(+), 274 deletions(-) delete mode 100644 arch/s390/kernel/mem_detect.c create mode 100644 arch/s390/mm/mem_detect.c
Documentation/s390/CommonIO +7 -5
@@ -8,9 +8,9 @@ Command line parameters Enable logging of debug information in case of ccw device timeouts. -* cio_ignore = {all} | - {<device> | <range of devices>} | - {!<device> | !<range of devices>} +* cio_ignore = device[,device[,..]] + + device := {all | [!]ipldev | [!]condev | [!]<devno> | [!]<devno>-<devno>} The given devices will be ignored by the common I/O-layer; no detection and device sensing will be done on any of those devices. The subchannel to
@@ -24,8 +24,10 @@ Command line parameters device numbers (0xabcd or abcd, for 2.4 backward compatibility). If you give a device number 0xabcd, it will be interpreted as 0.0.abcd. - You can use the 'all' keyword to ignore all devices. - The '!' operator will cause the I/O-layer to _not_ ignore a device. + You can use the 'all' keyword to ignore all devices. The 'ipldev' and 'condev' + keywords can be used to refer to the CCW based boot device and CCW console + device respectively (these are probably useful only when combined with the '!' + operator). The '!' operator will cause the I/O-layer to _not_ ignore a device. The command line is parsed from left to right. For example,
arch/s390/include/asm/pgtable.h +56 -10
155 lines not on this page · raw message
arch/s390/include/asm/setup.h +3 -6
@@ -33,8 +33,6 @@#define CHUNK_READ_WRITE 0#define CHUNK_READ_ONLY 1 -#define CHUNK_OLDMEM 4 -#define CHUNK_CRASHK 5struct mem_chunk {unsigned long addr;
@@ -43,13 +41,12 @@ struct mem_chunk { };extern struct mem_chunk memory_chunk[]; -extern unsigned long real_memory_size;extern int memory_end_set;extern unsigned long memory_end; -void detect_memory_layout (struct mem_chunk chunk[]); -void create_mem_hole (struct mem_chunk memory_chunk[],unsigned long addr, -unsigned long size,int type); +void detect_memory_layout (struct mem_chunk chunk[],unsigned long maxsize); +void create_mem_hole (struct mem_chunk mem_chunk[],unsigned long addr, +unsigned long size);#define PRIMARY_SPACE_MODE 0#define ACCESS_REGISTER_MODE 1
arch/s390/kernel/Makefile +1 -1
@@ -30,7 +30,7 @@ CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o vtime.o obj-y += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o -obj-y += debug.o irq.o ipl.o dis.o diag.o mem_detect.o sclp.o vdso.o +obj-y += debug.o irq.o ipl.o dis.o diag.o sclp.o vdso.o obj-y += sysinfo.o jump_label.o lgr.o os_info.o machine_kexec.o pgm_check.o obj-y += dumpstack.o
arch/s390/kernel/crash_dump.c +3 -3
@@ -88,8 +88,8 @@ static struct mem_chunk *get_memory_layout(void)struct mem_chunk *chunk_array; chunk_array =kzalloc_panic (MEMORY_CHUNKS *sizeof (struct mem_chunk )); -detect_memory_layout (chunk_array); -create_mem_hole (chunk_array,OLDMEM_BASE ,OLDMEM_SIZE ,CHUNK_CRASHK ); +detect_memory_layout (chunk_array,0 ); +create_mem_hole (chunk_array,OLDMEM_BASE ,OLDMEM_SIZE );return chunk_array; }
@@ -344,7 +344,7 @@ static int loads_init(Elf64_Phdr *phdr, u64 loads_offset)for (i =0 ; i <MEMORY_CHUNKS ; i++) { mem_chunk = &chunk_array[i];if (mem_chunk->size ==0 ) -break ; +continue ;if (chunk_array[i].type !=CHUNK_READ_WRITE && chunk_array[i].type !=CHUNK_READ_ONLY )continue ;
arch/s390/kernel/early.c +0 -1
@@ -482,7 +482,6 @@ void __init startup_init(void)detect_machine_facilities ();setup_topology ();sclp_facilities_detect (); -detect_memory_layout (memory_chunk);#ifdef CONFIG_DYNAMIC_FTRACE S390_lowcore.ftrace_func = (unsigned long )ftrace_caller;#endif
arch/s390/kernel/mem_detect.c deleted +0 -145
145 lines not on this page · raw message
arch/s390/kernel/setup.c +25 -40
161 lines not on this page · raw message
arch/s390/lib/uaccess_pt.c +3 -0
@@ -89,16 +89,19 @@ static unsigned long follow_table(struct mm_struct *mm,if (unlikely (*table & _REGION_ENTRY_INV))return -0x39UL ; table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); +/* fallthrough */ case _ASCE_TYPE_REGION2: table = table + ((address >>42 ) &0x7ff );if (unlikely (*table & _REGION_ENTRY_INV))return -0x3aUL ; table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); +/* fallthrough */ case _ASCE_TYPE_REGION3: table = table + ((address >>31 ) &0x7ff );if (unlikely (*table & _REGION_ENTRY_INV))return -0x3bUL ; table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); +/* fallthrough */ case _ASCE_TYPE_SEGMENT: table = table + ((address >>20 ) &0x7ff );if (unlikely (*table & _SEGMENT_ENTRY_INV))
arch/s390/mm/Makefile +1 -1
@@ -3,7 +3,7 @@ # obj-y := init.o fault.o extmem.o mmap.o vmem.o pgtable.o maccess.o -obj-y += page-states.o gup.o extable.o pageattr.o +obj-y += page-states.o gup.o extable.o pageattr.o mem_detect.o obj-$(CONFIG_CMM) += cmm.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
arch/s390/mm/init.c +11 -0
@@ -21,6 +21,7 @@#include <linux/init.h> #include <linux/pagemap.h> #include <linux/bootmem.h> +#include <linux/memory.h> #include <linux/pfn.h> #include <linux/poison.h> #include <linux/initrd.h>
@@ -36,6 +37,7 @@#include <asm/tlbflush.h> #include <asm/sections.h> #include <asm/ctl_reg.h> +#include <asm/sclp.h> pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
@@ -214,6 +216,15 @@ int arch_add_memory(int nid, u64 start, u64 size)return rc; } +unsigned long memory_block_size_bytes (void ) +{ +/* +* Make sure the memory block size is always greater +* or equal than the memory increment size. +*/ + return max_t(unsigned long, MIN_MEMORY_BLOCK_SIZE, sclp_get_rzm()); +} +#ifdef CONFIG_MEMORY_HOTREMOVE int arch_remove_memory (u64 start,u64 size) {
arch/s390/mm/mem_detect.c new file +134 -0
134 lines not on this page · raw message
arch/s390/mm/pgtable.c +117 -4
146 lines not on this page · raw message
arch/s390/mm/vmem.c +2 -6
@@ -375,9 +375,8 @@ void __init vmem_map_init(void) ro_start =PFN_ALIGN ((unsigned long )&_stext); ro_end = (unsigned long )&_eshared &PAGE_MASK ; -for (i =0 ; i <MEMORY_CHUNKS && memory_chunk[i].size >0 ; i++) { -if (memory_chunk[i].type ==CHUNK_CRASHK || - memory_chunk[i].type ==CHUNK_OLDMEM ) +for (i =0 ; i <MEMORY_CHUNKS ; i++) { +if (!memory_chunk[i].size)continue ; start = memory_chunk[i].addr; end = memory_chunk[i].addr + memory_chunk[i].size;
@@ -412,9 +411,6 @@ static int __init vmem_convert_memory_chunk(void)for (i =0 ; i <MEMORY_CHUNKS ; i++) {if (!memory_chunk[i].size)continue ; -if (memory_chunk[i].type ==CHUNK_CRASHK || - memory_chunk[i].type ==CHUNK_OLDMEM ) -continue ; seg =kzalloc (sizeof (*seg),GFP_KERNEL );if (!seg)panic ("Out of memory...\n" );
drivers/s390/char/sclp_cmd.c +2 -18
@@ -345,7 +345,6 @@ struct memory_increment {struct list_head list;u16 rn;int standby; -int usecount; };struct assign_storage_sccb {
@@ -463,21 +462,10 @@ static int sclp_mem_change_state(unsigned long start, unsigned long size,break ;if (start > istart + rzm -1 )continue ; -if (online) { -if (incr->usecount++) -continue ; -/* -* Don't break the loop if one assign fails. Loop may -* be walked again on CANCEL and we can't save -* information if state changed before or not. -* So continue and increase usecount for all increments. -*/ +if (online) rc |=sclp_assign_storage (incr->rn); - }else { -if (--incr->usecount) -continue ; +else sclp_unassign_storage (incr->rn); - } }return rc ? -EIO :0 ; }
@@ -561,8 +549,6 @@ static void __init sclp_add_standby_memory(void)add_memory_merged (0 ); } -#define MEM_SCT_SIZE (1UL << SECTION_SIZE_BITS) -static void __init insert_increment (u16 rn,int standby,int assigned) {struct memory_increment *incr, *new_incr;
@@ -574,8 +560,6 @@ static void __init insert_increment(u16 rn, int standby, int assigned)return ; new_incr->rn = rn; new_incr->standby = standby; -if (!standby) - new_incr->usecount = rzm >MEM_SCT_SIZE ? rzm/MEM_SCT_SIZE :1 ; last_rn =0 ; prev = &sclp_mem_list;list_for_each_entry (incr, &sclp_mem_list, list) {
drivers/s390/char/zcore.c +17 -17
@@ -426,7 +426,7 @@ static int zcore_memmap_open(struct inode *inode, struct file *filp) GFP_KERNEL);if (!chunk_array)return -ENOMEM ; -detect_memory_layout (chunk_array); +detect_memory_layout (chunk_array,0 ); buf =kzalloc (MEMORY_CHUNKS *CHUNK_INFO_SIZE ,GFP_KERNEL );if (!buf) {kfree (chunk_array);
@@ -557,7 +557,7 @@ static void __init set_lc_mask(struct save_area *map)/* * Initialize dump globals for a given architecture */ -static int __init sys_info_init (enum arch_id arch) +static int __init sys_info_init (enum arch_id arch,unsigned long mem_end) {int rc;
@@ -579,7 +579,7 @@ static int __init sys_info_init(enum arch_id arch) rc =init_cpu_info (arch);if (rc)return rc; - sys_info.mem_size = real_memory_size; + sys_info.mem_size = mem_end;return 0 ; }
@@ -601,7 +601,7 @@ static int __init check_sdias(void)return 0 ; } -static int __init get_mem_size (unsigned long *mem) +static int __init get_mem_info (unsigned long *mem,unsigned long *end) {int i;struct mem_chunk *chunk_array;
@@ -610,33 +610,31 @@ static int __init get_mem_size(unsigned long *mem) GFP_KERNEL);if (!chunk_array)return -ENOMEM ; -detect_memory_layout (chunk_array); +detect_memory_layout (chunk_array,0 );for (i =0 ; i <MEMORY_CHUNKS ; i++) {if (chunk_array[i].size ==0 )break ; *mem += chunk_array[i].size; + *end =max (*end, chunk_array[i].addr + chunk_array[i].size); }kfree (chunk_array);return 0 ; } -static int __init zcore_header_init (int arch,struct zcore_header *hdr) +static void __init zcore_header_init (int arch,struct zcore_header *hdr, +unsigned long mem_size) { -int rc, i; -unsigned long memory =0 ;u32 prefix; +int i;if (arch ==ARCH_S390X ) hdr->arch_id =DUMP_ARCH_S390X ;else hdr->arch_id =DUMP_ARCH_S390 ; - rc =get_mem_size (&memory); -if (rc) -return rc; - hdr->mem_size = memory; - hdr->rmem_size = memory; + hdr->mem_size = mem_size; + hdr->rmem_size = mem_size; hdr->mem_end = sys_info.mem_size; - hdr->num_pages = memory /PAGE_SIZE ; + hdr->num_pages = mem_size /PAGE_SIZE ; hdr->tod =get_tod_clock ();get_cpu_id (&hdr->cpu_id);for (i =0 ; zfcpdump_save_areas[i]; i++) {
@@ -647,7 +645,6 @@ static int __init zcore_header_init(int arch, struct zcore_header *hdr) hdr->lc_vec[hdr->cpu_cnt] = prefix; hdr->cpu_cnt++; } -return 0 ; }/*
@@ -682,9 +679,11 @@ static int __init zcore_reipl_init(void)static int __init zcore_init (void ) { +unsigned long mem_size, mem_end;unsigned char arch;int rc; + mem_size = mem_end =0 ;if (ipl_info.type !=IPL_TYPE_FCP_DUMP )return -ENODATA ;if (OLDMEM_BASE )
@@ -727,13 +726,14 @@ static int __init zcore_init(void) }#endif /* CONFIG_64BIT */ - rc =sys_info_init (arch); + rc =get_mem_info (&mem_size, &mem_end);if (rc) goto fail; - rc =zcore_header_init (arch, &zcore_header); + rc =sys_info_init (arch, mem_end);if (rc) goto fail; +zcore_header_init (arch, &zcore_header, mem_size); rc =zcore_reipl_init ();if (rc)
drivers/s390/cio/blacklist.c +26 -2
@@ -1,7 +1,7 @@/* * S/390 common I/O routines -- blacklisting of specific devices * -* Copyright IBM Corp. 1999, 2002 +* Copyright IBM Corp. 1999, 2013 * Author(s): Ingo Adlung ([email protected]) * Cornelia Huck ([email protected]) * Arnd Bergmann ([email protected])
@@ -17,8 +17,9 @@#include <linux/ctype.h> #include <linux/device.h> -#include <asm/cio.h> #include <asm/uaccess.h> +#include <asm/cio.h> +#include <asm/ipl.h> #include "blacklist.h" #include "cio.h"
@@ -172,6 +173,29 @@ static int blacklist_parse_parameters(char *str, range_action action, to_cssid = __MAX_CSSID; to_ssid = __MAX_SSID; to = __MAX_SUBCHANNEL; + }else if (strcmp (parm,"ipldev" ) ==0 ) { +if (ipl_info.type ==IPL_TYPE_CCW ) { + from_cssid =0 ; + from_ssid = ipl_info.data.ccw.dev_id.ssid; + from = ipl_info.data.ccw.dev_id.devno; + }else if (ipl_info.type ==IPL_TYPE_FCP || + ipl_info.type ==IPL_TYPE_FCP_DUMP ) { + from_cssid =0 ; + from_ssid = ipl_info.data.fcp.dev_id.ssid; + from = ipl_info.data.fcp.dev_id.devno; + }else { +continue ; + } + to_cssid = from_cssid; + to_ssid = from_ssid; + to = from; + }else if (strcmp (parm,"condev" ) ==0 ) { +if (console_devno ==-1 ) +continue ; + + from_cssid = to_cssid =0 ; + from_ssid = to_ssid =0 ; + from = to = console_devno; }else { rc =parse_busid (strsep (&parm,"-" ), &from_cssid, &from_ssid, &from, msgtrigger);
drivers/s390/crypto/ap_bus.c +7 -10
@@ -954,15 +954,11 @@ EXPORT_SYMBOL(ap_driver_unregister);void ap_bus_force_rescan (void ) { -/* Delete the AP bus rescan timer. */ -del_timer (&ap_config_timer); - -/* processing a synchonuous bus rescan */ -ap_scan_bus (NULL ); - -/* Setup the AP bus rescan timer again. */ - ap_config_timer.expires = jiffies + ap_config_time *HZ ; -add_timer (&ap_config_timer); +/* reconfigure the AP bus rescan timer. */ +mod_timer (&ap_config_timer, jiffies + ap_config_time *HZ ); +/* processing a asynchronous bus rescan */ +queue_work (ap_work_queue, &ap_config_work); +flush_work (&ap_config_work); }EXPORT_SYMBOL (ap_bus_force_rescan);
@@ -1305,8 +1301,9 @@ static void ap_scan_bus(struct work_struct *unused)int rc, i;ap_query_configuration (); -if (ap_select_domain () !=0 ) +if (ap_select_domain () !=0 ) {return ; + }for (i =0 ; i <AP_DEVICES ; i++) { qid =AP_MKQID (i, ap_domain_index); dev = bus_find_device(&ap_bus_type, NULL,
drivers/s390/kvm/kvm_virtio.c +6 -5
@@ -443,29 +443,30 @@ static int __init test_devices_support(unsigned long addr) }/* * Init function for virtio -* devices are in a single page above top of "normal" mem +* devices are in a single page above top of "normal" + standby mem */ static int __init kvm_devices_init (void ) {int rc; +unsigned long total_memory_size =sclp_get_rzm () *sclp_get_rnmax ();if (!MACHINE_IS_KVM )return -ENODEV ; -if (test_devices_support (real_memory_size) <0 ) +if (test_devices_support (total_memory_size) <0 )return -ENODEV ; - rc =vmem_add_mapping (real_memory_size,PAGE_SIZE ); + rc =vmem_add_mapping (total_memory_size,PAGE_SIZE );if (rc)return rc; - kvm_devices = (void *) real_memory_size; + kvm_devices = (void *) total_memory_size; kvm_root =root_device_register ("kvm_s390" );if (IS_ERR (kvm_root)) { rc =PTR_ERR (kvm_root);printk (KERN_ERR "Could not register kvm_s390 root device" ); -vmem_remove_mapping (real_memory_size,PAGE_SIZE ); +vmem_remove_mapping (total_memory_size,PAGE_SIZE );return rc; }