diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-22 20:38:28 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-22 20:38:28 +0100 |
commit | 9eb124fe796cbadd454c8f946d7051f4c3f4a251 (patch) | |
tree | 357d21901062bf487d4c19d0495e630256d1eee3 /arch/arm64/include/asm/mmu_context.h | |
parent | media: coda/imx-vdoa: Remove irq member from vdoa_data struct (diff) | |
parent | w1_netlink.h: add support for nested structs (diff) | |
download | linux-9eb124fe796cbadd454c8f946d7051f4c3f4a251.tar.xz linux-9eb124fe796cbadd454c8f946d7051f4c3f4a251.zip |
Merge branch 'docs-next' of git://git.lwn.net/linux into patchwork
* 'docs-next' of git://git.lwn.net/linux: (888 commits)
w1_netlink.h: add support for nested structs
scripts: kernel-doc: apply filtering rules to warnings
scripts: kernel-doc: improve nested logic to handle multiple identifiers
scripts: kernel-doc: handle nested struct function arguments
scripts: kernel-doc: print the declaration name on warnings
scripts: kernel-doc: get rid of $nested parameter
scripts: kernel-doc: parse next structs/unions
scripts: kernel-doc: replace tabs by spaces
scripts: kernel-doc: change default to ReST format
scripts: kernel-doc: improve argument handling
scripts: kernel-doc: get rid of unused output formats
docs: get rid of kernel-doc-nano-HOWTO.txt
docs: kernel-doc.rst: add documentation about man pages
docs: kernel-doc.rst: improve typedef documentation
docs: kernel-doc.rst: improve structs chapter
docs: kernel-doc.rst: improve function documentation section
docs: kernel-doc.rst: improve private members description
docs: kernel-doc.rst: better describe kernel-doc arguments
docs: fix process/submit-checklist.rst Sphinx warning
docs: ftrace-uses.rst fix varios code-block directives
...
Diffstat (limited to 'arch/arm64/include/asm/mmu_context.h')
-rw-r--r-- | arch/arm64/include/asm/mmu_context.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index 3257895a9b5e..9d155fa9a507 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -156,29 +156,21 @@ void check_and_switch_context(struct mm_struct *mm, unsigned int cpu); #define init_new_context(tsk,mm) ({ atomic64_set(&(mm)->context.id, 0); 0; }) -/* - * This is called when "tsk" is about to enter lazy TLB mode. - * - * mm: describes the currently active mm context - * tsk: task which is entering lazy tlb - * cpu: cpu number which is entering lazy tlb - * - * tsk->mm will be NULL - */ -static inline void -enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) -{ -} - #ifdef CONFIG_ARM64_SW_TTBR0_PAN static inline void update_saved_ttbr0(struct task_struct *tsk, struct mm_struct *mm) { - if (system_uses_ttbr0_pan()) { - BUG_ON(mm->pgd == swapper_pg_dir); - task_thread_info(tsk)->ttbr0 = - virt_to_phys(mm->pgd) | ASID(mm) << 48; - } + u64 ttbr; + + if (!system_uses_ttbr0_pan()) + return; + + if (mm == &init_mm) + ttbr = __pa_symbol(empty_zero_page); + else + ttbr = virt_to_phys(mm->pgd) | ASID(mm) << 48; + + task_thread_info(tsk)->ttbr0 = ttbr; } #else static inline void update_saved_ttbr0(struct task_struct *tsk, @@ -187,6 +179,16 @@ static inline void update_saved_ttbr0(struct task_struct *tsk, } #endif +static inline void +enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) +{ + /* + * We don't actually care about the ttbr0 mapping, so point it at the + * zero page. + */ + update_saved_ttbr0(tsk, &init_mm); +} + static inline void __switch_mm(struct mm_struct *next) { unsigned int cpu = smp_processor_id(); @@ -214,11 +216,9 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, * Update the saved TTBR0_EL1 of the scheduled-in task as the previous * value may have not been initialised yet (activate_mm caller) or the * ASID has changed since the last run (following the context switch - * of another thread of the same process). Avoid setting the reserved - * TTBR0_EL1 to swapper_pg_dir (init_mm; e.g. via idle_task_exit). + * of another thread of the same process). */ - if (next != &init_mm) - update_saved_ttbr0(tsk, next); + update_saved_ttbr0(tsk, next); } #define deactivate_mm(tsk,mm) do { } while (0) |