android_kernel_motorola_sm6225/arch/arc/mm
Vineet Gupta 648d4e3957 ARCv2: entry: push out the Z flag unclobber from common EXCEPTION_PROLOGUE
[ Upstream commit 23c0cbd0c75c3b564850294427fd2be2bc2a015b ]

Upon a taken interrupt/exception from User mode, HS hardware auto sets Z flag.
This helps shave a few instructions from EXCEPTION_PROLOGUE by eliding
re-reading ERSTATUS and some bit fiddling.

However TLB Miss Exception handler can clobber the CPU flags and still end
up in EXCEPTION_PROLOGUE in the slow path handling TLB handling case:

   EV_TLBMissD
     do_slow_path_pf
       EV_TLBProtV (aliased to call_do_page_fault)
          EXCEPTION_PROLOGUE

As a result, EXCEPTION_PROLOGUE need to "unclobber" the Z flag which this
patch changes. It is now pushed out to TLB Miss Exception handler.
The reasons beings:

 - The flag restoration is only needed for slowpath TLB Miss Exception
   handling, but currently being in EXCEPTION_PROLOGUE penalizes all
   exceptions such as ProtV and syscall Trap, where Z flag is already
   as expected.

 - Pushing unclobber out to where it was clobbered is much cleaner and
   also serves to document the fact.

 - Makes EXCEPTION_PROLGUE similar to INTERRUPT_PROLOGUE so easier to
   refactor the common parts which is what this series aims to do

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Stable-dep-of: 92e2921eeafd ("ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-11 11:45:10 +02:00
..
cache.c ARC: export clear_user_page() for modules 2021-09-22 11:48:13 +02:00
dma.c ARC: don't check for HIGHMEM pages in arch_dma_alloc 2018-09-04 13:21:38 -07:00
extable.c ARC: uaccess: enable INLINE_COPY_{TO,FROM}_USER ... 2017-03-30 00:07:48 -04:00
fault.c ARC: mm: SIGSEGV userspace trying to access kernel virtual memory 2019-09-16 08:22:14 +02:00
highmem.c ARC: export kmap 2016-08-19 10:45:29 -07:00
init.c ARC: adjust memblock_reserve of kernel memory 2019-01-31 08:14:35 +01:00
ioremap.c arc: iounmap() arg is volatile 2022-11-03 23:52:30 +09:00
Makefile
mmap.c mm: larger stack guard gap, between vmas 2017-06-19 21:50:20 +08:00
tlb.c ARC: fix build warnings 2019-06-25 11:35:55 +08:00
tlbex.S ARCv2: entry: push out the Z flag unclobber from common EXCEPTION_PROLOGUE 2023-08-11 11:45:10 +02:00