History

Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm

Pull ARM fixes from Russell King: "A number of fixes: Patrik found a problem with preempt counting in the VFP assembly functions which can cause the preempt count to be upset. Nicolas fixed a problem with the parsing of the DT when it straddles a 1MB boundary. Subhash Jadavani reported a problem with sparsemem and our highmem support for cache maintanence for DMA areas, and TI found a bug in their strongly ordered memory mapping type. Also, three fixes by way of Will Deacon's tree from Dave Martin for instruction compatibility and Marc Zyngier to fix hypervisor boot mode issues." * 'fixes' of git://git.linaro.org/people/rmk/linux-arm: ARM: 7629/1: mm: Fix missing XN flag for for MT_MEMORY_SO ARM: DMA: Fix struct page iterator in dma_cache_maint() to work with sparsemem ARM: 7628/1: head.S: map one extra section for the ATAG/DTB area ARM: 7627/1: Predicate preempt logic on PREEMP_COUNT not PREEMPT alone ARM: virt: simplify __hyp_stub_install epilog ARM: virt: boot secondary CPUs through the right entry point ARM: virt: Avoid bx instruction for compatibility with <=ARMv4

Linus Torvalds committed 13 years ago

Commit 01acd3e2 parents 1496ec1 210b1846 files · +26 −27Browse files

Unified · Split

6 files
  1. arch/arm/kernel/head.S +4 −1
  2. arch/arm/kernel/hyp-stub.S +6 −12
  3. arch/arm/mm/dma-mapping.c +10 −8
  4. arch/arm/mm/mmu.c +1 −1
  5. arch/arm/vfp/entry.S +3 −3
  6. arch/arm/vfp/vfphw.S +2 −2
arch/arm/kernel/head.S+4−1
@@ -246,6 +246,7 @@ __create_page_tables: · 245 unmodified lines
246246
247247 /*
248248 * Then map boot params address in r2 if specified.
249+ * We map 2 sections in case the ATAGs/DTB crosses a section boundary.
249250 */
250251 mov r0, r2, lsr #SECTION_SHIFT
251252 movs r0, r0, lsl #SECTION_SHIFT
@@ -253,6 +254,8 @@ __create_page_tables: · 1 unmodified line
253254 addne r3, r3, #PAGE_OFFSET
254255 addne r3, r4, r3, lsr #(SECTION_SHIFT - PMD_ORDER)
255256 orrne r6, r7, r0
257+ strne r6, [r3], #1 << PMD_ORDER
258+ addne r6, r6, #1 << SECTION_SHIFT
256259 strne r6, [r3]
257260
258261 #ifdef CONFIG_DEBUG_LL
@@ -331,7 +334,7 @@ ENTRY(secondary_startup) · 72 unmodified lines
331334 * as it has already been validated by the primary processor.
332335 */
333336 #ifdef CONFIG_ARM_VIRT_EXT
334− bl __hyp_stub_install
337+ bl __hyp_stub_install_secondary
335338 #endif
336339 safe_svcmode_maskall r9
337340
arch/arm/kernel/hyp-stub.S+6−12
@@ -99,7 +99,7 @@ ENTRY(__hyp_stub_install_secondary) · 98 unmodified lines
9999 * immediately.
100100 */
101101 compare_cpu_mode_with_primary r4, r5, r6, r7
102− bxne lr
102+ movne pc, lr
103103
104104 /*
105105 * Once we have given up on one CPU, we do not try to install the
@@ -111,7 +111,7 @@ ENTRY(__hyp_stub_install_secondary) · 5 unmodified lines
111111 */
112112
113113 cmp r4, #HYP_MODE
114− bxne lr @ give up if the CPU is not in HYP mode
114+ movne pc, lr @ give up if the CPU is not in HYP mode
115115
116116 /*
117117 * Configure HSCTLR to set correct exception endianness/instruction set
@@ -120,7 +120,8 @@ ENTRY(__hyp_stub_install_secondary) · 2 unmodified lines
120120 * Eventually, CPU-specific code might be needed -- assume not for now
121121 *
122122 * This code relies on the "eret" instruction to synchronize the
123− * various coprocessor accesses.
123+ * various coprocessor accesses. This is done when we switch to SVC
124+ * (see safe_svcmode_maskall).
124125 */
125126 @ Now install the hypervisor stub:
126127 adr r7, __hyp_stub_vectors
@@ -155,14 +156,7 @@ THUMB( orr r7, #(1 << 30) ) @ HSCTLR.TE · 28 unmodified lines
155156 1:
156157 #endif
157158
158− bic r7, r4, #MODE_MASK
159− orr r7, r7, #SVC_MODE
160−THUMB( orr r7, r7, #PSR_T_BIT )
161− msr spsr_cxsf, r7 @ This is SPSR_hyp.
162−
163− __MSR_ELR_HYP(14) @ msr elr_hyp, lr
164− __ERET @ return, switching to SVC mode
165− @ The boot CPU mode is left in r4.
159+ bx lr @ The boot CPU mode is left in r4.
166160 ENDPROC(__hyp_stub_install_secondary)
167161
168162 __hyp_stub_do_trap:
@@ -200,7 +194,7 @@ ENDPROC(__hyp_get_vectors) · 31 unmodified lines
200194 @ fall through
201195 ENTRY(__hyp_set_vectors)
202196 __HVC(0)
203− bx lr
197+ mov pc, lr
204198 ENDPROC(__hyp_set_vectors)
205199
206200 #ifndef ZIMAGE
arch/arm/mm/dma-mapping.c+10−8
@@ -774,25 +774,27 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset, · 773 unmodified lines
774774 size_t size, enum dma_data_direction dir,
775775 void (*op)(const void *, size_t, int))
776776 {
777+ unsigned long pfn;
778+ size_t left = size;
779+
780+ pfn = page_to_pfn(page) + offset / PAGE_SIZE;
781+ offset %= PAGE_SIZE;
782+
777783 /*
778784 * A single sg entry may refer to multiple physically contiguous
779785 * pages. But we still need to process highmem pages individually.
780786 * If highmem is not configured then the bulk of this loop gets
781787 * optimized out.
782788 */
783− size_t left = size;
784789 do {
785790 size_t len = left;
786791 void *vaddr;
787792
793+ page = pfn_to_page(pfn);
794+
788795 if (PageHighMem(page)) {
789− if (len + offset > PAGE_SIZE) {
790− if (offset >= PAGE_SIZE) {
791− page += offset / PAGE_SIZE;
792− offset %= PAGE_SIZE;
793− }
796+ if (len + offset > PAGE_SIZE)
794797 len = PAGE_SIZE - offset;
795− }
796798 vaddr = kmap_high_get(page);
797799 if (vaddr) {
798800 vaddr += offset;
@@ -809,7 +811,7 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset, · 10 unmodified lines
809811 op(vaddr, len, dir);
810812 }
811813 offset = 0;
812− page++;
814+ pfn++;
813815 left -= len;
814816 } while (left);
815817 }
arch/arm/mm/mmu.c+1−1
@@ -283,7 +283,7 @@ static struct mem_type mem_types[] = { · 282 unmodified lines
283283 },
284284 [MT_MEMORY_SO] = {
285285 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
286− L_PTE_MT_UNCACHED,
286+ L_PTE_MT_UNCACHED | L_PTE_XN,
287287 .prot_l1 = PMD_TYPE_TABLE,
288288 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_S |
289289 PMD_SECT_UNCACHED | PMD_SECT_XN,
arch/arm/vfp/entry.S+3−3
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 @ IRQs disabled.
2323 @
2424 ENTRY(do_vfp)
25−#ifdef CONFIG_PREEMPT
25+#ifdef CONFIG_PREEMPT_COUNT
2626 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
2727 add r11, r4, #1 @ increment it
2828 str r11, [r10, #TI_PREEMPT]
@@ -35,7 +35,7 @@ ENTRY(do_vfp) · 6 unmodified lines
3535 ENDPROC(do_vfp)
3636
3737 ENTRY(vfp_null_entry)
38−#ifdef CONFIG_PREEMPT
38+#ifdef CONFIG_PREEMPT_COUNT
3939 get_thread_info r10
4040 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
4141 sub r11, r4, #1 @ decrement it
@@ -53,7 +53,7 @@ ENDPROC(vfp_null_entry) · 11 unmodified lines
5353
5454 __INIT
5555 ENTRY(vfp_testing_entry)
56−#ifdef CONFIG_PREEMPT
56+#ifdef CONFIG_PREEMPT_COUNT
5757 get_thread_info r10
5858 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
5959 sub r11, r4, #1 @ decrement it
arch/arm/vfp/vfphw.S+2−2
@@ -168,7 +168,7 @@ vfp_hw_state_valid: · 167 unmodified lines
168168 @ else it's one 32-bit instruction, so
169169 @ always subtract 4 from the following
170170 @ instruction address.
171−#ifdef CONFIG_PREEMPT
171+#ifdef CONFIG_PREEMPT_COUNT
172172 get_thread_info r10
173173 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
174174 sub r11, r4, #1 @ decrement it
@@ -192,7 +192,7 @@ look_for_VFP_exceptions: · 17 unmodified lines
192192 @ not recognised by VFP
193193
194194 DBGSTR "not VFP"
195−#ifdef CONFIG_PREEMPT
195+#ifdef CONFIG_PREEMPT_COUNT
196196 get_thread_info r10
197197 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
198198 sub r11, r4, #1 @ decrement it