Pull s390 updates from Martin Schwidefsky: "One performance improvement and a few bug fixes. Two of the fixes deal with the clock related problems we have seen on recent kernels" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/mm: handle asce-type exceptions as normal page fault s390,time: revert direct ktime path for s390 clockevent device s390/time,vdso: convert to the new update_vsyscall interface s390/uaccess: add missing page table walk range check s390/mm: optimize copy_page s390/dasd: validate request size before building CCW/TCW request s390/signal: always restore saved runtime instrumentation psw bit
Unified · Split
| @@ -101,7 +101,7 @@ config S390 · 100 unmodified lines | ||
| 101 | 101 | select GENERIC_CPU_DEVICES if !SMP |
| 102 | 102 | select GENERIC_FIND_FIRST_BIT |
| 103 | 103 | select GENERIC_SMP_IDLE_THREAD |
| 104 | − select GENERIC_TIME_VSYSCALL_OLD | |
| 104 | + select GENERIC_TIME_VSYSCALL | |
| 105 | 105 | select HAVE_ALIGNED_STRUCT_PAGE if SLUB |
| 106 | 106 | select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 |
| 107 | 107 | select HAVE_ARCH_SECCOMP_FILTER |
| @@ -48,33 +48,21 @@ static inline void clear_page(void *page) · 47 unmodified lines | ||
| 48 | 48 | : "memory", "cc"); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | +/* | |
| 52 | + * copy_page uses the mvcl instruction with 0xb0 padding byte in order to | |
| 53 | + * bypass caches when copying a page. Especially when copying huge pages | |
| 54 | + * this keeps L1 and L2 data caches alive. | |
| 55 | + */ | |
| 51 | 56 | static inline void copy_page(void *to, void *from) |
| 52 | 57 | { |
| 53 | − if (MACHINE_HAS_MVPG) { | |
| 54 | − register unsigned long reg0 asm ("0") = 0; | |
| 55 | − asm volatile( | |
| 56 | − " mvpg %0,%1" | |
| 57 | − : : "a" (to), "a" (from), "d" (reg0) | |
| 58 | − : "memory", "cc"); | |
| 59 | − } else | |
| 60 | − asm volatile( | |
| 61 | − " mvc 0(256,%0),0(%1)\n" | |
| 62 | − " mvc 256(256,%0),256(%1)\n" | |
| 63 | − " mvc 512(256,%0),512(%1)\n" | |
| 64 | − " mvc 768(256,%0),768(%1)\n" | |
| 65 | − " mvc 1024(256,%0),1024(%1)\n" | |
| 66 | − " mvc 1280(256,%0),1280(%1)\n" | |
| 67 | − " mvc 1536(256,%0),1536(%1)\n" | |
| 68 | − " mvc 1792(256,%0),1792(%1)\n" | |
| 69 | − " mvc 2048(256,%0),2048(%1)\n" | |
| 70 | − " mvc 2304(256,%0),2304(%1)\n" | |
| 71 | − " mvc 2560(256,%0),2560(%1)\n" | |
| 72 | − " mvc 2816(256,%0),2816(%1)\n" | |
| 73 | − " mvc 3072(256,%0),3072(%1)\n" | |
| 74 | − " mvc 3328(256,%0),3328(%1)\n" | |
| 75 | − " mvc 3584(256,%0),3584(%1)\n" | |
| 76 | − " mvc 3840(256,%0),3840(%1)\n" | |
| 77 | − : : "a" (to), "a" (from) : "memory"); | |
| 58 | + register void *reg2 asm ("2") = to; | |
| 59 | + register unsigned long reg3 asm ("3") = 0x1000; | |
| 60 | + register void *reg4 asm ("4") = from; | |
| 61 | + register unsigned long reg5 asm ("5") = 0xb0001000; | |
| 62 | + asm volatile( | |
| 63 | + " mvcl 2,4" | |
| 64 | + : "+d" (reg2), "+d" (reg3), "+d" (reg4), "+d" (reg5) | |
| 65 | + : : "memory", "cc"); | |
| 78 | 66 | } |
| 79 | 67 | |
| 80 | 68 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| @@ -26,8 +26,9 @@ struct vdso_data { · 25 unmodified lines | ||
| 26 | 26 | __u64 wtom_clock_nsec; /* 0x28 */ |
| 27 | 27 | __u32 tz_minuteswest; /* Minutes west of Greenwich 0x30 */ |
| 28 | 28 | __u32 tz_dsttime; /* Type of dst correction 0x34 */ |
| 29 | − __u32 ectg_available; | |
| 30 | − __u32 ntp_mult; /* NTP adjusted multiplier 0x3C */ | |
| 29 | + __u32 ectg_available; /* ECTG instruction present 0x38 */ | |
| 30 | + __u32 tk_mult; /* Mult. used for xtime_nsec 0x3c */ | |
| 31 | + __u32 tk_shift; /* Shift used for xtime_nsec 0x40 */ | |
| 31 | 32 | }; |
| 32 | 33 | |
| 33 | 34 | struct vdso_per_cpu_data { |
| @@ -65,7 +65,8 @@ int main(void) · 64 unmodified lines | ||
| 65 | 65 | DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec)); |
| 66 | 66 | DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest)); |
| 67 | 67 | DEFINE(__VDSO_ECTG_OK, offsetof(struct vdso_data, ectg_available)); |
| 68 | − DEFINE(__VDSO_NTP_MULT, offsetof(struct vdso_data, ntp_mult)); | |
| 68 | + DEFINE(__VDSO_TK_MULT, offsetof(struct vdso_data, tk_mult)); | |
| 69 | + DEFINE(__VDSO_TK_SHIFT, offsetof(struct vdso_data, tk_shift)); | |
| 69 | 70 | DEFINE(__VDSO_ECTG_BASE, offsetof(struct vdso_per_cpu_data, ectg_timer_base)); |
| 70 | 71 | DEFINE(__VDSO_ECTG_USER, offsetof(struct vdso_per_cpu_data, ectg_user_time)); |
| 71 | 72 | /* constants used by the vdso */ |
| @@ -194,7 +194,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) · 193 unmodified lines | ||
| 194 | 194 | return -EINVAL; |
| 195 | 195 | |
| 196 | 196 | /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ |
| 197 | − regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | |
| 197 | + regs->psw.mask = (regs->psw.mask & ~(PSW_MASK_USER | PSW_MASK_RI)) | | |
| 198 | 198 | (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_USER) << 32 | |
| 199 | 199 | (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_RI) << 32 | |
| 200 | 200 | (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_AMODE); |
| @@ -78,7 +78,7 @@ PGM_CHECK_DEFAULT /* 34 */ · 77 unmodified lines | ||
| 78 | 78 | PGM_CHECK_DEFAULT /* 35 */ |
| 79 | 79 | PGM_CHECK_DEFAULT /* 36 */ |
| 80 | 80 | PGM_CHECK_DEFAULT /* 37 */ |
| 81 | −PGM_CHECK_DEFAULT /* 38 */ | |
| 81 | +PGM_CHECK_64BIT(do_dat_exception) /* 38 */ | |
| 82 | 82 | PGM_CHECK_64BIT(do_dat_exception) /* 39 */ |
| 83 | 83 | PGM_CHECK_64BIT(do_dat_exception) /* 3a */ |
| 84 | 84 | PGM_CHECK_64BIT(do_dat_exception) /* 3b */ |
| @@ -94,7 +94,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) · 93 unmodified lines | ||
| 94 | 94 | return -EINVAL; |
| 95 | 95 | |
| 96 | 96 | /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ |
| 97 | − regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | |
| 97 | + regs->psw.mask = (regs->psw.mask & ~(PSW_MASK_USER | PSW_MASK_RI)) | | |
| 98 | 98 | (user_sregs.regs.psw.mask & (PSW_MASK_USER | PSW_MASK_RI)); |
| 99 | 99 | /* Check for invalid user address space control. */ |
| 100 | 100 | if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_HOME) |
| @@ -108,20 +108,10 @@ static void fixup_clock_comparator(unsigned long long delta) · 107 unmodified lines | ||
| 108 | 108 | set_clock_comparator(S390_lowcore.clock_comparator); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | −static int s390_next_ktime(ktime_t expires, | |
| 111 | +static int s390_next_event(unsigned long delta, | |
| 112 | 112 | struct clock_event_device *evt) |
| 113 | 113 | { |
| 114 | − struct timespec ts; | |
| 115 | − u64 nsecs; | |
| 116 | − | |
| 117 | − ts.tv_sec = ts.tv_nsec = 0; | |
| 118 | − monotonic_to_bootbased(&ts); | |
| 119 | − nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires)); | |
| 120 | − do_div(nsecs, 125); | |
| 121 | − S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9); | |
| 122 | − /* Program the maximum value if we have an overflow (== year 2042) */ | |
| 123 | − if (unlikely(S390_lowcore.clock_comparator < sched_clock_base_cc)) | |
| 124 | − S390_lowcore.clock_comparator = -1ULL; | |
| 114 | + S390_lowcore.clock_comparator = get_tod_clock() + delta; | |
| 125 | 115 | set_clock_comparator(S390_lowcore.clock_comparator); |
| 126 | 116 | return 0; |
| 127 | 117 | } |
| @@ -146,15 +136,14 @@ void init_cpu_timer(void) · 18 unmodified lines | ||
| 146 | 136 | cpu = smp_processor_id(); |
| 147 | 137 | cd = &per_cpu(comparators, cpu); |
| 148 | 138 | cd->name = "comparator"; |
| 149 | − cd->features = CLOCK_EVT_FEAT_ONESHOT | | |
| 150 | − CLOCK_EVT_FEAT_KTIME; | |
| 139 | + cd->features = CLOCK_EVT_FEAT_ONESHOT; | |
| 151 | 140 | cd->mult = 16777; |
| 152 | 141 | cd->shift = 12; |
| 153 | 142 | cd->min_delta_ns = 1; |
| 154 | 143 | cd->max_delta_ns = LONG_MAX; |
| 155 | 144 | cd->rating = 400; |
| 156 | 145 | cd->cpumask = cpumask_of(cpu); |
| 157 | − cd->set_next_ktime = s390_next_ktime; | |
| 146 | + cd->set_next_event = s390_next_event; | |
| 158 | 147 | cd->set_mode = s390_set_mode; |
| 159 | 148 | |
| 160 | 149 | clockevents_register_device(cd); |
| @@ -221,21 +210,30 @@ struct clocksource * __init clocksource_default_clock(void) · 60 unmodified lines | ||
| 221 | 210 | return &clocksource_tod; |
| 222 | 211 | } |
| 223 | 212 | |
| 224 | −void update_vsyscall_old(struct timespec *wall_time, struct timespec *wtm, | |
| 225 | − struct clocksource *clock, u32 mult) | |
| 213 | +void update_vsyscall(struct timekeeper *tk) | |
| 226 | 214 | { |
| 227 | − if (clock != &clocksource_tod) | |
| 215 | + u64 nsecps; | |
| 216 | + | |
| 217 | + if (tk->clock != &clocksource_tod) | |
| 228 | 218 | return; |
| 229 | 219 | |
| 230 | 220 | /* Make userspace gettimeofday spin until we're done. */ |
| 231 | 221 | ++vdso_data->tb_update_count; |
| 232 | 222 | smp_wmb(); |
| 233 | − vdso_data->xtime_tod_stamp = clock->cycle_last; | |
| 234 | − vdso_data->xtime_clock_sec = wall_time->tv_sec; | |
| 235 | − vdso_data->xtime_clock_nsec = wall_time->tv_nsec; | |
| 236 | − vdso_data->wtom_clock_sec = wtm->tv_sec; | |
| 237 | − vdso_data->wtom_clock_nsec = wtm->tv_nsec; | |
| 238 | − vdso_data->ntp_mult = mult; | |
| 223 | + vdso_data->xtime_tod_stamp = tk->clock->cycle_last; | |
| 224 | + vdso_data->xtime_clock_sec = tk->xtime_sec; | |
| 225 | + vdso_data->xtime_clock_nsec = tk->xtime_nsec; | |
| 226 | + vdso_data->wtom_clock_sec = | |
| 227 | + tk->xtime_sec + tk->wall_to_monotonic.tv_sec; | |
| 228 | + vdso_data->wtom_clock_nsec = tk->xtime_nsec + | |
| 229 | + + (tk->wall_to_monotonic.tv_nsec << tk->shift); | |
| 230 | + nsecps = (u64) NSEC_PER_SEC << tk->shift; | |
| 231 | + while (vdso_data->wtom_clock_nsec >= nsecps) { | |
| 232 | + vdso_data->wtom_clock_nsec -= nsecps; | |
| 233 | + vdso_data->wtom_clock_sec++; | |
| 234 | + } | |
| 235 | + vdso_data->tk_mult = tk->mult; | |
| 236 | + vdso_data->tk_shift = tk->shift; | |
| 239 | 237 | smp_wmb(); |
| 240 | 238 | ++vdso_data->tb_update_count; |
| 241 | 239 | } |
| @@ -38,25 +38,26 @@ __kernel_clock_gettime: · 37 unmodified lines | ||
| 38 | 38 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) |
| 39 | 39 | brc 3,2f |
| 40 | 40 | ahi %r0,-1 |
| 41 | −2: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ | |
| 41 | +2: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */ | |
| 42 | 42 | lr %r2,%r0 |
| 43 | − l %r0,__VDSO_NTP_MULT(%r5) | |
| 43 | + l %r0,__VDSO_TK_MULT(%r5) | |
| 44 | 44 | ltr %r1,%r1 |
| 45 | 45 | mr %r0,%r0 |
| 46 | 46 | jnm 3f |
| 47 | − a %r0,__VDSO_NTP_MULT(%r5) | |
| 47 | + a %r0,__VDSO_TK_MULT(%r5) | |
| 48 | 48 | 3: alr %r0,%r2 |
| 49 | − srdl %r0,12 | |
| 50 | − al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | |
| 49 | + al %r0,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ | |
| 51 | 50 | al %r1,__VDSO_XTIME_NSEC+4(%r5) |
| 52 | 51 | brc 12,4f |
| 53 | 52 | ahi %r0,1 |
| 54 | −4: l %r2,__VDSO_XTIME_SEC+4(%r5) | |
| 55 | − al %r0,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic */ | |
| 53 | +4: al %r0,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic.nsec */ | |
| 56 | 54 | al %r1,__VDSO_WTOM_NSEC+4(%r5) |
| 57 | 55 | brc 12,5f |
| 58 | 56 | ahi %r0,1 |
| 59 | −5: al %r2,__VDSO_WTOM_SEC+4(%r5) | |
| 57 | +5: l %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | |
| 58 | + srdl %r0,0(%r2) /* >> tk->shift */ | |
| 59 | + l %r2,__VDSO_XTIME_SEC+4(%r5) | |
| 60 | + al %r2,__VDSO_WTOM_SEC+4(%r5) | |
| 60 | 61 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ |
| 61 | 62 | jne 1b |
| 62 | 63 | basr %r5,0 |
| @@ -86,20 +87,21 @@ __kernel_clock_gettime: · 23 unmodified lines | ||
| 86 | 87 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) |
| 87 | 88 | brc 3,12f |
| 88 | 89 | ahi %r0,-1 |
| 89 | −12: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ | |
| 90 | +12: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */ | |
| 90 | 91 | lr %r2,%r0 |
| 91 | − l %r0,__VDSO_NTP_MULT(%r5) | |
| 92 | + l %r0,__VDSO_TK_MULT(%r5) | |
| 92 | 93 | ltr %r1,%r1 |
| 93 | 94 | mr %r0,%r0 |
| 94 | 95 | jnm 13f |
| 95 | − a %r0,__VDSO_NTP_MULT(%r5) | |
| 96 | + a %r0,__VDSO_TK_MULT(%r5) | |
| 96 | 97 | 13: alr %r0,%r2 |
| 97 | − srdl %r0,12 | |
| 98 | − al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | |
| 98 | + al %r0,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ | |
| 99 | 99 | al %r1,__VDSO_XTIME_NSEC+4(%r5) |
| 100 | 100 | brc 12,14f |
| 101 | 101 | ahi %r0,1 |
| 102 | −14: l %r2,__VDSO_XTIME_SEC+4(%r5) | |
| 102 | +14: l %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | |
| 103 | + srdl %r0,0(%r2) /* >> tk->shift */ | |
| 104 | + l %r2,__VDSO_XTIME_SEC+4(%r5) | |
| 103 | 105 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ |
| 104 | 106 | jne 11b |
| 105 | 107 | basr %r5,0 |
| @@ -35,15 +35,14 @@ __kernel_gettimeofday: · 34 unmodified lines | ||
| 35 | 35 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) |
| 36 | 36 | brc 3,3f |
| 37 | 37 | ahi %r0,-1 |
| 38 | −3: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ | |
| 38 | +3: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */ | |
| 39 | 39 | st %r0,24(%r15) |
| 40 | − l %r0,__VDSO_NTP_MULT(%r5) | |
| 40 | + l %r0,__VDSO_TK_MULT(%r5) | |
| 41 | 41 | ltr %r1,%r1 |
| 42 | 42 | mr %r0,%r0 |
| 43 | 43 | jnm 4f |
| 44 | − a %r0,__VDSO_NTP_MULT(%r5) | |
| 44 | + a %r0,__VDSO_TK_MULT(%r5) | |
| 45 | 45 | 4: al %r0,24(%r15) |
| 46 | − srdl %r0,12 | |
| 47 | 46 | al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */ |
| 48 | 47 | al %r1,__VDSO_XTIME_NSEC+4(%r5) |
| 49 | 48 | brc 12,5f |
| @@ -51,6 +50,8 @@ __kernel_gettimeofday: · 1 unmodified line | ||
| 51 | 50 | 5: mvc 24(4,%r15),__VDSO_XTIME_SEC+4(%r5) |
| 52 | 51 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ |
| 53 | 52 | jne 1b |
| 53 | + l %r4,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | |
| 54 | + srdl %r0,0(%r4) /* >> tk->shift */ | |
| 54 | 55 | l %r4,24(%r15) /* get tv_sec from stack */ |
| 55 | 56 | basr %r5,0 |
| 56 | 57 | 6: ltr %r0,%r0 |
| @@ -34,14 +34,15 @@ __kernel_clock_gettime: · 33 unmodified lines | ||
| 34 | 34 | tmll %r4,0x0001 /* pending update ? loop */ |
| 35 | 35 | jnz 0b |
| 36 | 36 | stck 48(%r15) /* Store TOD clock */ |
| 37 | + lgf %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | |
| 38 | + lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */ | |
| 39 | + alg %r0,__VDSO_WTOM_SEC(%r5) /* + wall_to_monotonic.sec */ | |
| 37 | 40 | lg %r1,48(%r15) |
| 38 | 41 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ |
| 39 | − msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ | |
| 40 | − srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ | |
| 41 | − alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | |
| 42 | − lg %r0,__VDSO_XTIME_SEC(%r5) | |
| 43 | − alg %r1,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic */ | |
| 44 | − alg %r0,__VDSO_WTOM_SEC(%r5) | |
| 42 | + msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */ | |
| 43 | + alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ | |
| 44 | + alg %r1,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic.nsec */ | |
| 45 | + srlg %r1,%r1,0(%r2) /* >> tk->shift */ | |
| 45 | 46 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ |
| 46 | 47 | jne 0b |
| 47 | 48 | larl %r5,13f |
| @@ -62,12 +63,13 @@ __kernel_clock_gettime: · 14 unmodified lines | ||
| 62 | 63 | tmll %r4,0x0001 /* pending update ? loop */ |
| 63 | 64 | jnz 5b |
| 64 | 65 | stck 48(%r15) /* Store TOD clock */ |
| 66 | + lgf %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | |
| 65 | 67 | lg %r1,48(%r15) |
| 66 | 68 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ |
| 67 | − msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ | |
| 68 | − srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ | |
| 69 | − alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | |
| 70 | − lg %r0,__VDSO_XTIME_SEC(%r5) | |
| 69 | + msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */ | |
| 70 | + alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ | |
| 71 | + srlg %r1,%r1,0(%r2) /* >> tk->shift */ | |
| 72 | + lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */ | |
| 71 | 73 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ |
| 72 | 74 | jne 5b |
| 73 | 75 | larl %r5,13f |
| @@ -31,12 +31,13 @@ __kernel_gettimeofday: · 30 unmodified lines | ||
| 31 | 31 | stck 48(%r15) /* Store TOD clock */ |
| 32 | 32 | lg %r1,48(%r15) |
| 33 | 33 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ |
| 34 | − msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ | |
| 35 | − srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ | |
| 36 | − alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime.tv_nsec */ | |
| 37 | − lg %r0,__VDSO_XTIME_SEC(%r5) /* xtime.tv_sec */ | |
| 34 | + msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */ | |
| 35 | + alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ | |
| 36 | + lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */ | |
| 38 | 37 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ |
| 39 | 38 | jne 0b |
| 39 | + lgf %r5,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | |
| 40 | + srlg %r1,%r1,0(%r5) /* >> tk->shift */ | |
| 40 | 41 | larl %r5,5f |
| 41 | 42 | 2: clg %r1,0(%r5) |
| 42 | 43 | jl 3f |
| @@ -78,11 +78,14 @@ static size_t copy_in_kernel(size_t count, void __user *to, · 77 unmodified lines | ||
| 78 | 78 | * contains the (negative) exception code. |
| 79 | 79 | */ |
| 80 | 80 | #ifdef CONFIG_64BIT |
| 81 | + | |
| 81 | 82 | static unsigned long follow_table(struct mm_struct *mm, |
| 82 | 83 | unsigned long address, int write) |
| 83 | 84 | { |
| 84 | 85 | unsigned long *table = (unsigned long *)__pa(mm->pgd); |
| 85 | 86 | |
| 87 | + if (unlikely(address > mm->context.asce_limit - 1)) | |
| 88 | + return -0x38UL; | |
| 86 | 89 | switch (mm->context.asce_bits & _ASCE_TYPE_MASK) { |
| 87 | 90 | case _ASCE_TYPE_REGION1: |
| 88 | 91 | table = table + ((address >> 53) & 0x7ff); |
| @@ -3224,6 +3224,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev, · 3223 unmodified lines | ||
| 3224 | 3224 | |
| 3225 | 3225 | fcx_multitrack = private->features.feature[40] & 0x20; |
| 3226 | 3226 | data_size = blk_rq_bytes(req); |
| 3227 | + if (data_size % blksize) | |
| 3228 | + return ERR_PTR(-EINVAL); | |
| 3227 | 3229 | /* tpm write request add CBC data on each track boundary */ |
| 3228 | 3230 | if (rq_data_dir(req) == WRITE) |
| 3229 | 3231 | data_size += (last_trk - first_trk) * 4; |