linux-stable/arch/x86/kvm
Mark Rutland 6aa7de0591 locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
Please do not apply this to mainline directly, instead please re-run the
coccinelle script shown below and apply its output.

For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
preference to ACCESS_ONCE(), and new code is expected to use one of the
former. So far, there's been no reason to change most existing uses of
ACCESS_ONCE(), as these aren't harmful, and changing them results in
churn.

However, for some features, the read/write distinction is critical to
correct operation. To distinguish these cases, separate read/write
accessors must be used. This patch migrates (most) remaining
ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
coccinelle script:

----
// Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
// WRITE_ONCE()

// $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch

virtual patch

@ depends on patch @
expression E1, E2;
@@

- ACCESS_ONCE(E1) = E2
+ WRITE_ONCE(E1, E2)

@ depends on patch @
expression E;
@@

- ACCESS_ONCE(E)
+ READ_ONCE(E)
----

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: davem@davemloft.net
Cc: linux-arch@vger.kernel.org
Cc: mpe@ellerman.id.au
Cc: shuah@kernel.org
Cc: snitzer@redhat.com
Cc: thor.thayer@linux.intel.com
Cc: tj@kernel.org
Cc: viro@zeniv.linux.org.uk
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-25 11:01:08 +02:00
..
cpuid.c Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2017-09-08 14:40:43 +02:00
cpuid.h KVM: x86: fix clang build 2017-09-13 16:40:24 +02:00
debugfs.c kvm: x86: export TSC information to user-space 2016-09-16 16:57:48 +02:00
emulate.c x86/kvm: Move kvm_fastop_exception to .fixup section 2017-10-05 15:06:30 +02:00
hyperv.c KVM: X86: implement the logic for spinlock optimization 2017-08-08 10:57:43 +02:00
hyperv.h kvm: x86: hyperv: make VP_INDEX managed by userspace 2017-07-14 16:28:18 +02:00
i8254.c KVM: x86: take slots_lock in kvm_free_pit 2017-07-12 22:38:26 +02:00
i8254.h KVM: x86: Handle the kthread worker using the new API 2016-12-08 15:31:11 +01:00
i8259.c KVM: x86: simplify pic_ioport_read() 2017-04-12 20:17:15 +02:00
ioapic.c KVM: x86: rename kvm_vcpu_request_scan_ioapic() 2017-04-12 20:17:14 +02:00
ioapic.h KVM: x86: convert kvm_(set|get)_ioapic() into void 2017-04-12 20:17:14 +02:00
irq.c KVM: x86: get rid of pic_irqchip() 2017-04-12 20:17:13 +02:00
irq.h KVM: x86: don't hold kvm->lock in KVM_SET_GSI_ROUTING 2017-05-02 14:45:45 +02:00
irq_comm.c KVM: x86: don't hold kvm->lock in KVM_SET_GSI_ROUTING 2017-05-02 14:45:45 +02:00
Kconfig KVM: add X86_LOCAL_APIC dependency 2017-10-05 19:55:48 +02:00
kvm_cache_regs.h Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2017-09-08 14:40:43 +02:00
lapic.c kvm,lapic: Justify use of swait_active() 2017-09-15 16:57:11 +02:00
lapic.h KVM: hyperv: support HV_X64_MSR_TSC_FREQUENCY and HV_X64_MSR_APIC_FREQUENCY 2017-08-07 15:26:06 +02:00
Makefile KVM: x86: drop legacy device assignment 2017-04-07 16:49:00 +02:00
mmu.c locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
mmu.h Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2017-09-08 14:40:43 +02:00
mmu_audit.c KVM: MMU: Add 5 level EPT & Shadow page table support. 2017-08-24 18:09:17 +02:00
mmutrace.h kvm: x86: mmu: allow A/D bits to be disabled in an mmu 2017-07-03 11:19:54 +02:00
mtrr.c KVM: x86: generalize guest_cpuid_has_ helpers 2017-08-07 16:11:50 +02:00
page_track.c locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
paging_tmpl.h KVM: MMU: always terminate page walks at level 1 2017-10-10 15:31:28 +02:00
pmu.c KVM: x86: never specify a sample period for virtualized in_tx_cp counters 2017-03-01 14:19:46 +01:00
pmu.h KVM: x86/vPMU: Define kvm_pmu_ops to support vPMU function dispatch 2015-06-23 14:12:14 +02:00
pmu_amd.c perf/x86/amd: Make HW_CACHE_REFERENCES and HW_CACHE_MISSES measure L2 2016-09-16 16:19:49 +02:00
pmu_intel.c KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh() 2017-05-19 19:59:27 +02:00
svm.c KVM: SVM: Add irqchip_split() checks before enabling AVIC 2017-09-14 17:05:13 +02:00
trace.h KVM: x86: Add return value to kvm_cpuid(). 2017-08-24 18:09:15 +02:00
tss.h
vmx.c KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit 2017-10-12 13:54:56 +02:00
x86.c x86/fpu: Rename fpu__activate_curr() to fpu__initialize() 2017-09-26 09:43:44 +02:00
x86.h KVM: X86: Fix loss of exception which has not yet been injected 2017-08-24 18:09:19 +02:00