Skip to content

Commit 6381499

Browse files
author
Alex Shi
committed
Merge remote-tracking branch 'lts/linux-4.4.y' into linux-linaro-lsk-v4.4
Conflicts: replaced with _ASM_EXTABLE() in arch/arm64/include/asm/futex.h
2 parents a057484 + a34f0e8 commit 6381499

19 files changed

Lines changed: 127 additions & 59 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 38
3+
SUBLEVEL = 39
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/m68k/include/asm/delay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ static inline void __udelay(unsigned long usecs)
114114
*/
115115
#define HZSCALE (268435456 / (1000000 / HZ))
116116

117-
#define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000));
117+
#define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000))
118118

119119
#endif /* defined(_M68K_DELAY_H) */

arch/parisc/include/asm/pgtable.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
6565
unsigned long flags; \
6666
spin_lock_irqsave(&pa_tlb_lock, flags); \
6767
old_pte = *ptep; \
68-
set_pte(ptep, pteval); \
6968
if (pte_inserted(old_pte)) \
7069
purge_tlb_entries(mm, addr); \
70+
set_pte(ptep, pteval); \
7171
spin_unlock_irqrestore(&pa_tlb_lock, flags); \
7272
} while (0)
7373

@@ -478,8 +478,8 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned
478478
spin_unlock_irqrestore(&pa_tlb_lock, flags);
479479
return 0;
480480
}
481-
set_pte(ptep, pte_mkold(pte));
482481
purge_tlb_entries(vma->vm_mm, addr);
482+
set_pte(ptep, pte_mkold(pte));
483483
spin_unlock_irqrestore(&pa_tlb_lock, flags);
484484
return 1;
485485
}
@@ -492,9 +492,9 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
492492

493493
spin_lock_irqsave(&pa_tlb_lock, flags);
494494
old_pte = *ptep;
495-
set_pte(ptep, __pte(0));
496495
if (pte_inserted(old_pte))
497496
purge_tlb_entries(mm, addr);
497+
set_pte(ptep, __pte(0));
498498
spin_unlock_irqrestore(&pa_tlb_lock, flags);
499499

500500
return old_pte;
@@ -504,8 +504,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
504504
{
505505
unsigned long flags;
506506
spin_lock_irqsave(&pa_tlb_lock, flags);
507-
set_pte(ptep, pte_wrprotect(*ptep));
508507
purge_tlb_entries(mm, addr);
508+
set_pte(ptep, pte_wrprotect(*ptep));
509509
spin_unlock_irqrestore(&pa_tlb_lock, flags);
510510
}
511511

arch/parisc/kernel/cache.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,15 @@ void __init parisc_setup_cache_timing(void)
375375

376376
/* calculate TLB flush threshold */
377377

378+
/* On SMP machines, skip the TLB measure of kernel text which
379+
* has been mapped as huge pages. */
380+
if (num_online_cpus() > 1 && !parisc_requires_coherency()) {
381+
threshold = max(cache_info.it_size, cache_info.dt_size);
382+
threshold *= PAGE_SIZE;
383+
threshold /= num_online_cpus();
384+
goto set_tlb_threshold;
385+
}
386+
378387
alltime = mfctl(16);
379388
flush_tlb_all();
380389
alltime = mfctl(16) - alltime;
@@ -393,6 +402,8 @@ void __init parisc_setup_cache_timing(void)
393402
alltime, size, rangetime);
394403

395404
threshold = PAGE_ALIGN(num_online_cpus() * size * alltime / rangetime);
405+
406+
set_tlb_threshold:
396407
if (threshold)
397408
parisc_tlb_flush_threshold = threshold;
398409
printk(KERN_INFO "TLB flush threshold set to %lu KiB\n",

arch/parisc/kernel/pacache.S

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -886,19 +886,10 @@ ENTRY(flush_dcache_page_asm)
886886
fdc,m r31(%r28)
887887
fdc,m r31(%r28)
888888
fdc,m r31(%r28)
889-
cmpb,COND(<<) %r28, %r25,1b
889+
cmpb,COND(<<) %r28, %r25,1b
890890
fdc,m r31(%r28)
891891

892892
sync
893-
894-
#ifdef CONFIG_PA20
895-
pdtlb,l %r0(%r25)
896-
#else
897-
tlb_lock %r20,%r21,%r22
898-
pdtlb %r0(%r25)
899-
tlb_unlock %r20,%r21,%r22
900-
#endif
901-
902893
bv %r0(%r2)
903894
nop
904895
.exit
@@ -973,17 +964,6 @@ ENTRY(flush_icache_page_asm)
973964
fic,m %r31(%sr4,%r28)
974965

975966
sync
976-
977-
#ifdef CONFIG_PA20
978-
pdtlb,l %r0(%r28)
979-
pitlb,l %r0(%sr4,%r25)
980-
#else
981-
tlb_lock %r20,%r21,%r22
982-
pdtlb %r0(%r28)
983-
pitlb %r0(%sr4,%r25)
984-
tlb_unlock %r20,%r21,%r22
985-
#endif
986-
987967
bv %r0(%r2)
988968
nop
989969
.exit

arch/powerpc/kernel/eeh_driver.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
612612

613613
/* Clear frozen state */
614614
rc = eeh_clear_pe_frozen_state(pe, false);
615-
if (rc)
615+
if (rc) {
616+
pci_unlock_rescan_remove();
616617
return rc;
618+
}
617619

618620
/* Give the system 5 seconds to finish running the user-space
619621
* hotplug shutdown scripts, e.g. ifdown for ethernet. Yes,

arch/x86/kernel/cpu/perf_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ u64 x86_perf_event_update(struct perf_event *event)
6767
int shift = 64 - x86_pmu.cntval_bits;
6868
u64 prev_raw_count, new_raw_count;
6969
int idx = hwc->idx;
70-
s64 delta;
70+
u64 delta;
7171

7272
if (idx == INTEL_PMC_IDX_FIXED_BTS)
7373
return 0;

arch/x86/kernel/cpu/perf_event_intel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3636,7 +3636,7 @@ __init int intel_pmu_init(void)
36363636

36373637
/* Support full width counters using alternative MSR range */
36383638
if (x86_pmu.intel_cap.full_width_write) {
3639-
x86_pmu.max_period = x86_pmu.cntval_mask;
3639+
x86_pmu.max_period = x86_pmu.cntval_mask >> 1;
36403640
x86_pmu.perfctr = MSR_IA32_PMC0;
36413641
pr_cont("full-width counters, ");
36423642
}

crypto/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ obj-$(CONFIG_CRYPTO_AKCIPHER2) += akcipher.o
3333

3434
$(obj)/rsapubkey-asn1.o: $(obj)/rsapubkey-asn1.c $(obj)/rsapubkey-asn1.h
3535
$(obj)/rsaprivkey-asn1.o: $(obj)/rsaprivkey-asn1.c $(obj)/rsaprivkey-asn1.h
36+
$(obj)/rsa_helper.o: $(obj)/rsapubkey-asn1.h $(obj)/rsaprivkey-asn1.h
3637
clean-files += rsapubkey-asn1.c rsapubkey-asn1.h
3738
clean-files += rsaprivkey-asn1.c rsaprivkey-asn1.h
3839

crypto/mcryptd.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,18 +258,22 @@ static void *mcryptd_alloc_instance(struct crypto_alg *alg, unsigned int head,
258258
goto out;
259259
}
260260

261-
static inline void mcryptd_check_internal(struct rtattr **tb, u32 *type,
261+
static inline bool mcryptd_check_internal(struct rtattr **tb, u32 *type,
262262
u32 *mask)
263263
{
264264
struct crypto_attr_type *algt;
265265

266266
algt = crypto_get_attr_type(tb);
267267
if (IS_ERR(algt))
268-
return;
269-
if ((algt->type & CRYPTO_ALG_INTERNAL))
270-
*type |= CRYPTO_ALG_INTERNAL;
271-
if ((algt->mask & CRYPTO_ALG_INTERNAL))
272-
*mask |= CRYPTO_ALG_INTERNAL;
268+
return false;
269+
270+
*type |= algt->type & CRYPTO_ALG_INTERNAL;
271+
*mask |= algt->mask & CRYPTO_ALG_INTERNAL;
272+
273+
if (*type & *mask & CRYPTO_ALG_INTERNAL)
274+
return true;
275+
else
276+
return false;
273277
}
274278

275279
static int mcryptd_hash_init_tfm(struct crypto_tfm *tfm)
@@ -498,7 +502,8 @@ static int mcryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
498502
u32 mask = 0;
499503
int err;
500504

501-
mcryptd_check_internal(tb, &type, &mask);
505+
if (!mcryptd_check_internal(tb, &type, &mask))
506+
return -EINVAL;
502507

503508
salg = shash_attr_alg(tb[1], type, mask);
504509
if (IS_ERR(salg))

0 commit comments

Comments
 (0)