Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64

Pull arm64 fixes from Catalin Marinas:
- Post -rc1 update to the common reboot infrastructure.
- Fixes (user cache maintenance fault handling, !COMPAT compilation,
CPU online and interrupt hanlding).

* tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
arm64: use common reboot infrastructure
arm64: mm: don't treat user cache maintenance faults as writes
arm64: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
arm64: Only enable local interrupts after the CPU is marked online

+31 -42
-7
arch/arm64/include/asm/debug-monitors.h
··· 83 83 } 84 84 #endif 85 85 86 - #ifdef CONFIG_COMPAT 87 86 int aarch32_break_handler(struct pt_regs *regs); 88 - #else 89 - static int aarch32_break_handler(struct pt_regs *regs) 90 - { 91 - return -EFAULT; 92 - } 93 - #endif 94 87 95 88 #endif /* __ASSEMBLY */ 96 89 #endif /* __KERNEL__ */
+2 -1
arch/arm64/include/asm/system_misc.h
··· 23 23 #include <linux/compiler.h> 24 24 #include <linux/linkage.h> 25 25 #include <linux/irqflags.h> 26 + #include <linux/reboot.h> 26 27 27 28 struct pt_regs; 28 29 ··· 42 41 extern void __show_regs(struct pt_regs *); 43 42 44 43 void soft_restart(unsigned long); 45 - extern void (*arm_pm_restart)(char str, const char *cmd); 44 + extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd); 46 45 47 46 #define UDBG_UNDEFINED (1 << 0) 48 47 #define UDBG_SYSCALL (1 << 1)
+1 -1
arch/arm64/kernel/process.c
··· 132 132 133 133 /* Now call the architecture specific reboot code. */ 134 134 if (arm_pm_restart) 135 - arm_pm_restart('h', cmd); 135 + arm_pm_restart(reboot_mode, cmd); 136 136 137 137 /* 138 138 * Whoops - the architecture was unable to reboot.
+8 -7
arch/arm64/kernel/smp.c
··· 200 200 raw_spin_unlock(&boot_lock); 201 201 202 202 /* 203 - * Enable local interrupts. 204 - */ 205 - notify_cpu_starting(cpu); 206 - local_irq_enable(); 207 - local_fiq_enable(); 208 - 209 - /* 210 203 * OK, now it's safe to let the boot CPU continue. Wait for 211 204 * the CPU migration code to notice that the CPU is online 212 205 * before we continue. 213 206 */ 214 207 set_cpu_online(cpu, true); 215 208 complete(&cpu_running); 209 + 210 + /* 211 + * Enable GIC and timers. 212 + */ 213 + notify_cpu_starting(cpu); 214 + 215 + local_irq_enable(); 216 + local_fiq_enable(); 216 217 217 218 /* 218 219 * OK, it's off to the idle thread for us
+20 -26
arch/arm64/mm/fault.c
··· 152 152 #define ESR_CM (1 << 8) 153 153 #define ESR_LNX_EXEC (1 << 24) 154 154 155 - /* 156 - * Check that the permissions on the VMA allow for the fault which occurred. 157 - * If we encountered a write fault, we must have write permission, otherwise 158 - * we allow any permission. 159 - */ 160 - static inline bool access_error(unsigned int esr, struct vm_area_struct *vma) 161 - { 162 - unsigned int mask = VM_READ | VM_WRITE | VM_EXEC; 163 - 164 - if (esr & ESR_WRITE) 165 - mask = VM_WRITE; 166 - if (esr & ESR_LNX_EXEC) 167 - mask = VM_EXEC; 168 - 169 - return vma->vm_flags & mask ? false : true; 170 - } 171 - 172 155 static int __do_page_fault(struct mm_struct *mm, unsigned long addr, 173 - unsigned int esr, unsigned int flags, 156 + unsigned int mm_flags, unsigned long vm_flags, 174 157 struct task_struct *tsk) 175 158 { 176 159 struct vm_area_struct *vma; ··· 171 188 * it. 172 189 */ 173 190 good_area: 174 - if (access_error(esr, vma)) { 191 + /* 192 + * Check that the permissions on the VMA allow for the fault which 193 + * occurred. If we encountered a write or exec fault, we must have 194 + * appropriate permissions, otherwise we allow any permission. 195 + */ 196 + if (!(vma->vm_flags & vm_flags)) { 175 197 fault = VM_FAULT_BADACCESS; 176 198 goto out; 177 199 } 178 200 179 - return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); 201 + return handle_mm_fault(mm, vma, addr & PAGE_MASK, mm_flags); 180 202 181 203 check_stack: 182 204 if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr)) ··· 196 208 struct task_struct *tsk; 197 209 struct mm_struct *mm; 198 210 int fault, sig, code; 199 - bool write = (esr & ESR_WRITE) && !(esr & ESR_CM); 200 - unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | 201 - (write ? FAULT_FLAG_WRITE : 0); 211 + unsigned long vm_flags = VM_READ | VM_WRITE | VM_EXEC; 212 + unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; 213 + 214 + if (esr & ESR_LNX_EXEC) { 215 + vm_flags = VM_EXEC; 216 + } else if ((esr & ESR_WRITE) && !(esr & ESR_CM)) { 217 + vm_flags = VM_WRITE; 218 + mm_flags |= FAULT_FLAG_WRITE; 219 + } 202 220 203 221 tsk = current; 204 222 mm = tsk->mm; ··· 242 248 #endif 243 249 } 244 250 245 - fault = __do_page_fault(mm, addr, esr, flags, tsk); 251 + fault = __do_page_fault(mm, addr, mm_flags, vm_flags, tsk); 246 252 247 253 /* 248 254 * If we need to retry but a fatal signal is pending, handle the ··· 259 265 */ 260 266 261 267 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr); 262 - if (flags & FAULT_FLAG_ALLOW_RETRY) { 268 + if (mm_flags & FAULT_FLAG_ALLOW_RETRY) { 263 269 if (fault & VM_FAULT_MAJOR) { 264 270 tsk->maj_flt++; 265 271 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, ··· 274 280 * Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk of 275 281 * starvation. 276 282 */ 277 - flags &= ~FAULT_FLAG_ALLOW_RETRY; 283 + mm_flags &= ~FAULT_FLAG_ALLOW_RETRY; 278 284 goto retry; 279 285 } 280 286 }