diff options
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mm/context.c | 26 | ||||
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 3 |
3 files changed, 15 insertions, 15 deletions
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 03823e784f63..c43c71455566 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -1012,6 +1012,7 @@ config ARCH_SUPPORTS_BIG_ENDIAN | |||
1012 | 1012 | ||
1013 | config ARM_KERNMEM_PERMS | 1013 | config ARM_KERNMEM_PERMS |
1014 | bool "Restrict kernel memory permissions" | 1014 | bool "Restrict kernel memory permissions" |
1015 | depends on MMU | ||
1015 | help | 1016 | help |
1016 | If this is set, kernel memory other than kernel text (and rodata) | 1017 | If this is set, kernel memory other than kernel text (and rodata) |
1017 | will be made non-executable. The tradeoff is that each region is | 1018 | will be made non-executable. The tradeoff is that each region is |
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 91892569710f..845769e41332 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
@@ -144,21 +144,17 @@ static void flush_context(unsigned int cpu) | |||
144 | /* Update the list of reserved ASIDs and the ASID bitmap. */ | 144 | /* Update the list of reserved ASIDs and the ASID bitmap. */ |
145 | bitmap_clear(asid_map, 0, NUM_USER_ASIDS); | 145 | bitmap_clear(asid_map, 0, NUM_USER_ASIDS); |
146 | for_each_possible_cpu(i) { | 146 | for_each_possible_cpu(i) { |
147 | if (i == cpu) { | 147 | asid = atomic64_xchg(&per_cpu(active_asids, i), 0); |
148 | asid = 0; | 148 | /* |
149 | } else { | 149 | * If this CPU has already been through a |
150 | asid = atomic64_xchg(&per_cpu(active_asids, i), 0); | 150 | * rollover, but hasn't run another task in |
151 | /* | 151 | * the meantime, we must preserve its reserved |
152 | * If this CPU has already been through a | 152 | * ASID, as this is the only trace we have of |
153 | * rollover, but hasn't run another task in | 153 | * the process it is still running. |
154 | * the meantime, we must preserve its reserved | 154 | */ |
155 | * ASID, as this is the only trace we have of | 155 | if (asid == 0) |
156 | * the process it is still running. | 156 | asid = per_cpu(reserved_asids, i); |
157 | */ | 157 | __set_bit(asid & ~ASID_MASK, asid_map); |
158 | if (asid == 0) | ||
159 | asid = per_cpu(reserved_asids, i); | ||
160 | __set_bit(asid & ~ASID_MASK, asid_map); | ||
161 | } | ||
162 | per_cpu(reserved_asids, i) = asid; | 158 | per_cpu(reserved_asids, i) = asid; |
163 | } | 159 | } |
164 | 160 | ||
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index a673c7f7e208..903dba064a03 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -2048,6 +2048,9 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) | |||
2048 | { | 2048 | { |
2049 | struct dma_iommu_mapping *mapping = dev->archdata.mapping; | 2049 | struct dma_iommu_mapping *mapping = dev->archdata.mapping; |
2050 | 2050 | ||
2051 | if (!mapping) | ||
2052 | return; | ||
2053 | |||
2051 | __arm_iommu_detach_device(dev); | 2054 | __arm_iommu_detach_device(dev); |
2052 | arm_iommu_release_mapping(mapping); | 2055 | arm_iommu_release_mapping(mapping); |
2053 | } | 2056 | } |