public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/hardened-patchset:master commit in: 3.2.50/, 3.10.10/
@ 2013-09-02 19:47 Anthony G. Basile
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony G. Basile @ 2013-09-02 19:47 UTC (permalink / raw
  To: gentoo-commits

commit:     efcdad0b6e70e76b2730a5ad3809c58837031c62
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  2 19:46:29 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Sep  2 19:47:44 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-patchset.git;a=commit;h=efcdad0b

Grsec/PaX: 2.9.1-{3.2.50.3.10.9}-201309011630

---
 3.10.10/0000_README                                |    2 +-
 ...20_grsecurity-2.9.1-3.10.10-201309011630.patch} | 1476 +++++++++++++++++++-
 3.2.50/0000_README                                 |    2 +-
 ...420_grsecurity-2.9.1-3.2.50-201309011629.patch} |  974 ++++++++++++-
 4 files changed, 2378 insertions(+), 76 deletions(-)

diff --git a/3.10.10/0000_README b/3.10.10/0000_README
index bd3df03..a09b757 100644
--- a/3.10.10/0000_README
+++ b/3.10.10/0000_README
@@ -2,7 +2,7 @@ README
 -----------------------------------------------------------------------------
 Individual Patch Descriptions:
 -----------------------------------------------------------------------------
-Patch:	4420_grsecurity-2.9.1-3.10.10-201308301923.patch
+Patch:	4420_grsecurity-2.9.1-3.10.10-201309011630.patch
 From:	http://www.grsecurity.net
 Desc:	hardened-sources base patch from upstream grsecurity
 

diff --git a/3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch b/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
similarity index 98%
rename from 3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch
rename to 3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
index cd96025..54e5089 100644
--- a/3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch
+++ b/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
@@ -3271,6 +3271,46 @@ index 33f2ea3..0b91824 100644
  	. = ALIGN(THREAD_SIZE);
  	__data_loc = .;
  #endif
+diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
+index ef1703b..46b77f3 100644
+--- a/arch/arm/kvm/arm.c
++++ b/arch/arm/kvm/arm.c
+@@ -56,7 +56,7 @@ static unsigned long hyp_default_vectors;
+ static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
+ 
+ /* The VMID used in the VTTBR */
+-static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
++static atomic64_unchecked_t kvm_vmid_gen = ATOMIC64_INIT(1);
+ static u8 kvm_next_vmid;
+ static DEFINE_SPINLOCK(kvm_vmid_lock);
+ 
+@@ -392,7 +392,7 @@ void force_vm_exit(const cpumask_t *mask)
+  */
+ static bool need_new_vmid_gen(struct kvm *kvm)
+ {
+-	return unlikely(kvm->arch.vmid_gen != atomic64_read(&kvm_vmid_gen));
++	return unlikely(kvm->arch.vmid_gen != atomic64_read_unchecked(&kvm_vmid_gen));
+ }
+ 
+ /**
+@@ -425,7 +425,7 @@ static void update_vttbr(struct kvm *kvm)
+ 
+ 	/* First user of a new VMID generation? */
+ 	if (unlikely(kvm_next_vmid == 0)) {
+-		atomic64_inc(&kvm_vmid_gen);
++		atomic64_inc_unchecked(&kvm_vmid_gen);
+ 		kvm_next_vmid = 1;
+ 
+ 		/*
+@@ -442,7 +442,7 @@ static void update_vttbr(struct kvm *kvm)
+ 		kvm_call_hyp(__kvm_flush_vm_context);
+ 	}
+ 
+-	kvm->arch.vmid_gen = atomic64_read(&kvm_vmid_gen);
++	kvm->arch.vmid_gen = atomic64_read_unchecked(&kvm_vmid_gen);
+ 	kvm->arch.vmid = kvm_next_vmid;
+ 	kvm_next_vmid++;
+ 
 diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S
 index 14a0d98..7771a7d 100644
 --- a/arch/arm/lib/clear_user.S
@@ -3734,6 +3774,54 @@ index 6f4585b..7b6f52b 100644
  		if (err)					\
  			goto fault;				\
  	} while (0)
+diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
+index eeab06e..2638dc2 100644
+--- a/arch/arm/mm/context.c
++++ b/arch/arm/mm/context.c
+@@ -42,7 +42,7 @@
+ #define NUM_USER_ASIDS		ASID_FIRST_VERSION
+ 
+ static DEFINE_RAW_SPINLOCK(cpu_asid_lock);
+-static atomic64_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION);
++static atomic64_unchecked_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION);
+ static DECLARE_BITMAP(asid_map, NUM_USER_ASIDS);
+ 
+ static DEFINE_PER_CPU(atomic64_t, active_asids);
+@@ -188,7 +188,7 @@ static int is_reserved_asid(u64 asid)
+ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
+ {
+ 	u64 asid = atomic64_read(&mm->context.id);
+-	u64 generation = atomic64_read(&asid_generation);
++	u64 generation = atomic64_read_unchecked(&asid_generation);
+ 
+ 	if (asid != 0 && is_reserved_asid(asid)) {
+ 		/*
+@@ -206,7 +206,7 @@ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
+ 		 */
+ 		asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
+ 		if (asid == NUM_USER_ASIDS) {
+-			generation = atomic64_add_return(ASID_FIRST_VERSION,
++			generation = atomic64_add_return_unchecked(ASID_FIRST_VERSION,
+ 							 &asid_generation);
+ 			flush_context(cpu);
+ 			asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
+@@ -235,14 +235,14 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk)
+ 	cpu_set_reserved_ttbr0();
+ 
+ 	asid = atomic64_read(&mm->context.id);
+-	if (!((asid ^ atomic64_read(&asid_generation)) >> ASID_BITS)
++	if (!((asid ^ atomic64_read_unchecked(&asid_generation)) >> ASID_BITS)
+ 	    && atomic64_xchg(&per_cpu(active_asids, cpu), asid))
+ 		goto switch_mm_fastpath;
+ 
+ 	raw_spin_lock_irqsave(&cpu_asid_lock, flags);
+ 	/* Check that our ASID belongs to the current generation. */
+ 	asid = atomic64_read(&mm->context.id);
+-	if ((asid ^ atomic64_read(&asid_generation)) >> ASID_BITS) {
++	if ((asid ^ atomic64_read_unchecked(&asid_generation)) >> ASID_BITS) {
+ 		asid = new_context(mm, cpu);
+ 		atomic64_set(&mm->context.id, asid);
+ 	}
 diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
 index 5dbf13f..a2d1876 100644
 --- a/arch/arm/mm/fault.c
@@ -6496,6 +6584,31 @@ index 202e581..689ca79 100644
  #include <asm/processor.h>
  
  /*
+diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
+index d1fea7a..45602ea 100644
+--- a/arch/mips/kernel/irq.c
++++ b/arch/mips/kernel/irq.c
+@@ -77,17 +77,17 @@ void ack_bad_irq(unsigned int irq)
+ 	printk("unexpected IRQ # %d\n", irq);
+ }
+ 
+-atomic_t irq_err_count;
++atomic_unchecked_t irq_err_count;
+ 
+ int arch_show_interrupts(struct seq_file *p, int prec)
+ {
+-	seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
++	seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read_unchecked(&irq_err_count));
+ 	return 0;
+ }
+ 
+ asmlinkage void spurious_interrupt(void)
+ {
+-	atomic_inc(&irq_err_count);
++	atomic_inc_unchecked(&irq_err_count);
+ }
+ 
+ void __init init_IRQ(void)
 diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
 index c6a041d..b3e7318 100644
 --- a/arch/mips/kernel/process.c
@@ -6595,6 +6708,75 @@ index 74f485d..47d2c38 100644
  	LONG_L	t0, TI_FLAGS($28)	# syscall tracing enabled?
  	and	t0, t1, t0
  	bnez	t0, trace_a_syscall
+diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c
+index 1ff43d5..96fec68 100644
+--- a/arch/mips/kernel/sync-r4k.c
++++ b/arch/mips/kernel/sync-r4k.c
+@@ -21,8 +21,8 @@
+ #include <asm/mipsregs.h>
+ 
+ static atomic_t __cpuinitdata count_start_flag = ATOMIC_INIT(0);
+-static atomic_t __cpuinitdata count_count_start = ATOMIC_INIT(0);
+-static atomic_t __cpuinitdata count_count_stop = ATOMIC_INIT(0);
++static atomic_unchecked_t __cpuinitdata count_count_start = ATOMIC_INIT(0);
++static atomic_unchecked_t __cpuinitdata count_count_stop = ATOMIC_INIT(0);
+ static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0);
+ 
+ #define COUNTON 100
+@@ -69,13 +69,13 @@ void __cpuinit synchronise_count_master(int cpu)
+ 
+ 	for (i = 0; i < NR_LOOPS; i++) {
+ 		/* slaves loop on '!= 2' */
+-		while (atomic_read(&count_count_start) != 1)
++		while (atomic_read_unchecked(&count_count_start) != 1)
+ 			mb();
+-		atomic_set(&count_count_stop, 0);
++		atomic_set_unchecked(&count_count_stop, 0);
+ 		smp_wmb();
+ 
+ 		/* this lets the slaves write their count register */
+-		atomic_inc(&count_count_start);
++		atomic_inc_unchecked(&count_count_start);
+ 
+ 		/*
+ 		 * Everyone initialises count in the last loop:
+@@ -86,11 +86,11 @@ void __cpuinit synchronise_count_master(int cpu)
+ 		/*
+ 		 * Wait for all slaves to leave the synchronization point:
+ 		 */
+-		while (atomic_read(&count_count_stop) != 1)
++		while (atomic_read_unchecked(&count_count_stop) != 1)
+ 			mb();
+-		atomic_set(&count_count_start, 0);
++		atomic_set_unchecked(&count_count_start, 0);
+ 		smp_wmb();
+-		atomic_inc(&count_count_stop);
++		atomic_inc_unchecked(&count_count_stop);
+ 	}
+ 	/* Arrange for an interrupt in a short while */
+ 	write_c0_compare(read_c0_count() + COUNTON);
+@@ -131,8 +131,8 @@ void __cpuinit synchronise_count_slave(int cpu)
+ 	initcount = atomic_read(&count_reference);
+ 
+ 	for (i = 0; i < NR_LOOPS; i++) {
+-		atomic_inc(&count_count_start);
+-		while (atomic_read(&count_count_start) != 2)
++		atomic_inc_unchecked(&count_count_start);
++		while (atomic_read_unchecked(&count_count_start) != 2)
+ 			mb();
+ 
+ 		/*
+@@ -141,8 +141,8 @@ void __cpuinit synchronise_count_slave(int cpu)
+ 		if (i == NR_LOOPS-1)
+ 			write_c0_count(initcount);
+ 
+-		atomic_inc(&count_count_stop);
+-		while (atomic_read(&count_count_stop) != 2)
++		atomic_inc_unchecked(&count_count_stop);
++		while (atomic_read_unchecked(&count_count_stop) != 2)
+ 			mb();
+ 	}
+ 	/* Arrange for an interrupt in a short while */
 diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
 index a75ae40..0d0f56a 100644
 --- a/arch/mips/kernel/traps.c
@@ -6768,6 +6950,31 @@ index 7e5fe27..9656513 100644
  int __virt_addr_valid(const volatile void *kaddr)
  {
  	return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
+diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c
+index a2358b4..7cead4f 100644
+--- a/arch/mips/sgi-ip27/ip27-nmi.c
++++ b/arch/mips/sgi-ip27/ip27-nmi.c
+@@ -187,9 +187,9 @@ void
+ cont_nmi_dump(void)
+ {
+ #ifndef REAL_NMI_SIGNAL
+-	static atomic_t nmied_cpus = ATOMIC_INIT(0);
++	static atomic_unchecked_t nmied_cpus = ATOMIC_INIT(0);
+ 
+-	atomic_inc(&nmied_cpus);
++	atomic_inc_unchecked(&nmied_cpus);
+ #endif
+ 	/*
+ 	 * Only allow 1 cpu to proceed
+@@ -233,7 +233,7 @@ cont_nmi_dump(void)
+ 		udelay(10000);
+ 	}
+ #else
+-	while (atomic_read(&nmied_cpus) != num_online_cpus());
++	while (atomic_read_unchecked(&nmied_cpus) != num_online_cpus());
+ #endif
+ 
+ 	/*
 diff --git a/arch/mn10300/proc-mn103e010/include/proc/cache.h b/arch/mn10300/proc-mn103e010/include/proc/cache.h
 index 967d144..db12197 100644
 --- a/arch/mn10300/proc-mn103e010/include/proc/cache.h
@@ -9535,6 +9742,57 @@ index 7ff45e4..a58f271 100644
  	audit_syscall_exit(regs);
  
  	if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
+diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
+index 77539ed..3ffffe7 100644
+--- a/arch/sparc/kernel/smp_64.c
++++ b/arch/sparc/kernel/smp_64.c
+@@ -868,8 +868,8 @@ extern unsigned long xcall_flush_dcache_page_cheetah;
+ extern unsigned long xcall_flush_dcache_page_spitfire;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-extern atomic_t dcpage_flushes;
+-extern atomic_t dcpage_flushes_xcall;
++extern atomic_unchecked_t dcpage_flushes;
++extern atomic_unchecked_t dcpage_flushes_xcall;
+ #endif
+ 
+ static inline void __local_flush_dcache_page(struct page *page)
+@@ -893,7 +893,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
+ 		return;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 
+ 	this_cpu = get_cpu();
+@@ -917,7 +917,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
+ 			xcall_deliver(data0, __pa(pg_addr),
+ 				      (u64) pg_addr, cpumask_of(cpu));
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-			atomic_inc(&dcpage_flushes_xcall);
++			atomic_inc_unchecked(&dcpage_flushes_xcall);
+ #endif
+ 		}
+ 	}
+@@ -936,7 +936,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
+ 	preempt_disable();
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 	data0 = 0;
+ 	pg_addr = page_address(page);
+@@ -953,7 +953,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
+ 		xcall_deliver(data0, __pa(pg_addr),
+ 			      (u64) pg_addr, cpu_online_mask);
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-		atomic_inc(&dcpage_flushes_xcall);
++		atomic_inc_unchecked(&dcpage_flushes_xcall);
+ #endif
+ 	}
+ 	__local_flush_dcache_page(page);
 diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
 index 3a8d184..49498a8 100644
 --- a/arch/sparc/kernel/sys_sparc_32.c
@@ -9808,7 +10066,7 @@ index 6629829..036032d 100644
  }
  
 diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
-index b3f833a..ac74b2d 100644
+index b3f833a..f485f80 100644
 --- a/arch/sparc/kernel/traps_64.c
 +++ b/arch/sparc/kernel/traps_64.c
 @@ -76,7 +76,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
@@ -9878,6 +10136,55 @@ index b3f833a..ac74b2d 100644
  }
  
  struct sun4v_error_entry {
+@@ -1830,8 +1841,8 @@ struct sun4v_error_entry {
+ /*0x38*/u64		reserved_5;
+ };
+ 
+-static atomic_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
+-static atomic_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
++static atomic_unchecked_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
++static atomic_unchecked_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
+ 
+ static const char *sun4v_err_type_to_str(u8 type)
+ {
+@@ -1923,7 +1934,7 @@ static void sun4v_report_real_raddr(const char *pfx, struct pt_regs *regs)
+ }
+ 
+ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
+-			    int cpu, const char *pfx, atomic_t *ocnt)
++			    int cpu, const char *pfx, atomic_unchecked_t *ocnt)
+ {
+ 	u64 *raw_ptr = (u64 *) ent;
+ 	u32 attrs;
+@@ -1981,8 +1992,8 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
+ 
+ 	show_regs(regs);
+ 
+-	if ((cnt = atomic_read(ocnt)) != 0) {
+-		atomic_set(ocnt, 0);
++	if ((cnt = atomic_read_unchecked(ocnt)) != 0) {
++		atomic_set_unchecked(ocnt, 0);
+ 		wmb();
+ 		printk("%s: Queue overflowed %d times.\n",
+ 		       pfx, cnt);
+@@ -2036,7 +2047,7 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
+  */
+ void sun4v_resum_overflow(struct pt_regs *regs)
+ {
+-	atomic_inc(&sun4v_resum_oflow_cnt);
++	atomic_inc_unchecked(&sun4v_resum_oflow_cnt);
+ }
+ 
+ /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
+@@ -2089,7 +2100,7 @@ void sun4v_nonresum_overflow(struct pt_regs *regs)
+ 	/* XXX Actually even this can make not that much sense.  Perhaps
+ 	 * XXX we should just pull the plug and panic directly from here?
+ 	 */
+-	atomic_inc(&sun4v_nonresum_oflow_cnt);
++	atomic_inc_unchecked(&sun4v_nonresum_oflow_cnt);
+ }
+ 
+ unsigned long sun4v_err_itlb_vaddr;
 @@ -2104,9 +2115,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
  
  	printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
@@ -11165,6 +11472,44 @@ index d2b5944..d878f3c 100644
  }
  
  pte_t *huge_pte_alloc(struct mm_struct *mm,
+diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
+index 04fd55a..4ede686 100644
+--- a/arch/sparc/mm/init_64.c
++++ b/arch/sparc/mm/init_64.c
+@@ -188,9 +188,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
+ int num_kernel_image_mappings;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-atomic_t dcpage_flushes = ATOMIC_INIT(0);
++atomic_unchecked_t dcpage_flushes = ATOMIC_INIT(0);
+ #ifdef CONFIG_SMP
+-atomic_t dcpage_flushes_xcall = ATOMIC_INIT(0);
++atomic_unchecked_t dcpage_flushes_xcall = ATOMIC_INIT(0);
+ #endif
+ #endif
+ 
+@@ -198,7 +198,7 @@ inline void flush_dcache_page_impl(struct page *page)
+ {
+ 	BUG_ON(tlb_type == hypervisor);
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 
+ #ifdef DCACHE_ALIASING_POSSIBLE
+@@ -466,10 +466,10 @@ void mmu_info(struct seq_file *m)
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+ 	seq_printf(m, "DCPageFlushes\t: %d\n",
+-		   atomic_read(&dcpage_flushes));
++		   atomic_read_unchecked(&dcpage_flushes));
+ #ifdef CONFIG_SMP
+ 	seq_printf(m, "DCPageFlushesXC\t: %d\n",
+-		   atomic_read(&dcpage_flushes_xcall));
++		   atomic_read_unchecked(&dcpage_flushes_xcall));
+ #endif /* CONFIG_SMP */
+ #endif /* CONFIG_DEBUG_DCFLUSH */
+ }
 diff --git a/arch/tile/include/asm/atomic_64.h b/arch/tile/include/asm/atomic_64.h
 index f4500c6..889656c 100644
 --- a/arch/tile/include/asm/atomic_64.h
@@ -34359,6 +34704,28 @@ index af00795..2bb8105 100644
  
  #define XCHAL_ICACHE_SIZE		32768	/* I-cache size in bytes or 0 */
  #define XCHAL_DCACHE_SIZE		32768	/* D-cache size in bytes or 0 */
+diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
+index e8918ff..b3ffc51 100644
+--- a/block/blk-cgroup.c
++++ b/block/blk-cgroup.c
+@@ -825,7 +825,7 @@ static void blkcg_css_free(struct cgroup *cgroup)
+ 
+ static struct cgroup_subsys_state *blkcg_css_alloc(struct cgroup *cgroup)
+ {
+-	static atomic64_t id_seq = ATOMIC64_INIT(0);
++	static atomic64_unchecked_t id_seq = ATOMIC64_INIT(0);
+ 	struct blkcg *blkcg;
+ 	struct cgroup *parent = cgroup->parent;
+ 
+@@ -840,7 +840,7 @@ static struct cgroup_subsys_state *blkcg_css_alloc(struct cgroup *cgroup)
+ 
+ 	blkcg->cfq_weight = CFQ_WEIGHT_DEFAULT;
+ 	blkcg->cfq_leaf_weight = CFQ_WEIGHT_DEFAULT;
+-	blkcg->id = atomic64_inc_return(&id_seq); /* root is 0, start from 1 */
++	blkcg->id = atomic64_inc_return_unchecked(&id_seq); /* root is 0, start from 1 */
+ done:
+ 	spin_lock_init(&blkcg->lock);
+ 	INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_ATOMIC);
 diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c
 index 58916af..eb9dbcf6 100644
 --- a/block/blk-iopoll.c
@@ -34652,6 +35019,28 @@ index 33dc6a0..4b24b47 100644
  }
  EXPORT_SYMBOL_GPL(cper_next_record_id);
  
+diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
+index fcd7d91..6b2f1a3 100644
+--- a/drivers/acpi/apei/ghes.c
++++ b/drivers/acpi/apei/ghes.c
+@@ -468,7 +468,7 @@ static void __ghes_print_estatus(const char *pfx,
+ 				 const struct acpi_hest_generic *generic,
+ 				 const struct acpi_hest_generic_status *estatus)
+ {
+-	static atomic_t seqno;
++	static atomic_unchecked_t seqno;
+ 	unsigned int curr_seqno;
+ 	char pfx_seq[64];
+ 
+@@ -479,7 +479,7 @@ static void __ghes_print_estatus(const char *pfx,
+ 		else
+ 			pfx = KERN_ERR;
+ 	}
+-	curr_seqno = atomic_inc_return(&seqno);
++	curr_seqno = atomic_inc_return_unchecked(&seqno);
+ 	snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx, curr_seqno);
+ 	printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n",
+ 	       pfx_seq, generic->header.source_id);
 diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c
 index be60399..778b33e8 100644
 --- a/drivers/acpi/bgrt.c
@@ -34789,9 +35178,18 @@ index 7b9bdd8..37638ca 100644
  				unsigned long timeout_msec)
  {
 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index adf002a..39bb8f9 100644
+index adf002a..06c46a7 100644
 --- a/drivers/ata/libata-core.c
 +++ b/drivers/ata/libata-core.c
+@@ -98,7 +98,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
+ static void ata_dev_xfermask(struct ata_device *dev);
+ static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
+ 
+-atomic_t ata_print_id = ATOMIC_INIT(0);
++atomic_unchecked_t ata_print_id = ATOMIC_INIT(0);
+ 
+ struct ata_force_param {
+ 	const char	*name;
 @@ -4792,7 +4792,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
  	struct ata_port *ap;
  	unsigned int tag;
@@ -34829,6 +35227,41 @@ index adf002a..39bb8f9 100644
  	spin_unlock(&lock);
  }
  
+@@ -6133,7 +6135,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
+ 
+ 	/* give ports names and add SCSI hosts */
+ 	for (i = 0; i < host->n_ports; i++)
+-		host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
++		host->ports[i]->print_id = atomic_inc_return_unchecked(&ata_print_id);
+ 
+ 
+ 	/* Create associated sysfs transport objects  */
+diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
+index 0101af5..c70c325 100644
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -4105,7 +4105,7 @@ int ata_sas_port_init(struct ata_port *ap)
+ 
+ 	if (rc)
+ 		return rc;
+-	ap->print_id = atomic_inc_return(&ata_print_id);
++	ap->print_id = atomic_inc_return_unchecked(&ata_print_id);
+ 	return 0;
+ }
+ EXPORT_SYMBOL_GPL(ata_sas_port_init);
+diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
+index 577d902b..cb4781e 100644
+--- a/drivers/ata/libata.h
++++ b/drivers/ata/libata.h
+@@ -53,7 +53,7 @@ enum {
+ 	ATA_DNXFER_QUIET	= (1 << 31),
+ };
+ 
+-extern atomic_t ata_print_id;
++extern atomic_unchecked_t ata_print_id;
+ extern int atapi_passthru16;
+ extern int libata_fua;
+ extern int libata_noacpi;
 diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
 index 7638121..357a965 100644
 --- a/drivers/ata/pata_arasan_cf.c
@@ -36357,6 +36790,28 @@ index a5dca6a..bb27967 100644
  	kfree(tconn->current_epoch);
  
  	idr_destroy(&tconn->volumes);
+diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
+index 9e3f441..4044d47 100644
+--- a/drivers/block/drbd/drbd_nl.c
++++ b/drivers/block/drbd/drbd_nl.c
+@@ -3339,7 +3339,7 @@ out:
+ 
+ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)
+ {
+-	static atomic_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
++	static atomic_unchecked_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
+ 	struct sk_buff *msg;
+ 	struct drbd_genlmsghdr *d_out;
+ 	unsigned seq;
+@@ -3352,7 +3352,7 @@ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)
+ 			return;
+ 	}
+ 
+-	seq = atomic_inc_return(&drbd_genl_seq);
++	seq = atomic_inc_return_unchecked(&drbd_genl_seq);
+ 	msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
+ 	if (!msg)
+ 		goto failed;
 diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
 index 4222aff..1f79506 100644
 --- a/drivers/block/drbd/drbd_receiver.c
@@ -37596,6 +38051,28 @@ index 428754a..8bdf9cc 100644
  	.attrs = cpuidle_default_attrs,
  	.name = "cpuidle",
  };
+diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
+index ebf130e..e32d8a9 100644
+--- a/drivers/crypto/hifn_795x.c
++++ b/drivers/crypto/hifn_795x.c
+@@ -51,7 +51,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
+ MODULE_PARM_DESC(hifn_pll_ref,
+ 		 "PLL reference clock (pci[freq] or ext[freq], default ext)");
+ 
+-static atomic_t hifn_dev_number;
++static atomic_unchecked_t hifn_dev_number;
+ 
+ #define ACRYPTO_OP_DECRYPT	0
+ #define ACRYPTO_OP_ENCRYPT	1
+@@ -2577,7 +2577,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+ 		goto err_out_disable_pci_device;
+ 
+ 	snprintf(name, sizeof(name), "hifn%d",
+-			atomic_inc_return(&hifn_dev_number)-1);
++			atomic_inc_return_unchecked(&hifn_dev_number)-1);
+ 
+ 	err = pci_request_regions(pdev, name);
+ 	if (err)
 diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
 index 3b36797..db0b0c0 100644
 --- a/drivers/devfreq/devfreq.c
@@ -37640,6 +38117,22 @@ index b70709b..1d8d02a 100644
  	.notifier_call	= sh_dmae_nmi_handler,
  
  	/* Run before NMI debug handler and KGDB */
+diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
+index 211021d..201d47f 100644
+--- a/drivers/edac/edac_device.c
++++ b/drivers/edac/edac_device.c
+@@ -474,9 +474,9 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
+  */
+ int edac_device_alloc_index(void)
+ {
+-	static atomic_t device_indexes = ATOMIC_INIT(0);
++	static atomic_unchecked_t device_indexes = ATOMIC_INIT(0);
+ 
+-	return atomic_inc_return(&device_indexes) - 1;
++	return atomic_inc_return_unchecked(&device_indexes) - 1;
+ }
+ EXPORT_SYMBOL_GPL(edac_device_alloc_index);
+ 
 diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
 index c4d700a..0b57abd 100644
 --- a/drivers/edac/edac_mc_sysfs.c
@@ -37674,6 +38167,28 @@ index c4d700a..0b57abd 100644
  		err = device_create_file(&mci->dev,
  					 &dev_attr_sdram_scrub_rate);
  		if (err) {
+diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
+index dd370f9..0281629 100644
+--- a/drivers/edac/edac_pci.c
++++ b/drivers/edac/edac_pci.c
+@@ -29,7 +29,7 @@
+ 
+ static DEFINE_MUTEX(edac_pci_ctls_mutex);
+ static LIST_HEAD(edac_pci_list);
+-static atomic_t pci_indexes = ATOMIC_INIT(0);
++static atomic_unchecked_t pci_indexes = ATOMIC_INIT(0);
+ 
+ /*
+  * edac_pci_alloc_ctl_info
+@@ -315,7 +315,7 @@ EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
+  */
+ int edac_pci_alloc_index(void)
+ {
+-	return atomic_inc_return(&pci_indexes) - 1;
++	return atomic_inc_return_unchecked(&pci_indexes) - 1;
+ }
+ EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
+ 
 diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
 index e8658e4..22746d6 100644
 --- a/drivers/edac/edac_pci_sysfs.c
@@ -37784,9 +38299,21 @@ index 51b7e3a..aa8a3e8 100644
  void amd_report_gart_errors(bool);
  void amd_register_ecc_decoder(void (*f)(int, struct mce *));
 diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
-index 57ea7f4..789e3c3 100644
+index 57ea7f4..af06b76 100644
 --- a/drivers/firewire/core-card.c
 +++ b/drivers/firewire/core-card.c
+@@ -528,9 +528,9 @@ void fw_card_initialize(struct fw_card *card,
+ 			const struct fw_card_driver *driver,
+ 			struct device *device)
+ {
+-	static atomic_t index = ATOMIC_INIT(-1);
++	static atomic_unchecked_t index = ATOMIC_INIT(-1);
+ 
+-	card->index = atomic_inc_return(&index);
++	card->index = atomic_inc_return_unchecked(&index);
+ 	card->driver = driver;
+ 	card->device = device;
+ 	card->current_tlabel = 0;
 @@ -680,7 +680,7 @@ EXPORT_SYMBOL_GPL(fw_card_release);
  
  void fw_core_remove_card(struct fw_card *card)
@@ -39996,6 +40523,91 @@ index ae49237..380d4c9 100644
  
  	__asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
  			      "=a"(hv_status_lo) : "d" (control_hi),
+diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
+index deb5c25..ed2d4fd 100644
+--- a/drivers/hv/hv_balloon.c
++++ b/drivers/hv/hv_balloon.c
+@@ -464,7 +464,7 @@ MODULE_PARM_DESC(hot_add, "If set attempt memory hot_add");
+ 
+ module_param(pressure_report_delay, uint, (S_IRUGO | S_IWUSR));
+ MODULE_PARM_DESC(pressure_report_delay, "Delay in secs in reporting pressure");
+-static atomic_t trans_id = ATOMIC_INIT(0);
++static atomic_unchecked_t trans_id = ATOMIC_INIT(0);
+ 
+ static int dm_ring_size = (5 * PAGE_SIZE);
+ 
+@@ -825,7 +825,7 @@ static void hot_add_req(struct work_struct *dummy)
+ 	memset(&resp, 0, sizeof(struct dm_hot_add_response));
+ 	resp.hdr.type = DM_MEM_HOT_ADD_RESPONSE;
+ 	resp.hdr.size = sizeof(struct dm_hot_add_response);
+-	resp.hdr.trans_id = atomic_inc_return(&trans_id);
++	resp.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 
+ #ifdef CONFIG_MEMORY_HOTPLUG
+ 	pg_start = dm->ha_wrk.ha_page_range.finfo.start_page;
+@@ -960,7 +960,7 @@ static void post_status(struct hv_dynmem_device *dm)
+ 	memset(&status, 0, sizeof(struct dm_status));
+ 	status.hdr.type = DM_STATUS_REPORT;
+ 	status.hdr.size = sizeof(struct dm_status);
+-	status.hdr.trans_id = atomic_inc_return(&trans_id);
++	status.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 
+ 	/*
+ 	 * The host expects the guest to report free memory.
+@@ -980,7 +980,7 @@ static void post_status(struct hv_dynmem_device *dm)
+ 	 * send the status. This can happen if we were interrupted
+ 	 * after we picked our transaction ID.
+ 	 */
+-	if (status.hdr.trans_id != atomic_read(&trans_id))
++	if (status.hdr.trans_id != atomic_read_unchecked(&trans_id))
+ 		return;
+ 
+ 	vmbus_sendpacket(dm->dev->channel, &status,
+@@ -1081,7 +1081,7 @@ static void balloon_up(struct work_struct *dummy)
+ 		bl_resp = (struct dm_balloon_response *)send_buffer;
+ 		memset(send_buffer, 0, PAGE_SIZE);
+ 		bl_resp->hdr.type = DM_BALLOON_RESPONSE;
+-		bl_resp->hdr.trans_id = atomic_inc_return(&trans_id);
++		bl_resp->hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 		bl_resp->hdr.size = sizeof(struct dm_balloon_response);
+ 		bl_resp->more_pages = 1;
+ 
+@@ -1152,7 +1152,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
+ 
+ 	memset(&resp, 0, sizeof(struct dm_unballoon_response));
+ 	resp.hdr.type = DM_UNBALLOON_RESPONSE;
+-	resp.hdr.trans_id = atomic_inc_return(&trans_id);
++	resp.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 	resp.hdr.size = sizeof(struct dm_unballoon_response);
+ 
+ 	vmbus_sendpacket(dm_device.dev->channel, &resp,
+@@ -1215,7 +1215,7 @@ static void version_resp(struct hv_dynmem_device *dm,
+ 	memset(&version_req, 0, sizeof(struct dm_version_request));
+ 	version_req.hdr.type = DM_VERSION_REQUEST;
+ 	version_req.hdr.size = sizeof(struct dm_version_request);
+-	version_req.hdr.trans_id = atomic_inc_return(&trans_id);
++	version_req.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 	version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN7;
+ 	version_req.is_last_attempt = 1;
+ 
+@@ -1385,7 +1385,7 @@ static int balloon_probe(struct hv_device *dev,
+ 	memset(&version_req, 0, sizeof(struct dm_version_request));
+ 	version_req.hdr.type = DM_VERSION_REQUEST;
+ 	version_req.hdr.size = sizeof(struct dm_version_request);
+-	version_req.hdr.trans_id = atomic_inc_return(&trans_id);
++	version_req.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 	version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN8;
+ 	version_req.is_last_attempt = 0;
+ 
+@@ -1416,7 +1416,7 @@ static int balloon_probe(struct hv_device *dev,
+ 	memset(&cap_msg, 0, sizeof(struct dm_capabilities));
+ 	cap_msg.hdr.type = DM_CAPABILITIES_REPORT;
+ 	cap_msg.hdr.size = sizeof(struct dm_capabilities);
+-	cap_msg.hdr.trans_id = atomic_inc_return(&trans_id);
++	cap_msg.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 
+ 	cap_msg.caps.cap_bits.balloon = 1;
+ 	cap_msg.caps.cap_bits.hot_add = 1;
 diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
 index 12f2f9e..679603c 100644
 --- a/drivers/hv/hyperv_vmbus.h
@@ -40597,6 +41209,32 @@ index 1f95bba..9530f87 100644
  			(u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
  				      sdata, wqe->wr.wr.atomic.swap);
  		goto send_comp;
+diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
+index 4d599ce..697b17f 100644
+--- a/drivers/infiniband/hw/mlx4/mad.c
++++ b/drivers/infiniband/hw/mlx4/mad.c
+@@ -98,7 +98,7 @@ __be64 mlx4_ib_gen_node_guid(void)
+ 
+ __be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx)
+ {
+-	return cpu_to_be64(atomic_inc_return(&ctx->tid)) |
++	return cpu_to_be64(atomic_inc_return_unchecked(&ctx->tid)) |
+ 		cpu_to_be64(0xff00000000000000LL);
+ }
+ 
+diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
+index f61ec26..ebf72cf 100644
+--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
++++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
+@@ -398,7 +398,7 @@ struct mlx4_ib_demux_ctx {
+ 	struct list_head	mcg_mgid0_list;
+ 	struct workqueue_struct	*mcg_wq;
+ 	struct mlx4_ib_demux_pv_ctx **tun;
+-	atomic_t tid;
++	atomic_unchecked_t tid;
+ 	int    flushing; /* flushing the work queue */
+ };
+ 
 diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
 index 9d3e5c1..d9afe4a 100644
 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -41125,6 +41763,28 @@ index fa061d4..4a6957c 100644
  
  	snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
  	led->xpad = xpad;
+diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
+index e204f26..8459f15 100644
+--- a/drivers/input/misc/ims-pcu.c
++++ b/drivers/input/misc/ims-pcu.c
+@@ -1621,7 +1621,7 @@ static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id)
+ 
+ static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
+ {
+-	static atomic_t device_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t device_no = ATOMIC_INIT(0);
+ 
+ 	const struct ims_pcu_device_info *info;
+ 	u8 device_id;
+@@ -1653,7 +1653,7 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
+ 	}
+ 
+ 	/* Device appears to be operable, complete initialization */
+-	pcu->device_no = atomic_inc_return(&device_no) - 1;
++	pcu->device_no = atomic_inc_return_unchecked(&device_no) - 1;
+ 
+ 	error = ims_pcu_setup_backlight(pcu);
+ 	if (error)
 diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
 index 2f0b39d..7370f13 100644
 --- a/drivers/input/mouse/psmouse.h
@@ -41173,6 +41833,28 @@ index 25fc597..558bf3b3 100644
  	serio->dev.bus = &serio_bus;
  	serio->dev.release = serio_release_port;
  	serio->dev.groups = serio_device_attr_groups;
+diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
+index 59df2e7..8f1cafb 100644
+--- a/drivers/input/serio/serio_raw.c
++++ b/drivers/input/serio/serio_raw.c
+@@ -293,7 +293,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
+ 
+ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
+ {
+-	static atomic_t serio_raw_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t serio_raw_no = ATOMIC_INIT(0);
+ 	struct serio_raw *serio_raw;
+ 	int err;
+ 
+@@ -304,7 +304,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
+ 	}
+ 
+ 	snprintf(serio_raw->name, sizeof(serio_raw->name),
+-		 "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1);
++		 "serio_raw%ld", (long)atomic_inc_return_unchecked(&serio_raw_no) - 1);
+ 	kref_init(&serio_raw->kref);
+ 	INIT_LIST_HEAD(&serio_raw->client_list);
+ 	init_waitqueue_head(&serio_raw->wait);
 diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
 index d8f98b1..f62a640 100644
 --- a/drivers/iommu/iommu.c
@@ -42190,6 +42872,19 @@ index c7a9be1..683f6f8 100644
  
  module_param_array(video_nr, int, NULL, 0444);
  module_param_array(vbi_nr,   int, NULL, 0444);
+diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
+index 07b8460..e6d7265 100644
+--- a/drivers/media/pci/ivtv/ivtv-driver.c
++++ b/drivers/media/pci/ivtv/ivtv-driver.c
+@@ -84,7 +84,7 @@ static struct pci_device_id ivtv_pci_tbl[] = {
+ MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
+ 
+ /* ivtv instance counter */
+-static atomic_t ivtv_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t ivtv_instance = ATOMIC_INIT(0);
+ 
+ /* Parameter declarations */
+ static int cardtype[IVTV_MAX_CARDS];
 diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
 index d338b19..aae4f9e 100644
 --- a/drivers/media/platform/omap/omap_vout.c
@@ -42400,6 +43095,80 @@ index 545c04c..a14bded 100644
  		i = -EFAULT;
  unlock:
  	mutex_unlock(&dev->lock);
+diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
+index bd4d3a7..ffc0b9d 100644
+--- a/drivers/media/radio/radio-maxiradio.c
++++ b/drivers/media/radio/radio-maxiradio.c
+@@ -61,7 +61,7 @@ MODULE_PARM_DESC(radio_nr, "Radio device number");
+ /* TEA5757 pin mappings */
+ static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16;
+ 
+-static atomic_t maxiradio_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t maxiradio_instance = ATOMIC_INIT(0);
+ 
+ #define PCI_VENDOR_ID_GUILLEMOT 0x5046
+ #define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001
+diff --git a/drivers/media/radio/radio-shark.c b/drivers/media/radio/radio-shark.c
+index 8fa18ab..caee70f 100644
+--- a/drivers/media/radio/radio-shark.c
++++ b/drivers/media/radio/radio-shark.c
+@@ -79,7 +79,7 @@ struct shark_device {
+ 	u32 last_val;
+ };
+ 
+-static atomic_t shark_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t shark_instance = ATOMIC_INIT(0);
+ 
+ static void shark_write_val(struct snd_tea575x *tea, u32 val)
+ {
+diff --git a/drivers/media/radio/radio-shark2.c b/drivers/media/radio/radio-shark2.c
+index 9fb6697..f167415 100644
+--- a/drivers/media/radio/radio-shark2.c
++++ b/drivers/media/radio/radio-shark2.c
+@@ -74,7 +74,7 @@ struct shark_device {
+ 	u8 *transfer_buffer;
+ };
+ 
+-static atomic_t shark_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t shark_instance = ATOMIC_INIT(0);
+ 
+ static int shark_write_reg(struct radio_tea5777 *tea, u64 reg)
+ {
+diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c
+index 9dc8baf..796d52f 100644
+--- a/drivers/media/radio/radio-si476x.c
++++ b/drivers/media/radio/radio-si476x.c
+@@ -1456,7 +1456,7 @@ static int si476x_radio_probe(struct platform_device *pdev)
+ 	struct si476x_radio *radio;
+ 	struct v4l2_ctrl *ctrl;
+ 
+-	static atomic_t instance = ATOMIC_INIT(0);
++	static atomic_unchecked_t instance = ATOMIC_INIT(0);
+ 
+ 	radio = devm_kzalloc(&pdev->dev, sizeof(*radio), GFP_KERNEL);
+ 	if (!radio)
+diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
+index 1cf382a..c22998c 100644
+--- a/drivers/media/rc/rc-main.c
++++ b/drivers/media/rc/rc-main.c
+@@ -1030,7 +1030,7 @@ EXPORT_SYMBOL_GPL(rc_free_device);
+ int rc_register_device(struct rc_dev *dev)
+ {
+ 	static bool raw_init = false; /* raw decoders loaded? */
+-	static atomic_t devno = ATOMIC_INIT(0);
++	static atomic_unchecked_t devno = ATOMIC_INIT(0);
+ 	struct rc_map *rc_map;
+ 	const char *path;
+ 	int rc;
+@@ -1061,7 +1061,7 @@ int rc_register_device(struct rc_dev *dev)
+ 	 */
+ 	mutex_lock(&dev->lock);
+ 
+-	dev->devno = (unsigned long)(atomic_inc_return(&devno) - 1);
++	dev->devno = (unsigned long)(atomic_inc_return_unchecked(&devno) - 1);
+ 	dev_set_name(&dev->dev, "rc%ld", dev->devno);
+ 	dev_set_drvdata(&dev->dev, dev);
+ 	rc = device_add(&dev->dev);
 diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
 index 3940bb0..fb3952a 100644
 --- a/drivers/media/usb/dvb-usb/cxusb.c
@@ -42457,6 +43226,22 @@ index f129551..ecf6514 100644
  			return -EFAULT;
  	return 0;
  }
+diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c
+index 8ed5da2..47fee46 100644
+--- a/drivers/media/v4l2-core/v4l2-device.c
++++ b/drivers/media/v4l2-core/v4l2-device.c
+@@ -74,9 +74,9 @@ int v4l2_device_put(struct v4l2_device *v4l2_dev)
+ EXPORT_SYMBOL_GPL(v4l2_device_put);
+ 
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+-						atomic_t *instance)
++						atomic_unchecked_t *instance)
+ {
+-	int num = atomic_inc_return(instance) - 1;
++	int num = atomic_inc_return_unchecked(instance) - 1;
+ 	int len = strlen(basename);
+ 
+ 	if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
 index 7658586..1079260 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -43992,6 +44777,28 @@ index cba1d46..f703766 100644
  				result =
  				    hso_start_serial_device(serial_table[i], GFP_NOIO);
  				hso_kick_transmit(dev2ser(serial_table[i]));
+diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
+index a79e9d3..78cd4fa 100644
+--- a/drivers/net/usb/sierra_net.c
++++ b/drivers/net/usb/sierra_net.c
+@@ -52,7 +52,7 @@ static const char driver_name[] = "sierra_net";
+ /* atomic counter partially included in MAC address to make sure 2 devices
+  * do not end up with the same MAC - concept breaks in case of > 255 ifaces
+  */
+-static	atomic_t iface_counter = ATOMIC_INIT(0);
++static	atomic_unchecked_t iface_counter = ATOMIC_INIT(0);
+ 
+ /*
+  * SYNC Timer Delay definition used to set the expiry time
+@@ -698,7 +698,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
+ 	dev->net->netdev_ops = &sierra_net_device_ops;
+ 
+ 	/* change MAC addr to include, ifacenum, and to be unique */
+-	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
++	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return_unchecked(&iface_counter);
+ 	dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
+ 
+ 	/* we will have to manufacture ethernet headers, prepare template */
 diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
 index 57325f3..36b181f 100644
 --- a/drivers/net/vxlan.c
@@ -44914,15 +45721,22 @@ index 7d72c5e..edce02c 100644
  	int retval = -ENOMEM;
  
 diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
-index 5127f3f..cc115f7 100644
+index 5127f3f..b225573 100644
 --- a/drivers/pci/hotplug/pciehp_hpc.c
 +++ b/drivers/pci/hotplug/pciehp_hpc.c
-@@ -780,7 +780,7 @@ static int pcie_init_slot(struct controller *ctrl)
+@@ -773,14 +773,12 @@ static void pcie_shutdown_notification(struct controller *ctrl)
+ static int pcie_init_slot(struct controller *ctrl)
+ {
+ 	struct slot *slot;
+-	char name[32];
+ 
+ 	slot = kzalloc(sizeof(*slot), GFP_KERNEL);
+ 	if (!slot)
  		return -ENOMEM;
  
- 	snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
+-	snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
 -	slot->wq = alloc_workqueue(name, 0, 0);
-+	slot->wq = alloc_workqueue("%s", 0, 0, name);
++	slot->wq = alloc_workqueue("pciehp-%u", 0, 0, PSN(ctrl));
  	if (!slot->wq)
  		goto abort;
  
@@ -45392,6 +46206,28 @@ index 29178f7..c65f324 100644
  	for (i = 0; i < ARRAY_SIZE(power_supply_attrs); i++)
  		__power_supply_attrs[i] = &power_supply_attrs[i].attr;
  }
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index 815d6df..811633a 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -3529,7 +3529,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
+ {
+ 	const struct regulation_constraints *constraints = NULL;
+ 	const struct regulator_init_data *init_data;
+-	static atomic_t regulator_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t regulator_no = ATOMIC_INIT(0);
+ 	struct regulator_dev *rdev;
+ 	struct device *dev;
+ 	int ret, i;
+@@ -3599,7 +3599,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
+ 	rdev->dev.of_node = config->of_node;
+ 	rdev->dev.parent = dev;
+ 	dev_set_name(&rdev->dev, "regulator.%d",
+-		     atomic_inc_return(&regulator_no) - 1);
++		     atomic_inc_return_unchecked(&regulator_no) - 1);
+ 	ret = device_register(&rdev->dev);
+ 	if (ret != 0) {
+ 		put_device(&rdev->dev);
 diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
 index d428ef9..fdc0357 100644
 --- a/drivers/regulator/max8660.c
@@ -45546,6 +46382,50 @@ index 23a90e7..9cf04ee 100644
  
  /*
   * Queue element to wait for room in request queue. FIFO order is
+diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
+index 8c05ae01..b2cf224 100644
+--- a/drivers/scsi/fcoe/fcoe_sysfs.c
++++ b/drivers/scsi/fcoe/fcoe_sysfs.c
+@@ -33,8 +33,8 @@
+  */
+ #include "libfcoe.h"
+ 
+-static atomic_t ctlr_num;
+-static atomic_t fcf_num;
++static atomic_unchecked_t ctlr_num;
++static atomic_unchecked_t fcf_num;
+ 
+ /*
+  * fcoe_fcf_dev_loss_tmo: the default number of seconds that fcoe sysfs
+@@ -681,7 +681,7 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
+ 	if (!ctlr)
+ 		goto out;
+ 
+-	ctlr->id = atomic_inc_return(&ctlr_num) - 1;
++	ctlr->id = atomic_inc_return_unchecked(&ctlr_num) - 1;
+ 	ctlr->f = f;
+ 	ctlr->mode = FIP_CONN_TYPE_FABRIC;
+ 	INIT_LIST_HEAD(&ctlr->fcfs);
+@@ -898,7 +898,7 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *ctlr,
+ 	fcf->dev.parent = &ctlr->dev;
+ 	fcf->dev.bus = &fcoe_bus_type;
+ 	fcf->dev.type = &fcoe_fcf_device_type;
+-	fcf->id = atomic_inc_return(&fcf_num) - 1;
++	fcf->id = atomic_inc_return_unchecked(&fcf_num) - 1;
+ 	fcf->state = FCOE_FCF_STATE_UNKNOWN;
+ 
+ 	fcf->dev_loss_tmo = ctlr->fcf_dev_loss_tmo;
+@@ -934,8 +934,8 @@ int __init fcoe_sysfs_setup(void)
+ {
+ 	int error;
+ 
+-	atomic_set(&ctlr_num, 0);
+-	atomic_set(&fcf_num, 0);
++	atomic_set_unchecked(&ctlr_num, 0);
++	atomic_set_unchecked(&fcf_num, 0);
+ 
+ 	error = bus_register(&fcoe_bus_type);
+ 	if (error)
 diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
 index df0c3c7..b00e1d0 100644
 --- a/drivers/scsi/hosts.c
@@ -46470,6 +47350,37 @@ index 32b7bb1..2f1c4bd 100644
  
  static u8	*buf;
  
+diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c
+index ec9e2ae..cd15d67 100644
+--- a/drivers/staging/android/timed_output.c
++++ b/drivers/staging/android/timed_output.c
+@@ -25,7 +25,7 @@
+ #include "timed_output.h"
+ 
+ static struct class *timed_output_class;
+-static atomic_t device_count;
++static atomic_unchecked_t device_count;
+ 
+ static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
+ 		char *buf)
+@@ -59,7 +59,7 @@ static int create_timed_output_class(void)
+ 		timed_output_class = class_create(THIS_MODULE, "timed_output");
+ 		if (IS_ERR(timed_output_class))
+ 			return PTR_ERR(timed_output_class);
+-		atomic_set(&device_count, 0);
++		atomic_set_unchecked(&device_count, 0);
+ 	}
+ 
+ 	return 0;
+@@ -76,7 +76,7 @@ int timed_output_dev_register(struct timed_output_dev *tdev)
+ 	if (ret < 0)
+ 		return ret;
+ 
+-	tdev->index = atomic_inc_return(&device_count);
++	tdev->index = atomic_inc_return_unchecked(&device_count);
+ 	tdev->dev = device_create(timed_output_class, NULL,
+ 		MKDEV(0, tdev->index), NULL, tdev->name);
+ 	if (IS_ERR(tdev->dev))
 diff --git a/drivers/staging/media/solo6x10/solo6x10-core.c b/drivers/staging/media/solo6x10/solo6x10-core.c
 index 3675020..e80d92c 100644
 --- a/drivers/staging/media/solo6x10/solo6x10-core.c
@@ -46483,6 +47394,32 @@ index 3675020..e80d92c 100644
  	struct device *dev = &solo_dev->dev;
  	const char *driver;
  	int i;
+diff --git a/drivers/staging/media/solo6x10/solo6x10-p2m.c b/drivers/staging/media/solo6x10/solo6x10-p2m.c
+index 3335941..2b26186 100644
+--- a/drivers/staging/media/solo6x10/solo6x10-p2m.c
++++ b/drivers/staging/media/solo6x10/solo6x10-p2m.c
+@@ -77,7 +77,7 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev,
+ 
+ 	/* Get next ID. According to Softlogic, 6110 has problems on !=0 P2M */
+ 	if (solo_dev->type != SOLO_DEV_6110 && multi_p2m) {
+-		p2m_id = atomic_inc_return(&solo_dev->p2m_count) % SOLO_NR_P2M;
++		p2m_id = atomic_inc_return_unchecked(&solo_dev->p2m_count) % SOLO_NR_P2M;
+ 		if (p2m_id < 0)
+ 			p2m_id = -p2m_id;
+ 	}
+diff --git a/drivers/staging/media/solo6x10/solo6x10.h b/drivers/staging/media/solo6x10/solo6x10.h
+index 6f91d2e..3f011d2 100644
+--- a/drivers/staging/media/solo6x10/solo6x10.h
++++ b/drivers/staging/media/solo6x10/solo6x10.h
+@@ -238,7 +238,7 @@ struct solo_dev {
+ 
+ 	/* P2M DMA Engine */
+ 	struct solo_p2m_dev	p2m_dev[SOLO_NR_P2M];
+-	atomic_t		p2m_count;
++	atomic_unchecked_t	p2m_count;
+ 	int			p2m_jiffies;
+ 	unsigned int		p2m_timeouts;
+ 
 diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
 index 34afc16..ffe44dd 100644
 --- a/drivers/staging/octeon/ethernet-rx.c
@@ -46700,6 +47637,28 @@ index d128ce2..fc1f9a1 100644
  extern void tmem_register_hostops(struct tmem_hostops *m);
  
  /* core tmem accessor functions */
+diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
+index d3536f5..a0c2ce9 100644
+--- a/drivers/target/sbp/sbp_target.c
++++ b/drivers/target/sbp/sbp_target.c
+@@ -62,7 +62,7 @@ static const u32 sbp_unit_directory_template[] = {
+ 
+ #define SESSION_MAINTENANCE_INTERVAL HZ
+ 
+-static atomic_t login_id = ATOMIC_INIT(0);
++static atomic_unchecked_t login_id = ATOMIC_INIT(0);
+ 
+ static void session_maintenance_work(struct work_struct *);
+ static int sbp_run_transaction(struct fw_card *, int, int, int, int,
+@@ -444,7 +444,7 @@ static void sbp_management_request_login(
+ 	login->lun = se_lun;
+ 	login->status_fifo_addr = sbp2_pointer_to_addr(&req->orb.status_fifo);
+ 	login->exclusive = LOGIN_ORB_EXCLUSIVE(be32_to_cpu(req->orb.misc));
+-	login->login_id = atomic_inc_return(&login_id);
++	login->login_id = atomic_inc_return_unchecked(&login_id);
+ 
+ 	login->tgt_agt = sbp_target_agent_register(login);
+ 	if (IS_ERR(login->tgt_agt)) {
 diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
 index 4630481..c26782a 100644
 --- a/drivers/target/target_core_device.c
@@ -46907,6 +47866,95 @@ index 81e939e..95ead10 100644
  		return 0;
  
  	return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
+diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
+index 4190199..48f2920 100644
+--- a/drivers/tty/hvc/hvsi.c
++++ b/drivers/tty/hvc/hvsi.c
+@@ -85,7 +85,7 @@ struct hvsi_struct {
+ 	int n_outbuf;
+ 	uint32_t vtermno;
+ 	uint32_t virq;
+-	atomic_t seqno; /* HVSI packet sequence number */
++	atomic_unchecked_t seqno; /* HVSI packet sequence number */
+ 	uint16_t mctrl;
+ 	uint8_t state;  /* HVSI protocol state */
+ 	uint8_t flags;
+@@ -295,7 +295,7 @@ static int hvsi_version_respond(struct hvsi_struct *hp, uint16_t query_seqno)
+ 
+ 	packet.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER;
+ 	packet.hdr.len = sizeof(struct hvsi_query_response);
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.verb = VSV_SEND_VERSION_NUMBER;
+ 	packet.u.version = HVSI_VERSION;
+ 	packet.query_seqno = query_seqno+1;
+@@ -555,7 +555,7 @@ static int hvsi_query(struct hvsi_struct *hp, uint16_t verb)
+ 
+ 	packet.hdr.type = VS_QUERY_PACKET_HEADER;
+ 	packet.hdr.len = sizeof(struct hvsi_query);
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.verb = verb;
+ 
+ 	pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len);
+@@ -597,7 +597,7 @@ static int hvsi_set_mctrl(struct hvsi_struct *hp, uint16_t mctrl)
+ 	int wrote;
+ 
+ 	packet.hdr.type = VS_CONTROL_PACKET_HEADER,
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = sizeof(struct hvsi_control);
+ 	packet.verb = VSV_SET_MODEM_CTL;
+ 	packet.mask = HVSI_TSDTR;
+@@ -680,7 +680,7 @@ static int hvsi_put_chars(struct hvsi_struct *hp, const char *buf, int count)
+ 	BUG_ON(count > HVSI_MAX_OUTGOING_DATA);
+ 
+ 	packet.hdr.type = VS_DATA_PACKET_HEADER;
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = count + sizeof(struct hvsi_header);
+ 	memcpy(&packet.data, buf, count);
+ 
+@@ -697,7 +697,7 @@ static void hvsi_close_protocol(struct hvsi_struct *hp)
+ 	struct hvsi_control packet __ALIGNED__;
+ 
+ 	packet.hdr.type = VS_CONTROL_PACKET_HEADER;
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = 6;
+ 	packet.verb = VSV_CLOSE_PROTOCOL;
+ 
+diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
+index 3396eb9..6d3d540 100644
+--- a/drivers/tty/hvc/hvsi_lib.c
++++ b/drivers/tty/hvc/hvsi_lib.c
+@@ -9,7 +9,7 @@
+ 
+ static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet)
+ {
+-	packet->seqno = atomic_inc_return(&pv->seqno);
++	packet->seqno = atomic_inc_return_unchecked(&pv->seqno);
+ 
+ 	/* Assumes that always succeeds, works in practice */
+ 	return pv->put_chars(pv->termno, (char *)packet, packet->len);
+@@ -21,7 +21,7 @@ static void hvsi_start_handshake(struct hvsi_priv *pv)
+ 
+ 	/* Reset state */
+ 	pv->established = 0;
+-	atomic_set(&pv->seqno, 0);
++	atomic_set_unchecked(&pv->seqno, 0);
+ 
+ 	pr_devel("HVSI@%x: Handshaking started\n", pv->termno);
+ 
+@@ -265,7 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv)
+ 	pv->mctrl_update = 0;
+ 	q.hdr.type = VS_QUERY_PACKET_HEADER;
+ 	q.hdr.len = sizeof(struct hvsi_query);
+-	q.hdr.seqno = atomic_inc_return(&pv->seqno);
++	q.hdr.seqno = atomic_inc_return_unchecked(&pv->seqno);
+ 	q.verb = VSV_SEND_MODEM_CTL_STATUS;
+ 	rc = hvsi_send_packet(pv, &q.hdr);
+ 	if (rc <= 0) {
 diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
 index 8fd72ff..34a0bed 100644
 --- a/drivers/tty/ipwireless/tty.c
@@ -47119,6 +48167,37 @@ index 354564e..fe50d9a 100644
  		atomic_dec(&rp_num_ports_open);
  	clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
  	spin_unlock_irqrestore(&info->port.lock, flags);
+diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
+index e2520ab..034e20b 100644
+--- a/drivers/tty/serial/ioc4_serial.c
++++ b/drivers/tty/serial/ioc4_serial.c
+@@ -437,7 +437,7 @@ struct ioc4_soft {
+ 		} is_intr_info[MAX_IOC4_INTR_ENTS];
+ 
+ 		/* Number of entries active in the above array */
+-		atomic_t is_num_intrs;
++		atomic_unchecked_t is_num_intrs;
+ 	} is_intr_type[IOC4_NUM_INTR_TYPES];
+ 
+ 	/* is_ir_lock must be held while
+@@ -974,7 +974,7 @@ intr_connect(struct ioc4_soft *soft, int type,
+ 	BUG_ON(!((type == IOC4_SIO_INTR_TYPE)
+ 	       || (type == IOC4_OTHER_INTR_TYPE)));
+ 
+-	i = atomic_inc_return(&soft-> is_intr_type[type].is_num_intrs) - 1;
++	i = atomic_inc_return_unchecked(&soft-> is_intr_type[type].is_num_intrs) - 1;
+ 	BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0)));
+ 
+ 	/* Save off the lower level interrupt handler */
+@@ -1001,7 +1001,7 @@ static irqreturn_t ioc4_intr(int irq, void *arg)
+ 
+ 	soft = arg;
+ 	for (intr_type = 0; intr_type < IOC4_NUM_INTR_TYPES; intr_type++) {
+-		num_intrs = (int)atomic_read(
++		num_intrs = (int)atomic_read_unchecked(
+ 				&soft->is_intr_type[intr_type].is_num_intrs);
+ 
+ 		this_mir = this_ir = pending_intrs(soft, intr_type);
 diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
 index 1002054..dd644a8 100644
 --- a/drivers/tty/serial/kgdboc.c
@@ -47225,6 +48304,28 @@ index 1002054..dd644a8 100644
  #ifdef CONFIG_KGDB_SERIAL_CONSOLE
  /* This is only available if kgdboc is a built in for early debugging */
  static int __init kgdboc_early_init(char *opt)
+diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
+index b11e997..6d25a3b 100644
+--- a/drivers/tty/serial/msm_serial.c
++++ b/drivers/tty/serial/msm_serial.c
+@@ -857,7 +857,7 @@ static struct uart_driver msm_uart_driver = {
+ 	.cons = MSM_CONSOLE,
+ };
+ 
+-static atomic_t msm_uart_next_id = ATOMIC_INIT(0);
++static atomic_unchecked_t msm_uart_next_id = ATOMIC_INIT(0);
+ 
+ static int __init msm_serial_probe(struct platform_device *pdev)
+ {
+@@ -867,7 +867,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
+ 	int irq;
+ 
+ 	if (pdev->id == -1)
+-		pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;
++		pdev->id = atomic_inc_return_unchecked(&msm_uart_next_id) - 1;
+ 
+ 	if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
+ 		return -ENXIO;
 diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
 index 0c8a9fa..234a95f 100644
 --- a/drivers/tty/serial/samsung.c
@@ -48334,6 +49435,28 @@ index b369292..9f3ba40 100644
  		gs_buf_free(&port->port_write_buf);
  	gs_free_requests(gser->out, &port->read_pool, NULL);
  	gs_free_requests(gser->out, &port->read_queue, NULL);
+diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
+index ba6a5d6..f88f7f3 100644
+--- a/drivers/usb/misc/appledisplay.c
++++ b/drivers/usb/misc/appledisplay.c
+@@ -83,7 +83,7 @@ struct appledisplay {
+ 	spinlock_t lock;
+ };
+ 
+-static atomic_t count_displays = ATOMIC_INIT(0);
++static atomic_unchecked_t count_displays = ATOMIC_INIT(0);
+ static struct workqueue_struct *wq;
+ 
+ static void appledisplay_complete(struct urb *urb)
+@@ -281,7 +281,7 @@ static int appledisplay_probe(struct usb_interface *iface,
+ 
+ 	/* Register backlight device */
+ 	snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
+-		atomic_inc_return(&count_displays) - 1);
++		atomic_inc_return_unchecked(&count_displays) - 1);
+ 	memset(&props, 0, sizeof(struct backlight_properties));
+ 	props.type = BACKLIGHT_RAW;
+ 	props.max_brightness = 0xff;
 diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
 index 5f3bcd3..bfca43f 100644
 --- a/drivers/usb/serial/console.c
@@ -48613,6 +49736,28 @@ index 098bfc6..796841d 100644
  			return -EINVAL;
  		if (!registered_fb[con2fb.framebuffer])
  			request_module("fb%d", con2fb.framebuffer);
+diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
+index d4d2c5f..ebbd113 100644
+--- a/drivers/video/hyperv_fb.c
++++ b/drivers/video/hyperv_fb.c
+@@ -233,7 +233,7 @@ static uint screen_fb_size;
+ static inline int synthvid_send(struct hv_device *hdev,
+ 				struct synthvid_msg *msg)
+ {
+-	static atomic64_t request_id = ATOMIC64_INIT(0);
++	static atomic64_unchecked_t request_id = ATOMIC64_INIT(0);
+ 	int ret;
+ 
+ 	msg->pipe_hdr.type = PIPE_MSG_DATA;
+@@ -241,7 +241,7 @@ static inline int synthvid_send(struct hv_device *hdev,
+ 
+ 	ret = vmbus_sendpacket(hdev->channel, msg,
+ 			       msg->vid_hdr.size + sizeof(struct pipe_msg_hdr),
+-			       atomic64_inc_return(&request_id),
++			       atomic64_inc_return_unchecked(&request_id),
+ 			       VM_PKT_DATA_INBAND, 0);
+ 
+ 	if (ret)
 diff --git a/drivers/video/i810/i810_accel.c b/drivers/video/i810/i810_accel.c
 index 7672d2e..b56437f 100644
 --- a/drivers/video/i810/i810_accel.c
@@ -51880,6 +53025,28 @@ index 370b24c..ff0be7b 100644
  	---help---
  	  A.out (Assembler.OUTput) is a set of formats for libraries and
  	  executables used in the earliest versions of UNIX.  Linux used
+diff --git a/fs/afs/inode.c b/fs/afs/inode.c
+index 789bc25..fafaeea 100644
+--- a/fs/afs/inode.c
++++ b/fs/afs/inode.c
+@@ -141,7 +141,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
+ 	struct afs_vnode *vnode;
+ 	struct super_block *sb;
+ 	struct inode *inode;
+-	static atomic_t afs_autocell_ino;
++	static atomic_unchecked_t afs_autocell_ino;
+ 
+ 	_enter("{%x:%u},%*.*s,",
+ 	       AFS_FS_I(dir)->fid.vid, AFS_FS_I(dir)->fid.vnode,
+@@ -154,7 +154,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
+ 	data.fid.unique = 0;
+ 	data.fid.vnode = 0;
+ 
+-	inode = iget5_locked(sb, atomic_inc_return(&afs_autocell_ino),
++	inode = iget5_locked(sb, atomic_inc_return_unchecked(&afs_autocell_ino),
+ 			     afs_iget5_autocell_test, afs_iget5_set,
+ 			     &data);
+ 	if (!inode) {
 diff --git a/fs/aio.c b/fs/aio.c
 index 2bbcacf..8614116 100644
 --- a/fs/aio.c
@@ -53153,6 +54320,59 @@ index 7fb054b..ad36c67 100644
  			parent_start = 0;
  
  		WARN_ON(trans->transid != btrfs_header_generation(parent));
+diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
+index f26f38c..3d0f149 100644
+--- a/fs/btrfs/delayed-inode.c
++++ b/fs/btrfs/delayed-inode.c
+@@ -458,7 +458,7 @@ static int __btrfs_add_delayed_deletion_item(struct btrfs_delayed_node *node,
+ 
+ static void finish_one_item(struct btrfs_delayed_root *delayed_root)
+ {
+-	int seq = atomic_inc_return(&delayed_root->items_seq);
++	int seq = atomic_inc_return_unchecked(&delayed_root->items_seq);
+ 	if ((atomic_dec_return(&delayed_root->items) <
+ 	    BTRFS_DELAYED_BACKGROUND || seq % BTRFS_DELAYED_BATCH == 0) &&
+ 	    waitqueue_active(&delayed_root->wait))
+@@ -1391,7 +1391,7 @@ void btrfs_assert_delayed_root_empty(struct btrfs_root *root)
+ static int refs_newer(struct btrfs_delayed_root *delayed_root,
+ 		      int seq, int count)
+ {
+-	int val = atomic_read(&delayed_root->items_seq);
++	int val = atomic_read_unchecked(&delayed_root->items_seq);
+ 
+ 	if (val < seq || val >= seq + count)
+ 		return 1;
+@@ -1408,7 +1408,7 @@ void btrfs_balance_delayed_items(struct btrfs_root *root)
+ 	if (atomic_read(&delayed_root->items) < BTRFS_DELAYED_BACKGROUND)
+ 		return;
+ 
+-	seq = atomic_read(&delayed_root->items_seq);
++	seq = atomic_read_unchecked(&delayed_root->items_seq);
+ 
+ 	if (atomic_read(&delayed_root->items) >= BTRFS_DELAYED_WRITEBACK) {
+ 		int ret;
+diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
+index 1d5c5f7..0ba0afc 100644
+--- a/fs/btrfs/delayed-inode.h
++++ b/fs/btrfs/delayed-inode.h
+@@ -43,7 +43,7 @@ struct btrfs_delayed_root {
+ 	 */
+ 	struct list_head prepare_list;
+ 	atomic_t items;		/* for delayed items */
+-	atomic_t items_seq;	/* for delayed items */
++	atomic_unchecked_t items_seq;	/* for delayed items */
+ 	int nodes;		/* for delayed nodes */
+ 	wait_queue_head_t wait;
+ };
+@@ -87,7 +87,7 @@ static inline void btrfs_init_delayed_root(
+ 				struct btrfs_delayed_root *delayed_root)
+ {
+ 	atomic_set(&delayed_root->items, 0);
+-	atomic_set(&delayed_root->items_seq, 0);
++	atomic_set_unchecked(&delayed_root->items_seq, 0);
+ 	delayed_root->nodes = 0;
+ 	spin_lock_init(&delayed_root->lock);
+ 	init_waitqueue_head(&delayed_root->wait);
 diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
 index 0f81d67..0ad55fe 100644
 --- a/fs/btrfs/ioctl.c
@@ -55499,9 +56719,18 @@ index d8ac61d..79a36f0 100644
  	.seq		= SEQCNT_ZERO,
  	.umask		= 0022,
 diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
-index e2cba1f..17a25bb 100644
+index e2cba1f..20319c5 100644
 --- a/fs/fscache/cookie.c
 +++ b/fs/fscache/cookie.c
+@@ -19,7 +19,7 @@
+ 
+ struct kmem_cache *fscache_cookie_jar;
+ 
+-static atomic_t fscache_object_debug_id = ATOMIC_INIT(0);
++static atomic_unchecked_t fscache_object_debug_id = ATOMIC_INIT(0);
+ 
+ static int fscache_acquire_non_index_cookie(struct fscache_cookie *cookie);
+ static int fscache_alloc_object(struct fscache_cache *cache,
 @@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire_cookie(
  	       parent ? (char *) parent->def->name : "<no-parent>",
  	       def->name, netfs_data);
@@ -55567,7 +56796,7 @@ index e2cba1f..17a25bb 100644
  		_leave(" = -ENOMEDIUM [no cache]");
  		return -ENOMEDIUM;
  	}
-@@ -255,12 +255,12 @@ static int fscache_alloc_object(struct fscache_cache *cache,
+@@ -255,14 +255,14 @@ static int fscache_alloc_object(struct fscache_cache *cache,
  	object = cache->ops->alloc_object(cache, cookie);
  	fscache_stat_d(&fscache_n_cop_alloc_object);
  	if (IS_ERR(object)) {
@@ -55580,8 +56809,11 @@ index e2cba1f..17a25bb 100644
 -	fscache_stat(&fscache_n_object_alloc);
 +	fscache_stat_unchecked(&fscache_n_object_alloc);
  
- 	object->debug_id = atomic_inc_return(&fscache_object_debug_id);
+-	object->debug_id = atomic_inc_return(&fscache_object_debug_id);
++	object->debug_id = atomic_inc_return_unchecked(&fscache_object_debug_id);
  
+ 	_debug("ALLOC OBJ%x: %s {%lx}",
+ 	       object->debug_id, cookie->def->name, object->events);
 @@ -376,7 +376,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie)
  
  	_enter("{%s}", cookie->def->name);
@@ -57704,7 +58936,7 @@ index 9ed9361..2b72db1 100644
  out:
  	return len;
 diff --git a/fs/namespace.c b/fs/namespace.c
-index a45ba4f..e7dc489 100644
+index a45ba4f..44cfe66 100644
 --- a/fs/namespace.c
 +++ b/fs/namespace.c
 @@ -1265,6 +1265,9 @@ static int do_umount(struct mount *mnt, int flags)
@@ -57772,6 +59004,24 @@ index a45ba4f..e7dc489 100644
  	return retval;
  }
  
+@@ -2344,7 +2363,7 @@ static void free_mnt_ns(struct mnt_namespace *ns)
+  * number incrementing at 10Ghz will take 12,427 years to wrap which
+  * is effectively never, so we can ignore the possibility.
+  */
+-static atomic64_t mnt_ns_seq = ATOMIC64_INIT(1);
++static atomic64_unchecked_t mnt_ns_seq = ATOMIC64_INIT(1);
+ 
+ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
+ {
+@@ -2359,7 +2378,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
+ 		kfree(new_ns);
+ 		return ERR_PTR(ret);
+ 	}
+-	new_ns->seq = atomic64_add_return(1, &mnt_ns_seq);
++	new_ns->seq = atomic64_inc_return_unchecked(&mnt_ns_seq);
+ 	atomic_set(&new_ns->count, 1);
+ 	new_ns->root = NULL;
+ 	INIT_LIST_HEAD(&new_ns->list);
 @@ -2500,8 +2519,8 @@ struct dentry *mount_subtree(struct vfsmount *mnt, const char *name)
  }
  EXPORT_SYMBOL(mount_subtree);
@@ -77556,6 +78806,19 @@ index 95d1c91..6798cca 100644
  
  /*
   * Newer version of video_device, handled by videodev2.c
+diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
+index c9b1593..a572459 100644
+--- a/include/media/v4l2-device.h
++++ b/include/media/v4l2-device.h
+@@ -95,7 +95,7 @@ int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4
+    this function returns 0. If the name ends with a digit (e.g. cx18),
+    then the name will be set to cx18-0 since cx180 looks really odd. */
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+-						atomic_t *instance);
++						atomic_unchecked_t *instance);
+ 
+ /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
+    Since the parent disappears this ensures that v4l2_dev doesn't have an
 diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
 index adcbb20..62c2559 100644
 --- a/include/net/9p/transport.h
@@ -77658,7 +78921,7 @@ index de2c785..0588a6b 100644
  /** inet_connection_sock - INET connection oriented sock
   *
 diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
-index 53f464d..ba76aaa 100644
+index 53f464d..0bd0b49 100644
 --- a/include/net/inetpeer.h
 +++ b/include/net/inetpeer.h
 @@ -47,8 +47,8 @@ struct inet_peer {
@@ -77672,20 +78935,28 @@ index 53f464d..ba76aaa 100644
  		};
  		struct rcu_head         rcu;
  		struct inet_peer	*gc_next;
-@@ -182,11 +182,11 @@ static inline int inet_getid(struct inet_peer *p, int more)
+@@ -178,16 +178,13 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)
+ /* can be called with or without local BH being disabled */
+ static inline int inet_getid(struct inet_peer *p, int more)
+ {
+-	int old, new;
++	int id;
  	more++;
  	inet_peer_refcheck(p);
- 	do {
+-	do {
 -		old = atomic_read(&p->ip_id_count);
-+		old = atomic_read_unchecked(&p->ip_id_count);
- 		new = old + more;
- 		if (!new)
- 			new = 1;
+-		new = old + more;
+-		if (!new)
+-			new = 1;
 -	} while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
-+	} while (atomic_cmpxchg_unchecked(&p->ip_id_count, old, new) != old);
- 	return new;
+-	return new;
++	id = atomic_add_return_unchecked(more, &p->ip_id_count);
++	if (!id)
++		id = atomic_inc_return_unchecked(&p->ip_id_count);
++	return id;
  }
  
+ #endif /* _NET_INETPEER_H */
 diff --git a/include/net/ip.h b/include/net/ip.h
 index a68f838..74518ab 100644
 --- a/include/net/ip.h
@@ -85008,6 +86279,26 @@ index 51b4448..7be601f 100644
  
  /*
   * Normal trace_printk() and friends allocates special buffers
+diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
+index 26dc348..8708ca7 100644
+--- a/kernel/trace/trace_clock.c
++++ b/kernel/trace/trace_clock.c
+@@ -123,7 +123,7 @@ u64 notrace trace_clock_global(void)
+ 	return now;
+ }
+ 
+-static atomic64_t trace_counter;
++static atomic64_unchecked_t trace_counter;
+ 
+ /*
+  * trace_clock_counter(): simply an atomic counter.
+@@ -132,5 +132,5 @@ static atomic64_t trace_counter;
+  */
+ u64 notrace trace_clock_counter(void)
+ {
+-	return atomic64_add_return(1, &trace_counter);
++	return atomic64_inc_return_unchecked(&trace_counter);
+ }
 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
 index 3d18aad..d1be0eb 100644
 --- a/kernel/trace/trace_events.c
@@ -91483,6 +92774,28 @@ index 3ee690e..00d581b 100644
  	register_netdevice_notifier(&notifier);
  
  	if (__rtnl_register(PF_CAN, RTM_GETROUTE, NULL, cgw_dump_jobs, NULL)) {
+diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
+index eb0a46a..5f3bae8 100644
+--- a/net/ceph/messenger.c
++++ b/net/ceph/messenger.c
+@@ -186,7 +186,7 @@ static void con_fault(struct ceph_connection *con);
+ #define MAX_ADDR_STR_LEN	64	/* 54 is enough */
+ 
+ static char addr_str[ADDR_STR_COUNT][MAX_ADDR_STR_LEN];
+-static atomic_t addr_str_seq = ATOMIC_INIT(0);
++static atomic_unchecked_t addr_str_seq = ATOMIC_INIT(0);
+ 
+ static struct page *zero_page;		/* used in certain error cases */
+ 
+@@ -197,7 +197,7 @@ const char *ceph_pr_addr(const struct sockaddr_storage *ss)
+ 	struct sockaddr_in *in4 = (struct sockaddr_in *) ss;
+ 	struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) ss;
+ 
+-	i = atomic_inc_return(&addr_str_seq) & ADDR_STR_COUNT_MASK;
++	i = atomic_inc_return_unchecked(&addr_str_seq) & ADDR_STR_COUNT_MASK;
+ 	s = addr_str[i];
+ 
+ 	switch (ss->ss_family) {
 diff --git a/net/compat.c b/net/compat.c
 index f0a1ba6..0541331 100644
 --- a/net/compat.c
@@ -91918,6 +93231,28 @@ index f9765203..9feaef8 100644
  	mutex_unlock(&net_mutex);
  	return error;
  }
+diff --git a/net/core/netpoll.c b/net/core/netpoll.c
+index cec074b..a53a938 100644
+--- a/net/core/netpoll.c
++++ b/net/core/netpoll.c
+@@ -428,7 +428,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
+ 	struct udphdr *udph;
+ 	struct iphdr *iph;
+ 	struct ethhdr *eth;
+-	static atomic_t ip_ident;
++	static atomic_unchecked_t ip_ident;
+ 	struct ipv6hdr *ip6h;
+ 
+ 	udp_len = len + sizeof(*udph);
+@@ -499,7 +499,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
+ 		put_unaligned(0x45, (unsigned char *)iph);
+ 		iph->tos      = 0;
+ 		put_unaligned(htons(ip_len), &(iph->tot_len));
+-		iph->id       = htons(atomic_inc_return(&ip_ident));
++		iph->id       = htons(atomic_inc_return_unchecked(&ip_ident));
+ 		iph->frag_off = 0;
+ 		iph->ttl      = 64;
+ 		iph->protocol = IPPROTO_UDP;
 diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
 index a08bd2b..c59bd7c 100644
 --- a/net/core/rtnetlink.c
@@ -93731,6 +95066,39 @@ index dffdc1a..ccc6678 100644
  err_alloc:
  	return -ENOMEM;
  }
+diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
+index c2e73e6..12cca6f 100644
+--- a/net/ipv6/output_core.c
++++ b/net/ipv6/output_core.c
+@@ -8,8 +8,8 @@
+ 
+ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
+ {
+-	static atomic_t ipv6_fragmentation_id;
+-	int old, new;
++	static atomic_unchecked_t ipv6_fragmentation_id;
++	int id;
+ 
+ #if IS_ENABLED(CONFIG_IPV6)
+ 	if (rt && !(rt->dst.flags & DST_NOPEER)) {
+@@ -25,13 +25,10 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
+ 		}
+ 	}
+ #endif
+-	do {
+-		old = atomic_read(&ipv6_fragmentation_id);
+-		new = old + 1;
+-		if (!new)
+-			new = 1;
+-	} while (atomic_cmpxchg(&ipv6_fragmentation_id, old, new) != old);
+-	fhdr->identification = htonl(new);
++	id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
++	if (!id)
++		id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
++	fhdr->identification = htonl(id);
+ }
+ EXPORT_SYMBOL(ipv6_select_ident);
+ 
 diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
 index eedff8c..7d7e24a 100644
 --- a/net/ipv6/raw.c
@@ -96281,6 +97649,28 @@ index 4ca1526..df83e47 100644
  
  	set_fs(KERNEL_DS);
  	if (level == SOL_SOCKET)
+diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
+index 29b4ba9..f648ae7 100644
+--- a/net/sunrpc/auth_gss/svcauth_gss.c
++++ b/net/sunrpc/auth_gss/svcauth_gss.c
+@@ -1144,7 +1144,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
+ 				uint64_t *handle)
+ {
+ 	struct rsc rsci, *rscp = NULL;
+-	static atomic64_t ctxhctr;
++	static atomic64_unchecked_t ctxhctr = ATOMIC64_INIT(0);
+ 	long long ctxh;
+ 	struct gss_api_mech *gm = NULL;
+ 	time_t expiry;
+@@ -1155,7 +1155,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
+ 	status = -ENOMEM;
+ 	/* the handle needs to be just a unique id,
+ 	 * use a static counter */
+-	ctxh = atomic64_inc_return(&ctxhctr);
++	ctxh = atomic64_inc_return_unchecked(&ctxhctr);
+ 
+ 	/* make a copy for the caller */
+ 	*handle = ctxh;
 diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
 index 426f8fc..1ef9c32 100644
 --- a/net/sunrpc/clnt.c
@@ -96853,7 +98243,7 @@ index ea970b8..c68edb9f 100644
  	}
  
 diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
-index 78f66fa..9286768 100644
+index 78f66fa..b93d547 100644
 --- a/net/xfrm/xfrm_state.c
 +++ b/net/xfrm/xfrm_state.c
 @@ -177,12 +177,14 @@ int xfrm_register_type(const struct xfrm_type *type, unsigned short family)
@@ -96947,6 +98337,19 @@ index 78f66fa..9286768 100644
  		module_put(mode->afinfo->owner);
  		err = 0;
  	}
+@@ -1486,10 +1493,10 @@ EXPORT_SYMBOL(xfrm_find_acq_byseq);
+ u32 xfrm_get_acqseq(void)
+ {
+ 	u32 res;
+-	static atomic_t acqseq;
++	static atomic_unchecked_t acqseq;
+ 
+ 	do {
+-		res = atomic_inc_return(&acqseq);
++		res = atomic_inc_return_unchecked(&acqseq);
+ 	} while (!res);
+ 
+ 	return res;
 diff --git a/net/xfrm/xfrm_sysctl.c b/net/xfrm/xfrm_sysctl.c
 index 05a6e3d..6716ec9 100644
 --- a/net/xfrm/xfrm_sysctl.c
@@ -98954,6 +100357,37 @@ index a3dce87..9ca1435 100644
  }
  
  /* Save user chosen LSM */
+diff --git a/security/selinux/avc.c b/security/selinux/avc.c
+index dad36a6..7e5ffbf 100644
+--- a/security/selinux/avc.c
++++ b/security/selinux/avc.c
+@@ -59,7 +59,7 @@ struct avc_node {
+ struct avc_cache {
+ 	struct hlist_head	slots[AVC_CACHE_SLOTS]; /* head for avc_node->list */
+ 	spinlock_t		slots_lock[AVC_CACHE_SLOTS]; /* lock for writes */
+-	atomic_t		lru_hint;	/* LRU hint for reclaim scan */
++	atomic_unchecked_t	lru_hint;	/* LRU hint for reclaim scan */
+ 	atomic_t		active_nodes;
+ 	u32			latest_notif;	/* latest revocation notification */
+ };
+@@ -167,7 +167,7 @@ void __init avc_init(void)
+ 		spin_lock_init(&avc_cache.slots_lock[i]);
+ 	}
+ 	atomic_set(&avc_cache.active_nodes, 0);
+-	atomic_set(&avc_cache.lru_hint, 0);
++	atomic_set_unchecked(&avc_cache.lru_hint, 0);
+ 
+ 	avc_node_cachep = kmem_cache_create("avc_node", sizeof(struct avc_node),
+ 					     0, SLAB_PANIC, NULL);
+@@ -242,7 +242,7 @@ static inline int avc_reclaim_node(void)
+ 	spinlock_t *lock;
+ 
+ 	for (try = 0, ecx = 0; try < AVC_CACHE_SLOTS; try++) {
+-		hvalue = atomic_inc_return(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
++		hvalue = atomic_inc_return_unchecked(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
+ 		head = &avc_cache.slots[hvalue];
+ 		lock = &avc_cache.slots_lock[hvalue];
+ 
 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
 index 5c6f2cd..b4f945c 100644
 --- a/security/selinux/hooks.c

diff --git a/3.2.50/0000_README b/3.2.50/0000_README
index 8d5d81f..b584719 100644
--- a/3.2.50/0000_README
+++ b/3.2.50/0000_README
@@ -118,7 +118,7 @@ Patch:	1049_linux-3.2.50.patch
 From:	http://www.kernel.org
 Desc:	Linux 3.2.50
 
-Patch:	4420_grsecurity-2.9.1-3.2.50-201308282053.patch
+Patch:	4420_grsecurity-2.9.1-3.2.50-201309011629.patch
 From:	http://www.grsecurity.net
 Desc:	hardened-sources base patch from upstream grsecurity
 

diff --git a/3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch b/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
similarity index 99%
rename from 3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch
rename to 3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
index 581a30c..eab80ae 100644
--- a/3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch
+++ b/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
@@ -6732,6 +6732,57 @@ index 96ee50a..68ce124 100644
  #ifdef CONFIG_AUDITSYSCALL
  	if (unlikely(current->audit_context)) {
  		unsigned long tstate = regs->tstate;
+diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
+index e21d3c0d..8f453c1 100644
+--- a/arch/sparc/kernel/smp_64.c
++++ b/arch/sparc/kernel/smp_64.c
+@@ -871,8 +871,8 @@ extern unsigned long xcall_flush_dcache_page_cheetah;
+ extern unsigned long xcall_flush_dcache_page_spitfire;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-extern atomic_t dcpage_flushes;
+-extern atomic_t dcpage_flushes_xcall;
++extern atomic_unchecked_t dcpage_flushes;
++extern atomic_unchecked_t dcpage_flushes_xcall;
+ #endif
+ 
+ static inline void __local_flush_dcache_page(struct page *page)
+@@ -896,7 +896,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
+ 		return;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 
+ 	this_cpu = get_cpu();
+@@ -920,7 +920,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
+ 			xcall_deliver(data0, __pa(pg_addr),
+ 				      (u64) pg_addr, cpumask_of(cpu));
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-			atomic_inc(&dcpage_flushes_xcall);
++			atomic_inc_unchecked(&dcpage_flushes_xcall);
+ #endif
+ 		}
+ 	}
+@@ -939,7 +939,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
+ 	preempt_disable();
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 	data0 = 0;
+ 	pg_addr = page_address(page);
+@@ -956,7 +956,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
+ 		xcall_deliver(data0, __pa(pg_addr),
+ 			      (u64) pg_addr, cpu_online_mask);
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-		atomic_inc(&dcpage_flushes_xcall);
++		atomic_inc_unchecked(&dcpage_flushes_xcall);
+ #endif
+ 	}
+ 	__local_flush_dcache_page(page);
 diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
 index 42b282f..408977c 100644
 --- a/arch/sparc/kernel/sys_sparc_32.c
@@ -7044,7 +7095,7 @@ index 591f20c..0f1b925 100644
  }
  
 diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
-index 0cbdaa4..438e4c9 100644
+index 0cbdaa4..f37a97c 100644
 --- a/arch/sparc/kernel/traps_64.c
 +++ b/arch/sparc/kernel/traps_64.c
 @@ -75,7 +75,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
@@ -7114,6 +7165,55 @@ index 0cbdaa4..438e4c9 100644
  }
  
  struct sun4v_error_entry {
+@@ -1786,8 +1797,8 @@ struct sun4v_error_entry {
+ 	u16		err_pad;
+ };
+ 
+-static atomic_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
+-static atomic_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
++static atomic_unchecked_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
++static atomic_unchecked_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
+ 
+ static const char *sun4v_err_type_to_str(u32 type)
+ {
+@@ -1807,7 +1818,7 @@ static const char *sun4v_err_type_to_str(u32 type)
+ 	}
+ }
+ 
+-static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_t *ocnt)
++static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_unchecked_t *ocnt)
+ {
+ 	int cnt;
+ 
+@@ -1842,8 +1853,8 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
+ 
+ 	show_regs(regs);
+ 
+-	if ((cnt = atomic_read(ocnt)) != 0) {
+-		atomic_set(ocnt, 0);
++	if ((cnt = atomic_read_unchecked(ocnt)) != 0) {
++		atomic_set_unchecked(ocnt, 0);
+ 		wmb();
+ 		printk("%s: Queue overflowed %d times.\n",
+ 		       pfx, cnt);
+@@ -1895,7 +1906,7 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
+  */
+ void sun4v_resum_overflow(struct pt_regs *regs)
+ {
+-	atomic_inc(&sun4v_resum_oflow_cnt);
++	atomic_inc_unchecked(&sun4v_resum_oflow_cnt);
+ }
+ 
+ /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
+@@ -1948,7 +1959,7 @@ void sun4v_nonresum_overflow(struct pt_regs *regs)
+ 	/* XXX Actually even this can make not that much sense.  Perhaps
+ 	 * XXX we should just pull the plug and panic directly from here?
+ 	 */
+-	atomic_inc(&sun4v_nonresum_oflow_cnt);
++	atomic_inc_unchecked(&sun4v_nonresum_oflow_cnt);
+ }
+ 
+ unsigned long sun4v_err_itlb_vaddr;
 @@ -1963,9 +1974,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
  
  	printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
@@ -8574,6 +8674,44 @@ index 7b00de6..78239f4 100644
  	protection_map[12] = PAGE_READONLY;
  	protection_map[13] = PAGE_READONLY;
  	protection_map[14] = PAGE_SHARED;
+diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
+index b4989f9..530099e 100644
+--- a/arch/sparc/mm/init_64.c
++++ b/arch/sparc/mm/init_64.c
+@@ -170,9 +170,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
+ int num_kernel_image_mappings;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-atomic_t dcpage_flushes = ATOMIC_INIT(0);
++atomic_unchecked_t dcpage_flushes = ATOMIC_INIT(0);
+ #ifdef CONFIG_SMP
+-atomic_t dcpage_flushes_xcall = ATOMIC_INIT(0);
++atomic_unchecked_t dcpage_flushes_xcall = ATOMIC_INIT(0);
+ #endif
+ #endif
+ 
+@@ -180,7 +180,7 @@ inline void flush_dcache_page_impl(struct page *page)
+ {
+ 	BUG_ON(tlb_type == hypervisor);
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 
+ #ifdef DCACHE_ALIASING_POSSIBLE
+@@ -417,10 +417,10 @@ void mmu_info(struct seq_file *m)
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+ 	seq_printf(m, "DCPageFlushes\t: %d\n",
+-		   atomic_read(&dcpage_flushes));
++		   atomic_read_unchecked(&dcpage_flushes));
+ #ifdef CONFIG_SMP
+ 	seq_printf(m, "DCPageFlushesXC\t: %d\n",
+-		   atomic_read(&dcpage_flushes_xcall));
++		   atomic_read_unchecked(&dcpage_flushes_xcall));
+ #endif /* CONFIG_SMP */
+ #endif /* CONFIG_DEBUG_DCFLUSH */
+ }
 diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
 index cbef74e..c38fead 100644
 --- a/arch/sparc/mm/srmmu.c
@@ -14361,7 +14499,7 @@ index 566e803..86f1302 100644
  }
  
 diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
-index 1c66d30..f2fbd07 100644
+index 1c66d30..6c7b4d8 100644
 --- a/arch/x86/include/asm/uaccess_64.h
 +++ b/arch/x86/include/asm/uaccess_64.h
 @@ -10,6 +10,9 @@
@@ -14688,8 +14826,9 @@ index 1c66d30..f2fbd07 100644
 +__must_check unsigned long clear_user(void __user *mem, unsigned long len) __size_overflow(2);
 +__must_check unsigned long __clear_user(void __user *mem, unsigned long len) __size_overflow(2);
  
- static __must_check __always_inline int
+-static __must_check __always_inline int
 -__copy_from_user_inatomic(void *dst, const void __user *src, unsigned size)
++static __must_check __always_inline unsigned long
 +__copy_from_user_inatomic(void *dst, const void __user *src, unsigned long size)
  {
 -	return copy_user_generic(dst, (__force const void *)src, size);
@@ -33281,6 +33420,28 @@ index 1e756e1..6f7ead5 100644
  	.attrs = cpuclass_default_attrs,
  	.name = "cpuidle",
  };
+diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
+index fe765f4..0bc6d6a 100644
+--- a/drivers/crypto/hifn_795x.c
++++ b/drivers/crypto/hifn_795x.c
+@@ -51,7 +51,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
+ MODULE_PARM_DESC(hifn_pll_ref,
+ 		 "PLL reference clock (pci[freq] or ext[freq], default ext)");
+ 
+-static atomic_t hifn_dev_number;
++static atomic_unchecked_t hifn_dev_number;
+ 
+ #define ACRYPTO_OP_DECRYPT	0
+ #define ACRYPTO_OP_ENCRYPT	1
+@@ -2576,7 +2576,7 @@ static int __devinit hifn_probe(struct pci_dev *pdev, const struct pci_device_id
+ 		goto err_out_disable_pci_device;
+ 
+ 	snprintf(name, sizeof(name), "hifn%d",
+-			atomic_inc_return(&hifn_dev_number)-1);
++			atomic_inc_return_unchecked(&hifn_dev_number)-1);
+ 
+ 	err = pci_request_regions(pdev, name);
+ 	if (err)
 diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
 index 59d24e9..0d20240 100644
 --- a/drivers/devfreq/devfreq.c
@@ -33372,6 +33533,44 @@ index 6ffb6d2..383d8d7 100644
  	{
  	 PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  	 E7205},
+diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
+index c3f6743..e2c52b0 100644
+--- a/drivers/edac/edac_device.c
++++ b/drivers/edac/edac_device.c
+@@ -483,9 +483,9 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
+  */
+ int edac_device_alloc_index(void)
+ {
+-	static atomic_t device_indexes = ATOMIC_INIT(0);
++	static atomic_unchecked_t device_indexes = ATOMIC_INIT(0);
+ 
+-	return atomic_inc_return(&device_indexes) - 1;
++	return atomic_inc_return_unchecked(&device_indexes) - 1;
+ }
+ EXPORT_SYMBOL_GPL(edac_device_alloc_index);
+ 
+diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
+index 2b378207..99ba0bd 100644
+--- a/drivers/edac/edac_pci.c
++++ b/drivers/edac/edac_pci.c
+@@ -30,7 +30,7 @@
+ 
+ static DEFINE_MUTEX(edac_pci_ctls_mutex);
+ static LIST_HEAD(edac_pci_list);
+-static atomic_t pci_indexes = ATOMIC_INIT(0);
++static atomic_unchecked_t pci_indexes = ATOMIC_INIT(0);
+ 
+ /*
+  * edac_pci_alloc_ctl_info
+@@ -316,7 +316,7 @@ EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
+  */
+ int edac_pci_alloc_index(void)
+ {
+-	return atomic_inc_return(&pci_indexes) - 1;
++	return atomic_inc_return_unchecked(&pci_indexes) - 1;
+ }
+ EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
+ 
 diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
 index 8cc8676..90b70b9 100644
 --- a/drivers/edac/edac_pci_sysfs.c
@@ -33664,9 +33863,21 @@ index b6f47de..c5acf3a 100644
  	 PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  	 X38},
 diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
-index 85661b0..c784559a 100644
+index 85661b0..cdd4560 100644
 --- a/drivers/firewire/core-card.c
 +++ b/drivers/firewire/core-card.c
+@@ -512,9 +512,9 @@ void fw_card_initialize(struct fw_card *card,
+ 			const struct fw_card_driver *driver,
+ 			struct device *device)
+ {
+-	static atomic_t index = ATOMIC_INIT(-1);
++	static atomic_unchecked_t index = ATOMIC_INIT(-1);
+ 
+-	card->index = atomic_inc_return(&index);
++	card->index = atomic_inc_return_unchecked(&index);
+ 	card->driver = driver;
+ 	card->device = device;
+ 	card->current_tlabel = 0;
 @@ -657,7 +657,7 @@ void fw_card_release(struct kref *kref)
  
  void fw_core_remove_card(struct fw_card *card)
@@ -37699,6 +37910,28 @@ index ba70058..571d25d 100644
  	serio->dev.bus = &serio_bus;
  	serio->dev.release = serio_release_port;
  	serio->dev.groups = serio_device_attr_groups;
+diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
+index 4d4cd14..d6fdd87 100644
+--- a/drivers/input/serio/serio_raw.c
++++ b/drivers/input/serio/serio_raw.c
+@@ -280,7 +280,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
+ 
+ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
+ {
+-	static atomic_t serio_raw_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t serio_raw_no = ATOMIC_INIT(0);
+ 	struct serio_raw *serio_raw;
+ 	int err;
+ 
+@@ -291,7 +291,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
+ 	}
+ 
+ 	snprintf(serio_raw->name, sizeof(serio_raw->name),
+-		 "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1);
++		 "serio_raw%ld", (long)atomic_inc_return_unchecked(&serio_raw_no) - 1);
+ 	kref_init(&serio_raw->kref);
+ 	INIT_LIST_HEAD(&serio_raw->client_list);
+ 	init_waitqueue_head(&serio_raw->wait);
 diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
 index e44933d..9ba484a 100644
 --- a/drivers/isdn/capi/capi.c
@@ -37896,6 +38129,19 @@ index ee0a549..a7c9798 100644
  		dev_warn(cs->dev, "%s: device not opened\n", __func__);
  		goto out;
  	}
+diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
+index 5e3300d..dc7d752 100644
+--- a/drivers/isdn/gigaset/usb-gigaset.c
++++ b/drivers/isdn/gigaset/usb-gigaset.c
+@@ -546,7 +546,7 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
+ 	gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf);
+ 	memcpy(cs->hw.usb->bchars, buf, 6);
+ 	return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
+-			       0, 0, &buf, 6, 2000);
++			       0, 0, buf, 6, 2000);
+ }
+ 
+ static int gigaset_freebcshw(struct bc_state *bcs)
 diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
 index 2a57da59..e7a12ed 100644
 --- a/drivers/isdn/hardware/avm/b1.c
@@ -37918,6 +38164,19 @@ index 2a57da59..e7a12ed 100644
  				return -EFAULT;
  		} else {
  			memcpy(buf, dp, left);
+diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
+index 6ddb795e..bd2e875 100644
+--- a/drivers/isdn/i4l/isdn_common.c
++++ b/drivers/isdn/i4l/isdn_common.c
+@@ -1656,6 +1656,8 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
+ 				} else
+ 					return -EINVAL;
+ 			case IIOCDBGVAR:
++				if (!capable(CAP_SYS_RAWIO))
++					return -EPERM;
+ 				if (arg) {
+ 					if (copy_to_user(argp, &dev, sizeof(ulong)))
+ 						return -EFAULT;
 diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
 index 2339d73..802ab87a 100644
 --- a/drivers/isdn/i4l/isdn_net.c
@@ -38791,6 +39050,28 @@ index 16a089f..1661b11 100644
  		return -EFAULT;
  	return i;
  }
+diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
+index a47ba33..deafb02 100644
+--- a/drivers/media/rc/rc-main.c
++++ b/drivers/media/rc/rc-main.c
+@@ -1031,7 +1031,7 @@ EXPORT_SYMBOL_GPL(rc_free_device);
+ 
+ int rc_register_device(struct rc_dev *dev)
+ {
+-	static atomic_t devno = ATOMIC_INIT(0);
++	static atomic_unchecked_t devno = ATOMIC_INIT(0);
+ 	struct rc_map *rc_map;
+ 	const char *path;
+ 	int rc;
+@@ -1063,7 +1063,7 @@ int rc_register_device(struct rc_dev *dev)
+ 	 */
+ 	mutex_lock(&dev->lock);
+ 
+-	dev->devno = (unsigned long)(atomic_inc_return(&devno) - 1);
++	dev->devno = (unsigned long)(atomic_inc_return_unchecked(&devno) - 1);
+ 	dev_set_name(&dev->dev, "rc%ld", dev->devno);
+ 	dev_set_drvdata(&dev->dev, dev);
+ 	rc = device_add(&dev->dev);
 diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
 index 61287fc..8b08712 100644
 --- a/drivers/media/rc/redrat3.c
@@ -38834,6 +39115,19 @@ index 921c56d..7e6c4b2 100644
  
  module_param_array(video_nr, int, NULL, 0444);
  module_param_array(vbi_nr,   int, NULL, 0444);
+diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
+index 41108a9a..8ad2437 100644
+--- a/drivers/media/video/ivtv/ivtv-driver.c
++++ b/drivers/media/video/ivtv/ivtv-driver.c
+@@ -80,7 +80,7 @@ static struct pci_device_id ivtv_pci_tbl[] __devinitdata = {
+ MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
+ 
+ /* ivtv instance counter */
+-static atomic_t ivtv_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t ivtv_instance = ATOMIC_INIT(0);
+ 
+ /* Parameter declarations */
+ static int cardtype[IVTV_MAX_CARDS];
 diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
 index d345215..b607565 100644
 --- a/drivers/media/video/omap/omap_vout.c
@@ -38940,6 +39234,22 @@ index c68531b..82a9ea0 100644
  				enum v4l2_memory memory)
  {
  	if (copy_in_user(up32, up, 2 * sizeof(__u32)) ||
+diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c
+index 8b0777f..e29f31e 100644
+--- a/drivers/media/video/v4l2-device.c
++++ b/drivers/media/video/v4l2-device.c
+@@ -74,9 +74,9 @@ int v4l2_device_put(struct v4l2_device *v4l2_dev)
+ EXPORT_SYMBOL_GPL(v4l2_device_put);
+ 
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+-						atomic_t *instance)
++						atomic_unchecked_t *instance)
+ {
+-	int num = atomic_inc_return(instance) - 1;
++	int num = atomic_inc_return_unchecked(instance) - 1;
+ 	int len = strlen(basename);
+ 
+ 	if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
 diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
 index 639abee..e2336f4 100644
 --- a/drivers/media/video/v4l2-ioctl.c
@@ -40794,6 +41104,28 @@ index 304fe78..db112fa 100644
  				result =
  				    hso_start_serial_device(serial_table[i], GFP_NOIO);
  				hso_kick_transmit(dev2ser(serial_table[i]));
+diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
+index e773250..9ee61ab 100644
+--- a/drivers/net/usb/sierra_net.c
++++ b/drivers/net/usb/sierra_net.c
+@@ -52,7 +52,7 @@ static const char driver_name[] = "sierra_net";
+ /* atomic counter partially included in MAC address to make sure 2 devices
+  * do not end up with the same MAC - concept breaks in case of > 255 ifaces
+  */
+-static	atomic_t iface_counter = ATOMIC_INIT(0);
++static	atomic_unchecked_t iface_counter = ATOMIC_INIT(0);
+ 
+ /*
+  * SYNC Timer Delay definition used to set the expiry time
+@@ -738,7 +738,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
+ 	dev->net->netdev_ops = &sierra_net_device_ops;
+ 
+ 	/* change MAC addr to include, ifacenum, and to be unique */
+-	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
++	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return_unchecked(&iface_counter);
+ 	dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
+ 
+ 	/* we will have to manufacture ethernet headers, prepare template */
 diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
 index dc53a8f..2b66cc1 100644
 --- a/drivers/net/usb/usbnet.c
@@ -42048,6 +42380,19 @@ index 8e6c4fa..a7539b3 100644
  
  /*
   * Polling driver
+diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
+index a134c26..d024437 100644
+--- a/drivers/platform/x86/wmi.c
++++ b/drivers/platform/x86/wmi.c
+@@ -743,7 +743,7 @@ static int wmi_create_device(const struct guid_block *gblock,
+ 	wblock->dev.class = &wmi_class;
+ 
+ 	wmi_gtoa(gblock->guid, guid_string);
+-	dev_set_name(&wblock->dev, guid_string);
++	dev_set_name(&wblock->dev, "%s", guid_string);
+ 
+ 	dev_set_drvdata(&wblock->dev, wblock);
+ 
 diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
 index b859d16..5cc6b1a 100644
 --- a/drivers/pnp/pnpbios/bioscalls.c
@@ -42198,6 +42543,28 @@ index e15d4c9..83cd617 100644
  	for (i = 0; i < ARRAY_SIZE(power_supply_attrs); i++)
  		__power_supply_attrs[i] = &power_supply_attrs[i].attr;
  }
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index 6ec610c..078eaf3 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -2639,7 +2639,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
+ 	struct device *dev, const struct regulator_init_data *init_data,
+ 	void *driver_data)
+ {
+-	static atomic_t regulator_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t regulator_no = ATOMIC_INIT(0);
+ 	struct regulator_dev *rdev;
+ 	int ret, i;
+ 
+@@ -2698,7 +2698,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
+ 	rdev->dev.class = &regulator_class;
+ 	rdev->dev.parent = dev;
+ 	dev_set_name(&rdev->dev, "regulator.%d",
+-		     atomic_inc_return(&regulator_no) - 1);
++		     atomic_inc_return_unchecked(&regulator_no) - 1);
+ 	ret = device_register(&rdev->dev);
+ 	if (ret != 0) {
+ 		put_device(&rdev->dev);
 diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
 index 33f5d9a..d957d3f 100644
 --- a/drivers/regulator/max8660.c
@@ -43187,6 +43554,19 @@ index 21a045e..ec89e03 100644
  	dev_set_name(&rport->dev, "port-%d:%d", shost->host_no, id);
  
  	transport_setup_device(&rport->dev);
+diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
+index 17603da..332e23a 100644
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -2637,7 +2637,7 @@ static int sd_probe(struct device *dev)
+ 	device_initialize(&sdkp->dev);
+ 	sdkp->dev.parent = dev;
+ 	sdkp->dev.class = &sd_disk_class;
+-	dev_set_name(&sdkp->dev, dev_name(dev));
++	dev_set_name(&sdkp->dev, "%s", dev_name(dev));
+ 
+ 	if (device_add(&sdkp->dev))
+ 		goto out_free_index;
 diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
 index 441a1c5..07cece7 100644
 --- a/drivers/scsi/sg.c
@@ -43868,6 +44248,104 @@ index b9040be..e3f5aab 100644
  		return 0;
  
  	return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
+diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
+index cdfa3e0..37fa165 100644
+--- a/drivers/tty/hvc/hvsi.c
++++ b/drivers/tty/hvc/hvsi.c
+@@ -86,7 +86,7 @@ struct hvsi_struct {
+ 	int n_outbuf;
+ 	uint32_t vtermno;
+ 	uint32_t virq;
+-	atomic_t seqno; /* HVSI packet sequence number */
++	atomic_unchecked_t seqno; /* HVSI packet sequence number */
+ 	uint16_t mctrl;
+ 	uint8_t state;  /* HVSI protocol state */
+ 	uint8_t flags;
+@@ -297,7 +297,7 @@ static int hvsi_version_respond(struct hvsi_struct *hp, uint16_t query_seqno)
+ 
+ 	packet.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER;
+ 	packet.hdr.len = sizeof(struct hvsi_query_response);
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.verb = VSV_SEND_VERSION_NUMBER;
+ 	packet.u.version = HVSI_VERSION;
+ 	packet.query_seqno = query_seqno+1;
+@@ -581,7 +581,7 @@ static int hvsi_query(struct hvsi_struct *hp, uint16_t verb)
+ 
+ 	packet.hdr.type = VS_QUERY_PACKET_HEADER;
+ 	packet.hdr.len = sizeof(struct hvsi_query);
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.verb = verb;
+ 
+ 	pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len);
+@@ -623,7 +623,7 @@ static int hvsi_set_mctrl(struct hvsi_struct *hp, uint16_t mctrl)
+ 	int wrote;
+ 
+ 	packet.hdr.type = VS_CONTROL_PACKET_HEADER,
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = sizeof(struct hvsi_control);
+ 	packet.verb = VSV_SET_MODEM_CTL;
+ 	packet.mask = HVSI_TSDTR;
+@@ -706,7 +706,7 @@ static int hvsi_put_chars(struct hvsi_struct *hp, const char *buf, int count)
+ 	BUG_ON(count > HVSI_MAX_OUTGOING_DATA);
+ 
+ 	packet.hdr.type = VS_DATA_PACKET_HEADER;
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = count + sizeof(struct hvsi_header);
+ 	memcpy(&packet.data, buf, count);
+ 
+@@ -723,7 +723,7 @@ static void hvsi_close_protocol(struct hvsi_struct *hp)
+ 	struct hvsi_control packet __ALIGNED__;
+ 
+ 	packet.hdr.type = VS_CONTROL_PACKET_HEADER;
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = 6;
+ 	packet.verb = VSV_CLOSE_PROTOCOL;
+ 
+@@ -755,7 +755,7 @@ static int hvsi_open(struct tty_struct *tty, struct file *filp)
+ 	spin_lock_irqsave(&hp->lock, flags);
+ 	hp->tty = tty;
+ 	hp->count++;
+-	atomic_set(&hp->seqno, 0);
++	atomic_set_unchecked(&hp->seqno, 0);
+ 	h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE);
+ 	spin_unlock_irqrestore(&hp->lock, flags);
+ 
+diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
+index 6f4dd83..84c3f91 100644
+--- a/drivers/tty/hvc/hvsi_lib.c
++++ b/drivers/tty/hvc/hvsi_lib.c
+@@ -9,7 +9,7 @@
+ 
+ static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet)
+ {
+-	packet->seqno = atomic_inc_return(&pv->seqno);
++	packet->seqno = atomic_inc_return_unchecked(&pv->seqno);
+ 
+ 	/* Assumes that always succeeds, works in practice */
+ 	return pv->put_chars(pv->termno, (char *)packet, packet->len);
+@@ -21,7 +21,7 @@ static void hvsi_start_handshake(struct hvsi_priv *pv)
+ 
+ 	/* Reset state */
+ 	pv->established = 0;
+-	atomic_set(&pv->seqno, 0);
++	atomic_set_unchecked(&pv->seqno, 0);
+ 
+ 	pr_devel("HVSI@%x: Handshaking started\n", pv->termno);
+ 
+@@ -265,7 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv)
+ 	pv->mctrl_update = 0;
+ 	q.hdr.type = VS_QUERY_PACKET_HEADER;
+ 	q.hdr.len = sizeof(struct hvsi_query);
+-	q.hdr.seqno = atomic_inc_return(&pv->seqno);
++	q.hdr.seqno = atomic_inc_return_unchecked(&pv->seqno);
+ 	q.verb = VSV_SEND_MODEM_CTL_STATUS;
+ 	rc = hvsi_send_packet(pv, &q.hdr);
+ 	if (rc <= 0) {
 diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
 index ef92869..f4ebd88 100644
 --- a/drivers/tty/ipwireless/tty.c
@@ -44036,6 +44514,37 @@ index 4735928..e80860a 100644
  
  	cdev_init(&ptmx_cdev, &ptmx_fops);
  	if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
+diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
+index 6b36c15..335a4a2 100644
+--- a/drivers/tty/serial/ioc4_serial.c
++++ b/drivers/tty/serial/ioc4_serial.c
+@@ -438,7 +438,7 @@ struct ioc4_soft {
+ 		} is_intr_info[MAX_IOC4_INTR_ENTS];
+ 
+ 		/* Number of entries active in the above array */
+-		atomic_t is_num_intrs;
++		atomic_unchecked_t is_num_intrs;
+ 	} is_intr_type[IOC4_NUM_INTR_TYPES];
+ 
+ 	/* is_ir_lock must be held while
+@@ -975,7 +975,7 @@ intr_connect(struct ioc4_soft *soft, int type,
+ 	BUG_ON(!((type == IOC4_SIO_INTR_TYPE)
+ 	       || (type == IOC4_OTHER_INTR_TYPE)));
+ 
+-	i = atomic_inc(&soft-> is_intr_type[type].is_num_intrs) - 1;
++	i = atomic_inc_return_unchecked(&soft-> is_intr_type[type].is_num_intrs) - 1;
+ 	BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0)));
+ 
+ 	/* Save off the lower level interrupt handler */
+@@ -1002,7 +1002,7 @@ static irqreturn_t ioc4_intr(int irq, void *arg)
+ 
+ 	soft = arg;
+ 	for (intr_type = 0; intr_type < IOC4_NUM_INTR_TYPES; intr_type++) {
+-		num_intrs = (int)atomic_read(
++		num_intrs = (int)atomic_read_unchecked(
+ 				&soft->is_intr_type[intr_type].is_num_intrs);
+ 
+ 		this_mir = this_ir = pending_intrs(soft, intr_type);
 diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
 index 2b42a01..32a2ed3 100644
 --- a/drivers/tty/serial/kgdboc.c
@@ -44138,6 +44647,28 @@ index 2b42a01..32a2ed3 100644
  #ifdef CONFIG_KGDB_SERIAL_CONSOLE
  /* This is only available if kgdboc is a built in for early debugging */
  static int __init kgdboc_early_init(char *opt)
+diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
+index 8131e2c..b48928a 100644
+--- a/drivers/tty/serial/msm_serial.c
++++ b/drivers/tty/serial/msm_serial.c
+@@ -857,7 +857,7 @@ static struct uart_driver msm_uart_driver = {
+ 	.cons = MSM_CONSOLE,
+ };
+ 
+-static atomic_t msm_uart_next_id = ATOMIC_INIT(0);
++static atomic_unchecked_t msm_uart_next_id = ATOMIC_INIT(0);
+ 
+ static int __init msm_serial_probe(struct platform_device *pdev)
+ {
+@@ -867,7 +867,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
+ 	int irq;
+ 
+ 	if (pdev->id == -1)
+-		pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;
++		pdev->id = atomic_inc_return_unchecked(&msm_uart_next_id) - 1;
+ 
+ 	if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
+ 		return -ENXIO;
 diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
 index b31f1c3..1b6b8c4 100644
 --- a/drivers/tty/serial/samsung.c
@@ -44698,6 +45229,28 @@ index 7138540..2370195 100644
  
  /*----------------------------------------------------------------------*/
  
+diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
+index 9f7003e..b1db1b6 100644
+--- a/drivers/usb/misc/appledisplay.c
++++ b/drivers/usb/misc/appledisplay.c
+@@ -83,7 +83,7 @@ struct appledisplay {
+ 	spinlock_t lock;
+ };
+ 
+-static atomic_t count_displays = ATOMIC_INIT(0);
++static atomic_unchecked_t count_displays = ATOMIC_INIT(0);
+ static struct workqueue_struct *wq;
+ 
+ static void appledisplay_complete(struct urb *urb)
+@@ -281,7 +281,7 @@ static int appledisplay_probe(struct usb_interface *iface,
+ 
+ 	/* Register backlight device */
+ 	snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
+-		atomic_inc_return(&count_displays) - 1);
++		atomic_inc_return_unchecked(&count_displays) - 1);
+ 	memset(&props, 0, sizeof(struct backlight_properties));
+ 	props.type = BACKLIGHT_RAW;
+ 	props.max_brightness = 0xff;
 diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
 index e39b188..1fffda8 100644
 --- a/drivers/usb/storage/realtek_cr.c
@@ -48354,6 +48907,28 @@ index b31507d..5b42a3b 100644
  
  static int __init init_affs_fs(void)
  {
+diff --git a/fs/afs/inode.c b/fs/afs/inode.c
+index d890ae3..5733a4b 100644
+--- a/fs/afs/inode.c
++++ b/fs/afs/inode.c
+@@ -141,7 +141,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
+ 	struct afs_vnode *vnode;
+ 	struct super_block *sb;
+ 	struct inode *inode;
+-	static atomic_t afs_autocell_ino;
++	static atomic_unchecked_t afs_autocell_ino;
+ 
+ 	_enter("{%x:%u},%*.*s,",
+ 	       AFS_FS_I(dir)->fid.vid, AFS_FS_I(dir)->fid.vnode,
+@@ -154,7 +154,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
+ 	data.fid.unique = 0;
+ 	data.fid.vnode = 0;
+ 
+-	inode = iget5_locked(sb, atomic_inc_return(&afs_autocell_ino),
++	inode = iget5_locked(sb, atomic_inc_return_unchecked(&afs_autocell_ino),
+ 			     afs_iget5_autocell_test, afs_iget5_set,
+ 			     &data);
+ 	if (!inode) {
 diff --git a/fs/afs/super.c b/fs/afs/super.c
 index 356dcf0..c0046cd 100644
 --- a/fs/afs/super.c
@@ -52432,9 +53007,18 @@ index 78b519c..0386555 100644
  
  		task_unlock(current);
 diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
-index 9905350..02eaec4 100644
+index 9905350..97ff49a 100644
 --- a/fs/fscache/cookie.c
 +++ b/fs/fscache/cookie.c
+@@ -19,7 +19,7 @@
+ 
+ struct kmem_cache *fscache_cookie_jar;
+ 
+-static atomic_t fscache_object_debug_id = ATOMIC_INIT(0);
++static atomic_unchecked_t fscache_object_debug_id = ATOMIC_INIT(0);
+ 
+ static int fscache_acquire_non_index_cookie(struct fscache_cookie *cookie);
+ static int fscache_alloc_object(struct fscache_cache *cache,
 @@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire_cookie(
  	       parent ? (char *) parent->def->name : "<no-parent>",
  	       def->name, netfs_data);
@@ -52500,7 +53084,7 @@ index 9905350..02eaec4 100644
  		_leave(" = -ENOMEDIUM [no cache]");
  		return -ENOMEDIUM;
  	}
-@@ -256,12 +256,12 @@ static int fscache_alloc_object(struct fscache_cache *cache,
+@@ -256,14 +256,14 @@ static int fscache_alloc_object(struct fscache_cache *cache,
  	object = cache->ops->alloc_object(cache, cookie);
  	fscache_stat_d(&fscache_n_cop_alloc_object);
  	if (IS_ERR(object)) {
@@ -52513,8 +53097,11 @@ index 9905350..02eaec4 100644
 -	fscache_stat(&fscache_n_object_alloc);
 +	fscache_stat_unchecked(&fscache_n_object_alloc);
  
- 	object->debug_id = atomic_inc_return(&fscache_object_debug_id);
+-	object->debug_id = atomic_inc_return(&fscache_object_debug_id);
++	object->debug_id = atomic_inc_return_unchecked(&fscache_object_debug_id);
  
+ 	_debug("ALLOC OBJ%x: %s {%lx}",
+ 	       object->debug_id, cookie->def->name, object->events);
 @@ -377,10 +377,10 @@ void __fscache_update_cookie(struct fscache_cookie *cookie)
  	struct fscache_object *object;
  	struct hlist_node *_p;
@@ -55319,9 +55906,18 @@ index 99e3610..02c1068 100644
  				"inode 0x%lx or driver bug.", vdir->i_ino);
  		goto err_out;
 diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
-index c587e2d..3641eaa 100644
+index c587e2d..5189f0f 100644
 --- a/fs/ntfs/file.c
 +++ b/fs/ntfs/file.c
+@@ -1281,7 +1281,7 @@ static inline size_t ntfs_copy_from_user(struct page **pages,
+ 	char *addr;
+ 	size_t total = 0;
+ 	unsigned len;
+-	int left;
++	unsigned left;
+ 
+ 	do {
+ 		len = PAGE_CACHE_SIZE - ofs;
 @@ -2229,6 +2229,6 @@ const struct inode_operations ntfs_file_inode_ops = {
  #endif /* NTFS_RW */
  };
@@ -55332,9 +55928,36 @@ index c587e2d..3641eaa 100644
 -const struct inode_operations ntfs_empty_inode_ops = {};
 +const struct inode_operations ntfs_empty_inode_ops __read_only;
 diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
-index b52706d..68a038f 100644
+index b52706d..b9a9f9d 100644
 --- a/fs/ntfs/super.c
 +++ b/fs/ntfs/super.c
+@@ -661,7 +661,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
+ 		if (!silent)
+ 			ntfs_error(sb, "Primary boot sector is invalid.");
+ 	} else if (!silent)
+-		ntfs_error(sb, read_err_str, "primary");
++		ntfs_error(sb, read_err_str, "%s", "primary");
+ 	if (!(NTFS_SB(sb)->on_errors & ON_ERRORS_RECOVER)) {
+ 		if (bh_primary)
+ 			brelse(bh_primary);
+@@ -677,7 +677,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
+ 			goto hotfix_primary_boot_sector;
+ 		brelse(bh_backup);
+ 	} else if (!silent)
+-		ntfs_error(sb, read_err_str, "backup");
++		ntfs_error(sb, read_err_str, "%s", "backup");
+ 	/* Try to read NT3.51- backup boot sector. */
+ 	if ((bh_backup = sb_bread(sb, nr_blocks >> 1))) {
+ 		if (is_boot_sector_ntfs(sb, (NTFS_BOOT_SECTOR*)
+@@ -688,7 +688,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
+ 					"sector.");
+ 		brelse(bh_backup);
+ 	} else if (!silent)
+-		ntfs_error(sb, read_err_str, "backup");
++		ntfs_error(sb, read_err_str, "%s", "backup");
+ 	/* We failed. Cleanup and return. */
+ 	if (bh_primary)
+ 		brelse(bh_primary);
 @@ -3072,6 +3072,7 @@ static struct file_system_type ntfs_fs_type = {
  	.kill_sb	= kill_block_super,
  	.fs_flags	= FS_REQUIRES_DEV,
@@ -75071,6 +75694,19 @@ index c7c40f1..5c31482 100644
  	ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
  	ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
  	unsigned int (*poll) (struct file *, struct poll_table_struct *);
+diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
+index d61febf..f0094f6 100644
+--- a/include/media/v4l2-device.h
++++ b/include/media/v4l2-device.h
+@@ -95,7 +95,7 @@ int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4
+    this function returns 0. If the name ends with a digit (e.g. cx18),
+    then the name will be set to cx18-0 since cx180 looks really odd. */
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+-						atomic_t *instance);
++						atomic_unchecked_t *instance);
+ 
+ /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
+    Since the parent disappears this ensures that v4l2_dev doesn't have an
 diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
 index 4d1c74a..8e58054 100644
 --- a/include/media/v4l2-ioctl.h
@@ -75172,7 +75808,7 @@ index ca2755f..85ec88c 100644
  /** inet_connection_sock - INET connection oriented sock
   *
 diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
-index e9ff3fc..9d3e5c7 100644
+index e9ff3fc..c19998a 100644
 --- a/include/net/inetpeer.h
 +++ b/include/net/inetpeer.h
 @@ -48,8 +48,8 @@ struct inet_peer {
@@ -75186,20 +75822,28 @@ index e9ff3fc..9d3e5c7 100644
  			__u32				tcp_ts;
  			__u32				tcp_ts_stamp;
  		};
-@@ -113,11 +113,11 @@ static inline int inet_getid(struct inet_peer *p, int more)
+@@ -109,16 +109,13 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)
+ /* can be called with or without local BH being disabled */
+ static inline int inet_getid(struct inet_peer *p, int more)
+ {
+-	int old, new;
++	int id;
  	more++;
  	inet_peer_refcheck(p);
- 	do {
+-	do {
 -		old = atomic_read(&p->ip_id_count);
-+		old = atomic_read_unchecked(&p->ip_id_count);
- 		new = old + more;
- 		if (!new)
- 			new = 1;
+-		new = old + more;
+-		if (!new)
+-			new = 1;
 -	} while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
-+	} while (atomic_cmpxchg_unchecked(&p->ip_id_count, old, new) != old);
- 	return new;
+-	return new;
++	id = atomic_add_return_unchecked(more, &p->ip_id_count);
++	if (!id)
++		id = atomic_inc_return_unchecked(&p->ip_id_count);
++	return id;
  }
  
+ #endif /* _NET_INETPEER_H */
 diff --git a/include/net/ip.h b/include/net/ip.h
 index eca0ef7..88118cb 100644
 --- a/include/net/ip.h
@@ -77361,6 +78005,19 @@ index 8be9b746..cb7b792 100644
  		     &parent_event->child_total_time_running);
  
  	/*
+diff --git a/kernel/events/internal.h b/kernel/events/internal.h
+index a2101bb..f2e0354 100644
+--- a/kernel/events/internal.h
++++ b/kernel/events/internal.h
+@@ -78,7 +78,7 @@ static unsigned long perf_data_size(struct ring_buffer *rb)
+ 
+ static inline void
+ __output_copy(struct perf_output_handle *handle,
+-		   const void *buf, unsigned int len)
++		   const void *buf, unsigned long len)
+ {
+ 	do {
+ 		unsigned long size = min_t(unsigned long, handle->size, len);
 diff --git a/kernel/exit.c b/kernel/exit.c
 index 234e152..0ae0243 100644
 --- a/kernel/exit.c
@@ -77796,7 +78453,7 @@ index ce0c182..16fd1e0 100644
  			else
  				new_fs = fs;
 diff --git a/kernel/futex.c b/kernel/futex.c
-index 1d0538e..58e6a1a 100644
+index 1d0538e..04de80f 100644
 --- a/kernel/futex.c
 +++ b/kernel/futex.c
 @@ -54,6 +54,7 @@
@@ -77819,6 +78476,15 @@ index 1d0538e..58e6a1a 100644
  	/*
  	 * The futex address must be "naturally" aligned.
  	 */
+@@ -438,7 +444,7 @@ static int cmpxchg_futex_value_locked(u32 *curval, u32 __user *uaddr,
+ 
+ static int get_futex_value_locked(u32 *dest, u32 __user *from)
+ {
+-	int ret;
++	unsigned long ret;
+ 
+ 	pagefault_disable();
+ 	ret = __copy_from_user_inatomic(dest, from, sizeof(u32));
 @@ -2744,6 +2750,7 @@ static int __init futex_init(void)
  {
  	u32 curval;
@@ -82139,6 +82805,26 @@ index c3c3f6b..7d8dbdc 100644
  
  #undef FTRACE_ENTRY
  #define FTRACE_ENTRY(call, struct_name, id, tstruct, print)		\
+diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
+index 3947835..8c0488b 100644
+--- a/kernel/trace/trace_clock.c
++++ b/kernel/trace/trace_clock.c
+@@ -114,7 +114,7 @@ u64 notrace trace_clock_global(void)
+ 	return now;
+ }
+ 
+-static atomic64_t trace_counter;
++static atomic64_unchecked_t trace_counter;
+ 
+ /*
+  * trace_clock_counter(): simply an atomic counter.
+@@ -123,5 +123,5 @@ static atomic64_t trace_counter;
+  */
+ u64 notrace trace_clock_counter(void)
+ {
+-	return atomic64_add_return(1, &trace_counter);
++	return atomic64_add_return_unchecked(1, &trace_counter);
+ }
 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
 index c212a7f..a2560bc 100644
 --- a/kernel/trace/trace_events.c
@@ -83090,7 +83776,7 @@ index 2b49dd2..0527d62 100644
  		bdi_destroy(bdi);
  		return err;
 diff --git a/mm/filemap.c b/mm/filemap.c
-index 556858c..ec09758 100644
+index 556858c..71a567d 100644
 --- a/mm/filemap.c
 +++ b/mm/filemap.c
 @@ -1773,7 +1773,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
@@ -83102,6 +83788,42 @@ index 556858c..ec09758 100644
  	file_accessed(file);
  	vma->vm_ops = &generic_file_vm_ops;
  	vma->vm_flags |= VM_CAN_NONLINEAR;
+@@ -2021,7 +2021,7 @@ static size_t __iovec_copy_from_user_inatomic(char *vaddr,
+ 
+ 	while (bytes) {
+ 		char __user *buf = iov->iov_base + base;
+-		int copy = min(bytes, iov->iov_len - base);
++		size_t copy = min(bytes, iov->iov_len - base);
+ 
+ 		base = 0;
+ 		left = __copy_from_user_inatomic(vaddr, buf, copy);
+@@ -2050,7 +2050,7 @@ size_t iov_iter_copy_from_user_atomic(struct page *page,
+ 	BUG_ON(!in_atomic());
+ 	kaddr = kmap_atomic(page, KM_USER0);
+ 	if (likely(i->nr_segs == 1)) {
+-		int left;
++		size_t left;
+ 		char __user *buf = i->iov->iov_base + i->iov_offset;
+ 		left = __copy_from_user_inatomic(kaddr + offset, buf, bytes);
+ 		copied = bytes - left;
+@@ -2078,7 +2078,7 @@ size_t iov_iter_copy_from_user(struct page *page,
+ 
+ 	kaddr = kmap(page);
+ 	if (likely(i->nr_segs == 1)) {
+-		int left;
++		size_t left;
+ 		char __user *buf = i->iov->iov_base + i->iov_offset;
+ 		left = __copy_from_user(kaddr + offset, buf, bytes);
+ 		copied = bytes - left;
+@@ -2108,7 +2108,7 @@ void iov_iter_advance(struct iov_iter *i, size_t bytes)
+ 		 * zero-length segments (without overruning the iovec).
+ 		 */
+ 		while (bytes || unlikely(i->count && !iov->iov_len)) {
+-			int copy;
++			size_t copy;
+ 
+ 			copy = min(bytes, iov->iov_len - base);
+ 			BUG_ON(!i->count || i->count < copy);
 @@ -2179,6 +2179,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
                          *pos = i_size_read(inode);
  
@@ -89687,6 +90409,19 @@ index 39a2d29..f39c0fe 100644
  	---help---
  	  Econet is a fairly old and slow networking protocol mainly used by
  	  Acorn computers to access file and print servers. It uses native
+diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
+index 19d6aef..4f610f4 100644
+--- a/net/ieee802154/6lowpan.c
++++ b/net/ieee802154/6lowpan.c
+@@ -329,7 +329,7 @@ static int lowpan_header_create(struct sk_buff *skb,
+ 			hc06_ptr += 3;
+ 		} else {
+ 			/* compress nothing */
+-			memcpy(hc06_ptr, &hdr, 4);
++			memcpy(hc06_ptr, hdr, 4);
+ 			/* replace the top byte with new ECN | DSCP format */
+ 			*hc06_ptr = tmp;
+ 			hc06_ptr += 4;
 diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
 index 5d228de..91bdee5 100644
 --- a/net/ipv4/af_inet.c
@@ -91119,6 +91854,39 @@ index 1567fb1..29af910 100644
  			__sk_dst_reset(sk);
  			dst = NULL;
  		}
+diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
+index db60043..33181b7 100644
+--- a/net/ipv6/ip6_output.c
++++ b/net/ipv6/ip6_output.c
+@@ -600,8 +600,8 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
+ 
+ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
+ {
+-	static atomic_t ipv6_fragmentation_id;
+-	int old, new;
++	static atomic_unchecked_t ipv6_fragmentation_id;
++	int id;
+ 
+ 	if (rt && !(rt->dst.flags & DST_NOPEER)) {
+ 		struct inet_peer *peer;
+@@ -614,13 +614,10 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
+ 			return;
+ 		}
+ 	}
+-	do {
+-		old = atomic_read(&ipv6_fragmentation_id);
+-		new = old + 1;
+-		if (!new)
+-			new = 1;
+-	} while (atomic_cmpxchg(&ipv6_fragmentation_id, old, new) != old);
+-	fhdr->identification = htonl(new);
++	id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
++	if (!id)
++		id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
++	fhdr->identification = htonl(id);
+ }
+ 
+ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
 diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
 index b204df8..8f274f4 100644
 --- a/net/ipv6/ipv6_sockglue.c
@@ -91182,9 +91950,18 @@ index 94874b0..a47969c 100644
  
  	case IP6T_SO_GET_ENTRIES:
 diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
-index 6e6c2c4..942cebf 100644
+index 6e6c2c4..c97891e 100644
 --- a/net/ipv6/raw.c
 +++ b/net/ipv6/raw.c
+@@ -109,7 +109,7 @@ found:
+  */
+ static int icmpv6_filter(const struct sock *sk, const struct sk_buff *skb)
+ {
+-	struct icmp6hdr *_hdr;
++	struct icmp6hdr _hdr;
+ 	const struct icmp6hdr *hdr;
+ 
+ 	hdr = skb_header_pointer(skb, skb_transport_offset(skb),
 @@ -376,7 +376,7 @@ static inline int rawv6_rcv_skb(struct sock *sk, struct sk_buff *skb)
  {
  	if ((raw6_sk(sk)->checksum || rcu_access_pointer(sk->sk_filter)) &&
@@ -92244,7 +93021,7 @@ index 14af632..9914188 100644
  	table = kmemdup(event_sysctl_table, sizeof(event_sysctl_table),
  			GFP_KERNEL);
 diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
-index 2e664a6..4264602 100644
+index 2e664a6..c854e4a 100644
 --- a/net/netfilter/nf_conntrack_proto_dccp.c
 +++ b/net/netfilter/nf_conntrack_proto_dccp.c
 @@ -391,7 +391,7 @@ struct dccp_net {
@@ -92256,6 +93033,15 @@ index 2e664a6..4264602 100644
  #endif
  };
  
+@@ -431,7 +431,7 @@ static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
+ 	const char *msg;
+ 	u_int8_t state;
+ 
+-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
++	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
+ 	BUG_ON(dh == NULL);
+ 
+ 	state = dccp_state_table[CT_DCCP_ROLE_CLIENT][dh->dccph_type][CT_DCCP_NONE];
 @@ -459,7 +459,7 @@ static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
  
  out_invalid:
@@ -92265,6 +93051,24 @@ index 2e664a6..4264602 100644
  	return false;
  }
  
+@@ -483,7 +483,7 @@ static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,
+ 	u_int8_t type, old_state, new_state;
+ 	enum ct_dccp_roles role;
+ 
+-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
++	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
+ 	BUG_ON(dh == NULL);
+ 	type = dh->dccph_type;
+ 
+@@ -575,7 +575,7 @@ static int dccp_error(struct net *net, struct nf_conn *tmpl,
+ 	unsigned int cscov;
+ 	const char *msg;
+ 
+-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
++	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
+ 	if (dh == NULL) {
+ 		msg = "nf_ct_dccp: short packet ";
+ 		goto out_invalid;
 @@ -612,7 +612,7 @@ static int dccp_error(struct net *net, struct nf_conn *tmpl,
  
  out_invalid:
@@ -94907,7 +95711,7 @@ index 113d20e..16d8f04 100644
  	}
  
 diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
-index 9414b9c..8b3547c 100644
+index 9414b9c..2477932 100644
 --- a/net/xfrm/xfrm_state.c
 +++ b/net/xfrm/xfrm_state.c
 @@ -194,11 +194,13 @@ int xfrm_register_type(const struct xfrm_type *type, unsigned short family)
@@ -94998,6 +95802,19 @@ index 9414b9c..8b3547c 100644
  		module_put(mode->afinfo->owner);
  		err = 0;
  	}
+@@ -1497,10 +1504,10 @@ EXPORT_SYMBOL(xfrm_find_acq_byseq);
+ u32 xfrm_get_acqseq(void)
+ {
+ 	u32 res;
+-	static atomic_t acqseq;
++	static atomic_unchecked_t acqseq;
+ 
+ 	do {
+-		res = atomic_inc_return(&acqseq);
++		res = atomic_inc_return_unchecked(&acqseq);
+ 	} while (!res);
+ 
+ 	return res;
 @@ -1985,8 +1992,10 @@ int __xfrm_init_state(struct xfrm_state *x, bool init_replay)
  		goto error;
  
@@ -97745,6 +98562,37 @@ index e2f684a..8eed291 100644
  int security_real_capable(struct task_struct *tsk, struct user_namespace *ns,
  			  int cap)
  {
+diff --git a/security/selinux/avc.c b/security/selinux/avc.c
+index dca1c22..4fa4591 100644
+--- a/security/selinux/avc.c
++++ b/security/selinux/avc.c
+@@ -59,7 +59,7 @@ struct avc_node {
+ struct avc_cache {
+ 	struct hlist_head	slots[AVC_CACHE_SLOTS]; /* head for avc_node->list */
+ 	spinlock_t		slots_lock[AVC_CACHE_SLOTS]; /* lock for writes */
+-	atomic_t		lru_hint;	/* LRU hint for reclaim scan */
++	atomic_unchecked_t	lru_hint;	/* LRU hint for reclaim scan */
+ 	atomic_t		active_nodes;
+ 	u32			latest_notif;	/* latest revocation notification */
+ };
+@@ -173,7 +173,7 @@ void __init avc_init(void)
+ 		spin_lock_init(&avc_cache.slots_lock[i]);
+ 	}
+ 	atomic_set(&avc_cache.active_nodes, 0);
+-	atomic_set(&avc_cache.lru_hint, 0);
++	atomic_set_unchecked(&avc_cache.lru_hint, 0);
+ 
+ 	avc_node_cachep = kmem_cache_create("avc_node", sizeof(struct avc_node),
+ 					     0, SLAB_PANIC, NULL);
+@@ -251,7 +251,7 @@ static inline int avc_reclaim_node(void)
+ 	spinlock_t *lock;
+ 
+ 	for (try = 0, ecx = 0; try < AVC_CACHE_SLOTS; try++) {
+-		hvalue = atomic_inc_return(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
++		hvalue = atomic_inc_return_unchecked(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
+ 		head = &avc_cache.slots[hvalue];
+ 		lock = &avc_cache.slots_lock[hvalue];
+ 
 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
 index 1126c10..effb32b 100644
 --- a/security/selinux/hooks.c
@@ -98246,6 +99094,27 @@ index 09d4648..cf234c7 100644
  
                  list_add(&s->list, &cs4297a_devs);
  
+diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
+index faabaa5..9888f8b 100644
+--- a/sound/pci/hda/hda_codec.c
++++ b/sound/pci/hda/hda_codec.c
+@@ -850,14 +850,10 @@ find_codec_preset(struct hda_codec *codec)
+ 	mutex_unlock(&preset_mutex);
+ 
+ 	if (mod_requested < HDA_MODREQ_MAX_COUNT) {
+-		char name[32];
+ 		if (!mod_requested)
+-			snprintf(name, sizeof(name), "snd-hda-codec-id:%08x",
+-				 codec->vendor_id);
++			request_module("snd-hda-codec-id:%08x", codec->vendor_id);
+ 		else
+-			snprintf(name, sizeof(name), "snd-hda-codec-id:%04x*",
+-				 (codec->vendor_id >> 16) & 0xffff);
+-		request_module(name);
++			request_module("snd-hda-codec-id:%04x*", (codec->vendor_id >> 16) & 0xffff);
+ 		mod_requested++;
+ 		goto again;
+ 	}
 diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
 index 03ee4e3..be86b46 100644
 --- a/sound/pci/ymfpci/ymfpci_main.c
@@ -99601,10 +100470,10 @@ index 0000000..568b360
 +}
 diff --git a/tools/gcc/kernexec_plugin.c b/tools/gcc/kernexec_plugin.c
 new file mode 100644
-index 0000000..0408e06
+index 0000000..257529f
 --- /dev/null
 +++ b/tools/gcc/kernexec_plugin.c
-@@ -0,0 +1,465 @@
+@@ -0,0 +1,471 @@
 +/*
 + * Copyright 2011-2013 by the PaX Team <pageexec@freemail.hu>
 + * Licensed under the GPL v2
@@ -99656,7 +100525,7 @@ index 0000000..0408e06
 +int plugin_is_GPL_compatible;
 +
 +static struct plugin_info kernexec_plugin_info = {
-+	.version	= "201302112000",
++	.version	= "201308230150",
 +	.help		= "method=[bts|or]\tinstrumentation method\n"
 +};
 +
@@ -99807,7 +100676,7 @@ index 0000000..0408e06
 +static void kernexec_instrument_fptr_bts(gimple_stmt_iterator *gsi)
 +{
 +	gimple assign_intptr, assign_new_fptr, call_stmt;
-+	tree intptr, old_fptr, new_fptr, kernexec_mask;
++	tree intptr, orptr, old_fptr, new_fptr, kernexec_mask;
 +
 +	call_stmt = gsi_stmt(*gsi);
 +	old_fptr = gimple_call_fn(call_stmt);
@@ -99816,16 +100685,20 @@ index 0000000..0408e06
 +	intptr = create_tmp_var(long_unsigned_type_node, "kernexec_bts");
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(intptr);
-+	mark_sym_for_renaming(intptr);
 +#endif
++	intptr = make_ssa_name(intptr, NULL);
 +	assign_intptr = gimple_build_assign(intptr, fold_convert(long_unsigned_type_node, old_fptr));
++	SSA_NAME_DEF_STMT(intptr) = assign_intptr;
 +	gsi_insert_before(gsi, assign_intptr, GSI_SAME_STMT);
 +	update_stmt(assign_intptr);
 +
 +	// apply logical or to temporary unsigned long and bitmask
 +	kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0x8000000000000000LL);
 +//	kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0xffffffff80000000LL);
-+	assign_intptr = gimple_build_assign(intptr, fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask));
++	orptr = fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask);
++	intptr = make_ssa_name(SSA_NAME_VAR(intptr), NULL);
++	assign_intptr = gimple_build_assign(intptr, orptr);
++	SSA_NAME_DEF_STMT(intptr) = assign_intptr;
 +	gsi_insert_before(gsi, assign_intptr, GSI_SAME_STMT);
 +	update_stmt(assign_intptr);
 +
@@ -99833,9 +100706,10 @@ index 0000000..0408e06
 +	new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_fptr");
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(new_fptr);
-+	mark_sym_for_renaming(new_fptr);
 +#endif
++	new_fptr = make_ssa_name(new_fptr, NULL);
 +	assign_new_fptr = gimple_build_assign(new_fptr, fold_convert(TREE_TYPE(old_fptr), intptr));
++	SSA_NAME_DEF_STMT(new_fptr) = assign_new_fptr;
 +	gsi_insert_before(gsi, assign_new_fptr, GSI_SAME_STMT);
 +	update_stmt(assign_new_fptr);
 +
@@ -99863,8 +100737,8 @@ index 0000000..0408e06
 +	new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_or");
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(new_fptr);
-+	mark_sym_for_renaming(new_fptr);
 +#endif
++	new_fptr = make_ssa_name(new_fptr, NULL);
 +
 +	// build asm volatile("orq %%r10, %0\n\t" : "=r"(new_fptr) : "0"(old_fptr));
 +	input = build_tree_list(NULL_TREE, build_string(2, "0"));
@@ -99879,6 +100753,7 @@ index 0000000..0408e06
 +	vec_safe_push(outputs, output);
 +#endif
 +	asm_or_stmt = gimple_build_asm_vec("orq %%r10, %0\n\t", inputs, outputs, NULL, NULL);
++	SSA_NAME_DEF_STMT(new_fptr) = asm_or_stmt;
 +	gimple_asm_set_volatile(asm_or_stmt, true);
 +	gsi_insert_before(gsi, asm_or_stmt, GSI_SAME_STMT);
 +	update_stmt(asm_or_stmt);
@@ -100072,10 +100947,10 @@ index 0000000..0408e06
 +}
 diff --git a/tools/gcc/latent_entropy_plugin.c b/tools/gcc/latent_entropy_plugin.c
 new file mode 100644
-index 0000000..b5395ba
+index 0000000..2ef6fd9
 --- /dev/null
 +++ b/tools/gcc/latent_entropy_plugin.c
-@@ -0,0 +1,327 @@
+@@ -0,0 +1,321 @@
 +/*
 + * Copyright 2012-2013 by the PaX Team <pageexec@freemail.hu>
 + * Licensed under the GPL v2
@@ -100127,7 +101002,7 @@ index 0000000..b5395ba
 +static tree latent_entropy_decl;
 +
 +static struct plugin_info latent_entropy_plugin_info = {
-+	.version	= "201303102320",
++	.version	= "201308230230",
 +	.help		= NULL
 +};
 +
@@ -100236,13 +101111,10 @@ index 0000000..b5395ba
 +	op = get_op(&rhs);
 +	addxorrol = fold_build2_loc(UNKNOWN_LOCATION, op, unsigned_intDI_type_node, local_entropy, rhs);
 +	assign = gimple_build_assign(local_entropy, addxorrol);
-+#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
-+#endif
-+//debug_bb(bb);
 +	gsi = gsi_after_labels(bb);
 +	gsi_insert_before(&gsi, assign, GSI_NEW_STMT);
 +	update_stmt(assign);
++//debug_bb(bb);
 +}
 +
 +static void perturb_latent_entropy(basic_block bb, tree rhs)
@@ -100255,13 +101127,14 @@ index 0000000..b5395ba
 +	temp = create_tmp_var(unsigned_intDI_type_node, "temp_latent_entropy");
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(temp);
-+	mark_sym_for_renaming(temp);
 +#endif
 +
 +	// 2. read...
++	temp = make_ssa_name(temp, NULL);
 +	assign = gimple_build_assign(temp, latent_entropy_decl);
++	SSA_NAME_DEF_STMT(temp) = assign;
 +#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
++	add_referenced_var(latent_entropy_decl);
 +#endif
 +	gsi = gsi_after_labels(bb);
 +	gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
@@ -100269,18 +101142,14 @@ index 0000000..b5395ba
 +
 +	// 3. ...modify...
 +	addxorrol = fold_build2_loc(UNKNOWN_LOCATION, get_op(NULL), unsigned_intDI_type_node, temp, rhs);
++	temp = make_ssa_name(SSA_NAME_VAR(temp), NULL);
 +	assign = gimple_build_assign(temp, addxorrol);
-+#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
-+#endif
++	SSA_NAME_DEF_STMT(temp) = assign;
 +	gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
 +	update_stmt(assign);
 +
 +	// 4. ...write latent_entropy
 +	assign = gimple_build_assign(latent_entropy_decl, temp);
-+#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
-+#endif
 +	gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
 +	update_stmt(assign);
 +}
@@ -100331,21 +101200,21 @@ index 0000000..b5395ba
 +
 +	assign = gimple_build_assign(local_entropy, build_int_cstu(unsigned_intDI_type_node, get_random_const()));
 +//	gimple_set_location(assign, loc);
-+#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
-+#endif
 +	gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
 +	update_stmt(assign);
++//debug_bb(bb);
 +	bb = bb->next_bb;
 +
 +	// 3. instrument each BB with an operation on the local entropy variable
 +	while (bb != EXIT_BLOCK_PTR) {
 +		perturb_local_entropy(bb, local_entropy);
++//debug_bb(bb);
 +		bb = bb->next_bb;
 +	};
 +
 +	// 4. mix local entropy into the global entropy variable
 +	perturb_latent_entropy(EXIT_BLOCK_PTR->prev_bb, local_entropy);
++//debug_bb(EXIT_BLOCK_PTR->prev_bb);
 +	return 0;
 +}
 +
@@ -105195,10 +106064,10 @@ index 0000000..6fcc08d
 +alloc_dr_65495 alloc_dr 2 65495 NULL
 diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c
 new file mode 100644
-index 0000000..9db0d0e
+index 0000000..03d0c84
 --- /dev/null
 +++ b/tools/gcc/size_overflow_plugin.c
-@@ -0,0 +1,2114 @@
+@@ -0,0 +1,2113 @@
 +/*
 + * Copyright 2011, 2012, 2013 by Emese Revfy <re.emese@gmail.com>
 + * Licensed under the GPL v2, or (at your option) v3
@@ -105288,7 +106157,7 @@ index 0000000..9db0d0e
 +static void print_missing_msg(tree func, unsigned int argnum);
 +
 +static struct plugin_info size_overflow_plugin_info = {
-+	.version	= "20130410beta",
++	.version	= "20130822beta",
 +	.help		= "no-size-overflow\tturn off size overflow checking\n",
 +};
 +
@@ -105668,7 +106537,6 @@ index 0000000..9db0d0e
 +
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(new_var);
-+	mark_sym_for_renaming(new_var);
 +#endif
 +	return new_var;
 +}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/hardened-patchset:master commit in: 3.2.50/, 3.10.10/
@ 2013-09-02 19:48 Anthony G. Basile
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony G. Basile @ 2013-09-02 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     98b1920aad8533f1ac0f456c6926373b18773709
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  2 19:46:29 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Sep  2 19:48:47 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-patchset.git;a=commit;h=98b1920a

Grsec/PaX: 2.9.1-{3.2.50.3.10.10}-201309011630

---
 3.10.10/0000_README                                |    2 +-
 ...20_grsecurity-2.9.1-3.10.10-201309011630.patch} | 1476 +++++++++++++++++++-
 3.2.50/0000_README                                 |    2 +-
 ...420_grsecurity-2.9.1-3.2.50-201309011629.patch} |  974 ++++++++++++-
 4 files changed, 2378 insertions(+), 76 deletions(-)

diff --git a/3.10.10/0000_README b/3.10.10/0000_README
index bd3df03..a09b757 100644
--- a/3.10.10/0000_README
+++ b/3.10.10/0000_README
@@ -2,7 +2,7 @@ README
 -----------------------------------------------------------------------------
 Individual Patch Descriptions:
 -----------------------------------------------------------------------------
-Patch:	4420_grsecurity-2.9.1-3.10.10-201308301923.patch
+Patch:	4420_grsecurity-2.9.1-3.10.10-201309011630.patch
 From:	http://www.grsecurity.net
 Desc:	hardened-sources base patch from upstream grsecurity
 

diff --git a/3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch b/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
similarity index 98%
rename from 3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch
rename to 3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
index cd96025..54e5089 100644
--- a/3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch
+++ b/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
@@ -3271,6 +3271,46 @@ index 33f2ea3..0b91824 100644
  	. = ALIGN(THREAD_SIZE);
  	__data_loc = .;
  #endif
+diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
+index ef1703b..46b77f3 100644
+--- a/arch/arm/kvm/arm.c
++++ b/arch/arm/kvm/arm.c
+@@ -56,7 +56,7 @@ static unsigned long hyp_default_vectors;
+ static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
+ 
+ /* The VMID used in the VTTBR */
+-static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
++static atomic64_unchecked_t kvm_vmid_gen = ATOMIC64_INIT(1);
+ static u8 kvm_next_vmid;
+ static DEFINE_SPINLOCK(kvm_vmid_lock);
+ 
+@@ -392,7 +392,7 @@ void force_vm_exit(const cpumask_t *mask)
+  */
+ static bool need_new_vmid_gen(struct kvm *kvm)
+ {
+-	return unlikely(kvm->arch.vmid_gen != atomic64_read(&kvm_vmid_gen));
++	return unlikely(kvm->arch.vmid_gen != atomic64_read_unchecked(&kvm_vmid_gen));
+ }
+ 
+ /**
+@@ -425,7 +425,7 @@ static void update_vttbr(struct kvm *kvm)
+ 
+ 	/* First user of a new VMID generation? */
+ 	if (unlikely(kvm_next_vmid == 0)) {
+-		atomic64_inc(&kvm_vmid_gen);
++		atomic64_inc_unchecked(&kvm_vmid_gen);
+ 		kvm_next_vmid = 1;
+ 
+ 		/*
+@@ -442,7 +442,7 @@ static void update_vttbr(struct kvm *kvm)
+ 		kvm_call_hyp(__kvm_flush_vm_context);
+ 	}
+ 
+-	kvm->arch.vmid_gen = atomic64_read(&kvm_vmid_gen);
++	kvm->arch.vmid_gen = atomic64_read_unchecked(&kvm_vmid_gen);
+ 	kvm->arch.vmid = kvm_next_vmid;
+ 	kvm_next_vmid++;
+ 
 diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S
 index 14a0d98..7771a7d 100644
 --- a/arch/arm/lib/clear_user.S
@@ -3734,6 +3774,54 @@ index 6f4585b..7b6f52b 100644
  		if (err)					\
  			goto fault;				\
  	} while (0)
+diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
+index eeab06e..2638dc2 100644
+--- a/arch/arm/mm/context.c
++++ b/arch/arm/mm/context.c
+@@ -42,7 +42,7 @@
+ #define NUM_USER_ASIDS		ASID_FIRST_VERSION
+ 
+ static DEFINE_RAW_SPINLOCK(cpu_asid_lock);
+-static atomic64_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION);
++static atomic64_unchecked_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION);
+ static DECLARE_BITMAP(asid_map, NUM_USER_ASIDS);
+ 
+ static DEFINE_PER_CPU(atomic64_t, active_asids);
+@@ -188,7 +188,7 @@ static int is_reserved_asid(u64 asid)
+ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
+ {
+ 	u64 asid = atomic64_read(&mm->context.id);
+-	u64 generation = atomic64_read(&asid_generation);
++	u64 generation = atomic64_read_unchecked(&asid_generation);
+ 
+ 	if (asid != 0 && is_reserved_asid(asid)) {
+ 		/*
+@@ -206,7 +206,7 @@ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
+ 		 */
+ 		asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
+ 		if (asid == NUM_USER_ASIDS) {
+-			generation = atomic64_add_return(ASID_FIRST_VERSION,
++			generation = atomic64_add_return_unchecked(ASID_FIRST_VERSION,
+ 							 &asid_generation);
+ 			flush_context(cpu);
+ 			asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
+@@ -235,14 +235,14 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk)
+ 	cpu_set_reserved_ttbr0();
+ 
+ 	asid = atomic64_read(&mm->context.id);
+-	if (!((asid ^ atomic64_read(&asid_generation)) >> ASID_BITS)
++	if (!((asid ^ atomic64_read_unchecked(&asid_generation)) >> ASID_BITS)
+ 	    && atomic64_xchg(&per_cpu(active_asids, cpu), asid))
+ 		goto switch_mm_fastpath;
+ 
+ 	raw_spin_lock_irqsave(&cpu_asid_lock, flags);
+ 	/* Check that our ASID belongs to the current generation. */
+ 	asid = atomic64_read(&mm->context.id);
+-	if ((asid ^ atomic64_read(&asid_generation)) >> ASID_BITS) {
++	if ((asid ^ atomic64_read_unchecked(&asid_generation)) >> ASID_BITS) {
+ 		asid = new_context(mm, cpu);
+ 		atomic64_set(&mm->context.id, asid);
+ 	}
 diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
 index 5dbf13f..a2d1876 100644
 --- a/arch/arm/mm/fault.c
@@ -6496,6 +6584,31 @@ index 202e581..689ca79 100644
  #include <asm/processor.h>
  
  /*
+diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
+index d1fea7a..45602ea 100644
+--- a/arch/mips/kernel/irq.c
++++ b/arch/mips/kernel/irq.c
+@@ -77,17 +77,17 @@ void ack_bad_irq(unsigned int irq)
+ 	printk("unexpected IRQ # %d\n", irq);
+ }
+ 
+-atomic_t irq_err_count;
++atomic_unchecked_t irq_err_count;
+ 
+ int arch_show_interrupts(struct seq_file *p, int prec)
+ {
+-	seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
++	seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read_unchecked(&irq_err_count));
+ 	return 0;
+ }
+ 
+ asmlinkage void spurious_interrupt(void)
+ {
+-	atomic_inc(&irq_err_count);
++	atomic_inc_unchecked(&irq_err_count);
+ }
+ 
+ void __init init_IRQ(void)
 diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
 index c6a041d..b3e7318 100644
 --- a/arch/mips/kernel/process.c
@@ -6595,6 +6708,75 @@ index 74f485d..47d2c38 100644
  	LONG_L	t0, TI_FLAGS($28)	# syscall tracing enabled?
  	and	t0, t1, t0
  	bnez	t0, trace_a_syscall
+diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c
+index 1ff43d5..96fec68 100644
+--- a/arch/mips/kernel/sync-r4k.c
++++ b/arch/mips/kernel/sync-r4k.c
+@@ -21,8 +21,8 @@
+ #include <asm/mipsregs.h>
+ 
+ static atomic_t __cpuinitdata count_start_flag = ATOMIC_INIT(0);
+-static atomic_t __cpuinitdata count_count_start = ATOMIC_INIT(0);
+-static atomic_t __cpuinitdata count_count_stop = ATOMIC_INIT(0);
++static atomic_unchecked_t __cpuinitdata count_count_start = ATOMIC_INIT(0);
++static atomic_unchecked_t __cpuinitdata count_count_stop = ATOMIC_INIT(0);
+ static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0);
+ 
+ #define COUNTON 100
+@@ -69,13 +69,13 @@ void __cpuinit synchronise_count_master(int cpu)
+ 
+ 	for (i = 0; i < NR_LOOPS; i++) {
+ 		/* slaves loop on '!= 2' */
+-		while (atomic_read(&count_count_start) != 1)
++		while (atomic_read_unchecked(&count_count_start) != 1)
+ 			mb();
+-		atomic_set(&count_count_stop, 0);
++		atomic_set_unchecked(&count_count_stop, 0);
+ 		smp_wmb();
+ 
+ 		/* this lets the slaves write their count register */
+-		atomic_inc(&count_count_start);
++		atomic_inc_unchecked(&count_count_start);
+ 
+ 		/*
+ 		 * Everyone initialises count in the last loop:
+@@ -86,11 +86,11 @@ void __cpuinit synchronise_count_master(int cpu)
+ 		/*
+ 		 * Wait for all slaves to leave the synchronization point:
+ 		 */
+-		while (atomic_read(&count_count_stop) != 1)
++		while (atomic_read_unchecked(&count_count_stop) != 1)
+ 			mb();
+-		atomic_set(&count_count_start, 0);
++		atomic_set_unchecked(&count_count_start, 0);
+ 		smp_wmb();
+-		atomic_inc(&count_count_stop);
++		atomic_inc_unchecked(&count_count_stop);
+ 	}
+ 	/* Arrange for an interrupt in a short while */
+ 	write_c0_compare(read_c0_count() + COUNTON);
+@@ -131,8 +131,8 @@ void __cpuinit synchronise_count_slave(int cpu)
+ 	initcount = atomic_read(&count_reference);
+ 
+ 	for (i = 0; i < NR_LOOPS; i++) {
+-		atomic_inc(&count_count_start);
+-		while (atomic_read(&count_count_start) != 2)
++		atomic_inc_unchecked(&count_count_start);
++		while (atomic_read_unchecked(&count_count_start) != 2)
+ 			mb();
+ 
+ 		/*
+@@ -141,8 +141,8 @@ void __cpuinit synchronise_count_slave(int cpu)
+ 		if (i == NR_LOOPS-1)
+ 			write_c0_count(initcount);
+ 
+-		atomic_inc(&count_count_stop);
+-		while (atomic_read(&count_count_stop) != 2)
++		atomic_inc_unchecked(&count_count_stop);
++		while (atomic_read_unchecked(&count_count_stop) != 2)
+ 			mb();
+ 	}
+ 	/* Arrange for an interrupt in a short while */
 diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
 index a75ae40..0d0f56a 100644
 --- a/arch/mips/kernel/traps.c
@@ -6768,6 +6950,31 @@ index 7e5fe27..9656513 100644
  int __virt_addr_valid(const volatile void *kaddr)
  {
  	return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
+diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c
+index a2358b4..7cead4f 100644
+--- a/arch/mips/sgi-ip27/ip27-nmi.c
++++ b/arch/mips/sgi-ip27/ip27-nmi.c
+@@ -187,9 +187,9 @@ void
+ cont_nmi_dump(void)
+ {
+ #ifndef REAL_NMI_SIGNAL
+-	static atomic_t nmied_cpus = ATOMIC_INIT(0);
++	static atomic_unchecked_t nmied_cpus = ATOMIC_INIT(0);
+ 
+-	atomic_inc(&nmied_cpus);
++	atomic_inc_unchecked(&nmied_cpus);
+ #endif
+ 	/*
+ 	 * Only allow 1 cpu to proceed
+@@ -233,7 +233,7 @@ cont_nmi_dump(void)
+ 		udelay(10000);
+ 	}
+ #else
+-	while (atomic_read(&nmied_cpus) != num_online_cpus());
++	while (atomic_read_unchecked(&nmied_cpus) != num_online_cpus());
+ #endif
+ 
+ 	/*
 diff --git a/arch/mn10300/proc-mn103e010/include/proc/cache.h b/arch/mn10300/proc-mn103e010/include/proc/cache.h
 index 967d144..db12197 100644
 --- a/arch/mn10300/proc-mn103e010/include/proc/cache.h
@@ -9535,6 +9742,57 @@ index 7ff45e4..a58f271 100644
  	audit_syscall_exit(regs);
  
  	if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
+diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
+index 77539ed..3ffffe7 100644
+--- a/arch/sparc/kernel/smp_64.c
++++ b/arch/sparc/kernel/smp_64.c
+@@ -868,8 +868,8 @@ extern unsigned long xcall_flush_dcache_page_cheetah;
+ extern unsigned long xcall_flush_dcache_page_spitfire;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-extern atomic_t dcpage_flushes;
+-extern atomic_t dcpage_flushes_xcall;
++extern atomic_unchecked_t dcpage_flushes;
++extern atomic_unchecked_t dcpage_flushes_xcall;
+ #endif
+ 
+ static inline void __local_flush_dcache_page(struct page *page)
+@@ -893,7 +893,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
+ 		return;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 
+ 	this_cpu = get_cpu();
+@@ -917,7 +917,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
+ 			xcall_deliver(data0, __pa(pg_addr),
+ 				      (u64) pg_addr, cpumask_of(cpu));
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-			atomic_inc(&dcpage_flushes_xcall);
++			atomic_inc_unchecked(&dcpage_flushes_xcall);
+ #endif
+ 		}
+ 	}
+@@ -936,7 +936,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
+ 	preempt_disable();
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 	data0 = 0;
+ 	pg_addr = page_address(page);
+@@ -953,7 +953,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
+ 		xcall_deliver(data0, __pa(pg_addr),
+ 			      (u64) pg_addr, cpu_online_mask);
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-		atomic_inc(&dcpage_flushes_xcall);
++		atomic_inc_unchecked(&dcpage_flushes_xcall);
+ #endif
+ 	}
+ 	__local_flush_dcache_page(page);
 diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
 index 3a8d184..49498a8 100644
 --- a/arch/sparc/kernel/sys_sparc_32.c
@@ -9808,7 +10066,7 @@ index 6629829..036032d 100644
  }
  
 diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
-index b3f833a..ac74b2d 100644
+index b3f833a..f485f80 100644
 --- a/arch/sparc/kernel/traps_64.c
 +++ b/arch/sparc/kernel/traps_64.c
 @@ -76,7 +76,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
@@ -9878,6 +10136,55 @@ index b3f833a..ac74b2d 100644
  }
  
  struct sun4v_error_entry {
+@@ -1830,8 +1841,8 @@ struct sun4v_error_entry {
+ /*0x38*/u64		reserved_5;
+ };
+ 
+-static atomic_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
+-static atomic_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
++static atomic_unchecked_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
++static atomic_unchecked_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
+ 
+ static const char *sun4v_err_type_to_str(u8 type)
+ {
+@@ -1923,7 +1934,7 @@ static void sun4v_report_real_raddr(const char *pfx, struct pt_regs *regs)
+ }
+ 
+ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
+-			    int cpu, const char *pfx, atomic_t *ocnt)
++			    int cpu, const char *pfx, atomic_unchecked_t *ocnt)
+ {
+ 	u64 *raw_ptr = (u64 *) ent;
+ 	u32 attrs;
+@@ -1981,8 +1992,8 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
+ 
+ 	show_regs(regs);
+ 
+-	if ((cnt = atomic_read(ocnt)) != 0) {
+-		atomic_set(ocnt, 0);
++	if ((cnt = atomic_read_unchecked(ocnt)) != 0) {
++		atomic_set_unchecked(ocnt, 0);
+ 		wmb();
+ 		printk("%s: Queue overflowed %d times.\n",
+ 		       pfx, cnt);
+@@ -2036,7 +2047,7 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
+  */
+ void sun4v_resum_overflow(struct pt_regs *regs)
+ {
+-	atomic_inc(&sun4v_resum_oflow_cnt);
++	atomic_inc_unchecked(&sun4v_resum_oflow_cnt);
+ }
+ 
+ /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
+@@ -2089,7 +2100,7 @@ void sun4v_nonresum_overflow(struct pt_regs *regs)
+ 	/* XXX Actually even this can make not that much sense.  Perhaps
+ 	 * XXX we should just pull the plug and panic directly from here?
+ 	 */
+-	atomic_inc(&sun4v_nonresum_oflow_cnt);
++	atomic_inc_unchecked(&sun4v_nonresum_oflow_cnt);
+ }
+ 
+ unsigned long sun4v_err_itlb_vaddr;
 @@ -2104,9 +2115,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
  
  	printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
@@ -11165,6 +11472,44 @@ index d2b5944..d878f3c 100644
  }
  
  pte_t *huge_pte_alloc(struct mm_struct *mm,
+diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
+index 04fd55a..4ede686 100644
+--- a/arch/sparc/mm/init_64.c
++++ b/arch/sparc/mm/init_64.c
+@@ -188,9 +188,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
+ int num_kernel_image_mappings;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-atomic_t dcpage_flushes = ATOMIC_INIT(0);
++atomic_unchecked_t dcpage_flushes = ATOMIC_INIT(0);
+ #ifdef CONFIG_SMP
+-atomic_t dcpage_flushes_xcall = ATOMIC_INIT(0);
++atomic_unchecked_t dcpage_flushes_xcall = ATOMIC_INIT(0);
+ #endif
+ #endif
+ 
+@@ -198,7 +198,7 @@ inline void flush_dcache_page_impl(struct page *page)
+ {
+ 	BUG_ON(tlb_type == hypervisor);
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 
+ #ifdef DCACHE_ALIASING_POSSIBLE
+@@ -466,10 +466,10 @@ void mmu_info(struct seq_file *m)
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+ 	seq_printf(m, "DCPageFlushes\t: %d\n",
+-		   atomic_read(&dcpage_flushes));
++		   atomic_read_unchecked(&dcpage_flushes));
+ #ifdef CONFIG_SMP
+ 	seq_printf(m, "DCPageFlushesXC\t: %d\n",
+-		   atomic_read(&dcpage_flushes_xcall));
++		   atomic_read_unchecked(&dcpage_flushes_xcall));
+ #endif /* CONFIG_SMP */
+ #endif /* CONFIG_DEBUG_DCFLUSH */
+ }
 diff --git a/arch/tile/include/asm/atomic_64.h b/arch/tile/include/asm/atomic_64.h
 index f4500c6..889656c 100644
 --- a/arch/tile/include/asm/atomic_64.h
@@ -34359,6 +34704,28 @@ index af00795..2bb8105 100644
  
  #define XCHAL_ICACHE_SIZE		32768	/* I-cache size in bytes or 0 */
  #define XCHAL_DCACHE_SIZE		32768	/* D-cache size in bytes or 0 */
+diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
+index e8918ff..b3ffc51 100644
+--- a/block/blk-cgroup.c
++++ b/block/blk-cgroup.c
+@@ -825,7 +825,7 @@ static void blkcg_css_free(struct cgroup *cgroup)
+ 
+ static struct cgroup_subsys_state *blkcg_css_alloc(struct cgroup *cgroup)
+ {
+-	static atomic64_t id_seq = ATOMIC64_INIT(0);
++	static atomic64_unchecked_t id_seq = ATOMIC64_INIT(0);
+ 	struct blkcg *blkcg;
+ 	struct cgroup *parent = cgroup->parent;
+ 
+@@ -840,7 +840,7 @@ static struct cgroup_subsys_state *blkcg_css_alloc(struct cgroup *cgroup)
+ 
+ 	blkcg->cfq_weight = CFQ_WEIGHT_DEFAULT;
+ 	blkcg->cfq_leaf_weight = CFQ_WEIGHT_DEFAULT;
+-	blkcg->id = atomic64_inc_return(&id_seq); /* root is 0, start from 1 */
++	blkcg->id = atomic64_inc_return_unchecked(&id_seq); /* root is 0, start from 1 */
+ done:
+ 	spin_lock_init(&blkcg->lock);
+ 	INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_ATOMIC);
 diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c
 index 58916af..eb9dbcf6 100644
 --- a/block/blk-iopoll.c
@@ -34652,6 +35019,28 @@ index 33dc6a0..4b24b47 100644
  }
  EXPORT_SYMBOL_GPL(cper_next_record_id);
  
+diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
+index fcd7d91..6b2f1a3 100644
+--- a/drivers/acpi/apei/ghes.c
++++ b/drivers/acpi/apei/ghes.c
+@@ -468,7 +468,7 @@ static void __ghes_print_estatus(const char *pfx,
+ 				 const struct acpi_hest_generic *generic,
+ 				 const struct acpi_hest_generic_status *estatus)
+ {
+-	static atomic_t seqno;
++	static atomic_unchecked_t seqno;
+ 	unsigned int curr_seqno;
+ 	char pfx_seq[64];
+ 
+@@ -479,7 +479,7 @@ static void __ghes_print_estatus(const char *pfx,
+ 		else
+ 			pfx = KERN_ERR;
+ 	}
+-	curr_seqno = atomic_inc_return(&seqno);
++	curr_seqno = atomic_inc_return_unchecked(&seqno);
+ 	snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx, curr_seqno);
+ 	printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n",
+ 	       pfx_seq, generic->header.source_id);
 diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c
 index be60399..778b33e8 100644
 --- a/drivers/acpi/bgrt.c
@@ -34789,9 +35178,18 @@ index 7b9bdd8..37638ca 100644
  				unsigned long timeout_msec)
  {
 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index adf002a..39bb8f9 100644
+index adf002a..06c46a7 100644
 --- a/drivers/ata/libata-core.c
 +++ b/drivers/ata/libata-core.c
+@@ -98,7 +98,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
+ static void ata_dev_xfermask(struct ata_device *dev);
+ static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
+ 
+-atomic_t ata_print_id = ATOMIC_INIT(0);
++atomic_unchecked_t ata_print_id = ATOMIC_INIT(0);
+ 
+ struct ata_force_param {
+ 	const char	*name;
 @@ -4792,7 +4792,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
  	struct ata_port *ap;
  	unsigned int tag;
@@ -34829,6 +35227,41 @@ index adf002a..39bb8f9 100644
  	spin_unlock(&lock);
  }
  
+@@ -6133,7 +6135,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
+ 
+ 	/* give ports names and add SCSI hosts */
+ 	for (i = 0; i < host->n_ports; i++)
+-		host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
++		host->ports[i]->print_id = atomic_inc_return_unchecked(&ata_print_id);
+ 
+ 
+ 	/* Create associated sysfs transport objects  */
+diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
+index 0101af5..c70c325 100644
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -4105,7 +4105,7 @@ int ata_sas_port_init(struct ata_port *ap)
+ 
+ 	if (rc)
+ 		return rc;
+-	ap->print_id = atomic_inc_return(&ata_print_id);
++	ap->print_id = atomic_inc_return_unchecked(&ata_print_id);
+ 	return 0;
+ }
+ EXPORT_SYMBOL_GPL(ata_sas_port_init);
+diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
+index 577d902b..cb4781e 100644
+--- a/drivers/ata/libata.h
++++ b/drivers/ata/libata.h
+@@ -53,7 +53,7 @@ enum {
+ 	ATA_DNXFER_QUIET	= (1 << 31),
+ };
+ 
+-extern atomic_t ata_print_id;
++extern atomic_unchecked_t ata_print_id;
+ extern int atapi_passthru16;
+ extern int libata_fua;
+ extern int libata_noacpi;
 diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
 index 7638121..357a965 100644
 --- a/drivers/ata/pata_arasan_cf.c
@@ -36357,6 +36790,28 @@ index a5dca6a..bb27967 100644
  	kfree(tconn->current_epoch);
  
  	idr_destroy(&tconn->volumes);
+diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
+index 9e3f441..4044d47 100644
+--- a/drivers/block/drbd/drbd_nl.c
++++ b/drivers/block/drbd/drbd_nl.c
+@@ -3339,7 +3339,7 @@ out:
+ 
+ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)
+ {
+-	static atomic_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
++	static atomic_unchecked_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
+ 	struct sk_buff *msg;
+ 	struct drbd_genlmsghdr *d_out;
+ 	unsigned seq;
+@@ -3352,7 +3352,7 @@ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)
+ 			return;
+ 	}
+ 
+-	seq = atomic_inc_return(&drbd_genl_seq);
++	seq = atomic_inc_return_unchecked(&drbd_genl_seq);
+ 	msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
+ 	if (!msg)
+ 		goto failed;
 diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
 index 4222aff..1f79506 100644
 --- a/drivers/block/drbd/drbd_receiver.c
@@ -37596,6 +38051,28 @@ index 428754a..8bdf9cc 100644
  	.attrs = cpuidle_default_attrs,
  	.name = "cpuidle",
  };
+diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
+index ebf130e..e32d8a9 100644
+--- a/drivers/crypto/hifn_795x.c
++++ b/drivers/crypto/hifn_795x.c
+@@ -51,7 +51,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
+ MODULE_PARM_DESC(hifn_pll_ref,
+ 		 "PLL reference clock (pci[freq] or ext[freq], default ext)");
+ 
+-static atomic_t hifn_dev_number;
++static atomic_unchecked_t hifn_dev_number;
+ 
+ #define ACRYPTO_OP_DECRYPT	0
+ #define ACRYPTO_OP_ENCRYPT	1
+@@ -2577,7 +2577,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+ 		goto err_out_disable_pci_device;
+ 
+ 	snprintf(name, sizeof(name), "hifn%d",
+-			atomic_inc_return(&hifn_dev_number)-1);
++			atomic_inc_return_unchecked(&hifn_dev_number)-1);
+ 
+ 	err = pci_request_regions(pdev, name);
+ 	if (err)
 diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
 index 3b36797..db0b0c0 100644
 --- a/drivers/devfreq/devfreq.c
@@ -37640,6 +38117,22 @@ index b70709b..1d8d02a 100644
  	.notifier_call	= sh_dmae_nmi_handler,
  
  	/* Run before NMI debug handler and KGDB */
+diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
+index 211021d..201d47f 100644
+--- a/drivers/edac/edac_device.c
++++ b/drivers/edac/edac_device.c
+@@ -474,9 +474,9 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
+  */
+ int edac_device_alloc_index(void)
+ {
+-	static atomic_t device_indexes = ATOMIC_INIT(0);
++	static atomic_unchecked_t device_indexes = ATOMIC_INIT(0);
+ 
+-	return atomic_inc_return(&device_indexes) - 1;
++	return atomic_inc_return_unchecked(&device_indexes) - 1;
+ }
+ EXPORT_SYMBOL_GPL(edac_device_alloc_index);
+ 
 diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
 index c4d700a..0b57abd 100644
 --- a/drivers/edac/edac_mc_sysfs.c
@@ -37674,6 +38167,28 @@ index c4d700a..0b57abd 100644
  		err = device_create_file(&mci->dev,
  					 &dev_attr_sdram_scrub_rate);
  		if (err) {
+diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
+index dd370f9..0281629 100644
+--- a/drivers/edac/edac_pci.c
++++ b/drivers/edac/edac_pci.c
+@@ -29,7 +29,7 @@
+ 
+ static DEFINE_MUTEX(edac_pci_ctls_mutex);
+ static LIST_HEAD(edac_pci_list);
+-static atomic_t pci_indexes = ATOMIC_INIT(0);
++static atomic_unchecked_t pci_indexes = ATOMIC_INIT(0);
+ 
+ /*
+  * edac_pci_alloc_ctl_info
+@@ -315,7 +315,7 @@ EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
+  */
+ int edac_pci_alloc_index(void)
+ {
+-	return atomic_inc_return(&pci_indexes) - 1;
++	return atomic_inc_return_unchecked(&pci_indexes) - 1;
+ }
+ EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
+ 
 diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
 index e8658e4..22746d6 100644
 --- a/drivers/edac/edac_pci_sysfs.c
@@ -37784,9 +38299,21 @@ index 51b7e3a..aa8a3e8 100644
  void amd_report_gart_errors(bool);
  void amd_register_ecc_decoder(void (*f)(int, struct mce *));
 diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
-index 57ea7f4..789e3c3 100644
+index 57ea7f4..af06b76 100644
 --- a/drivers/firewire/core-card.c
 +++ b/drivers/firewire/core-card.c
+@@ -528,9 +528,9 @@ void fw_card_initialize(struct fw_card *card,
+ 			const struct fw_card_driver *driver,
+ 			struct device *device)
+ {
+-	static atomic_t index = ATOMIC_INIT(-1);
++	static atomic_unchecked_t index = ATOMIC_INIT(-1);
+ 
+-	card->index = atomic_inc_return(&index);
++	card->index = atomic_inc_return_unchecked(&index);
+ 	card->driver = driver;
+ 	card->device = device;
+ 	card->current_tlabel = 0;
 @@ -680,7 +680,7 @@ EXPORT_SYMBOL_GPL(fw_card_release);
  
  void fw_core_remove_card(struct fw_card *card)
@@ -39996,6 +40523,91 @@ index ae49237..380d4c9 100644
  
  	__asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
  			      "=a"(hv_status_lo) : "d" (control_hi),
+diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
+index deb5c25..ed2d4fd 100644
+--- a/drivers/hv/hv_balloon.c
++++ b/drivers/hv/hv_balloon.c
+@@ -464,7 +464,7 @@ MODULE_PARM_DESC(hot_add, "If set attempt memory hot_add");
+ 
+ module_param(pressure_report_delay, uint, (S_IRUGO | S_IWUSR));
+ MODULE_PARM_DESC(pressure_report_delay, "Delay in secs in reporting pressure");
+-static atomic_t trans_id = ATOMIC_INIT(0);
++static atomic_unchecked_t trans_id = ATOMIC_INIT(0);
+ 
+ static int dm_ring_size = (5 * PAGE_SIZE);
+ 
+@@ -825,7 +825,7 @@ static void hot_add_req(struct work_struct *dummy)
+ 	memset(&resp, 0, sizeof(struct dm_hot_add_response));
+ 	resp.hdr.type = DM_MEM_HOT_ADD_RESPONSE;
+ 	resp.hdr.size = sizeof(struct dm_hot_add_response);
+-	resp.hdr.trans_id = atomic_inc_return(&trans_id);
++	resp.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 
+ #ifdef CONFIG_MEMORY_HOTPLUG
+ 	pg_start = dm->ha_wrk.ha_page_range.finfo.start_page;
+@@ -960,7 +960,7 @@ static void post_status(struct hv_dynmem_device *dm)
+ 	memset(&status, 0, sizeof(struct dm_status));
+ 	status.hdr.type = DM_STATUS_REPORT;
+ 	status.hdr.size = sizeof(struct dm_status);
+-	status.hdr.trans_id = atomic_inc_return(&trans_id);
++	status.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 
+ 	/*
+ 	 * The host expects the guest to report free memory.
+@@ -980,7 +980,7 @@ static void post_status(struct hv_dynmem_device *dm)
+ 	 * send the status. This can happen if we were interrupted
+ 	 * after we picked our transaction ID.
+ 	 */
+-	if (status.hdr.trans_id != atomic_read(&trans_id))
++	if (status.hdr.trans_id != atomic_read_unchecked(&trans_id))
+ 		return;
+ 
+ 	vmbus_sendpacket(dm->dev->channel, &status,
+@@ -1081,7 +1081,7 @@ static void balloon_up(struct work_struct *dummy)
+ 		bl_resp = (struct dm_balloon_response *)send_buffer;
+ 		memset(send_buffer, 0, PAGE_SIZE);
+ 		bl_resp->hdr.type = DM_BALLOON_RESPONSE;
+-		bl_resp->hdr.trans_id = atomic_inc_return(&trans_id);
++		bl_resp->hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 		bl_resp->hdr.size = sizeof(struct dm_balloon_response);
+ 		bl_resp->more_pages = 1;
+ 
+@@ -1152,7 +1152,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
+ 
+ 	memset(&resp, 0, sizeof(struct dm_unballoon_response));
+ 	resp.hdr.type = DM_UNBALLOON_RESPONSE;
+-	resp.hdr.trans_id = atomic_inc_return(&trans_id);
++	resp.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 	resp.hdr.size = sizeof(struct dm_unballoon_response);
+ 
+ 	vmbus_sendpacket(dm_device.dev->channel, &resp,
+@@ -1215,7 +1215,7 @@ static void version_resp(struct hv_dynmem_device *dm,
+ 	memset(&version_req, 0, sizeof(struct dm_version_request));
+ 	version_req.hdr.type = DM_VERSION_REQUEST;
+ 	version_req.hdr.size = sizeof(struct dm_version_request);
+-	version_req.hdr.trans_id = atomic_inc_return(&trans_id);
++	version_req.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 	version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN7;
+ 	version_req.is_last_attempt = 1;
+ 
+@@ -1385,7 +1385,7 @@ static int balloon_probe(struct hv_device *dev,
+ 	memset(&version_req, 0, sizeof(struct dm_version_request));
+ 	version_req.hdr.type = DM_VERSION_REQUEST;
+ 	version_req.hdr.size = sizeof(struct dm_version_request);
+-	version_req.hdr.trans_id = atomic_inc_return(&trans_id);
++	version_req.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 	version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN8;
+ 	version_req.is_last_attempt = 0;
+ 
+@@ -1416,7 +1416,7 @@ static int balloon_probe(struct hv_device *dev,
+ 	memset(&cap_msg, 0, sizeof(struct dm_capabilities));
+ 	cap_msg.hdr.type = DM_CAPABILITIES_REPORT;
+ 	cap_msg.hdr.size = sizeof(struct dm_capabilities);
+-	cap_msg.hdr.trans_id = atomic_inc_return(&trans_id);
++	cap_msg.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
+ 
+ 	cap_msg.caps.cap_bits.balloon = 1;
+ 	cap_msg.caps.cap_bits.hot_add = 1;
 diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
 index 12f2f9e..679603c 100644
 --- a/drivers/hv/hyperv_vmbus.h
@@ -40597,6 +41209,32 @@ index 1f95bba..9530f87 100644
  			(u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
  				      sdata, wqe->wr.wr.atomic.swap);
  		goto send_comp;
+diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
+index 4d599ce..697b17f 100644
+--- a/drivers/infiniband/hw/mlx4/mad.c
++++ b/drivers/infiniband/hw/mlx4/mad.c
+@@ -98,7 +98,7 @@ __be64 mlx4_ib_gen_node_guid(void)
+ 
+ __be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx)
+ {
+-	return cpu_to_be64(atomic_inc_return(&ctx->tid)) |
++	return cpu_to_be64(atomic_inc_return_unchecked(&ctx->tid)) |
+ 		cpu_to_be64(0xff00000000000000LL);
+ }
+ 
+diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
+index f61ec26..ebf72cf 100644
+--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
++++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
+@@ -398,7 +398,7 @@ struct mlx4_ib_demux_ctx {
+ 	struct list_head	mcg_mgid0_list;
+ 	struct workqueue_struct	*mcg_wq;
+ 	struct mlx4_ib_demux_pv_ctx **tun;
+-	atomic_t tid;
++	atomic_unchecked_t tid;
+ 	int    flushing; /* flushing the work queue */
+ };
+ 
 diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
 index 9d3e5c1..d9afe4a 100644
 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -41125,6 +41763,28 @@ index fa061d4..4a6957c 100644
  
  	snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
  	led->xpad = xpad;
+diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
+index e204f26..8459f15 100644
+--- a/drivers/input/misc/ims-pcu.c
++++ b/drivers/input/misc/ims-pcu.c
+@@ -1621,7 +1621,7 @@ static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id)
+ 
+ static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
+ {
+-	static atomic_t device_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t device_no = ATOMIC_INIT(0);
+ 
+ 	const struct ims_pcu_device_info *info;
+ 	u8 device_id;
+@@ -1653,7 +1653,7 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
+ 	}
+ 
+ 	/* Device appears to be operable, complete initialization */
+-	pcu->device_no = atomic_inc_return(&device_no) - 1;
++	pcu->device_no = atomic_inc_return_unchecked(&device_no) - 1;
+ 
+ 	error = ims_pcu_setup_backlight(pcu);
+ 	if (error)
 diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
 index 2f0b39d..7370f13 100644
 --- a/drivers/input/mouse/psmouse.h
@@ -41173,6 +41833,28 @@ index 25fc597..558bf3b3 100644
  	serio->dev.bus = &serio_bus;
  	serio->dev.release = serio_release_port;
  	serio->dev.groups = serio_device_attr_groups;
+diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
+index 59df2e7..8f1cafb 100644
+--- a/drivers/input/serio/serio_raw.c
++++ b/drivers/input/serio/serio_raw.c
+@@ -293,7 +293,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
+ 
+ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
+ {
+-	static atomic_t serio_raw_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t serio_raw_no = ATOMIC_INIT(0);
+ 	struct serio_raw *serio_raw;
+ 	int err;
+ 
+@@ -304,7 +304,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
+ 	}
+ 
+ 	snprintf(serio_raw->name, sizeof(serio_raw->name),
+-		 "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1);
++		 "serio_raw%ld", (long)atomic_inc_return_unchecked(&serio_raw_no) - 1);
+ 	kref_init(&serio_raw->kref);
+ 	INIT_LIST_HEAD(&serio_raw->client_list);
+ 	init_waitqueue_head(&serio_raw->wait);
 diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
 index d8f98b1..f62a640 100644
 --- a/drivers/iommu/iommu.c
@@ -42190,6 +42872,19 @@ index c7a9be1..683f6f8 100644
  
  module_param_array(video_nr, int, NULL, 0444);
  module_param_array(vbi_nr,   int, NULL, 0444);
+diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
+index 07b8460..e6d7265 100644
+--- a/drivers/media/pci/ivtv/ivtv-driver.c
++++ b/drivers/media/pci/ivtv/ivtv-driver.c
+@@ -84,7 +84,7 @@ static struct pci_device_id ivtv_pci_tbl[] = {
+ MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
+ 
+ /* ivtv instance counter */
+-static atomic_t ivtv_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t ivtv_instance = ATOMIC_INIT(0);
+ 
+ /* Parameter declarations */
+ static int cardtype[IVTV_MAX_CARDS];
 diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
 index d338b19..aae4f9e 100644
 --- a/drivers/media/platform/omap/omap_vout.c
@@ -42400,6 +43095,80 @@ index 545c04c..a14bded 100644
  		i = -EFAULT;
  unlock:
  	mutex_unlock(&dev->lock);
+diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
+index bd4d3a7..ffc0b9d 100644
+--- a/drivers/media/radio/radio-maxiradio.c
++++ b/drivers/media/radio/radio-maxiradio.c
+@@ -61,7 +61,7 @@ MODULE_PARM_DESC(radio_nr, "Radio device number");
+ /* TEA5757 pin mappings */
+ static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16;
+ 
+-static atomic_t maxiradio_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t maxiradio_instance = ATOMIC_INIT(0);
+ 
+ #define PCI_VENDOR_ID_GUILLEMOT 0x5046
+ #define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001
+diff --git a/drivers/media/radio/radio-shark.c b/drivers/media/radio/radio-shark.c
+index 8fa18ab..caee70f 100644
+--- a/drivers/media/radio/radio-shark.c
++++ b/drivers/media/radio/radio-shark.c
+@@ -79,7 +79,7 @@ struct shark_device {
+ 	u32 last_val;
+ };
+ 
+-static atomic_t shark_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t shark_instance = ATOMIC_INIT(0);
+ 
+ static void shark_write_val(struct snd_tea575x *tea, u32 val)
+ {
+diff --git a/drivers/media/radio/radio-shark2.c b/drivers/media/radio/radio-shark2.c
+index 9fb6697..f167415 100644
+--- a/drivers/media/radio/radio-shark2.c
++++ b/drivers/media/radio/radio-shark2.c
+@@ -74,7 +74,7 @@ struct shark_device {
+ 	u8 *transfer_buffer;
+ };
+ 
+-static atomic_t shark_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t shark_instance = ATOMIC_INIT(0);
+ 
+ static int shark_write_reg(struct radio_tea5777 *tea, u64 reg)
+ {
+diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c
+index 9dc8baf..796d52f 100644
+--- a/drivers/media/radio/radio-si476x.c
++++ b/drivers/media/radio/radio-si476x.c
+@@ -1456,7 +1456,7 @@ static int si476x_radio_probe(struct platform_device *pdev)
+ 	struct si476x_radio *radio;
+ 	struct v4l2_ctrl *ctrl;
+ 
+-	static atomic_t instance = ATOMIC_INIT(0);
++	static atomic_unchecked_t instance = ATOMIC_INIT(0);
+ 
+ 	radio = devm_kzalloc(&pdev->dev, sizeof(*radio), GFP_KERNEL);
+ 	if (!radio)
+diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
+index 1cf382a..c22998c 100644
+--- a/drivers/media/rc/rc-main.c
++++ b/drivers/media/rc/rc-main.c
+@@ -1030,7 +1030,7 @@ EXPORT_SYMBOL_GPL(rc_free_device);
+ int rc_register_device(struct rc_dev *dev)
+ {
+ 	static bool raw_init = false; /* raw decoders loaded? */
+-	static atomic_t devno = ATOMIC_INIT(0);
++	static atomic_unchecked_t devno = ATOMIC_INIT(0);
+ 	struct rc_map *rc_map;
+ 	const char *path;
+ 	int rc;
+@@ -1061,7 +1061,7 @@ int rc_register_device(struct rc_dev *dev)
+ 	 */
+ 	mutex_lock(&dev->lock);
+ 
+-	dev->devno = (unsigned long)(atomic_inc_return(&devno) - 1);
++	dev->devno = (unsigned long)(atomic_inc_return_unchecked(&devno) - 1);
+ 	dev_set_name(&dev->dev, "rc%ld", dev->devno);
+ 	dev_set_drvdata(&dev->dev, dev);
+ 	rc = device_add(&dev->dev);
 diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
 index 3940bb0..fb3952a 100644
 --- a/drivers/media/usb/dvb-usb/cxusb.c
@@ -42457,6 +43226,22 @@ index f129551..ecf6514 100644
  			return -EFAULT;
  	return 0;
  }
+diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c
+index 8ed5da2..47fee46 100644
+--- a/drivers/media/v4l2-core/v4l2-device.c
++++ b/drivers/media/v4l2-core/v4l2-device.c
+@@ -74,9 +74,9 @@ int v4l2_device_put(struct v4l2_device *v4l2_dev)
+ EXPORT_SYMBOL_GPL(v4l2_device_put);
+ 
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+-						atomic_t *instance)
++						atomic_unchecked_t *instance)
+ {
+-	int num = atomic_inc_return(instance) - 1;
++	int num = atomic_inc_return_unchecked(instance) - 1;
+ 	int len = strlen(basename);
+ 
+ 	if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
 index 7658586..1079260 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -43992,6 +44777,28 @@ index cba1d46..f703766 100644
  				result =
  				    hso_start_serial_device(serial_table[i], GFP_NOIO);
  				hso_kick_transmit(dev2ser(serial_table[i]));
+diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
+index a79e9d3..78cd4fa 100644
+--- a/drivers/net/usb/sierra_net.c
++++ b/drivers/net/usb/sierra_net.c
+@@ -52,7 +52,7 @@ static const char driver_name[] = "sierra_net";
+ /* atomic counter partially included in MAC address to make sure 2 devices
+  * do not end up with the same MAC - concept breaks in case of > 255 ifaces
+  */
+-static	atomic_t iface_counter = ATOMIC_INIT(0);
++static	atomic_unchecked_t iface_counter = ATOMIC_INIT(0);
+ 
+ /*
+  * SYNC Timer Delay definition used to set the expiry time
+@@ -698,7 +698,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
+ 	dev->net->netdev_ops = &sierra_net_device_ops;
+ 
+ 	/* change MAC addr to include, ifacenum, and to be unique */
+-	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
++	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return_unchecked(&iface_counter);
+ 	dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
+ 
+ 	/* we will have to manufacture ethernet headers, prepare template */
 diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
 index 57325f3..36b181f 100644
 --- a/drivers/net/vxlan.c
@@ -44914,15 +45721,22 @@ index 7d72c5e..edce02c 100644
  	int retval = -ENOMEM;
  
 diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
-index 5127f3f..cc115f7 100644
+index 5127f3f..b225573 100644
 --- a/drivers/pci/hotplug/pciehp_hpc.c
 +++ b/drivers/pci/hotplug/pciehp_hpc.c
-@@ -780,7 +780,7 @@ static int pcie_init_slot(struct controller *ctrl)
+@@ -773,14 +773,12 @@ static void pcie_shutdown_notification(struct controller *ctrl)
+ static int pcie_init_slot(struct controller *ctrl)
+ {
+ 	struct slot *slot;
+-	char name[32];
+ 
+ 	slot = kzalloc(sizeof(*slot), GFP_KERNEL);
+ 	if (!slot)
  		return -ENOMEM;
  
- 	snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
+-	snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
 -	slot->wq = alloc_workqueue(name, 0, 0);
-+	slot->wq = alloc_workqueue("%s", 0, 0, name);
++	slot->wq = alloc_workqueue("pciehp-%u", 0, 0, PSN(ctrl));
  	if (!slot->wq)
  		goto abort;
  
@@ -45392,6 +46206,28 @@ index 29178f7..c65f324 100644
  	for (i = 0; i < ARRAY_SIZE(power_supply_attrs); i++)
  		__power_supply_attrs[i] = &power_supply_attrs[i].attr;
  }
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index 815d6df..811633a 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -3529,7 +3529,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
+ {
+ 	const struct regulation_constraints *constraints = NULL;
+ 	const struct regulator_init_data *init_data;
+-	static atomic_t regulator_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t regulator_no = ATOMIC_INIT(0);
+ 	struct regulator_dev *rdev;
+ 	struct device *dev;
+ 	int ret, i;
+@@ -3599,7 +3599,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
+ 	rdev->dev.of_node = config->of_node;
+ 	rdev->dev.parent = dev;
+ 	dev_set_name(&rdev->dev, "regulator.%d",
+-		     atomic_inc_return(&regulator_no) - 1);
++		     atomic_inc_return_unchecked(&regulator_no) - 1);
+ 	ret = device_register(&rdev->dev);
+ 	if (ret != 0) {
+ 		put_device(&rdev->dev);
 diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
 index d428ef9..fdc0357 100644
 --- a/drivers/regulator/max8660.c
@@ -45546,6 +46382,50 @@ index 23a90e7..9cf04ee 100644
  
  /*
   * Queue element to wait for room in request queue. FIFO order is
+diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
+index 8c05ae01..b2cf224 100644
+--- a/drivers/scsi/fcoe/fcoe_sysfs.c
++++ b/drivers/scsi/fcoe/fcoe_sysfs.c
+@@ -33,8 +33,8 @@
+  */
+ #include "libfcoe.h"
+ 
+-static atomic_t ctlr_num;
+-static atomic_t fcf_num;
++static atomic_unchecked_t ctlr_num;
++static atomic_unchecked_t fcf_num;
+ 
+ /*
+  * fcoe_fcf_dev_loss_tmo: the default number of seconds that fcoe sysfs
+@@ -681,7 +681,7 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
+ 	if (!ctlr)
+ 		goto out;
+ 
+-	ctlr->id = atomic_inc_return(&ctlr_num) - 1;
++	ctlr->id = atomic_inc_return_unchecked(&ctlr_num) - 1;
+ 	ctlr->f = f;
+ 	ctlr->mode = FIP_CONN_TYPE_FABRIC;
+ 	INIT_LIST_HEAD(&ctlr->fcfs);
+@@ -898,7 +898,7 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *ctlr,
+ 	fcf->dev.parent = &ctlr->dev;
+ 	fcf->dev.bus = &fcoe_bus_type;
+ 	fcf->dev.type = &fcoe_fcf_device_type;
+-	fcf->id = atomic_inc_return(&fcf_num) - 1;
++	fcf->id = atomic_inc_return_unchecked(&fcf_num) - 1;
+ 	fcf->state = FCOE_FCF_STATE_UNKNOWN;
+ 
+ 	fcf->dev_loss_tmo = ctlr->fcf_dev_loss_tmo;
+@@ -934,8 +934,8 @@ int __init fcoe_sysfs_setup(void)
+ {
+ 	int error;
+ 
+-	atomic_set(&ctlr_num, 0);
+-	atomic_set(&fcf_num, 0);
++	atomic_set_unchecked(&ctlr_num, 0);
++	atomic_set_unchecked(&fcf_num, 0);
+ 
+ 	error = bus_register(&fcoe_bus_type);
+ 	if (error)
 diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
 index df0c3c7..b00e1d0 100644
 --- a/drivers/scsi/hosts.c
@@ -46470,6 +47350,37 @@ index 32b7bb1..2f1c4bd 100644
  
  static u8	*buf;
  
+diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c
+index ec9e2ae..cd15d67 100644
+--- a/drivers/staging/android/timed_output.c
++++ b/drivers/staging/android/timed_output.c
+@@ -25,7 +25,7 @@
+ #include "timed_output.h"
+ 
+ static struct class *timed_output_class;
+-static atomic_t device_count;
++static atomic_unchecked_t device_count;
+ 
+ static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
+ 		char *buf)
+@@ -59,7 +59,7 @@ static int create_timed_output_class(void)
+ 		timed_output_class = class_create(THIS_MODULE, "timed_output");
+ 		if (IS_ERR(timed_output_class))
+ 			return PTR_ERR(timed_output_class);
+-		atomic_set(&device_count, 0);
++		atomic_set_unchecked(&device_count, 0);
+ 	}
+ 
+ 	return 0;
+@@ -76,7 +76,7 @@ int timed_output_dev_register(struct timed_output_dev *tdev)
+ 	if (ret < 0)
+ 		return ret;
+ 
+-	tdev->index = atomic_inc_return(&device_count);
++	tdev->index = atomic_inc_return_unchecked(&device_count);
+ 	tdev->dev = device_create(timed_output_class, NULL,
+ 		MKDEV(0, tdev->index), NULL, tdev->name);
+ 	if (IS_ERR(tdev->dev))
 diff --git a/drivers/staging/media/solo6x10/solo6x10-core.c b/drivers/staging/media/solo6x10/solo6x10-core.c
 index 3675020..e80d92c 100644
 --- a/drivers/staging/media/solo6x10/solo6x10-core.c
@@ -46483,6 +47394,32 @@ index 3675020..e80d92c 100644
  	struct device *dev = &solo_dev->dev;
  	const char *driver;
  	int i;
+diff --git a/drivers/staging/media/solo6x10/solo6x10-p2m.c b/drivers/staging/media/solo6x10/solo6x10-p2m.c
+index 3335941..2b26186 100644
+--- a/drivers/staging/media/solo6x10/solo6x10-p2m.c
++++ b/drivers/staging/media/solo6x10/solo6x10-p2m.c
+@@ -77,7 +77,7 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev,
+ 
+ 	/* Get next ID. According to Softlogic, 6110 has problems on !=0 P2M */
+ 	if (solo_dev->type != SOLO_DEV_6110 && multi_p2m) {
+-		p2m_id = atomic_inc_return(&solo_dev->p2m_count) % SOLO_NR_P2M;
++		p2m_id = atomic_inc_return_unchecked(&solo_dev->p2m_count) % SOLO_NR_P2M;
+ 		if (p2m_id < 0)
+ 			p2m_id = -p2m_id;
+ 	}
+diff --git a/drivers/staging/media/solo6x10/solo6x10.h b/drivers/staging/media/solo6x10/solo6x10.h
+index 6f91d2e..3f011d2 100644
+--- a/drivers/staging/media/solo6x10/solo6x10.h
++++ b/drivers/staging/media/solo6x10/solo6x10.h
+@@ -238,7 +238,7 @@ struct solo_dev {
+ 
+ 	/* P2M DMA Engine */
+ 	struct solo_p2m_dev	p2m_dev[SOLO_NR_P2M];
+-	atomic_t		p2m_count;
++	atomic_unchecked_t	p2m_count;
+ 	int			p2m_jiffies;
+ 	unsigned int		p2m_timeouts;
+ 
 diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
 index 34afc16..ffe44dd 100644
 --- a/drivers/staging/octeon/ethernet-rx.c
@@ -46700,6 +47637,28 @@ index d128ce2..fc1f9a1 100644
  extern void tmem_register_hostops(struct tmem_hostops *m);
  
  /* core tmem accessor functions */
+diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
+index d3536f5..a0c2ce9 100644
+--- a/drivers/target/sbp/sbp_target.c
++++ b/drivers/target/sbp/sbp_target.c
+@@ -62,7 +62,7 @@ static const u32 sbp_unit_directory_template[] = {
+ 
+ #define SESSION_MAINTENANCE_INTERVAL HZ
+ 
+-static atomic_t login_id = ATOMIC_INIT(0);
++static atomic_unchecked_t login_id = ATOMIC_INIT(0);
+ 
+ static void session_maintenance_work(struct work_struct *);
+ static int sbp_run_transaction(struct fw_card *, int, int, int, int,
+@@ -444,7 +444,7 @@ static void sbp_management_request_login(
+ 	login->lun = se_lun;
+ 	login->status_fifo_addr = sbp2_pointer_to_addr(&req->orb.status_fifo);
+ 	login->exclusive = LOGIN_ORB_EXCLUSIVE(be32_to_cpu(req->orb.misc));
+-	login->login_id = atomic_inc_return(&login_id);
++	login->login_id = atomic_inc_return_unchecked(&login_id);
+ 
+ 	login->tgt_agt = sbp_target_agent_register(login);
+ 	if (IS_ERR(login->tgt_agt)) {
 diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
 index 4630481..c26782a 100644
 --- a/drivers/target/target_core_device.c
@@ -46907,6 +47866,95 @@ index 81e939e..95ead10 100644
  		return 0;
  
  	return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
+diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
+index 4190199..48f2920 100644
+--- a/drivers/tty/hvc/hvsi.c
++++ b/drivers/tty/hvc/hvsi.c
+@@ -85,7 +85,7 @@ struct hvsi_struct {
+ 	int n_outbuf;
+ 	uint32_t vtermno;
+ 	uint32_t virq;
+-	atomic_t seqno; /* HVSI packet sequence number */
++	atomic_unchecked_t seqno; /* HVSI packet sequence number */
+ 	uint16_t mctrl;
+ 	uint8_t state;  /* HVSI protocol state */
+ 	uint8_t flags;
+@@ -295,7 +295,7 @@ static int hvsi_version_respond(struct hvsi_struct *hp, uint16_t query_seqno)
+ 
+ 	packet.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER;
+ 	packet.hdr.len = sizeof(struct hvsi_query_response);
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.verb = VSV_SEND_VERSION_NUMBER;
+ 	packet.u.version = HVSI_VERSION;
+ 	packet.query_seqno = query_seqno+1;
+@@ -555,7 +555,7 @@ static int hvsi_query(struct hvsi_struct *hp, uint16_t verb)
+ 
+ 	packet.hdr.type = VS_QUERY_PACKET_HEADER;
+ 	packet.hdr.len = sizeof(struct hvsi_query);
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.verb = verb;
+ 
+ 	pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len);
+@@ -597,7 +597,7 @@ static int hvsi_set_mctrl(struct hvsi_struct *hp, uint16_t mctrl)
+ 	int wrote;
+ 
+ 	packet.hdr.type = VS_CONTROL_PACKET_HEADER,
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = sizeof(struct hvsi_control);
+ 	packet.verb = VSV_SET_MODEM_CTL;
+ 	packet.mask = HVSI_TSDTR;
+@@ -680,7 +680,7 @@ static int hvsi_put_chars(struct hvsi_struct *hp, const char *buf, int count)
+ 	BUG_ON(count > HVSI_MAX_OUTGOING_DATA);
+ 
+ 	packet.hdr.type = VS_DATA_PACKET_HEADER;
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = count + sizeof(struct hvsi_header);
+ 	memcpy(&packet.data, buf, count);
+ 
+@@ -697,7 +697,7 @@ static void hvsi_close_protocol(struct hvsi_struct *hp)
+ 	struct hvsi_control packet __ALIGNED__;
+ 
+ 	packet.hdr.type = VS_CONTROL_PACKET_HEADER;
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = 6;
+ 	packet.verb = VSV_CLOSE_PROTOCOL;
+ 
+diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
+index 3396eb9..6d3d540 100644
+--- a/drivers/tty/hvc/hvsi_lib.c
++++ b/drivers/tty/hvc/hvsi_lib.c
+@@ -9,7 +9,7 @@
+ 
+ static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet)
+ {
+-	packet->seqno = atomic_inc_return(&pv->seqno);
++	packet->seqno = atomic_inc_return_unchecked(&pv->seqno);
+ 
+ 	/* Assumes that always succeeds, works in practice */
+ 	return pv->put_chars(pv->termno, (char *)packet, packet->len);
+@@ -21,7 +21,7 @@ static void hvsi_start_handshake(struct hvsi_priv *pv)
+ 
+ 	/* Reset state */
+ 	pv->established = 0;
+-	atomic_set(&pv->seqno, 0);
++	atomic_set_unchecked(&pv->seqno, 0);
+ 
+ 	pr_devel("HVSI@%x: Handshaking started\n", pv->termno);
+ 
+@@ -265,7 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv)
+ 	pv->mctrl_update = 0;
+ 	q.hdr.type = VS_QUERY_PACKET_HEADER;
+ 	q.hdr.len = sizeof(struct hvsi_query);
+-	q.hdr.seqno = atomic_inc_return(&pv->seqno);
++	q.hdr.seqno = atomic_inc_return_unchecked(&pv->seqno);
+ 	q.verb = VSV_SEND_MODEM_CTL_STATUS;
+ 	rc = hvsi_send_packet(pv, &q.hdr);
+ 	if (rc <= 0) {
 diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
 index 8fd72ff..34a0bed 100644
 --- a/drivers/tty/ipwireless/tty.c
@@ -47119,6 +48167,37 @@ index 354564e..fe50d9a 100644
  		atomic_dec(&rp_num_ports_open);
  	clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
  	spin_unlock_irqrestore(&info->port.lock, flags);
+diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
+index e2520ab..034e20b 100644
+--- a/drivers/tty/serial/ioc4_serial.c
++++ b/drivers/tty/serial/ioc4_serial.c
+@@ -437,7 +437,7 @@ struct ioc4_soft {
+ 		} is_intr_info[MAX_IOC4_INTR_ENTS];
+ 
+ 		/* Number of entries active in the above array */
+-		atomic_t is_num_intrs;
++		atomic_unchecked_t is_num_intrs;
+ 	} is_intr_type[IOC4_NUM_INTR_TYPES];
+ 
+ 	/* is_ir_lock must be held while
+@@ -974,7 +974,7 @@ intr_connect(struct ioc4_soft *soft, int type,
+ 	BUG_ON(!((type == IOC4_SIO_INTR_TYPE)
+ 	       || (type == IOC4_OTHER_INTR_TYPE)));
+ 
+-	i = atomic_inc_return(&soft-> is_intr_type[type].is_num_intrs) - 1;
++	i = atomic_inc_return_unchecked(&soft-> is_intr_type[type].is_num_intrs) - 1;
+ 	BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0)));
+ 
+ 	/* Save off the lower level interrupt handler */
+@@ -1001,7 +1001,7 @@ static irqreturn_t ioc4_intr(int irq, void *arg)
+ 
+ 	soft = arg;
+ 	for (intr_type = 0; intr_type < IOC4_NUM_INTR_TYPES; intr_type++) {
+-		num_intrs = (int)atomic_read(
++		num_intrs = (int)atomic_read_unchecked(
+ 				&soft->is_intr_type[intr_type].is_num_intrs);
+ 
+ 		this_mir = this_ir = pending_intrs(soft, intr_type);
 diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
 index 1002054..dd644a8 100644
 --- a/drivers/tty/serial/kgdboc.c
@@ -47225,6 +48304,28 @@ index 1002054..dd644a8 100644
  #ifdef CONFIG_KGDB_SERIAL_CONSOLE
  /* This is only available if kgdboc is a built in for early debugging */
  static int __init kgdboc_early_init(char *opt)
+diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
+index b11e997..6d25a3b 100644
+--- a/drivers/tty/serial/msm_serial.c
++++ b/drivers/tty/serial/msm_serial.c
+@@ -857,7 +857,7 @@ static struct uart_driver msm_uart_driver = {
+ 	.cons = MSM_CONSOLE,
+ };
+ 
+-static atomic_t msm_uart_next_id = ATOMIC_INIT(0);
++static atomic_unchecked_t msm_uart_next_id = ATOMIC_INIT(0);
+ 
+ static int __init msm_serial_probe(struct platform_device *pdev)
+ {
+@@ -867,7 +867,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
+ 	int irq;
+ 
+ 	if (pdev->id == -1)
+-		pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;
++		pdev->id = atomic_inc_return_unchecked(&msm_uart_next_id) - 1;
+ 
+ 	if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
+ 		return -ENXIO;
 diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
 index 0c8a9fa..234a95f 100644
 --- a/drivers/tty/serial/samsung.c
@@ -48334,6 +49435,28 @@ index b369292..9f3ba40 100644
  		gs_buf_free(&port->port_write_buf);
  	gs_free_requests(gser->out, &port->read_pool, NULL);
  	gs_free_requests(gser->out, &port->read_queue, NULL);
+diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
+index ba6a5d6..f88f7f3 100644
+--- a/drivers/usb/misc/appledisplay.c
++++ b/drivers/usb/misc/appledisplay.c
+@@ -83,7 +83,7 @@ struct appledisplay {
+ 	spinlock_t lock;
+ };
+ 
+-static atomic_t count_displays = ATOMIC_INIT(0);
++static atomic_unchecked_t count_displays = ATOMIC_INIT(0);
+ static struct workqueue_struct *wq;
+ 
+ static void appledisplay_complete(struct urb *urb)
+@@ -281,7 +281,7 @@ static int appledisplay_probe(struct usb_interface *iface,
+ 
+ 	/* Register backlight device */
+ 	snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
+-		atomic_inc_return(&count_displays) - 1);
++		atomic_inc_return_unchecked(&count_displays) - 1);
+ 	memset(&props, 0, sizeof(struct backlight_properties));
+ 	props.type = BACKLIGHT_RAW;
+ 	props.max_brightness = 0xff;
 diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
 index 5f3bcd3..bfca43f 100644
 --- a/drivers/usb/serial/console.c
@@ -48613,6 +49736,28 @@ index 098bfc6..796841d 100644
  			return -EINVAL;
  		if (!registered_fb[con2fb.framebuffer])
  			request_module("fb%d", con2fb.framebuffer);
+diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
+index d4d2c5f..ebbd113 100644
+--- a/drivers/video/hyperv_fb.c
++++ b/drivers/video/hyperv_fb.c
+@@ -233,7 +233,7 @@ static uint screen_fb_size;
+ static inline int synthvid_send(struct hv_device *hdev,
+ 				struct synthvid_msg *msg)
+ {
+-	static atomic64_t request_id = ATOMIC64_INIT(0);
++	static atomic64_unchecked_t request_id = ATOMIC64_INIT(0);
+ 	int ret;
+ 
+ 	msg->pipe_hdr.type = PIPE_MSG_DATA;
+@@ -241,7 +241,7 @@ static inline int synthvid_send(struct hv_device *hdev,
+ 
+ 	ret = vmbus_sendpacket(hdev->channel, msg,
+ 			       msg->vid_hdr.size + sizeof(struct pipe_msg_hdr),
+-			       atomic64_inc_return(&request_id),
++			       atomic64_inc_return_unchecked(&request_id),
+ 			       VM_PKT_DATA_INBAND, 0);
+ 
+ 	if (ret)
 diff --git a/drivers/video/i810/i810_accel.c b/drivers/video/i810/i810_accel.c
 index 7672d2e..b56437f 100644
 --- a/drivers/video/i810/i810_accel.c
@@ -51880,6 +53025,28 @@ index 370b24c..ff0be7b 100644
  	---help---
  	  A.out (Assembler.OUTput) is a set of formats for libraries and
  	  executables used in the earliest versions of UNIX.  Linux used
+diff --git a/fs/afs/inode.c b/fs/afs/inode.c
+index 789bc25..fafaeea 100644
+--- a/fs/afs/inode.c
++++ b/fs/afs/inode.c
+@@ -141,7 +141,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
+ 	struct afs_vnode *vnode;
+ 	struct super_block *sb;
+ 	struct inode *inode;
+-	static atomic_t afs_autocell_ino;
++	static atomic_unchecked_t afs_autocell_ino;
+ 
+ 	_enter("{%x:%u},%*.*s,",
+ 	       AFS_FS_I(dir)->fid.vid, AFS_FS_I(dir)->fid.vnode,
+@@ -154,7 +154,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
+ 	data.fid.unique = 0;
+ 	data.fid.vnode = 0;
+ 
+-	inode = iget5_locked(sb, atomic_inc_return(&afs_autocell_ino),
++	inode = iget5_locked(sb, atomic_inc_return_unchecked(&afs_autocell_ino),
+ 			     afs_iget5_autocell_test, afs_iget5_set,
+ 			     &data);
+ 	if (!inode) {
 diff --git a/fs/aio.c b/fs/aio.c
 index 2bbcacf..8614116 100644
 --- a/fs/aio.c
@@ -53153,6 +54320,59 @@ index 7fb054b..ad36c67 100644
  			parent_start = 0;
  
  		WARN_ON(trans->transid != btrfs_header_generation(parent));
+diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
+index f26f38c..3d0f149 100644
+--- a/fs/btrfs/delayed-inode.c
++++ b/fs/btrfs/delayed-inode.c
+@@ -458,7 +458,7 @@ static int __btrfs_add_delayed_deletion_item(struct btrfs_delayed_node *node,
+ 
+ static void finish_one_item(struct btrfs_delayed_root *delayed_root)
+ {
+-	int seq = atomic_inc_return(&delayed_root->items_seq);
++	int seq = atomic_inc_return_unchecked(&delayed_root->items_seq);
+ 	if ((atomic_dec_return(&delayed_root->items) <
+ 	    BTRFS_DELAYED_BACKGROUND || seq % BTRFS_DELAYED_BATCH == 0) &&
+ 	    waitqueue_active(&delayed_root->wait))
+@@ -1391,7 +1391,7 @@ void btrfs_assert_delayed_root_empty(struct btrfs_root *root)
+ static int refs_newer(struct btrfs_delayed_root *delayed_root,
+ 		      int seq, int count)
+ {
+-	int val = atomic_read(&delayed_root->items_seq);
++	int val = atomic_read_unchecked(&delayed_root->items_seq);
+ 
+ 	if (val < seq || val >= seq + count)
+ 		return 1;
+@@ -1408,7 +1408,7 @@ void btrfs_balance_delayed_items(struct btrfs_root *root)
+ 	if (atomic_read(&delayed_root->items) < BTRFS_DELAYED_BACKGROUND)
+ 		return;
+ 
+-	seq = atomic_read(&delayed_root->items_seq);
++	seq = atomic_read_unchecked(&delayed_root->items_seq);
+ 
+ 	if (atomic_read(&delayed_root->items) >= BTRFS_DELAYED_WRITEBACK) {
+ 		int ret;
+diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
+index 1d5c5f7..0ba0afc 100644
+--- a/fs/btrfs/delayed-inode.h
++++ b/fs/btrfs/delayed-inode.h
+@@ -43,7 +43,7 @@ struct btrfs_delayed_root {
+ 	 */
+ 	struct list_head prepare_list;
+ 	atomic_t items;		/* for delayed items */
+-	atomic_t items_seq;	/* for delayed items */
++	atomic_unchecked_t items_seq;	/* for delayed items */
+ 	int nodes;		/* for delayed nodes */
+ 	wait_queue_head_t wait;
+ };
+@@ -87,7 +87,7 @@ static inline void btrfs_init_delayed_root(
+ 				struct btrfs_delayed_root *delayed_root)
+ {
+ 	atomic_set(&delayed_root->items, 0);
+-	atomic_set(&delayed_root->items_seq, 0);
++	atomic_set_unchecked(&delayed_root->items_seq, 0);
+ 	delayed_root->nodes = 0;
+ 	spin_lock_init(&delayed_root->lock);
+ 	init_waitqueue_head(&delayed_root->wait);
 diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
 index 0f81d67..0ad55fe 100644
 --- a/fs/btrfs/ioctl.c
@@ -55499,9 +56719,18 @@ index d8ac61d..79a36f0 100644
  	.seq		= SEQCNT_ZERO,
  	.umask		= 0022,
 diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
-index e2cba1f..17a25bb 100644
+index e2cba1f..20319c5 100644
 --- a/fs/fscache/cookie.c
 +++ b/fs/fscache/cookie.c
+@@ -19,7 +19,7 @@
+ 
+ struct kmem_cache *fscache_cookie_jar;
+ 
+-static atomic_t fscache_object_debug_id = ATOMIC_INIT(0);
++static atomic_unchecked_t fscache_object_debug_id = ATOMIC_INIT(0);
+ 
+ static int fscache_acquire_non_index_cookie(struct fscache_cookie *cookie);
+ static int fscache_alloc_object(struct fscache_cache *cache,
 @@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire_cookie(
  	       parent ? (char *) parent->def->name : "<no-parent>",
  	       def->name, netfs_data);
@@ -55567,7 +56796,7 @@ index e2cba1f..17a25bb 100644
  		_leave(" = -ENOMEDIUM [no cache]");
  		return -ENOMEDIUM;
  	}
-@@ -255,12 +255,12 @@ static int fscache_alloc_object(struct fscache_cache *cache,
+@@ -255,14 +255,14 @@ static int fscache_alloc_object(struct fscache_cache *cache,
  	object = cache->ops->alloc_object(cache, cookie);
  	fscache_stat_d(&fscache_n_cop_alloc_object);
  	if (IS_ERR(object)) {
@@ -55580,8 +56809,11 @@ index e2cba1f..17a25bb 100644
 -	fscache_stat(&fscache_n_object_alloc);
 +	fscache_stat_unchecked(&fscache_n_object_alloc);
  
- 	object->debug_id = atomic_inc_return(&fscache_object_debug_id);
+-	object->debug_id = atomic_inc_return(&fscache_object_debug_id);
++	object->debug_id = atomic_inc_return_unchecked(&fscache_object_debug_id);
  
+ 	_debug("ALLOC OBJ%x: %s {%lx}",
+ 	       object->debug_id, cookie->def->name, object->events);
 @@ -376,7 +376,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie)
  
  	_enter("{%s}", cookie->def->name);
@@ -57704,7 +58936,7 @@ index 9ed9361..2b72db1 100644
  out:
  	return len;
 diff --git a/fs/namespace.c b/fs/namespace.c
-index a45ba4f..e7dc489 100644
+index a45ba4f..44cfe66 100644
 --- a/fs/namespace.c
 +++ b/fs/namespace.c
 @@ -1265,6 +1265,9 @@ static int do_umount(struct mount *mnt, int flags)
@@ -57772,6 +59004,24 @@ index a45ba4f..e7dc489 100644
  	return retval;
  }
  
+@@ -2344,7 +2363,7 @@ static void free_mnt_ns(struct mnt_namespace *ns)
+  * number incrementing at 10Ghz will take 12,427 years to wrap which
+  * is effectively never, so we can ignore the possibility.
+  */
+-static atomic64_t mnt_ns_seq = ATOMIC64_INIT(1);
++static atomic64_unchecked_t mnt_ns_seq = ATOMIC64_INIT(1);
+ 
+ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
+ {
+@@ -2359,7 +2378,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
+ 		kfree(new_ns);
+ 		return ERR_PTR(ret);
+ 	}
+-	new_ns->seq = atomic64_add_return(1, &mnt_ns_seq);
++	new_ns->seq = atomic64_inc_return_unchecked(&mnt_ns_seq);
+ 	atomic_set(&new_ns->count, 1);
+ 	new_ns->root = NULL;
+ 	INIT_LIST_HEAD(&new_ns->list);
 @@ -2500,8 +2519,8 @@ struct dentry *mount_subtree(struct vfsmount *mnt, const char *name)
  }
  EXPORT_SYMBOL(mount_subtree);
@@ -77556,6 +78806,19 @@ index 95d1c91..6798cca 100644
  
  /*
   * Newer version of video_device, handled by videodev2.c
+diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
+index c9b1593..a572459 100644
+--- a/include/media/v4l2-device.h
++++ b/include/media/v4l2-device.h
+@@ -95,7 +95,7 @@ int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4
+    this function returns 0. If the name ends with a digit (e.g. cx18),
+    then the name will be set to cx18-0 since cx180 looks really odd. */
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+-						atomic_t *instance);
++						atomic_unchecked_t *instance);
+ 
+ /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
+    Since the parent disappears this ensures that v4l2_dev doesn't have an
 diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
 index adcbb20..62c2559 100644
 --- a/include/net/9p/transport.h
@@ -77658,7 +78921,7 @@ index de2c785..0588a6b 100644
  /** inet_connection_sock - INET connection oriented sock
   *
 diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
-index 53f464d..ba76aaa 100644
+index 53f464d..0bd0b49 100644
 --- a/include/net/inetpeer.h
 +++ b/include/net/inetpeer.h
 @@ -47,8 +47,8 @@ struct inet_peer {
@@ -77672,20 +78935,28 @@ index 53f464d..ba76aaa 100644
  		};
  		struct rcu_head         rcu;
  		struct inet_peer	*gc_next;
-@@ -182,11 +182,11 @@ static inline int inet_getid(struct inet_peer *p, int more)
+@@ -178,16 +178,13 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)
+ /* can be called with or without local BH being disabled */
+ static inline int inet_getid(struct inet_peer *p, int more)
+ {
+-	int old, new;
++	int id;
  	more++;
  	inet_peer_refcheck(p);
- 	do {
+-	do {
 -		old = atomic_read(&p->ip_id_count);
-+		old = atomic_read_unchecked(&p->ip_id_count);
- 		new = old + more;
- 		if (!new)
- 			new = 1;
+-		new = old + more;
+-		if (!new)
+-			new = 1;
 -	} while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
-+	} while (atomic_cmpxchg_unchecked(&p->ip_id_count, old, new) != old);
- 	return new;
+-	return new;
++	id = atomic_add_return_unchecked(more, &p->ip_id_count);
++	if (!id)
++		id = atomic_inc_return_unchecked(&p->ip_id_count);
++	return id;
  }
  
+ #endif /* _NET_INETPEER_H */
 diff --git a/include/net/ip.h b/include/net/ip.h
 index a68f838..74518ab 100644
 --- a/include/net/ip.h
@@ -85008,6 +86279,26 @@ index 51b4448..7be601f 100644
  
  /*
   * Normal trace_printk() and friends allocates special buffers
+diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
+index 26dc348..8708ca7 100644
+--- a/kernel/trace/trace_clock.c
++++ b/kernel/trace/trace_clock.c
+@@ -123,7 +123,7 @@ u64 notrace trace_clock_global(void)
+ 	return now;
+ }
+ 
+-static atomic64_t trace_counter;
++static atomic64_unchecked_t trace_counter;
+ 
+ /*
+  * trace_clock_counter(): simply an atomic counter.
+@@ -132,5 +132,5 @@ static atomic64_t trace_counter;
+  */
+ u64 notrace trace_clock_counter(void)
+ {
+-	return atomic64_add_return(1, &trace_counter);
++	return atomic64_inc_return_unchecked(&trace_counter);
+ }
 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
 index 3d18aad..d1be0eb 100644
 --- a/kernel/trace/trace_events.c
@@ -91483,6 +92774,28 @@ index 3ee690e..00d581b 100644
  	register_netdevice_notifier(&notifier);
  
  	if (__rtnl_register(PF_CAN, RTM_GETROUTE, NULL, cgw_dump_jobs, NULL)) {
+diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
+index eb0a46a..5f3bae8 100644
+--- a/net/ceph/messenger.c
++++ b/net/ceph/messenger.c
+@@ -186,7 +186,7 @@ static void con_fault(struct ceph_connection *con);
+ #define MAX_ADDR_STR_LEN	64	/* 54 is enough */
+ 
+ static char addr_str[ADDR_STR_COUNT][MAX_ADDR_STR_LEN];
+-static atomic_t addr_str_seq = ATOMIC_INIT(0);
++static atomic_unchecked_t addr_str_seq = ATOMIC_INIT(0);
+ 
+ static struct page *zero_page;		/* used in certain error cases */
+ 
+@@ -197,7 +197,7 @@ const char *ceph_pr_addr(const struct sockaddr_storage *ss)
+ 	struct sockaddr_in *in4 = (struct sockaddr_in *) ss;
+ 	struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) ss;
+ 
+-	i = atomic_inc_return(&addr_str_seq) & ADDR_STR_COUNT_MASK;
++	i = atomic_inc_return_unchecked(&addr_str_seq) & ADDR_STR_COUNT_MASK;
+ 	s = addr_str[i];
+ 
+ 	switch (ss->ss_family) {
 diff --git a/net/compat.c b/net/compat.c
 index f0a1ba6..0541331 100644
 --- a/net/compat.c
@@ -91918,6 +93231,28 @@ index f9765203..9feaef8 100644
  	mutex_unlock(&net_mutex);
  	return error;
  }
+diff --git a/net/core/netpoll.c b/net/core/netpoll.c
+index cec074b..a53a938 100644
+--- a/net/core/netpoll.c
++++ b/net/core/netpoll.c
+@@ -428,7 +428,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
+ 	struct udphdr *udph;
+ 	struct iphdr *iph;
+ 	struct ethhdr *eth;
+-	static atomic_t ip_ident;
++	static atomic_unchecked_t ip_ident;
+ 	struct ipv6hdr *ip6h;
+ 
+ 	udp_len = len + sizeof(*udph);
+@@ -499,7 +499,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
+ 		put_unaligned(0x45, (unsigned char *)iph);
+ 		iph->tos      = 0;
+ 		put_unaligned(htons(ip_len), &(iph->tot_len));
+-		iph->id       = htons(atomic_inc_return(&ip_ident));
++		iph->id       = htons(atomic_inc_return_unchecked(&ip_ident));
+ 		iph->frag_off = 0;
+ 		iph->ttl      = 64;
+ 		iph->protocol = IPPROTO_UDP;
 diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
 index a08bd2b..c59bd7c 100644
 --- a/net/core/rtnetlink.c
@@ -93731,6 +95066,39 @@ index dffdc1a..ccc6678 100644
  err_alloc:
  	return -ENOMEM;
  }
+diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
+index c2e73e6..12cca6f 100644
+--- a/net/ipv6/output_core.c
++++ b/net/ipv6/output_core.c
+@@ -8,8 +8,8 @@
+ 
+ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
+ {
+-	static atomic_t ipv6_fragmentation_id;
+-	int old, new;
++	static atomic_unchecked_t ipv6_fragmentation_id;
++	int id;
+ 
+ #if IS_ENABLED(CONFIG_IPV6)
+ 	if (rt && !(rt->dst.flags & DST_NOPEER)) {
+@@ -25,13 +25,10 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
+ 		}
+ 	}
+ #endif
+-	do {
+-		old = atomic_read(&ipv6_fragmentation_id);
+-		new = old + 1;
+-		if (!new)
+-			new = 1;
+-	} while (atomic_cmpxchg(&ipv6_fragmentation_id, old, new) != old);
+-	fhdr->identification = htonl(new);
++	id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
++	if (!id)
++		id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
++	fhdr->identification = htonl(id);
+ }
+ EXPORT_SYMBOL(ipv6_select_ident);
+ 
 diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
 index eedff8c..7d7e24a 100644
 --- a/net/ipv6/raw.c
@@ -96281,6 +97649,28 @@ index 4ca1526..df83e47 100644
  
  	set_fs(KERNEL_DS);
  	if (level == SOL_SOCKET)
+diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
+index 29b4ba9..f648ae7 100644
+--- a/net/sunrpc/auth_gss/svcauth_gss.c
++++ b/net/sunrpc/auth_gss/svcauth_gss.c
+@@ -1144,7 +1144,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
+ 				uint64_t *handle)
+ {
+ 	struct rsc rsci, *rscp = NULL;
+-	static atomic64_t ctxhctr;
++	static atomic64_unchecked_t ctxhctr = ATOMIC64_INIT(0);
+ 	long long ctxh;
+ 	struct gss_api_mech *gm = NULL;
+ 	time_t expiry;
+@@ -1155,7 +1155,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
+ 	status = -ENOMEM;
+ 	/* the handle needs to be just a unique id,
+ 	 * use a static counter */
+-	ctxh = atomic64_inc_return(&ctxhctr);
++	ctxh = atomic64_inc_return_unchecked(&ctxhctr);
+ 
+ 	/* make a copy for the caller */
+ 	*handle = ctxh;
 diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
 index 426f8fc..1ef9c32 100644
 --- a/net/sunrpc/clnt.c
@@ -96853,7 +98243,7 @@ index ea970b8..c68edb9f 100644
  	}
  
 diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
-index 78f66fa..9286768 100644
+index 78f66fa..b93d547 100644
 --- a/net/xfrm/xfrm_state.c
 +++ b/net/xfrm/xfrm_state.c
 @@ -177,12 +177,14 @@ int xfrm_register_type(const struct xfrm_type *type, unsigned short family)
@@ -96947,6 +98337,19 @@ index 78f66fa..9286768 100644
  		module_put(mode->afinfo->owner);
  		err = 0;
  	}
+@@ -1486,10 +1493,10 @@ EXPORT_SYMBOL(xfrm_find_acq_byseq);
+ u32 xfrm_get_acqseq(void)
+ {
+ 	u32 res;
+-	static atomic_t acqseq;
++	static atomic_unchecked_t acqseq;
+ 
+ 	do {
+-		res = atomic_inc_return(&acqseq);
++		res = atomic_inc_return_unchecked(&acqseq);
+ 	} while (!res);
+ 
+ 	return res;
 diff --git a/net/xfrm/xfrm_sysctl.c b/net/xfrm/xfrm_sysctl.c
 index 05a6e3d..6716ec9 100644
 --- a/net/xfrm/xfrm_sysctl.c
@@ -98954,6 +100357,37 @@ index a3dce87..9ca1435 100644
  }
  
  /* Save user chosen LSM */
+diff --git a/security/selinux/avc.c b/security/selinux/avc.c
+index dad36a6..7e5ffbf 100644
+--- a/security/selinux/avc.c
++++ b/security/selinux/avc.c
+@@ -59,7 +59,7 @@ struct avc_node {
+ struct avc_cache {
+ 	struct hlist_head	slots[AVC_CACHE_SLOTS]; /* head for avc_node->list */
+ 	spinlock_t		slots_lock[AVC_CACHE_SLOTS]; /* lock for writes */
+-	atomic_t		lru_hint;	/* LRU hint for reclaim scan */
++	atomic_unchecked_t	lru_hint;	/* LRU hint for reclaim scan */
+ 	atomic_t		active_nodes;
+ 	u32			latest_notif;	/* latest revocation notification */
+ };
+@@ -167,7 +167,7 @@ void __init avc_init(void)
+ 		spin_lock_init(&avc_cache.slots_lock[i]);
+ 	}
+ 	atomic_set(&avc_cache.active_nodes, 0);
+-	atomic_set(&avc_cache.lru_hint, 0);
++	atomic_set_unchecked(&avc_cache.lru_hint, 0);
+ 
+ 	avc_node_cachep = kmem_cache_create("avc_node", sizeof(struct avc_node),
+ 					     0, SLAB_PANIC, NULL);
+@@ -242,7 +242,7 @@ static inline int avc_reclaim_node(void)
+ 	spinlock_t *lock;
+ 
+ 	for (try = 0, ecx = 0; try < AVC_CACHE_SLOTS; try++) {
+-		hvalue = atomic_inc_return(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
++		hvalue = atomic_inc_return_unchecked(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
+ 		head = &avc_cache.slots[hvalue];
+ 		lock = &avc_cache.slots_lock[hvalue];
+ 
 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
 index 5c6f2cd..b4f945c 100644
 --- a/security/selinux/hooks.c

diff --git a/3.2.50/0000_README b/3.2.50/0000_README
index 8d5d81f..b584719 100644
--- a/3.2.50/0000_README
+++ b/3.2.50/0000_README
@@ -118,7 +118,7 @@ Patch:	1049_linux-3.2.50.patch
 From:	http://www.kernel.org
 Desc:	Linux 3.2.50
 
-Patch:	4420_grsecurity-2.9.1-3.2.50-201308282053.patch
+Patch:	4420_grsecurity-2.9.1-3.2.50-201309011629.patch
 From:	http://www.grsecurity.net
 Desc:	hardened-sources base patch from upstream grsecurity
 

diff --git a/3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch b/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
similarity index 99%
rename from 3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch
rename to 3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
index 581a30c..eab80ae 100644
--- a/3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch
+++ b/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
@@ -6732,6 +6732,57 @@ index 96ee50a..68ce124 100644
  #ifdef CONFIG_AUDITSYSCALL
  	if (unlikely(current->audit_context)) {
  		unsigned long tstate = regs->tstate;
+diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
+index e21d3c0d..8f453c1 100644
+--- a/arch/sparc/kernel/smp_64.c
++++ b/arch/sparc/kernel/smp_64.c
+@@ -871,8 +871,8 @@ extern unsigned long xcall_flush_dcache_page_cheetah;
+ extern unsigned long xcall_flush_dcache_page_spitfire;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-extern atomic_t dcpage_flushes;
+-extern atomic_t dcpage_flushes_xcall;
++extern atomic_unchecked_t dcpage_flushes;
++extern atomic_unchecked_t dcpage_flushes_xcall;
+ #endif
+ 
+ static inline void __local_flush_dcache_page(struct page *page)
+@@ -896,7 +896,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
+ 		return;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 
+ 	this_cpu = get_cpu();
+@@ -920,7 +920,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
+ 			xcall_deliver(data0, __pa(pg_addr),
+ 				      (u64) pg_addr, cpumask_of(cpu));
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-			atomic_inc(&dcpage_flushes_xcall);
++			atomic_inc_unchecked(&dcpage_flushes_xcall);
+ #endif
+ 		}
+ 	}
+@@ -939,7 +939,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
+ 	preempt_disable();
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 	data0 = 0;
+ 	pg_addr = page_address(page);
+@@ -956,7 +956,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
+ 		xcall_deliver(data0, __pa(pg_addr),
+ 			      (u64) pg_addr, cpu_online_mask);
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-		atomic_inc(&dcpage_flushes_xcall);
++		atomic_inc_unchecked(&dcpage_flushes_xcall);
+ #endif
+ 	}
+ 	__local_flush_dcache_page(page);
 diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
 index 42b282f..408977c 100644
 --- a/arch/sparc/kernel/sys_sparc_32.c
@@ -7044,7 +7095,7 @@ index 591f20c..0f1b925 100644
  }
  
 diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
-index 0cbdaa4..438e4c9 100644
+index 0cbdaa4..f37a97c 100644
 --- a/arch/sparc/kernel/traps_64.c
 +++ b/arch/sparc/kernel/traps_64.c
 @@ -75,7 +75,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
@@ -7114,6 +7165,55 @@ index 0cbdaa4..438e4c9 100644
  }
  
  struct sun4v_error_entry {
+@@ -1786,8 +1797,8 @@ struct sun4v_error_entry {
+ 	u16		err_pad;
+ };
+ 
+-static atomic_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
+-static atomic_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
++static atomic_unchecked_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
++static atomic_unchecked_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
+ 
+ static const char *sun4v_err_type_to_str(u32 type)
+ {
+@@ -1807,7 +1818,7 @@ static const char *sun4v_err_type_to_str(u32 type)
+ 	}
+ }
+ 
+-static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_t *ocnt)
++static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_unchecked_t *ocnt)
+ {
+ 	int cnt;
+ 
+@@ -1842,8 +1853,8 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
+ 
+ 	show_regs(regs);
+ 
+-	if ((cnt = atomic_read(ocnt)) != 0) {
+-		atomic_set(ocnt, 0);
++	if ((cnt = atomic_read_unchecked(ocnt)) != 0) {
++		atomic_set_unchecked(ocnt, 0);
+ 		wmb();
+ 		printk("%s: Queue overflowed %d times.\n",
+ 		       pfx, cnt);
+@@ -1895,7 +1906,7 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
+  */
+ void sun4v_resum_overflow(struct pt_regs *regs)
+ {
+-	atomic_inc(&sun4v_resum_oflow_cnt);
++	atomic_inc_unchecked(&sun4v_resum_oflow_cnt);
+ }
+ 
+ /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
+@@ -1948,7 +1959,7 @@ void sun4v_nonresum_overflow(struct pt_regs *regs)
+ 	/* XXX Actually even this can make not that much sense.  Perhaps
+ 	 * XXX we should just pull the plug and panic directly from here?
+ 	 */
+-	atomic_inc(&sun4v_nonresum_oflow_cnt);
++	atomic_inc_unchecked(&sun4v_nonresum_oflow_cnt);
+ }
+ 
+ unsigned long sun4v_err_itlb_vaddr;
 @@ -1963,9 +1974,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
  
  	printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
@@ -8574,6 +8674,44 @@ index 7b00de6..78239f4 100644
  	protection_map[12] = PAGE_READONLY;
  	protection_map[13] = PAGE_READONLY;
  	protection_map[14] = PAGE_SHARED;
+diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
+index b4989f9..530099e 100644
+--- a/arch/sparc/mm/init_64.c
++++ b/arch/sparc/mm/init_64.c
+@@ -170,9 +170,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
+ int num_kernel_image_mappings;
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-atomic_t dcpage_flushes = ATOMIC_INIT(0);
++atomic_unchecked_t dcpage_flushes = ATOMIC_INIT(0);
+ #ifdef CONFIG_SMP
+-atomic_t dcpage_flushes_xcall = ATOMIC_INIT(0);
++atomic_unchecked_t dcpage_flushes_xcall = ATOMIC_INIT(0);
+ #endif
+ #endif
+ 
+@@ -180,7 +180,7 @@ inline void flush_dcache_page_impl(struct page *page)
+ {
+ 	BUG_ON(tlb_type == hypervisor);
+ #ifdef CONFIG_DEBUG_DCFLUSH
+-	atomic_inc(&dcpage_flushes);
++	atomic_inc_unchecked(&dcpage_flushes);
+ #endif
+ 
+ #ifdef DCACHE_ALIASING_POSSIBLE
+@@ -417,10 +417,10 @@ void mmu_info(struct seq_file *m)
+ 
+ #ifdef CONFIG_DEBUG_DCFLUSH
+ 	seq_printf(m, "DCPageFlushes\t: %d\n",
+-		   atomic_read(&dcpage_flushes));
++		   atomic_read_unchecked(&dcpage_flushes));
+ #ifdef CONFIG_SMP
+ 	seq_printf(m, "DCPageFlushesXC\t: %d\n",
+-		   atomic_read(&dcpage_flushes_xcall));
++		   atomic_read_unchecked(&dcpage_flushes_xcall));
+ #endif /* CONFIG_SMP */
+ #endif /* CONFIG_DEBUG_DCFLUSH */
+ }
 diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
 index cbef74e..c38fead 100644
 --- a/arch/sparc/mm/srmmu.c
@@ -14361,7 +14499,7 @@ index 566e803..86f1302 100644
  }
  
 diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
-index 1c66d30..f2fbd07 100644
+index 1c66d30..6c7b4d8 100644
 --- a/arch/x86/include/asm/uaccess_64.h
 +++ b/arch/x86/include/asm/uaccess_64.h
 @@ -10,6 +10,9 @@
@@ -14688,8 +14826,9 @@ index 1c66d30..f2fbd07 100644
 +__must_check unsigned long clear_user(void __user *mem, unsigned long len) __size_overflow(2);
 +__must_check unsigned long __clear_user(void __user *mem, unsigned long len) __size_overflow(2);
  
- static __must_check __always_inline int
+-static __must_check __always_inline int
 -__copy_from_user_inatomic(void *dst, const void __user *src, unsigned size)
++static __must_check __always_inline unsigned long
 +__copy_from_user_inatomic(void *dst, const void __user *src, unsigned long size)
  {
 -	return copy_user_generic(dst, (__force const void *)src, size);
@@ -33281,6 +33420,28 @@ index 1e756e1..6f7ead5 100644
  	.attrs = cpuclass_default_attrs,
  	.name = "cpuidle",
  };
+diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
+index fe765f4..0bc6d6a 100644
+--- a/drivers/crypto/hifn_795x.c
++++ b/drivers/crypto/hifn_795x.c
+@@ -51,7 +51,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
+ MODULE_PARM_DESC(hifn_pll_ref,
+ 		 "PLL reference clock (pci[freq] or ext[freq], default ext)");
+ 
+-static atomic_t hifn_dev_number;
++static atomic_unchecked_t hifn_dev_number;
+ 
+ #define ACRYPTO_OP_DECRYPT	0
+ #define ACRYPTO_OP_ENCRYPT	1
+@@ -2576,7 +2576,7 @@ static int __devinit hifn_probe(struct pci_dev *pdev, const struct pci_device_id
+ 		goto err_out_disable_pci_device;
+ 
+ 	snprintf(name, sizeof(name), "hifn%d",
+-			atomic_inc_return(&hifn_dev_number)-1);
++			atomic_inc_return_unchecked(&hifn_dev_number)-1);
+ 
+ 	err = pci_request_regions(pdev, name);
+ 	if (err)
 diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
 index 59d24e9..0d20240 100644
 --- a/drivers/devfreq/devfreq.c
@@ -33372,6 +33533,44 @@ index 6ffb6d2..383d8d7 100644
  	{
  	 PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  	 E7205},
+diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
+index c3f6743..e2c52b0 100644
+--- a/drivers/edac/edac_device.c
++++ b/drivers/edac/edac_device.c
+@@ -483,9 +483,9 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
+  */
+ int edac_device_alloc_index(void)
+ {
+-	static atomic_t device_indexes = ATOMIC_INIT(0);
++	static atomic_unchecked_t device_indexes = ATOMIC_INIT(0);
+ 
+-	return atomic_inc_return(&device_indexes) - 1;
++	return atomic_inc_return_unchecked(&device_indexes) - 1;
+ }
+ EXPORT_SYMBOL_GPL(edac_device_alloc_index);
+ 
+diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
+index 2b378207..99ba0bd 100644
+--- a/drivers/edac/edac_pci.c
++++ b/drivers/edac/edac_pci.c
+@@ -30,7 +30,7 @@
+ 
+ static DEFINE_MUTEX(edac_pci_ctls_mutex);
+ static LIST_HEAD(edac_pci_list);
+-static atomic_t pci_indexes = ATOMIC_INIT(0);
++static atomic_unchecked_t pci_indexes = ATOMIC_INIT(0);
+ 
+ /*
+  * edac_pci_alloc_ctl_info
+@@ -316,7 +316,7 @@ EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
+  */
+ int edac_pci_alloc_index(void)
+ {
+-	return atomic_inc_return(&pci_indexes) - 1;
++	return atomic_inc_return_unchecked(&pci_indexes) - 1;
+ }
+ EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
+ 
 diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
 index 8cc8676..90b70b9 100644
 --- a/drivers/edac/edac_pci_sysfs.c
@@ -33664,9 +33863,21 @@ index b6f47de..c5acf3a 100644
  	 PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  	 X38},
 diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
-index 85661b0..c784559a 100644
+index 85661b0..cdd4560 100644
 --- a/drivers/firewire/core-card.c
 +++ b/drivers/firewire/core-card.c
+@@ -512,9 +512,9 @@ void fw_card_initialize(struct fw_card *card,
+ 			const struct fw_card_driver *driver,
+ 			struct device *device)
+ {
+-	static atomic_t index = ATOMIC_INIT(-1);
++	static atomic_unchecked_t index = ATOMIC_INIT(-1);
+ 
+-	card->index = atomic_inc_return(&index);
++	card->index = atomic_inc_return_unchecked(&index);
+ 	card->driver = driver;
+ 	card->device = device;
+ 	card->current_tlabel = 0;
 @@ -657,7 +657,7 @@ void fw_card_release(struct kref *kref)
  
  void fw_core_remove_card(struct fw_card *card)
@@ -37699,6 +37910,28 @@ index ba70058..571d25d 100644
  	serio->dev.bus = &serio_bus;
  	serio->dev.release = serio_release_port;
  	serio->dev.groups = serio_device_attr_groups;
+diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
+index 4d4cd14..d6fdd87 100644
+--- a/drivers/input/serio/serio_raw.c
++++ b/drivers/input/serio/serio_raw.c
+@@ -280,7 +280,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
+ 
+ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
+ {
+-	static atomic_t serio_raw_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t serio_raw_no = ATOMIC_INIT(0);
+ 	struct serio_raw *serio_raw;
+ 	int err;
+ 
+@@ -291,7 +291,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
+ 	}
+ 
+ 	snprintf(serio_raw->name, sizeof(serio_raw->name),
+-		 "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1);
++		 "serio_raw%ld", (long)atomic_inc_return_unchecked(&serio_raw_no) - 1);
+ 	kref_init(&serio_raw->kref);
+ 	INIT_LIST_HEAD(&serio_raw->client_list);
+ 	init_waitqueue_head(&serio_raw->wait);
 diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
 index e44933d..9ba484a 100644
 --- a/drivers/isdn/capi/capi.c
@@ -37896,6 +38129,19 @@ index ee0a549..a7c9798 100644
  		dev_warn(cs->dev, "%s: device not opened\n", __func__);
  		goto out;
  	}
+diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
+index 5e3300d..dc7d752 100644
+--- a/drivers/isdn/gigaset/usb-gigaset.c
++++ b/drivers/isdn/gigaset/usb-gigaset.c
+@@ -546,7 +546,7 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
+ 	gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf);
+ 	memcpy(cs->hw.usb->bchars, buf, 6);
+ 	return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
+-			       0, 0, &buf, 6, 2000);
++			       0, 0, buf, 6, 2000);
+ }
+ 
+ static int gigaset_freebcshw(struct bc_state *bcs)
 diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
 index 2a57da59..e7a12ed 100644
 --- a/drivers/isdn/hardware/avm/b1.c
@@ -37918,6 +38164,19 @@ index 2a57da59..e7a12ed 100644
  				return -EFAULT;
  		} else {
  			memcpy(buf, dp, left);
+diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
+index 6ddb795e..bd2e875 100644
+--- a/drivers/isdn/i4l/isdn_common.c
++++ b/drivers/isdn/i4l/isdn_common.c
+@@ -1656,6 +1656,8 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
+ 				} else
+ 					return -EINVAL;
+ 			case IIOCDBGVAR:
++				if (!capable(CAP_SYS_RAWIO))
++					return -EPERM;
+ 				if (arg) {
+ 					if (copy_to_user(argp, &dev, sizeof(ulong)))
+ 						return -EFAULT;
 diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
 index 2339d73..802ab87a 100644
 --- a/drivers/isdn/i4l/isdn_net.c
@@ -38791,6 +39050,28 @@ index 16a089f..1661b11 100644
  		return -EFAULT;
  	return i;
  }
+diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
+index a47ba33..deafb02 100644
+--- a/drivers/media/rc/rc-main.c
++++ b/drivers/media/rc/rc-main.c
+@@ -1031,7 +1031,7 @@ EXPORT_SYMBOL_GPL(rc_free_device);
+ 
+ int rc_register_device(struct rc_dev *dev)
+ {
+-	static atomic_t devno = ATOMIC_INIT(0);
++	static atomic_unchecked_t devno = ATOMIC_INIT(0);
+ 	struct rc_map *rc_map;
+ 	const char *path;
+ 	int rc;
+@@ -1063,7 +1063,7 @@ int rc_register_device(struct rc_dev *dev)
+ 	 */
+ 	mutex_lock(&dev->lock);
+ 
+-	dev->devno = (unsigned long)(atomic_inc_return(&devno) - 1);
++	dev->devno = (unsigned long)(atomic_inc_return_unchecked(&devno) - 1);
+ 	dev_set_name(&dev->dev, "rc%ld", dev->devno);
+ 	dev_set_drvdata(&dev->dev, dev);
+ 	rc = device_add(&dev->dev);
 diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
 index 61287fc..8b08712 100644
 --- a/drivers/media/rc/redrat3.c
@@ -38834,6 +39115,19 @@ index 921c56d..7e6c4b2 100644
  
  module_param_array(video_nr, int, NULL, 0444);
  module_param_array(vbi_nr,   int, NULL, 0444);
+diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
+index 41108a9a..8ad2437 100644
+--- a/drivers/media/video/ivtv/ivtv-driver.c
++++ b/drivers/media/video/ivtv/ivtv-driver.c
+@@ -80,7 +80,7 @@ static struct pci_device_id ivtv_pci_tbl[] __devinitdata = {
+ MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
+ 
+ /* ivtv instance counter */
+-static atomic_t ivtv_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t ivtv_instance = ATOMIC_INIT(0);
+ 
+ /* Parameter declarations */
+ static int cardtype[IVTV_MAX_CARDS];
 diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
 index d345215..b607565 100644
 --- a/drivers/media/video/omap/omap_vout.c
@@ -38940,6 +39234,22 @@ index c68531b..82a9ea0 100644
  				enum v4l2_memory memory)
  {
  	if (copy_in_user(up32, up, 2 * sizeof(__u32)) ||
+diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c
+index 8b0777f..e29f31e 100644
+--- a/drivers/media/video/v4l2-device.c
++++ b/drivers/media/video/v4l2-device.c
+@@ -74,9 +74,9 @@ int v4l2_device_put(struct v4l2_device *v4l2_dev)
+ EXPORT_SYMBOL_GPL(v4l2_device_put);
+ 
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+-						atomic_t *instance)
++						atomic_unchecked_t *instance)
+ {
+-	int num = atomic_inc_return(instance) - 1;
++	int num = atomic_inc_return_unchecked(instance) - 1;
+ 	int len = strlen(basename);
+ 
+ 	if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
 diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
 index 639abee..e2336f4 100644
 --- a/drivers/media/video/v4l2-ioctl.c
@@ -40794,6 +41104,28 @@ index 304fe78..db112fa 100644
  				result =
  				    hso_start_serial_device(serial_table[i], GFP_NOIO);
  				hso_kick_transmit(dev2ser(serial_table[i]));
+diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
+index e773250..9ee61ab 100644
+--- a/drivers/net/usb/sierra_net.c
++++ b/drivers/net/usb/sierra_net.c
+@@ -52,7 +52,7 @@ static const char driver_name[] = "sierra_net";
+ /* atomic counter partially included in MAC address to make sure 2 devices
+  * do not end up with the same MAC - concept breaks in case of > 255 ifaces
+  */
+-static	atomic_t iface_counter = ATOMIC_INIT(0);
++static	atomic_unchecked_t iface_counter = ATOMIC_INIT(0);
+ 
+ /*
+  * SYNC Timer Delay definition used to set the expiry time
+@@ -738,7 +738,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
+ 	dev->net->netdev_ops = &sierra_net_device_ops;
+ 
+ 	/* change MAC addr to include, ifacenum, and to be unique */
+-	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
++	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return_unchecked(&iface_counter);
+ 	dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
+ 
+ 	/* we will have to manufacture ethernet headers, prepare template */
 diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
 index dc53a8f..2b66cc1 100644
 --- a/drivers/net/usb/usbnet.c
@@ -42048,6 +42380,19 @@ index 8e6c4fa..a7539b3 100644
  
  /*
   * Polling driver
+diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
+index a134c26..d024437 100644
+--- a/drivers/platform/x86/wmi.c
++++ b/drivers/platform/x86/wmi.c
+@@ -743,7 +743,7 @@ static int wmi_create_device(const struct guid_block *gblock,
+ 	wblock->dev.class = &wmi_class;
+ 
+ 	wmi_gtoa(gblock->guid, guid_string);
+-	dev_set_name(&wblock->dev, guid_string);
++	dev_set_name(&wblock->dev, "%s", guid_string);
+ 
+ 	dev_set_drvdata(&wblock->dev, wblock);
+ 
 diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
 index b859d16..5cc6b1a 100644
 --- a/drivers/pnp/pnpbios/bioscalls.c
@@ -42198,6 +42543,28 @@ index e15d4c9..83cd617 100644
  	for (i = 0; i < ARRAY_SIZE(power_supply_attrs); i++)
  		__power_supply_attrs[i] = &power_supply_attrs[i].attr;
  }
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index 6ec610c..078eaf3 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -2639,7 +2639,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
+ 	struct device *dev, const struct regulator_init_data *init_data,
+ 	void *driver_data)
+ {
+-	static atomic_t regulator_no = ATOMIC_INIT(0);
++	static atomic_unchecked_t regulator_no = ATOMIC_INIT(0);
+ 	struct regulator_dev *rdev;
+ 	int ret, i;
+ 
+@@ -2698,7 +2698,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
+ 	rdev->dev.class = &regulator_class;
+ 	rdev->dev.parent = dev;
+ 	dev_set_name(&rdev->dev, "regulator.%d",
+-		     atomic_inc_return(&regulator_no) - 1);
++		     atomic_inc_return_unchecked(&regulator_no) - 1);
+ 	ret = device_register(&rdev->dev);
+ 	if (ret != 0) {
+ 		put_device(&rdev->dev);
 diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
 index 33f5d9a..d957d3f 100644
 --- a/drivers/regulator/max8660.c
@@ -43187,6 +43554,19 @@ index 21a045e..ec89e03 100644
  	dev_set_name(&rport->dev, "port-%d:%d", shost->host_no, id);
  
  	transport_setup_device(&rport->dev);
+diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
+index 17603da..332e23a 100644
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -2637,7 +2637,7 @@ static int sd_probe(struct device *dev)
+ 	device_initialize(&sdkp->dev);
+ 	sdkp->dev.parent = dev;
+ 	sdkp->dev.class = &sd_disk_class;
+-	dev_set_name(&sdkp->dev, dev_name(dev));
++	dev_set_name(&sdkp->dev, "%s", dev_name(dev));
+ 
+ 	if (device_add(&sdkp->dev))
+ 		goto out_free_index;
 diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
 index 441a1c5..07cece7 100644
 --- a/drivers/scsi/sg.c
@@ -43868,6 +44248,104 @@ index b9040be..e3f5aab 100644
  		return 0;
  
  	return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
+diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
+index cdfa3e0..37fa165 100644
+--- a/drivers/tty/hvc/hvsi.c
++++ b/drivers/tty/hvc/hvsi.c
+@@ -86,7 +86,7 @@ struct hvsi_struct {
+ 	int n_outbuf;
+ 	uint32_t vtermno;
+ 	uint32_t virq;
+-	atomic_t seqno; /* HVSI packet sequence number */
++	atomic_unchecked_t seqno; /* HVSI packet sequence number */
+ 	uint16_t mctrl;
+ 	uint8_t state;  /* HVSI protocol state */
+ 	uint8_t flags;
+@@ -297,7 +297,7 @@ static int hvsi_version_respond(struct hvsi_struct *hp, uint16_t query_seqno)
+ 
+ 	packet.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER;
+ 	packet.hdr.len = sizeof(struct hvsi_query_response);
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.verb = VSV_SEND_VERSION_NUMBER;
+ 	packet.u.version = HVSI_VERSION;
+ 	packet.query_seqno = query_seqno+1;
+@@ -581,7 +581,7 @@ static int hvsi_query(struct hvsi_struct *hp, uint16_t verb)
+ 
+ 	packet.hdr.type = VS_QUERY_PACKET_HEADER;
+ 	packet.hdr.len = sizeof(struct hvsi_query);
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.verb = verb;
+ 
+ 	pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len);
+@@ -623,7 +623,7 @@ static int hvsi_set_mctrl(struct hvsi_struct *hp, uint16_t mctrl)
+ 	int wrote;
+ 
+ 	packet.hdr.type = VS_CONTROL_PACKET_HEADER,
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = sizeof(struct hvsi_control);
+ 	packet.verb = VSV_SET_MODEM_CTL;
+ 	packet.mask = HVSI_TSDTR;
+@@ -706,7 +706,7 @@ static int hvsi_put_chars(struct hvsi_struct *hp, const char *buf, int count)
+ 	BUG_ON(count > HVSI_MAX_OUTGOING_DATA);
+ 
+ 	packet.hdr.type = VS_DATA_PACKET_HEADER;
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = count + sizeof(struct hvsi_header);
+ 	memcpy(&packet.data, buf, count);
+ 
+@@ -723,7 +723,7 @@ static void hvsi_close_protocol(struct hvsi_struct *hp)
+ 	struct hvsi_control packet __ALIGNED__;
+ 
+ 	packet.hdr.type = VS_CONTROL_PACKET_HEADER;
+-	packet.hdr.seqno = atomic_inc_return(&hp->seqno);
++	packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
+ 	packet.hdr.len = 6;
+ 	packet.verb = VSV_CLOSE_PROTOCOL;
+ 
+@@ -755,7 +755,7 @@ static int hvsi_open(struct tty_struct *tty, struct file *filp)
+ 	spin_lock_irqsave(&hp->lock, flags);
+ 	hp->tty = tty;
+ 	hp->count++;
+-	atomic_set(&hp->seqno, 0);
++	atomic_set_unchecked(&hp->seqno, 0);
+ 	h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE);
+ 	spin_unlock_irqrestore(&hp->lock, flags);
+ 
+diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
+index 6f4dd83..84c3f91 100644
+--- a/drivers/tty/hvc/hvsi_lib.c
++++ b/drivers/tty/hvc/hvsi_lib.c
+@@ -9,7 +9,7 @@
+ 
+ static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet)
+ {
+-	packet->seqno = atomic_inc_return(&pv->seqno);
++	packet->seqno = atomic_inc_return_unchecked(&pv->seqno);
+ 
+ 	/* Assumes that always succeeds, works in practice */
+ 	return pv->put_chars(pv->termno, (char *)packet, packet->len);
+@@ -21,7 +21,7 @@ static void hvsi_start_handshake(struct hvsi_priv *pv)
+ 
+ 	/* Reset state */
+ 	pv->established = 0;
+-	atomic_set(&pv->seqno, 0);
++	atomic_set_unchecked(&pv->seqno, 0);
+ 
+ 	pr_devel("HVSI@%x: Handshaking started\n", pv->termno);
+ 
+@@ -265,7 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv)
+ 	pv->mctrl_update = 0;
+ 	q.hdr.type = VS_QUERY_PACKET_HEADER;
+ 	q.hdr.len = sizeof(struct hvsi_query);
+-	q.hdr.seqno = atomic_inc_return(&pv->seqno);
++	q.hdr.seqno = atomic_inc_return_unchecked(&pv->seqno);
+ 	q.verb = VSV_SEND_MODEM_CTL_STATUS;
+ 	rc = hvsi_send_packet(pv, &q.hdr);
+ 	if (rc <= 0) {
 diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
 index ef92869..f4ebd88 100644
 --- a/drivers/tty/ipwireless/tty.c
@@ -44036,6 +44514,37 @@ index 4735928..e80860a 100644
  
  	cdev_init(&ptmx_cdev, &ptmx_fops);
  	if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
+diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
+index 6b36c15..335a4a2 100644
+--- a/drivers/tty/serial/ioc4_serial.c
++++ b/drivers/tty/serial/ioc4_serial.c
+@@ -438,7 +438,7 @@ struct ioc4_soft {
+ 		} is_intr_info[MAX_IOC4_INTR_ENTS];
+ 
+ 		/* Number of entries active in the above array */
+-		atomic_t is_num_intrs;
++		atomic_unchecked_t is_num_intrs;
+ 	} is_intr_type[IOC4_NUM_INTR_TYPES];
+ 
+ 	/* is_ir_lock must be held while
+@@ -975,7 +975,7 @@ intr_connect(struct ioc4_soft *soft, int type,
+ 	BUG_ON(!((type == IOC4_SIO_INTR_TYPE)
+ 	       || (type == IOC4_OTHER_INTR_TYPE)));
+ 
+-	i = atomic_inc(&soft-> is_intr_type[type].is_num_intrs) - 1;
++	i = atomic_inc_return_unchecked(&soft-> is_intr_type[type].is_num_intrs) - 1;
+ 	BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0)));
+ 
+ 	/* Save off the lower level interrupt handler */
+@@ -1002,7 +1002,7 @@ static irqreturn_t ioc4_intr(int irq, void *arg)
+ 
+ 	soft = arg;
+ 	for (intr_type = 0; intr_type < IOC4_NUM_INTR_TYPES; intr_type++) {
+-		num_intrs = (int)atomic_read(
++		num_intrs = (int)atomic_read_unchecked(
+ 				&soft->is_intr_type[intr_type].is_num_intrs);
+ 
+ 		this_mir = this_ir = pending_intrs(soft, intr_type);
 diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
 index 2b42a01..32a2ed3 100644
 --- a/drivers/tty/serial/kgdboc.c
@@ -44138,6 +44647,28 @@ index 2b42a01..32a2ed3 100644
  #ifdef CONFIG_KGDB_SERIAL_CONSOLE
  /* This is only available if kgdboc is a built in for early debugging */
  static int __init kgdboc_early_init(char *opt)
+diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
+index 8131e2c..b48928a 100644
+--- a/drivers/tty/serial/msm_serial.c
++++ b/drivers/tty/serial/msm_serial.c
+@@ -857,7 +857,7 @@ static struct uart_driver msm_uart_driver = {
+ 	.cons = MSM_CONSOLE,
+ };
+ 
+-static atomic_t msm_uart_next_id = ATOMIC_INIT(0);
++static atomic_unchecked_t msm_uart_next_id = ATOMIC_INIT(0);
+ 
+ static int __init msm_serial_probe(struct platform_device *pdev)
+ {
+@@ -867,7 +867,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
+ 	int irq;
+ 
+ 	if (pdev->id == -1)
+-		pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;
++		pdev->id = atomic_inc_return_unchecked(&msm_uart_next_id) - 1;
+ 
+ 	if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
+ 		return -ENXIO;
 diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
 index b31f1c3..1b6b8c4 100644
 --- a/drivers/tty/serial/samsung.c
@@ -44698,6 +45229,28 @@ index 7138540..2370195 100644
  
  /*----------------------------------------------------------------------*/
  
+diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
+index 9f7003e..b1db1b6 100644
+--- a/drivers/usb/misc/appledisplay.c
++++ b/drivers/usb/misc/appledisplay.c
+@@ -83,7 +83,7 @@ struct appledisplay {
+ 	spinlock_t lock;
+ };
+ 
+-static atomic_t count_displays = ATOMIC_INIT(0);
++static atomic_unchecked_t count_displays = ATOMIC_INIT(0);
+ static struct workqueue_struct *wq;
+ 
+ static void appledisplay_complete(struct urb *urb)
+@@ -281,7 +281,7 @@ static int appledisplay_probe(struct usb_interface *iface,
+ 
+ 	/* Register backlight device */
+ 	snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
+-		atomic_inc_return(&count_displays) - 1);
++		atomic_inc_return_unchecked(&count_displays) - 1);
+ 	memset(&props, 0, sizeof(struct backlight_properties));
+ 	props.type = BACKLIGHT_RAW;
+ 	props.max_brightness = 0xff;
 diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
 index e39b188..1fffda8 100644
 --- a/drivers/usb/storage/realtek_cr.c
@@ -48354,6 +48907,28 @@ index b31507d..5b42a3b 100644
  
  static int __init init_affs_fs(void)
  {
+diff --git a/fs/afs/inode.c b/fs/afs/inode.c
+index d890ae3..5733a4b 100644
+--- a/fs/afs/inode.c
++++ b/fs/afs/inode.c
+@@ -141,7 +141,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
+ 	struct afs_vnode *vnode;
+ 	struct super_block *sb;
+ 	struct inode *inode;
+-	static atomic_t afs_autocell_ino;
++	static atomic_unchecked_t afs_autocell_ino;
+ 
+ 	_enter("{%x:%u},%*.*s,",
+ 	       AFS_FS_I(dir)->fid.vid, AFS_FS_I(dir)->fid.vnode,
+@@ -154,7 +154,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
+ 	data.fid.unique = 0;
+ 	data.fid.vnode = 0;
+ 
+-	inode = iget5_locked(sb, atomic_inc_return(&afs_autocell_ino),
++	inode = iget5_locked(sb, atomic_inc_return_unchecked(&afs_autocell_ino),
+ 			     afs_iget5_autocell_test, afs_iget5_set,
+ 			     &data);
+ 	if (!inode) {
 diff --git a/fs/afs/super.c b/fs/afs/super.c
 index 356dcf0..c0046cd 100644
 --- a/fs/afs/super.c
@@ -52432,9 +53007,18 @@ index 78b519c..0386555 100644
  
  		task_unlock(current);
 diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
-index 9905350..02eaec4 100644
+index 9905350..97ff49a 100644
 --- a/fs/fscache/cookie.c
 +++ b/fs/fscache/cookie.c
+@@ -19,7 +19,7 @@
+ 
+ struct kmem_cache *fscache_cookie_jar;
+ 
+-static atomic_t fscache_object_debug_id = ATOMIC_INIT(0);
++static atomic_unchecked_t fscache_object_debug_id = ATOMIC_INIT(0);
+ 
+ static int fscache_acquire_non_index_cookie(struct fscache_cookie *cookie);
+ static int fscache_alloc_object(struct fscache_cache *cache,
 @@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire_cookie(
  	       parent ? (char *) parent->def->name : "<no-parent>",
  	       def->name, netfs_data);
@@ -52500,7 +53084,7 @@ index 9905350..02eaec4 100644
  		_leave(" = -ENOMEDIUM [no cache]");
  		return -ENOMEDIUM;
  	}
-@@ -256,12 +256,12 @@ static int fscache_alloc_object(struct fscache_cache *cache,
+@@ -256,14 +256,14 @@ static int fscache_alloc_object(struct fscache_cache *cache,
  	object = cache->ops->alloc_object(cache, cookie);
  	fscache_stat_d(&fscache_n_cop_alloc_object);
  	if (IS_ERR(object)) {
@@ -52513,8 +53097,11 @@ index 9905350..02eaec4 100644
 -	fscache_stat(&fscache_n_object_alloc);
 +	fscache_stat_unchecked(&fscache_n_object_alloc);
  
- 	object->debug_id = atomic_inc_return(&fscache_object_debug_id);
+-	object->debug_id = atomic_inc_return(&fscache_object_debug_id);
++	object->debug_id = atomic_inc_return_unchecked(&fscache_object_debug_id);
  
+ 	_debug("ALLOC OBJ%x: %s {%lx}",
+ 	       object->debug_id, cookie->def->name, object->events);
 @@ -377,10 +377,10 @@ void __fscache_update_cookie(struct fscache_cookie *cookie)
  	struct fscache_object *object;
  	struct hlist_node *_p;
@@ -55319,9 +55906,18 @@ index 99e3610..02c1068 100644
  				"inode 0x%lx or driver bug.", vdir->i_ino);
  		goto err_out;
 diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
-index c587e2d..3641eaa 100644
+index c587e2d..5189f0f 100644
 --- a/fs/ntfs/file.c
 +++ b/fs/ntfs/file.c
+@@ -1281,7 +1281,7 @@ static inline size_t ntfs_copy_from_user(struct page **pages,
+ 	char *addr;
+ 	size_t total = 0;
+ 	unsigned len;
+-	int left;
++	unsigned left;
+ 
+ 	do {
+ 		len = PAGE_CACHE_SIZE - ofs;
 @@ -2229,6 +2229,6 @@ const struct inode_operations ntfs_file_inode_ops = {
  #endif /* NTFS_RW */
  };
@@ -55332,9 +55928,36 @@ index c587e2d..3641eaa 100644
 -const struct inode_operations ntfs_empty_inode_ops = {};
 +const struct inode_operations ntfs_empty_inode_ops __read_only;
 diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
-index b52706d..68a038f 100644
+index b52706d..b9a9f9d 100644
 --- a/fs/ntfs/super.c
 +++ b/fs/ntfs/super.c
+@@ -661,7 +661,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
+ 		if (!silent)
+ 			ntfs_error(sb, "Primary boot sector is invalid.");
+ 	} else if (!silent)
+-		ntfs_error(sb, read_err_str, "primary");
++		ntfs_error(sb, read_err_str, "%s", "primary");
+ 	if (!(NTFS_SB(sb)->on_errors & ON_ERRORS_RECOVER)) {
+ 		if (bh_primary)
+ 			brelse(bh_primary);
+@@ -677,7 +677,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
+ 			goto hotfix_primary_boot_sector;
+ 		brelse(bh_backup);
+ 	} else if (!silent)
+-		ntfs_error(sb, read_err_str, "backup");
++		ntfs_error(sb, read_err_str, "%s", "backup");
+ 	/* Try to read NT3.51- backup boot sector. */
+ 	if ((bh_backup = sb_bread(sb, nr_blocks >> 1))) {
+ 		if (is_boot_sector_ntfs(sb, (NTFS_BOOT_SECTOR*)
+@@ -688,7 +688,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
+ 					"sector.");
+ 		brelse(bh_backup);
+ 	} else if (!silent)
+-		ntfs_error(sb, read_err_str, "backup");
++		ntfs_error(sb, read_err_str, "%s", "backup");
+ 	/* We failed. Cleanup and return. */
+ 	if (bh_primary)
+ 		brelse(bh_primary);
 @@ -3072,6 +3072,7 @@ static struct file_system_type ntfs_fs_type = {
  	.kill_sb	= kill_block_super,
  	.fs_flags	= FS_REQUIRES_DEV,
@@ -75071,6 +75694,19 @@ index c7c40f1..5c31482 100644
  	ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
  	ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
  	unsigned int (*poll) (struct file *, struct poll_table_struct *);
+diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
+index d61febf..f0094f6 100644
+--- a/include/media/v4l2-device.h
++++ b/include/media/v4l2-device.h
+@@ -95,7 +95,7 @@ int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4
+    this function returns 0. If the name ends with a digit (e.g. cx18),
+    then the name will be set to cx18-0 since cx180 looks really odd. */
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+-						atomic_t *instance);
++						atomic_unchecked_t *instance);
+ 
+ /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
+    Since the parent disappears this ensures that v4l2_dev doesn't have an
 diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
 index 4d1c74a..8e58054 100644
 --- a/include/media/v4l2-ioctl.h
@@ -75172,7 +75808,7 @@ index ca2755f..85ec88c 100644
  /** inet_connection_sock - INET connection oriented sock
   *
 diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
-index e9ff3fc..9d3e5c7 100644
+index e9ff3fc..c19998a 100644
 --- a/include/net/inetpeer.h
 +++ b/include/net/inetpeer.h
 @@ -48,8 +48,8 @@ struct inet_peer {
@@ -75186,20 +75822,28 @@ index e9ff3fc..9d3e5c7 100644
  			__u32				tcp_ts;
  			__u32				tcp_ts_stamp;
  		};
-@@ -113,11 +113,11 @@ static inline int inet_getid(struct inet_peer *p, int more)
+@@ -109,16 +109,13 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)
+ /* can be called with or without local BH being disabled */
+ static inline int inet_getid(struct inet_peer *p, int more)
+ {
+-	int old, new;
++	int id;
  	more++;
  	inet_peer_refcheck(p);
- 	do {
+-	do {
 -		old = atomic_read(&p->ip_id_count);
-+		old = atomic_read_unchecked(&p->ip_id_count);
- 		new = old + more;
- 		if (!new)
- 			new = 1;
+-		new = old + more;
+-		if (!new)
+-			new = 1;
 -	} while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
-+	} while (atomic_cmpxchg_unchecked(&p->ip_id_count, old, new) != old);
- 	return new;
+-	return new;
++	id = atomic_add_return_unchecked(more, &p->ip_id_count);
++	if (!id)
++		id = atomic_inc_return_unchecked(&p->ip_id_count);
++	return id;
  }
  
+ #endif /* _NET_INETPEER_H */
 diff --git a/include/net/ip.h b/include/net/ip.h
 index eca0ef7..88118cb 100644
 --- a/include/net/ip.h
@@ -77361,6 +78005,19 @@ index 8be9b746..cb7b792 100644
  		     &parent_event->child_total_time_running);
  
  	/*
+diff --git a/kernel/events/internal.h b/kernel/events/internal.h
+index a2101bb..f2e0354 100644
+--- a/kernel/events/internal.h
++++ b/kernel/events/internal.h
+@@ -78,7 +78,7 @@ static unsigned long perf_data_size(struct ring_buffer *rb)
+ 
+ static inline void
+ __output_copy(struct perf_output_handle *handle,
+-		   const void *buf, unsigned int len)
++		   const void *buf, unsigned long len)
+ {
+ 	do {
+ 		unsigned long size = min_t(unsigned long, handle->size, len);
 diff --git a/kernel/exit.c b/kernel/exit.c
 index 234e152..0ae0243 100644
 --- a/kernel/exit.c
@@ -77796,7 +78453,7 @@ index ce0c182..16fd1e0 100644
  			else
  				new_fs = fs;
 diff --git a/kernel/futex.c b/kernel/futex.c
-index 1d0538e..58e6a1a 100644
+index 1d0538e..04de80f 100644
 --- a/kernel/futex.c
 +++ b/kernel/futex.c
 @@ -54,6 +54,7 @@
@@ -77819,6 +78476,15 @@ index 1d0538e..58e6a1a 100644
  	/*
  	 * The futex address must be "naturally" aligned.
  	 */
+@@ -438,7 +444,7 @@ static int cmpxchg_futex_value_locked(u32 *curval, u32 __user *uaddr,
+ 
+ static int get_futex_value_locked(u32 *dest, u32 __user *from)
+ {
+-	int ret;
++	unsigned long ret;
+ 
+ 	pagefault_disable();
+ 	ret = __copy_from_user_inatomic(dest, from, sizeof(u32));
 @@ -2744,6 +2750,7 @@ static int __init futex_init(void)
  {
  	u32 curval;
@@ -82139,6 +82805,26 @@ index c3c3f6b..7d8dbdc 100644
  
  #undef FTRACE_ENTRY
  #define FTRACE_ENTRY(call, struct_name, id, tstruct, print)		\
+diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
+index 3947835..8c0488b 100644
+--- a/kernel/trace/trace_clock.c
++++ b/kernel/trace/trace_clock.c
+@@ -114,7 +114,7 @@ u64 notrace trace_clock_global(void)
+ 	return now;
+ }
+ 
+-static atomic64_t trace_counter;
++static atomic64_unchecked_t trace_counter;
+ 
+ /*
+  * trace_clock_counter(): simply an atomic counter.
+@@ -123,5 +123,5 @@ static atomic64_t trace_counter;
+  */
+ u64 notrace trace_clock_counter(void)
+ {
+-	return atomic64_add_return(1, &trace_counter);
++	return atomic64_add_return_unchecked(1, &trace_counter);
+ }
 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
 index c212a7f..a2560bc 100644
 --- a/kernel/trace/trace_events.c
@@ -83090,7 +83776,7 @@ index 2b49dd2..0527d62 100644
  		bdi_destroy(bdi);
  		return err;
 diff --git a/mm/filemap.c b/mm/filemap.c
-index 556858c..ec09758 100644
+index 556858c..71a567d 100644
 --- a/mm/filemap.c
 +++ b/mm/filemap.c
 @@ -1773,7 +1773,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
@@ -83102,6 +83788,42 @@ index 556858c..ec09758 100644
  	file_accessed(file);
  	vma->vm_ops = &generic_file_vm_ops;
  	vma->vm_flags |= VM_CAN_NONLINEAR;
+@@ -2021,7 +2021,7 @@ static size_t __iovec_copy_from_user_inatomic(char *vaddr,
+ 
+ 	while (bytes) {
+ 		char __user *buf = iov->iov_base + base;
+-		int copy = min(bytes, iov->iov_len - base);
++		size_t copy = min(bytes, iov->iov_len - base);
+ 
+ 		base = 0;
+ 		left = __copy_from_user_inatomic(vaddr, buf, copy);
+@@ -2050,7 +2050,7 @@ size_t iov_iter_copy_from_user_atomic(struct page *page,
+ 	BUG_ON(!in_atomic());
+ 	kaddr = kmap_atomic(page, KM_USER0);
+ 	if (likely(i->nr_segs == 1)) {
+-		int left;
++		size_t left;
+ 		char __user *buf = i->iov->iov_base + i->iov_offset;
+ 		left = __copy_from_user_inatomic(kaddr + offset, buf, bytes);
+ 		copied = bytes - left;
+@@ -2078,7 +2078,7 @@ size_t iov_iter_copy_from_user(struct page *page,
+ 
+ 	kaddr = kmap(page);
+ 	if (likely(i->nr_segs == 1)) {
+-		int left;
++		size_t left;
+ 		char __user *buf = i->iov->iov_base + i->iov_offset;
+ 		left = __copy_from_user(kaddr + offset, buf, bytes);
+ 		copied = bytes - left;
+@@ -2108,7 +2108,7 @@ void iov_iter_advance(struct iov_iter *i, size_t bytes)
+ 		 * zero-length segments (without overruning the iovec).
+ 		 */
+ 		while (bytes || unlikely(i->count && !iov->iov_len)) {
+-			int copy;
++			size_t copy;
+ 
+ 			copy = min(bytes, iov->iov_len - base);
+ 			BUG_ON(!i->count || i->count < copy);
 @@ -2179,6 +2179,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
                          *pos = i_size_read(inode);
  
@@ -89687,6 +90409,19 @@ index 39a2d29..f39c0fe 100644
  	---help---
  	  Econet is a fairly old and slow networking protocol mainly used by
  	  Acorn computers to access file and print servers. It uses native
+diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
+index 19d6aef..4f610f4 100644
+--- a/net/ieee802154/6lowpan.c
++++ b/net/ieee802154/6lowpan.c
+@@ -329,7 +329,7 @@ static int lowpan_header_create(struct sk_buff *skb,
+ 			hc06_ptr += 3;
+ 		} else {
+ 			/* compress nothing */
+-			memcpy(hc06_ptr, &hdr, 4);
++			memcpy(hc06_ptr, hdr, 4);
+ 			/* replace the top byte with new ECN | DSCP format */
+ 			*hc06_ptr = tmp;
+ 			hc06_ptr += 4;
 diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
 index 5d228de..91bdee5 100644
 --- a/net/ipv4/af_inet.c
@@ -91119,6 +91854,39 @@ index 1567fb1..29af910 100644
  			__sk_dst_reset(sk);
  			dst = NULL;
  		}
+diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
+index db60043..33181b7 100644
+--- a/net/ipv6/ip6_output.c
++++ b/net/ipv6/ip6_output.c
+@@ -600,8 +600,8 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
+ 
+ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
+ {
+-	static atomic_t ipv6_fragmentation_id;
+-	int old, new;
++	static atomic_unchecked_t ipv6_fragmentation_id;
++	int id;
+ 
+ 	if (rt && !(rt->dst.flags & DST_NOPEER)) {
+ 		struct inet_peer *peer;
+@@ -614,13 +614,10 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
+ 			return;
+ 		}
+ 	}
+-	do {
+-		old = atomic_read(&ipv6_fragmentation_id);
+-		new = old + 1;
+-		if (!new)
+-			new = 1;
+-	} while (atomic_cmpxchg(&ipv6_fragmentation_id, old, new) != old);
+-	fhdr->identification = htonl(new);
++	id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
++	if (!id)
++		id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
++	fhdr->identification = htonl(id);
+ }
+ 
+ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
 diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
 index b204df8..8f274f4 100644
 --- a/net/ipv6/ipv6_sockglue.c
@@ -91182,9 +91950,18 @@ index 94874b0..a47969c 100644
  
  	case IP6T_SO_GET_ENTRIES:
 diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
-index 6e6c2c4..942cebf 100644
+index 6e6c2c4..c97891e 100644
 --- a/net/ipv6/raw.c
 +++ b/net/ipv6/raw.c
+@@ -109,7 +109,7 @@ found:
+  */
+ static int icmpv6_filter(const struct sock *sk, const struct sk_buff *skb)
+ {
+-	struct icmp6hdr *_hdr;
++	struct icmp6hdr _hdr;
+ 	const struct icmp6hdr *hdr;
+ 
+ 	hdr = skb_header_pointer(skb, skb_transport_offset(skb),
 @@ -376,7 +376,7 @@ static inline int rawv6_rcv_skb(struct sock *sk, struct sk_buff *skb)
  {
  	if ((raw6_sk(sk)->checksum || rcu_access_pointer(sk->sk_filter)) &&
@@ -92244,7 +93021,7 @@ index 14af632..9914188 100644
  	table = kmemdup(event_sysctl_table, sizeof(event_sysctl_table),
  			GFP_KERNEL);
 diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
-index 2e664a6..4264602 100644
+index 2e664a6..c854e4a 100644
 --- a/net/netfilter/nf_conntrack_proto_dccp.c
 +++ b/net/netfilter/nf_conntrack_proto_dccp.c
 @@ -391,7 +391,7 @@ struct dccp_net {
@@ -92256,6 +93033,15 @@ index 2e664a6..4264602 100644
  #endif
  };
  
+@@ -431,7 +431,7 @@ static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
+ 	const char *msg;
+ 	u_int8_t state;
+ 
+-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
++	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
+ 	BUG_ON(dh == NULL);
+ 
+ 	state = dccp_state_table[CT_DCCP_ROLE_CLIENT][dh->dccph_type][CT_DCCP_NONE];
 @@ -459,7 +459,7 @@ static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
  
  out_invalid:
@@ -92265,6 +93051,24 @@ index 2e664a6..4264602 100644
  	return false;
  }
  
+@@ -483,7 +483,7 @@ static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,
+ 	u_int8_t type, old_state, new_state;
+ 	enum ct_dccp_roles role;
+ 
+-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
++	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
+ 	BUG_ON(dh == NULL);
+ 	type = dh->dccph_type;
+ 
+@@ -575,7 +575,7 @@ static int dccp_error(struct net *net, struct nf_conn *tmpl,
+ 	unsigned int cscov;
+ 	const char *msg;
+ 
+-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
++	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
+ 	if (dh == NULL) {
+ 		msg = "nf_ct_dccp: short packet ";
+ 		goto out_invalid;
 @@ -612,7 +612,7 @@ static int dccp_error(struct net *net, struct nf_conn *tmpl,
  
  out_invalid:
@@ -94907,7 +95711,7 @@ index 113d20e..16d8f04 100644
  	}
  
 diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
-index 9414b9c..8b3547c 100644
+index 9414b9c..2477932 100644
 --- a/net/xfrm/xfrm_state.c
 +++ b/net/xfrm/xfrm_state.c
 @@ -194,11 +194,13 @@ int xfrm_register_type(const struct xfrm_type *type, unsigned short family)
@@ -94998,6 +95802,19 @@ index 9414b9c..8b3547c 100644
  		module_put(mode->afinfo->owner);
  		err = 0;
  	}
+@@ -1497,10 +1504,10 @@ EXPORT_SYMBOL(xfrm_find_acq_byseq);
+ u32 xfrm_get_acqseq(void)
+ {
+ 	u32 res;
+-	static atomic_t acqseq;
++	static atomic_unchecked_t acqseq;
+ 
+ 	do {
+-		res = atomic_inc_return(&acqseq);
++		res = atomic_inc_return_unchecked(&acqseq);
+ 	} while (!res);
+ 
+ 	return res;
 @@ -1985,8 +1992,10 @@ int __xfrm_init_state(struct xfrm_state *x, bool init_replay)
  		goto error;
  
@@ -97745,6 +98562,37 @@ index e2f684a..8eed291 100644
  int security_real_capable(struct task_struct *tsk, struct user_namespace *ns,
  			  int cap)
  {
+diff --git a/security/selinux/avc.c b/security/selinux/avc.c
+index dca1c22..4fa4591 100644
+--- a/security/selinux/avc.c
++++ b/security/selinux/avc.c
+@@ -59,7 +59,7 @@ struct avc_node {
+ struct avc_cache {
+ 	struct hlist_head	slots[AVC_CACHE_SLOTS]; /* head for avc_node->list */
+ 	spinlock_t		slots_lock[AVC_CACHE_SLOTS]; /* lock for writes */
+-	atomic_t		lru_hint;	/* LRU hint for reclaim scan */
++	atomic_unchecked_t	lru_hint;	/* LRU hint for reclaim scan */
+ 	atomic_t		active_nodes;
+ 	u32			latest_notif;	/* latest revocation notification */
+ };
+@@ -173,7 +173,7 @@ void __init avc_init(void)
+ 		spin_lock_init(&avc_cache.slots_lock[i]);
+ 	}
+ 	atomic_set(&avc_cache.active_nodes, 0);
+-	atomic_set(&avc_cache.lru_hint, 0);
++	atomic_set_unchecked(&avc_cache.lru_hint, 0);
+ 
+ 	avc_node_cachep = kmem_cache_create("avc_node", sizeof(struct avc_node),
+ 					     0, SLAB_PANIC, NULL);
+@@ -251,7 +251,7 @@ static inline int avc_reclaim_node(void)
+ 	spinlock_t *lock;
+ 
+ 	for (try = 0, ecx = 0; try < AVC_CACHE_SLOTS; try++) {
+-		hvalue = atomic_inc_return(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
++		hvalue = atomic_inc_return_unchecked(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
+ 		head = &avc_cache.slots[hvalue];
+ 		lock = &avc_cache.slots_lock[hvalue];
+ 
 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
 index 1126c10..effb32b 100644
 --- a/security/selinux/hooks.c
@@ -98246,6 +99094,27 @@ index 09d4648..cf234c7 100644
  
                  list_add(&s->list, &cs4297a_devs);
  
+diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
+index faabaa5..9888f8b 100644
+--- a/sound/pci/hda/hda_codec.c
++++ b/sound/pci/hda/hda_codec.c
+@@ -850,14 +850,10 @@ find_codec_preset(struct hda_codec *codec)
+ 	mutex_unlock(&preset_mutex);
+ 
+ 	if (mod_requested < HDA_MODREQ_MAX_COUNT) {
+-		char name[32];
+ 		if (!mod_requested)
+-			snprintf(name, sizeof(name), "snd-hda-codec-id:%08x",
+-				 codec->vendor_id);
++			request_module("snd-hda-codec-id:%08x", codec->vendor_id);
+ 		else
+-			snprintf(name, sizeof(name), "snd-hda-codec-id:%04x*",
+-				 (codec->vendor_id >> 16) & 0xffff);
+-		request_module(name);
++			request_module("snd-hda-codec-id:%04x*", (codec->vendor_id >> 16) & 0xffff);
+ 		mod_requested++;
+ 		goto again;
+ 	}
 diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
 index 03ee4e3..be86b46 100644
 --- a/sound/pci/ymfpci/ymfpci_main.c
@@ -99601,10 +100470,10 @@ index 0000000..568b360
 +}
 diff --git a/tools/gcc/kernexec_plugin.c b/tools/gcc/kernexec_plugin.c
 new file mode 100644
-index 0000000..0408e06
+index 0000000..257529f
 --- /dev/null
 +++ b/tools/gcc/kernexec_plugin.c
-@@ -0,0 +1,465 @@
+@@ -0,0 +1,471 @@
 +/*
 + * Copyright 2011-2013 by the PaX Team <pageexec@freemail.hu>
 + * Licensed under the GPL v2
@@ -99656,7 +100525,7 @@ index 0000000..0408e06
 +int plugin_is_GPL_compatible;
 +
 +static struct plugin_info kernexec_plugin_info = {
-+	.version	= "201302112000",
++	.version	= "201308230150",
 +	.help		= "method=[bts|or]\tinstrumentation method\n"
 +};
 +
@@ -99807,7 +100676,7 @@ index 0000000..0408e06
 +static void kernexec_instrument_fptr_bts(gimple_stmt_iterator *gsi)
 +{
 +	gimple assign_intptr, assign_new_fptr, call_stmt;
-+	tree intptr, old_fptr, new_fptr, kernexec_mask;
++	tree intptr, orptr, old_fptr, new_fptr, kernexec_mask;
 +
 +	call_stmt = gsi_stmt(*gsi);
 +	old_fptr = gimple_call_fn(call_stmt);
@@ -99816,16 +100685,20 @@ index 0000000..0408e06
 +	intptr = create_tmp_var(long_unsigned_type_node, "kernexec_bts");
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(intptr);
-+	mark_sym_for_renaming(intptr);
 +#endif
++	intptr = make_ssa_name(intptr, NULL);
 +	assign_intptr = gimple_build_assign(intptr, fold_convert(long_unsigned_type_node, old_fptr));
++	SSA_NAME_DEF_STMT(intptr) = assign_intptr;
 +	gsi_insert_before(gsi, assign_intptr, GSI_SAME_STMT);
 +	update_stmt(assign_intptr);
 +
 +	// apply logical or to temporary unsigned long and bitmask
 +	kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0x8000000000000000LL);
 +//	kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0xffffffff80000000LL);
-+	assign_intptr = gimple_build_assign(intptr, fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask));
++	orptr = fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask);
++	intptr = make_ssa_name(SSA_NAME_VAR(intptr), NULL);
++	assign_intptr = gimple_build_assign(intptr, orptr);
++	SSA_NAME_DEF_STMT(intptr) = assign_intptr;
 +	gsi_insert_before(gsi, assign_intptr, GSI_SAME_STMT);
 +	update_stmt(assign_intptr);
 +
@@ -99833,9 +100706,10 @@ index 0000000..0408e06
 +	new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_fptr");
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(new_fptr);
-+	mark_sym_for_renaming(new_fptr);
 +#endif
++	new_fptr = make_ssa_name(new_fptr, NULL);
 +	assign_new_fptr = gimple_build_assign(new_fptr, fold_convert(TREE_TYPE(old_fptr), intptr));
++	SSA_NAME_DEF_STMT(new_fptr) = assign_new_fptr;
 +	gsi_insert_before(gsi, assign_new_fptr, GSI_SAME_STMT);
 +	update_stmt(assign_new_fptr);
 +
@@ -99863,8 +100737,8 @@ index 0000000..0408e06
 +	new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_or");
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(new_fptr);
-+	mark_sym_for_renaming(new_fptr);
 +#endif
++	new_fptr = make_ssa_name(new_fptr, NULL);
 +
 +	// build asm volatile("orq %%r10, %0\n\t" : "=r"(new_fptr) : "0"(old_fptr));
 +	input = build_tree_list(NULL_TREE, build_string(2, "0"));
@@ -99879,6 +100753,7 @@ index 0000000..0408e06
 +	vec_safe_push(outputs, output);
 +#endif
 +	asm_or_stmt = gimple_build_asm_vec("orq %%r10, %0\n\t", inputs, outputs, NULL, NULL);
++	SSA_NAME_DEF_STMT(new_fptr) = asm_or_stmt;
 +	gimple_asm_set_volatile(asm_or_stmt, true);
 +	gsi_insert_before(gsi, asm_or_stmt, GSI_SAME_STMT);
 +	update_stmt(asm_or_stmt);
@@ -100072,10 +100947,10 @@ index 0000000..0408e06
 +}
 diff --git a/tools/gcc/latent_entropy_plugin.c b/tools/gcc/latent_entropy_plugin.c
 new file mode 100644
-index 0000000..b5395ba
+index 0000000..2ef6fd9
 --- /dev/null
 +++ b/tools/gcc/latent_entropy_plugin.c
-@@ -0,0 +1,327 @@
+@@ -0,0 +1,321 @@
 +/*
 + * Copyright 2012-2013 by the PaX Team <pageexec@freemail.hu>
 + * Licensed under the GPL v2
@@ -100127,7 +101002,7 @@ index 0000000..b5395ba
 +static tree latent_entropy_decl;
 +
 +static struct plugin_info latent_entropy_plugin_info = {
-+	.version	= "201303102320",
++	.version	= "201308230230",
 +	.help		= NULL
 +};
 +
@@ -100236,13 +101111,10 @@ index 0000000..b5395ba
 +	op = get_op(&rhs);
 +	addxorrol = fold_build2_loc(UNKNOWN_LOCATION, op, unsigned_intDI_type_node, local_entropy, rhs);
 +	assign = gimple_build_assign(local_entropy, addxorrol);
-+#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
-+#endif
-+//debug_bb(bb);
 +	gsi = gsi_after_labels(bb);
 +	gsi_insert_before(&gsi, assign, GSI_NEW_STMT);
 +	update_stmt(assign);
++//debug_bb(bb);
 +}
 +
 +static void perturb_latent_entropy(basic_block bb, tree rhs)
@@ -100255,13 +101127,14 @@ index 0000000..b5395ba
 +	temp = create_tmp_var(unsigned_intDI_type_node, "temp_latent_entropy");
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(temp);
-+	mark_sym_for_renaming(temp);
 +#endif
 +
 +	// 2. read...
++	temp = make_ssa_name(temp, NULL);
 +	assign = gimple_build_assign(temp, latent_entropy_decl);
++	SSA_NAME_DEF_STMT(temp) = assign;
 +#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
++	add_referenced_var(latent_entropy_decl);
 +#endif
 +	gsi = gsi_after_labels(bb);
 +	gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
@@ -100269,18 +101142,14 @@ index 0000000..b5395ba
 +
 +	// 3. ...modify...
 +	addxorrol = fold_build2_loc(UNKNOWN_LOCATION, get_op(NULL), unsigned_intDI_type_node, temp, rhs);
++	temp = make_ssa_name(SSA_NAME_VAR(temp), NULL);
 +	assign = gimple_build_assign(temp, addxorrol);
-+#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
-+#endif
++	SSA_NAME_DEF_STMT(temp) = assign;
 +	gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
 +	update_stmt(assign);
 +
 +	// 4. ...write latent_entropy
 +	assign = gimple_build_assign(latent_entropy_decl, temp);
-+#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
-+#endif
 +	gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
 +	update_stmt(assign);
 +}
@@ -100331,21 +101200,21 @@ index 0000000..b5395ba
 +
 +	assign = gimple_build_assign(local_entropy, build_int_cstu(unsigned_intDI_type_node, get_random_const()));
 +//	gimple_set_location(assign, loc);
-+#if BUILDING_GCC_VERSION <= 4007
-+	find_referenced_vars_in(assign);
-+#endif
 +	gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
 +	update_stmt(assign);
++//debug_bb(bb);
 +	bb = bb->next_bb;
 +
 +	// 3. instrument each BB with an operation on the local entropy variable
 +	while (bb != EXIT_BLOCK_PTR) {
 +		perturb_local_entropy(bb, local_entropy);
++//debug_bb(bb);
 +		bb = bb->next_bb;
 +	};
 +
 +	// 4. mix local entropy into the global entropy variable
 +	perturb_latent_entropy(EXIT_BLOCK_PTR->prev_bb, local_entropy);
++//debug_bb(EXIT_BLOCK_PTR->prev_bb);
 +	return 0;
 +}
 +
@@ -105195,10 +106064,10 @@ index 0000000..6fcc08d
 +alloc_dr_65495 alloc_dr 2 65495 NULL
 diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c
 new file mode 100644
-index 0000000..9db0d0e
+index 0000000..03d0c84
 --- /dev/null
 +++ b/tools/gcc/size_overflow_plugin.c
-@@ -0,0 +1,2114 @@
+@@ -0,0 +1,2113 @@
 +/*
 + * Copyright 2011, 2012, 2013 by Emese Revfy <re.emese@gmail.com>
 + * Licensed under the GPL v2, or (at your option) v3
@@ -105288,7 +106157,7 @@ index 0000000..9db0d0e
 +static void print_missing_msg(tree func, unsigned int argnum);
 +
 +static struct plugin_info size_overflow_plugin_info = {
-+	.version	= "20130410beta",
++	.version	= "20130822beta",
 +	.help		= "no-size-overflow\tturn off size overflow checking\n",
 +};
 +
@@ -105668,7 +106537,6 @@ index 0000000..9db0d0e
 +
 +#if BUILDING_GCC_VERSION <= 4007
 +	add_referenced_var(new_var);
-+	mark_sym_for_renaming(new_var);
 +#endif
 +	return new_var;
 +}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/hardened-patchset:master commit in: 3.2.50/, 3.10.10/
@ 2013-09-07 13:46 Anthony G. Basile
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony G. Basile @ 2013-09-07 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     5f94db8f4dbe6439cfa05014e3345b36d003bbb2
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  7 13:46:33 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Sep  7 13:46:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-patchset.git;a=commit;h=5f94db8f

Grsec/PaX: 2.9.1-{3.2.50,3.10.10}-201309062014

---
 3.10.10/0000_README                                |   2 +-
 ...20_grsecurity-2.9.1-3.10.10-201309062014.patch} | 122 ++++++++++++++++++++-
 3.2.50/0000_README                                 |   2 +-
 ...420_grsecurity-2.9.1-3.2.50-201309062011.patch} |  95 ++++++++++++++++
 4 files changed, 218 insertions(+), 3 deletions(-)

diff --git a/3.10.10/0000_README b/3.10.10/0000_README
index 4ab8587..b165467 100644
--- a/3.10.10/0000_README
+++ b/3.10.10/0000_README
@@ -2,7 +2,7 @@ README
 -----------------------------------------------------------------------------
 Individual Patch Descriptions:
 -----------------------------------------------------------------------------
-Patch:	4420_grsecurity-2.9.1-3.10.10-201309052118.patch
+Patch:	4420_grsecurity-2.9.1-3.10.10-201309062014.patch
 From:	http://www.grsecurity.net
 Desc:	hardened-sources base patch from upstream grsecurity
 

diff --git a/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309052118.patch b/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309062014.patch
similarity index 99%
rename from 3.10.10/4420_grsecurity-2.9.1-3.10.10-201309052118.patch
rename to 3.10.10/4420_grsecurity-2.9.1-3.10.10-201309062014.patch
index 938f65c..f986115 100644
--- a/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309052118.patch
+++ b/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309062014.patch
@@ -39885,6 +39885,101 @@ index 3eb1486..0a47ee9 100644
  	} while (*seqno == 0);
  
  	if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE)) {
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
+index 3751730..1a0bf07 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
+@@ -29,7 +29,9 @@
+ #include <drm/drmP.h>
+ #include <drm/ttm/ttm_bo_driver.h>
+ 
+-#define VMW_PPN_SIZE sizeof(unsigned long)
++#define VMW_PPN_SIZE (sizeof(unsigned long))
++/* A future safe maximum remap size. */
++#define VMW_PPN_PER_REMAP ((31 * 1024) / VMW_PPN_SIZE)
+ 
+ static int vmw_gmr2_bind(struct vmw_private *dev_priv,
+ 			 struct page *pages[],
+@@ -38,43 +40,61 @@ static int vmw_gmr2_bind(struct vmw_private *dev_priv,
+ {
+ 	SVGAFifoCmdDefineGMR2 define_cmd;
+ 	SVGAFifoCmdRemapGMR2 remap_cmd;
+-	uint32_t define_size = sizeof(define_cmd) + 4;
+-	uint32_t remap_size = VMW_PPN_SIZE * num_pages + sizeof(remap_cmd) + 4;
+ 	uint32_t *cmd;
+ 	uint32_t *cmd_orig;
++	uint32_t define_size = sizeof(define_cmd) + sizeof(*cmd);
++	uint32_t remap_num = num_pages / VMW_PPN_PER_REMAP + ((num_pages % VMW_PPN_PER_REMAP) > 0);
++	uint32_t remap_size = VMW_PPN_SIZE * num_pages + (sizeof(remap_cmd) + sizeof(*cmd)) * remap_num;
++	uint32_t remap_pos = 0;
++	uint32_t cmd_size = define_size + remap_size;
+ 	uint32_t i;
+ 
+-	cmd_orig = cmd = vmw_fifo_reserve(dev_priv, define_size + remap_size);
++	cmd_orig = cmd = vmw_fifo_reserve(dev_priv, cmd_size);
+ 	if (unlikely(cmd == NULL))
+ 		return -ENOMEM;
+ 
+ 	define_cmd.gmrId = gmr_id;
+ 	define_cmd.numPages = num_pages;
+ 
++	*cmd++ = SVGA_CMD_DEFINE_GMR2;
++	memcpy(cmd, &define_cmd, sizeof(define_cmd));
++	cmd += sizeof(define_cmd) / sizeof(*cmd);
++
++	/*
++	 * Need to split the command if there are too many
++	 * pages that goes into the gmr.
++	 */
++
+ 	remap_cmd.gmrId = gmr_id;
+ 	remap_cmd.flags = (VMW_PPN_SIZE > sizeof(*cmd)) ?
+ 		SVGA_REMAP_GMR2_PPN64 : SVGA_REMAP_GMR2_PPN32;
+-	remap_cmd.offsetPages = 0;
+-	remap_cmd.numPages = num_pages;
+ 
+-	*cmd++ = SVGA_CMD_DEFINE_GMR2;
+-	memcpy(cmd, &define_cmd, sizeof(define_cmd));
+-	cmd += sizeof(define_cmd) / sizeof(uint32);
++	while (num_pages > 0) {
++		unsigned long nr = min(num_pages, (unsigned long)VMW_PPN_PER_REMAP);
+ 
+-	*cmd++ = SVGA_CMD_REMAP_GMR2;
+-	memcpy(cmd, &remap_cmd, sizeof(remap_cmd));
+-	cmd += sizeof(remap_cmd) / sizeof(uint32);
++		remap_cmd.offsetPages = remap_pos;
++		remap_cmd.numPages = nr;
+ 
+-	for (i = 0; i < num_pages; ++i) {
+-		if (VMW_PPN_SIZE <= 4)
+-			*cmd = page_to_pfn(*pages++);
+-		else
+-			*((uint64_t *)cmd) = page_to_pfn(*pages++);
++		*cmd++ = SVGA_CMD_REMAP_GMR2;
++		memcpy(cmd, &remap_cmd, sizeof(remap_cmd));
++		cmd += sizeof(remap_cmd) / sizeof(*cmd);
+ 
+-		cmd += VMW_PPN_SIZE / sizeof(*cmd);
++		for (i = 0; i < nr; ++i) {
++			if (VMW_PPN_SIZE <= 4)
++				*cmd = page_to_pfn(*pages++);
++			else
++				*((uint64_t *)cmd) = page_to_pfn(*pages++);
++
++			cmd += VMW_PPN_SIZE / sizeof(*cmd);
++		}
++
++		num_pages -= nr;
++		remap_pos += nr;
+ 	}
+ 
+-	vmw_fifo_commit(dev_priv, define_size + remap_size);
++	BUG_ON(cmd != cmd_orig + cmd_size / sizeof(*cmd));
++
++	vmw_fifo_commit(dev_priv, cmd_size);
+ 
+ 	return 0;
+ }
 diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
 index c509d40..3b640c3 100644
 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
@@ -42115,6 +42210,22 @@ index e74df7c..03a03ba 100644
  				return -EFAULT;
  		} else
  			memcpy(msg, buf, count);
+diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c
+index 22b720e..77025f5 100644
+--- a/drivers/isdn/mISDN/dsp_core.c
++++ b/drivers/isdn/mISDN/dsp_core.c
+@@ -288,8 +288,10 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)
+ 	u8 *data;
+ 	int len;
+ 
+-	if (skb->len < sizeof(int))
++	if (skb->len < sizeof(int)) {
+ 		printk(KERN_ERR "%s: PH_CONTROL message too short\n", __func__);
++		return -EINVAL;
++	}
+ 	cont = *((int *)skb->data);
+ 	len = skb->len - sizeof(int);
+ 	data = skb->data + sizeof(int);
 diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c
 index 6a8405d..0bd1c7e 100644
 --- a/drivers/leds/leds-clevo-mail.c
@@ -95300,7 +95411,7 @@ index e85c48b..b8268d3 100644
  	struct ctl_table *ipv6_icmp_table;
  	int err;
 diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
-index 0a17ed9..2526cc3 100644
+index 0a17ed9..5600868 100644
 --- a/net/ipv6/tcp_ipv6.c
 +++ b/net/ipv6/tcp_ipv6.c
 @@ -103,6 +103,10 @@ static void inet6_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb)
@@ -95324,6 +95435,15 @@ index 0a17ed9..2526cc3 100644
  	tcp_v6_send_reset(sk, skb);
  discard:
  	if (opt_skb)
+@@ -1426,7 +1433,7 @@ ipv6_pktoptions:
+ 		if (np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim)
+ 			np->mcast_hops = ipv6_hdr(opt_skb)->hop_limit;
+ 		if (np->rxopt.bits.rxtclass)
+-			np->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb));
++			np->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(opt_skb));
+ 		if (ipv6_opt_accepted(sk, opt_skb)) {
+ 			skb_set_owner_r(opt_skb, sk);
+ 			opt_skb = xchg(&np->pktoptions, opt_skb);
 @@ -1480,12 +1487,20 @@ static int tcp_v6_rcv(struct sk_buff *skb)
  	TCP_SKB_CB(skb)->sacked = 0;
  

diff --git a/3.2.50/0000_README b/3.2.50/0000_README
index f87c63f..ac663c9 100644
--- a/3.2.50/0000_README
+++ b/3.2.50/0000_README
@@ -118,7 +118,7 @@ Patch:	1049_linux-3.2.50.patch
 From:	http://www.kernel.org
 Desc:	Linux 3.2.50
 
-Patch:	4420_grsecurity-2.9.1-3.2.50-201309052115.patch
+Patch:	4420_grsecurity-2.9.1-3.2.50-201309062011.patch
 From:	http://www.grsecurity.net
 Desc:	hardened-sources base patch from upstream grsecurity
 

diff --git a/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309052115.patch b/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309062011.patch
similarity index 99%
rename from 3.2.50/4420_grsecurity-2.9.1-3.2.50-201309052115.patch
rename to 3.2.50/4420_grsecurity-2.9.1-3.2.50-201309062011.patch
index 45cd2da..0f89ebd 100644
--- a/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309052115.patch
+++ b/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309062011.patch
@@ -35743,6 +35743,101 @@ index a0c2f12..68ae6cb 100644
  	} while (*seqno == 0);
  
  	if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE)) {
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
+index c41226a..2952249 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
+@@ -29,7 +29,9 @@
+ #include "drmP.h"
+ #include "ttm/ttm_bo_driver.h"
+ 
+-#define VMW_PPN_SIZE sizeof(unsigned long)
++#define VMW_PPN_SIZE (sizeof(unsigned long))
++/* A future safe maximum remap size. */
++#define VMW_PPN_PER_REMAP ((31 * 1024) / VMW_PPN_SIZE)
+ 
+ static int vmw_gmr2_bind(struct vmw_private *dev_priv,
+ 			 struct page *pages[],
+@@ -38,43 +40,61 @@ static int vmw_gmr2_bind(struct vmw_private *dev_priv,
+ {
+ 	SVGAFifoCmdDefineGMR2 define_cmd;
+ 	SVGAFifoCmdRemapGMR2 remap_cmd;
+-	uint32_t define_size = sizeof(define_cmd) + 4;
+-	uint32_t remap_size = VMW_PPN_SIZE * num_pages + sizeof(remap_cmd) + 4;
+ 	uint32_t *cmd;
+ 	uint32_t *cmd_orig;
++	uint32_t define_size = sizeof(define_cmd) + sizeof(*cmd);
++	uint32_t remap_num = num_pages / VMW_PPN_PER_REMAP + ((num_pages % VMW_PPN_PER_REMAP) > 0);
++	uint32_t remap_size = VMW_PPN_SIZE * num_pages + (sizeof(remap_cmd) + sizeof(*cmd)) * remap_num;
++	uint32_t remap_pos = 0;
++	uint32_t cmd_size = define_size + remap_size;
+ 	uint32_t i;
+ 
+-	cmd_orig = cmd = vmw_fifo_reserve(dev_priv, define_size + remap_size);
++	cmd_orig = cmd = vmw_fifo_reserve(dev_priv, cmd_size);
+ 	if (unlikely(cmd == NULL))
+ 		return -ENOMEM;
+ 
+ 	define_cmd.gmrId = gmr_id;
+ 	define_cmd.numPages = num_pages;
+ 
++	*cmd++ = SVGA_CMD_DEFINE_GMR2;
++	memcpy(cmd, &define_cmd, sizeof(define_cmd));
++	cmd += sizeof(define_cmd) / sizeof(*cmd);
++
++	/*
++	 * Need to split the command if there are too many
++	 * pages that goes into the gmr.
++	 */
++
+ 	remap_cmd.gmrId = gmr_id;
+ 	remap_cmd.flags = (VMW_PPN_SIZE > sizeof(*cmd)) ?
+ 		SVGA_REMAP_GMR2_PPN64 : SVGA_REMAP_GMR2_PPN32;
+-	remap_cmd.offsetPages = 0;
+-	remap_cmd.numPages = num_pages;
+ 
+-	*cmd++ = SVGA_CMD_DEFINE_GMR2;
+-	memcpy(cmd, &define_cmd, sizeof(define_cmd));
+-	cmd += sizeof(define_cmd) / sizeof(uint32);
++	while (num_pages > 0) {
++		unsigned long nr = min(num_pages, (unsigned long)VMW_PPN_PER_REMAP);
+ 
+-	*cmd++ = SVGA_CMD_REMAP_GMR2;
+-	memcpy(cmd, &remap_cmd, sizeof(remap_cmd));
+-	cmd += sizeof(remap_cmd) / sizeof(uint32);
++		remap_cmd.offsetPages = remap_pos;
++		remap_cmd.numPages = nr;
+ 
+-	for (i = 0; i < num_pages; ++i) {
+-		if (VMW_PPN_SIZE <= 4)
+-			*cmd = page_to_pfn(*pages++);
+-		else
+-			*((uint64_t *)cmd) = page_to_pfn(*pages++);
++		*cmd++ = SVGA_CMD_REMAP_GMR2;
++		memcpy(cmd, &remap_cmd, sizeof(remap_cmd));
++		cmd += sizeof(remap_cmd) / sizeof(*cmd);
+ 
+-		cmd += VMW_PPN_SIZE / sizeof(*cmd);
++		for (i = 0; i < nr; ++i) {
++			if (VMW_PPN_SIZE <= 4)
++				*cmd = page_to_pfn(*pages++);
++			else
++				*((uint64_t *)cmd) = page_to_pfn(*pages++);
++
++			cmd += VMW_PPN_SIZE / sizeof(*cmd);
++		}
++
++		num_pages -= nr;
++		remap_pos += nr;
+ 	}
+ 
+-	vmw_fifo_commit(dev_priv, define_size + remap_size);
++	BUG_ON(cmd != cmd_orig + cmd_size / sizeof(*cmd));
++
++	vmw_fifo_commit(dev_priv, cmd_size);
+ 
+ 	return 0;
+ }
 diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
 index 66917c6..2dcc8ae 100644
 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-07 13:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-02 19:48 [gentoo-commits] proj/hardened-patchset:master commit in: 3.2.50/, 3.10.10/ Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2013-09-07 13:46 Anthony G. Basile
2013-09-02 19:47 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox