Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
"One performance optimization for page_clear and a couple of bug fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/mm: fix incorrect ASCE after crst_table_downgrade
s390/ftrace: fix crashes when switching tracers / add notrace to cpu_relax()
s390/pci: unify pci_iomap symbol exports
s390/pci: fix [un]map_resources sequence
s390: let the compiler do page clearing
s390/pci: fix possible information leak in mmio syscall
s390/dcss: array index 'i' is used before limits check.
s390/scm_block: fix off by one during cluster reservation
s390/jump label: improve and fix sanity check
s390/jump label: add missing jump_label_apply_nops() call

+38 -39
+1 -1
arch/s390/include/asm/mmu_context.h
··· 62 62 { 63 63 int cpu = smp_processor_id(); 64 64 65 + S390_lowcore.user_asce = next->context.asce_bits | __pa(next->pgd); 65 66 if (prev == next) 66 67 return; 67 68 if (MACHINE_HAS_TLB_LC) ··· 74 73 atomic_dec(&prev->context.attach_count); 75 74 if (MACHINE_HAS_TLB_LC) 76 75 cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask); 77 - S390_lowcore.user_asce = next->context.asce_bits | __pa(next->pgd); 78 76 } 79 77 80 78 #define finish_arch_post_lock_switch finish_arch_post_lock_switch
+1 -10
arch/s390/include/asm/page.h
··· 37 37 #endif 38 38 } 39 39 40 - static inline void clear_page(void *page) 41 - { 42 - register unsigned long reg1 asm ("1") = 0; 43 - register void *reg2 asm ("2") = page; 44 - register unsigned long reg3 asm ("3") = 4096; 45 - asm volatile( 46 - " mvcl 2,0" 47 - : "+d" (reg2), "+d" (reg3) : "d" (reg1) 48 - : "memory", "cc"); 49 - } 40 + #define clear_page(page) memset((page), 0, PAGE_SIZE) 50 41 51 42 /* 52 43 * copy_page uses the mvcl instruction with 0xb0 padding byte in order to
+8 -4
arch/s390/kernel/jump_label.c
··· 36 36 insn->offset = (entry->target - entry->code) >> 1; 37 37 } 38 38 39 - static void jump_label_bug(struct jump_entry *entry, struct insn *insn) 39 + static void jump_label_bug(struct jump_entry *entry, struct insn *expected, 40 + struct insn *new) 40 41 { 41 42 unsigned char *ipc = (unsigned char *)entry->code; 42 - unsigned char *ipe = (unsigned char *)insn; 43 + unsigned char *ipe = (unsigned char *)expected; 44 + unsigned char *ipn = (unsigned char *)new; 43 45 44 46 pr_emerg("Jump label code mismatch at %pS [%p]\n", ipc, ipc); 45 47 pr_emerg("Found: %02x %02x %02x %02x %02x %02x\n", 46 48 ipc[0], ipc[1], ipc[2], ipc[3], ipc[4], ipc[5]); 47 49 pr_emerg("Expected: %02x %02x %02x %02x %02x %02x\n", 48 50 ipe[0], ipe[1], ipe[2], ipe[3], ipe[4], ipe[5]); 51 + pr_emerg("New: %02x %02x %02x %02x %02x %02x\n", 52 + ipn[0], ipn[1], ipn[2], ipn[3], ipn[4], ipn[5]); 49 53 panic("Corrupted kernel text"); 50 54 } 51 55 ··· 73 69 } 74 70 if (init) { 75 71 if (memcmp((void *)entry->code, &orignop, sizeof(orignop))) 76 - jump_label_bug(entry, &old); 72 + jump_label_bug(entry, &orignop, &new); 77 73 } else { 78 74 if (memcmp((void *)entry->code, &old, sizeof(old))) 79 - jump_label_bug(entry, &old); 75 + jump_label_bug(entry, &old, &new); 80 76 } 81 77 probe_kernel_write((void *)entry->code, &new, sizeof(new)); 82 78 }
+1
arch/s390/kernel/module.c
··· 436 436 const Elf_Shdr *sechdrs, 437 437 struct module *me) 438 438 { 439 + jump_label_apply_nops(me); 439 440 vfree(me->arch.syminfo); 440 441 me->arch.syminfo = NULL; 441 442 return 0;
+1 -1
arch/s390/kernel/processor.c
··· 18 18 19 19 static DEFINE_PER_CPU(struct cpuid, cpu_id); 20 20 21 - void cpu_relax(void) 21 + void notrace cpu_relax(void) 22 22 { 23 23 if (!smp_cpu_mtid && MACHINE_HAS_DIAG44) 24 24 asm volatile("diag 0,0,0x44");
+16 -12
arch/s390/pci/pci.c
··· 287 287 addr = ZPCI_IOMAP_ADDR_BASE | ((u64) idx << 48); 288 288 return (void __iomem *) addr + offset; 289 289 } 290 - EXPORT_SYMBOL_GPL(pci_iomap_range); 290 + EXPORT_SYMBOL(pci_iomap_range); 291 291 292 292 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 293 293 { ··· 309 309 } 310 310 spin_unlock(&zpci_iomap_lock); 311 311 } 312 - EXPORT_SYMBOL_GPL(pci_iounmap); 312 + EXPORT_SYMBOL(pci_iounmap); 313 313 314 314 static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, 315 315 int size, u32 *val) ··· 483 483 airq_iv_free_bit(zpci_aisb_iv, zdev->aisb); 484 484 } 485 485 486 - static void zpci_map_resources(struct zpci_dev *zdev) 486 + static void zpci_map_resources(struct pci_dev *pdev) 487 487 { 488 - struct pci_dev *pdev = zdev->pdev; 489 488 resource_size_t len; 490 489 int i; 491 490 ··· 498 499 } 499 500 } 500 501 501 - static void zpci_unmap_resources(struct zpci_dev *zdev) 502 + static void zpci_unmap_resources(struct pci_dev *pdev) 502 503 { 503 - struct pci_dev *pdev = zdev->pdev; 504 504 resource_size_t len; 505 505 int i; 506 506 ··· 649 651 650 652 zdev->pdev = pdev; 651 653 pdev->dev.groups = zpci_attr_groups; 652 - zpci_map_resources(zdev); 654 + zpci_map_resources(pdev); 653 655 654 656 for (i = 0; i < PCI_BAR_COUNT; i++) { 655 657 res = &pdev->resource[i]; ··· 661 663 return 0; 662 664 } 663 665 666 + void pcibios_release_device(struct pci_dev *pdev) 667 + { 668 + zpci_unmap_resources(pdev); 669 + } 670 + 664 671 int pcibios_enable_device(struct pci_dev *pdev, int mask) 665 672 { 666 673 struct zpci_dev *zdev = get_zdev(pdev); ··· 673 670 zdev->pdev = pdev; 674 671 zpci_debug_init_device(zdev); 675 672 zpci_fmb_enable_device(zdev); 676 - zpci_map_resources(zdev); 677 673 678 674 return pci_enable_resources(pdev, mask); 679 675 } ··· 681 679 { 682 680 struct zpci_dev *zdev = get_zdev(pdev); 683 681 684 - zpci_unmap_resources(zdev); 685 682 zpci_fmb_disable_device(zdev); 686 683 zpci_debug_exit_device(zdev); 687 684 zdev->pdev = NULL; ··· 689 688 #ifdef CONFIG_HIBERNATE_CALLBACKS 690 689 static int zpci_restore(struct device *dev) 691 690 { 692 - struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); 691 + struct pci_dev *pdev = to_pci_dev(dev); 692 + struct zpci_dev *zdev = get_zdev(pdev); 693 693 int ret = 0; 694 694 695 695 if (zdev->state != ZPCI_FN_STATE_ONLINE) ··· 700 698 if (ret) 701 699 goto out; 702 700 703 - zpci_map_resources(zdev); 701 + zpci_map_resources(pdev); 704 702 zpci_register_ioat(zdev, 0, zdev->start_dma + PAGE_OFFSET, 705 703 zdev->start_dma + zdev->iommu_size - 1, 706 704 (u64) zdev->dma_table); ··· 711 709 712 710 static int zpci_freeze(struct device *dev) 713 711 { 714 - struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); 712 + struct pci_dev *pdev = to_pci_dev(dev); 713 + struct zpci_dev *zdev = get_zdev(pdev); 715 714 716 715 if (zdev->state != ZPCI_FN_STATE_ONLINE) 717 716 return 0; 718 717 719 718 zpci_unregister_ioat(zdev, 0); 719 + zpci_unmap_resources(pdev); 720 720 return clp_disable_fh(zdev); 721 721 } 722 722
+8 -9
arch/s390/pci/pci_mmio.c
··· 64 64 if (copy_from_user(buf, user_buffer, length)) 65 65 goto out; 66 66 67 - memcpy_toio(io_addr, buf, length); 68 - ret = 0; 67 + ret = zpci_memcpy_toio(io_addr, buf, length); 69 68 out: 70 69 if (buf != local_buf) 71 70 kfree(buf); ··· 97 98 goto out; 98 99 io_addr = (void __iomem *)((pfn << PAGE_SHIFT) | (mmio_addr & ~PAGE_MASK)); 99 100 100 - ret = -EFAULT; 101 - if ((unsigned long) io_addr < ZPCI_IOMAP_ADDR_BASE) 101 + if ((unsigned long) io_addr < ZPCI_IOMAP_ADDR_BASE) { 102 + ret = -EFAULT; 102 103 goto out; 103 - 104 - memcpy_fromio(buf, io_addr, length); 105 - 104 + } 105 + ret = zpci_memcpy_fromio(buf, io_addr, length); 106 + if (ret) 107 + goto out; 106 108 if (copy_to_user(user_buffer, buf, length)) 107 - goto out; 109 + ret = -EFAULT; 108 110 109 - ret = 0; 110 111 out: 111 112 if (buf != local_buf) 112 113 kfree(buf);
+1 -1
drivers/s390/block/dcssblk.c
··· 547 547 * parse input 548 548 */ 549 549 num_of_segments = 0; 550 - for (i = 0; ((buf[i] != '\0') && (buf[i] != '\n') && i < count); i++) { 550 + for (i = 0; (i < count && (buf[i] != '\0') && (buf[i] != '\n')); i++) { 551 551 for (j = i; (buf[j] != ':') && 552 552 (buf[j] != '\0') && 553 553 (buf[j] != '\n') &&
+1 -1
drivers/s390/block/scm_blk_cluster.c
··· 92 92 add = 0; 93 93 continue; 94 94 } 95 - for (pos = 0; pos <= iter->aob->request.msb_count; pos++) { 95 + for (pos = 0; pos < iter->aob->request.msb_count; pos++) { 96 96 if (clusters_intersect(req, iter->request[pos]) && 97 97 (rq_data_dir(req) == WRITE || 98 98 rq_data_dir(iter->request[pos]) == WRITE)) {