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 'parisc-4.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc updates from Helge Deller:
"The first three patches are trivial and add some required KERN_CONT,
ignore the new pkey syscalls on parisc and use the LINUX_GATEWAY_ADDR
define instead of hardcoded values.

The two patches from Dave Anglin are important.

The first one avoids trashing the sr2 and sr3 space registers in the
Light-weight syscall path. Especially the usage of sr3 is critical
since it may get trashed by the interrupt handler.

The second patch is even more important and tagged for stable series.
It protects one critical section in the syscall entry path by
disabling local interrupts. Without disabling interrupts, the sr7
space register may not be in sync with the current stack setup and
thus an incoming hardware interrupt may destroy memory in random
userspace areas"

* 'parisc-4.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: Ignore the pkey system calls for now
parisc: Use LINUX_GATEWAY_ADDR define instead of hardcoded value
parisc: Ensure consistent state when switching to kernel stack at syscall entry
parisc: Avoid trashing sr2 and sr3 in LWS code
parisc: use KERN_CONT when printing device inventory

+40 -36
+3 -1
arch/parisc/include/uapi/asm/unistd.h
··· 368 368 369 369 #define __IGNORE_select /* newselect */ 370 370 #define __IGNORE_fadvise64 /* fadvise64_64 */ 371 - 371 + #define __IGNORE_pkey_mprotect 372 + #define __IGNORE_pkey_alloc 373 + #define __IGNORE_pkey_free 372 374 373 375 #define LINUX_GATEWAY_ADDR 0x100 374 376
+3 -3
arch/parisc/kernel/drivers.c
··· 873 873 874 874 if (dev->num_addrs) { 875 875 int k; 876 - printk(", additional addresses: "); 876 + pr_cont(", additional addresses: "); 877 877 for (k = 0; k < dev->num_addrs; k++) 878 - printk("0x%lx ", dev->addr[k]); 878 + pr_cont("0x%lx ", dev->addr[k]); 879 879 } 880 - printk("\n"); 880 + pr_cont("\n"); 881 881 } 882 882 883 883 /**
+34 -32
arch/parisc/kernel/syscall.S
··· 100 100 .endr 101 101 102 102 /* This address must remain fixed at 0x100 for glibc's syscalls to work */ 103 - .align 256 103 + .align LINUX_GATEWAY_ADDR 104 104 linux_gateway_entry: 105 105 gate .+8, %r0 /* become privileged */ 106 106 mtsp %r0,%sr4 /* get kernel space into sr4 */ 107 107 mtsp %r0,%sr5 /* get kernel space into sr5 */ 108 108 mtsp %r0,%sr6 /* get kernel space into sr6 */ 109 - mfsp %sr7,%r1 /* save user sr7 */ 110 - mtsp %r1,%sr3 /* and store it in sr3 */ 111 109 112 110 #ifdef CONFIG_64BIT 113 111 /* for now we can *always* set the W bit on entry to the syscall ··· 131 133 depdi 0, 31, 32, %r21 132 134 1: 133 135 #endif 136 + 137 + /* We use a rsm/ssm pair to prevent sr3 from being clobbered 138 + * by external interrupts. 139 + */ 140 + mfsp %sr7,%r1 /* save user sr7 */ 141 + rsm PSW_SM_I, %r0 /* disable interrupts */ 142 + mtsp %r1,%sr3 /* and store it in sr3 */ 143 + 134 144 mfctl %cr30,%r1 135 145 xor %r1,%r30,%r30 /* ye olde xor trick */ 136 146 xor %r1,%r30,%r1 ··· 153 147 */ 154 148 155 149 mtsp %r0,%sr7 /* get kernel space into sr7 */ 150 + ssm PSW_SM_I, %r0 /* enable interrupts */ 156 151 STREGM %r1,FRAME_SIZE(%r30) /* save r1 (usp) here for now */ 157 152 mfctl %cr30,%r1 /* get task ptr in %r1 */ 158 153 LDREG TI_TASK(%r1),%r1 ··· 481 474 comiclr,>> __NR_lws_entries, %r20, %r0 482 475 b,n lws_exit_nosys 483 476 484 - /* WARNING: Trashing sr2 and sr3 */ 485 - mfsp %sr7,%r1 /* get userspace into sr3 */ 486 - mtsp %r1,%sr3 487 - mtsp %r0,%sr2 /* get kernel space into sr2 */ 488 - 489 477 /* Load table start */ 490 478 ldil L%lws_table, %r1 491 479 ldo R%lws_table(%r1), %r28 /* Scratch use of r28 */ ··· 629 627 stw %r1, 4(%sr2,%r20) 630 628 #endif 631 629 /* The load and store could fail */ 632 - 1: ldw,ma 0(%sr3,%r26), %r28 630 + 1: ldw,ma 0(%r26), %r28 633 631 sub,<> %r28, %r25, %r0 634 - 2: stw,ma %r24, 0(%sr3,%r26) 632 + 2: stw,ma %r24, 0(%r26) 635 633 /* Free lock */ 636 634 stw,ma %r20, 0(%sr2,%r20) 637 635 #if ENABLE_LWS_DEBUG ··· 708 706 nop 709 707 710 708 /* 8bit load */ 711 - 4: ldb 0(%sr3,%r25), %r25 709 + 4: ldb 0(%r25), %r25 712 710 b cas2_lock_start 713 - 5: ldb 0(%sr3,%r24), %r24 711 + 5: ldb 0(%r24), %r24 714 712 nop 715 713 nop 716 714 nop ··· 718 716 nop 719 717 720 718 /* 16bit load */ 721 - 6: ldh 0(%sr3,%r25), %r25 719 + 6: ldh 0(%r25), %r25 722 720 b cas2_lock_start 723 - 7: ldh 0(%sr3,%r24), %r24 721 + 7: ldh 0(%r24), %r24 724 722 nop 725 723 nop 726 724 nop ··· 728 726 nop 729 727 730 728 /* 32bit load */ 731 - 8: ldw 0(%sr3,%r25), %r25 729 + 8: ldw 0(%r25), %r25 732 730 b cas2_lock_start 733 - 9: ldw 0(%sr3,%r24), %r24 731 + 9: ldw 0(%r24), %r24 734 732 nop 735 733 nop 736 734 nop ··· 739 737 740 738 /* 64bit load */ 741 739 #ifdef CONFIG_64BIT 742 - 10: ldd 0(%sr3,%r25), %r25 743 - 11: ldd 0(%sr3,%r24), %r24 740 + 10: ldd 0(%r25), %r25 741 + 11: ldd 0(%r24), %r24 744 742 #else 745 743 /* Load new value into r22/r23 - high/low */ 746 - 10: ldw 0(%sr3,%r25), %r22 747 - 11: ldw 4(%sr3,%r25), %r23 744 + 10: ldw 0(%r25), %r22 745 + 11: ldw 4(%r25), %r23 748 746 /* Load new value into fr4 for atomic store later */ 749 - 12: flddx 0(%sr3,%r24), %fr4 747 + 12: flddx 0(%r24), %fr4 750 748 #endif 751 749 752 750 cas2_lock_start: ··· 796 794 ldo 1(%r0),%r28 797 795 798 796 /* 8bit CAS */ 799 - 13: ldb,ma 0(%sr3,%r26), %r29 797 + 13: ldb,ma 0(%r26), %r29 800 798 sub,= %r29, %r25, %r0 801 799 b,n cas2_end 802 - 14: stb,ma %r24, 0(%sr3,%r26) 800 + 14: stb,ma %r24, 0(%r26) 803 801 b cas2_end 804 802 copy %r0, %r28 805 803 nop 806 804 nop 807 805 808 806 /* 16bit CAS */ 809 - 15: ldh,ma 0(%sr3,%r26), %r29 807 + 15: ldh,ma 0(%r26), %r29 810 808 sub,= %r29, %r25, %r0 811 809 b,n cas2_end 812 - 16: sth,ma %r24, 0(%sr3,%r26) 810 + 16: sth,ma %r24, 0(%r26) 813 811 b cas2_end 814 812 copy %r0, %r28 815 813 nop 816 814 nop 817 815 818 816 /* 32bit CAS */ 819 - 17: ldw,ma 0(%sr3,%r26), %r29 817 + 17: ldw,ma 0(%r26), %r29 820 818 sub,= %r29, %r25, %r0 821 819 b,n cas2_end 822 - 18: stw,ma %r24, 0(%sr3,%r26) 820 + 18: stw,ma %r24, 0(%r26) 823 821 b cas2_end 824 822 copy %r0, %r28 825 823 nop ··· 827 825 828 826 /* 64bit CAS */ 829 827 #ifdef CONFIG_64BIT 830 - 19: ldd,ma 0(%sr3,%r26), %r29 828 + 19: ldd,ma 0(%r26), %r29 831 829 sub,*= %r29, %r25, %r0 832 830 b,n cas2_end 833 - 20: std,ma %r24, 0(%sr3,%r26) 831 + 20: std,ma %r24, 0(%r26) 834 832 copy %r0, %r28 835 833 #else 836 834 /* Compare first word */ 837 - 19: ldw,ma 0(%sr3,%r26), %r29 835 + 19: ldw,ma 0(%r26), %r29 838 836 sub,= %r29, %r22, %r0 839 837 b,n cas2_end 840 838 /* Compare second word */ 841 - 20: ldw,ma 4(%sr3,%r26), %r29 839 + 20: ldw,ma 4(%r26), %r29 842 840 sub,= %r29, %r23, %r0 843 841 b,n cas2_end 844 842 /* Perform the store */ 845 - 21: fstdx %fr4, 0(%sr3,%r26) 843 + 21: fstdx %fr4, 0(%r26) 846 844 copy %r0, %r28 847 845 #endif 848 846