There are some empty trap_init() in different ARCHs, introduce
a new weak trap_init() function to cleanup them.
Cc: Vineet Gupta
Cc: Russell King
Cc: Yoshinori Sato
Cc: Ley Foon Tan
Cc: Jonas Bonn
Cc: Stefan Kristiansson
Cc: Stafford Horne
Cc: James E.J. Bottomley
Cc: Helge Deller
Cc: Mic
On Thu, Aug 12, 2021 at 08:36:02PM +0800, Kefeng Wang wrote:
> There are some empty trap_init() in different ARCHs, introduce
> a new weak trap_init() function to cleanup them.
>
> Cc: Vineet Gupta
> Cc: Russell King
> Cc: Yoshinori Sato
> Cc: Ley Foon Tan
> Cc: Jonas Bonn
> Cc: Stefan Kristi
On 8/12/21 5:36 AM, Kefeng Wang wrote:
There are some empty trap_init() in different ARCHs, introduce
a new weak trap_init() function to cleanup them.
Cc: Vineet Gupta
Cc: Russell King
Cc: Yoshinori Sato
Cc: Ley Foon Tan
Cc: Jonas Bonn
Cc: Stefan Kristiansson
Cc: Stafford Horne
Cc: James E.J. Bo
On 8/11/21 11:18 PM, Mike Rapoport wrote:
On Wed, Aug 11, 2021 at 06:37:19PM -0700, Vineet Gupta wrote:
On 8/11/21 5:31 AM, Mike Rapoport wrote:
+/*
+ * For ARC, pgtable_t is not struct page *, but pte_t * (to avoid
+ * extraneous page_address() calculations) hence can't use
+ * use asm-generic
In the past I've refrained from doing this (at least 2 times) due to the
slight code bloat due to ABI implications of pte_t etc becoming struct
Per ARC ABI, functions return struct via memory and not through register
r0, even if the struct would fit in register(s)
- caller allocates space on sta
With previous patch ARC pgalloc functions are same as generic, hence
switch to that.
Suggested-by: Mike Rapoport
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/pgalloc.h | 42 +-
1 file changed, 1 insertion(+), 41 deletions(-)
diff --git a/arch/arc/include
MMU SCRATCH_DATA0 register is intended to cache task pgd. However in
ARC700 SMP port, it has to be repurposed for reentrant interrupt
handling, while UP port doesn't. We currently ahandle boe usecases
using a fabricated which has usual issues of dependency nesting and
ugliness.
So clean this up:
And while at it, rewrite commentary on ASID allocator
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/mmu.h | 13 +
arch/arc/include/asm/mmu_context.h | 28 +---
arch/arc/mm/tlb.c | 11 ---
3 files changed, 30 insertions(+
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/pgalloc.h | 14 ++
arch/arc/include/asm/pgtable.h | 6 --
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h
index a32ca3104ced..408bc4b0842d 100644
Hi,
Big pile of ARC mm changes to prepare for 3 or 4 levels of paging (from
current 2) needed for new hardware page walked MMUv6 (in aRCv3 ISA based
cores).
Most of these changes are incremental cleanups to make way for 14/18 and
15/18 which actually imeplement the new levels (in existing ARCv2 p
Signed-off-by: Vineet Gupta
---
arch/arc/mm/tlb.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c
index 6079dfd129b9..15cbc285b0de 100644
--- a/arch/arc/mm/tlb.c
+++ b/arch/arc/mm/tlb.c
@@ -71,7 +71,7 @@ static void tlb_entry
This was used back in arc700 days when ASID allocator was fragile.
Not needed in last 5 years
Signed-off-by: Vineet Gupta
---
arch/arc/Kconfig | 3 ---
arch/arc/include/asm/mmu.h | 6 -
arch/arc/mm/tlb.c | 40 --
arch/arc/mm/tlbex.S| 5
and remove the one off uncached definition for ARC
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/pgtable.h | 3 ---
arch/arc/mm/ioremap.c | 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h
index
... not PGD
vmalloc() sets up the kernel page table (starting from @swapper_pg_dir).
But when vmalloc area is accessed in context of a user task, say opening
terminal in n_tty_open(), the user page tables need to be synced from
kernel page tables so that TLB entry is created in "user context".
Th
So far ARC pgtable_t has not been struct page based to avoid extra
page_address() calls involved. However the differences are down to
noise and get in the way of using generic code, hence this patch.
Suggested-by: Mike Rapoport
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/page.h| 2
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/cache.h | 4
arch/arc/include/asm/mmu.h | 4
arch/arc/include/asm/setup.h | 12 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index d8ece4
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/page.h | 30 --
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h
index 514b8b70df50..28ed82b1800f 100644
--- a/arch/arc/include/asm/page.h
+++
ARCv2 MMU is software walked and Linux implements 2 levels of paging: pgd/pte.
Forthcoming hw will have multiple levels, so this change preps mm code
for same. It is also fun to try multi levels even on soft-walked code to
ensure generic mm code is robust to handle.
overview
2 levels {pg
PMD_SHIFT is mapped to PUD_SHIFT or PGD_SHIFT by asm-generic/pgtable-*
but only for !__ASSEMBLY__
tlbex.S asm code has PTRS_PER_PTE which uses PMD_SHIFT hence barfs
for CONFIG_PGTABLE_LEVEL={2,3} and works for 4.
So add a workaround local to tlbex.S - the proper fix is to change
asm-generic/pgtab
ARCv3 hardware walker expects Table Descriptors to have b'11 in LSB bits
to continue moving to next level.
This commits adds that (to ARCv2 code) and ensures that it works in
software walked regime.
The pte entries stil need tagging, but that is not possible in ARCv2
since the LSB 2 bits are curr
... to avoid polluting shared entry code (across three ISA variants)
with ISA/MMU specific code.
Cc: Jose Abreu
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/mmu.h| 8
arch/arc/kernel/entry-arcv2.S | 1 +
arch/arc/kernel/entry.S | 7 ++-
3 files changed, 11 inserti
non functional change
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/mmu-arcv2.h | 103 +++
arch/arc/include/asm/mmu.h | 80 +---
arch/arc/include/asm/pgtable.h | 6 --
3 files changed, 105 insertions(+), 84 deletions(-)
create mo
- pgtable-bits-arcv2.h (MMU specific page table flags)
- pgtable-levels.h (paging levels)
No functional changes, but paves way for easy addition of new MMU code
with different bits and levels etc
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/pgtable-bits-arcv2.h | 149
arc
Signed-off-by: Vineet Gupta
---
arch/arc/include/asm/page.h | 11 +++
arch/arc/include/asm/pgalloc.h| 11 +++
arch/arc/include/asm/pgtable-levels.h | 45 ---
arch/arc/mm/fault.c | 2 ++
arch/arc/mm/init.c| 1
Kefeng Wang writes:
> There are some empty trap_init() in different ARCHs, introduce
> a new weak trap_init() function to cleanup them.
>
> Cc: Vineet Gupta
> Cc: Russell King
> Cc: Yoshinori Sato
> Cc: Ley Foon Tan
> Cc: Jonas Bonn
> Cc: Stefan Kristiansson
> Cc: Stafford Horne
> Cc: James
Hi Vineet,
I love your patch! Yet something to improve:
[auto build test ERROR on arc/for-next]
[also build test ERROR on next-20210812]
[cannot apply to linux/master linus/master v5.14-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
master
head: 9b992972fb9c2a1bc3fb25bab70da8a4385e3abe
commit: 9cf1d7d830f4a586dfa4ddcaf9eae3959e0708ef [5363/7554] ARC: cmpxchg/xchg:
rewrite as macros to make type safe
config: arc-randconfig-s032-20210812 (attached
27 matches
Mail list logo