aboutsummaryrefslogtreecommitdiff
path: root/drivers/iommu/intel_irq_remapping.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <[email protected]>2017-06-27 18:16:48 +0200
committerJoerg Roedel <[email protected]>2017-06-28 12:24:40 +0200
commit58c4a95f90839624b67f67acdb8a129f4383b569 (patch)
tree44e773e9f149411b27fe80cbfecb87fc78feb572 /drivers/iommu/intel_irq_remapping.c
parent71bb620df634b22a08efd62a0f93c3f2aceaa8e2 (diff)
iommu/vt-d: Don't disable preemption while accessing deferred_flush()
get_cpu() disables preemption and returns the current CPU number. The CPU number is only used once while retrieving the address of the local's CPU deferred_flush pointer. We can instead use raw_cpu_ptr() while we remain preemptible. The worst thing that can happen is that flush_unmaps_timeout() is invoked multiple times: once by taskA after seeing HIGH_WATER_MARK and then preempted to another CPU and then by taskB which saw HIGH_WATER_MARK on the same CPU as taskA. It is also likely that ->size got from HIGH_WATER_MARK to 0 right after its read because another CPU invoked flush_unmaps_timeout() for this CPU. The access to flush_data is protected by a spinlock so even if we get migrated to another CPU or preempted - the data structure is protected. While at it, I marked deferred_flush static since I can't find a reference to it outside of this file. Cc: David Woodhouse <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: [email protected] Cc: Andrew Morton <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
Diffstat (limited to 'drivers/iommu/intel_irq_remapping.c')
0 files changed, 0 insertions, 0 deletions