<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/arc/mm/tlb.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/arc/mm/tlb.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/arc/mm/tlb.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-08-26T20:43:19Z</updated>
<entry>
<title>ARC: mm: support 3 levels of page tables</title>
<updated>2021-08-26T20:43:19Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@kernel.org</email>
</author>
<published>2020-10-01T01:58:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2dde02ab6d1a725ddccc7144ff6bf5f55d37f916'/>
<id>urn:sha1:2dde02ab6d1a725ddccc7144ff6bf5f55d37f916</id>
<content type='text'>
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 {pgd, pte} : pmd is folded but pmd_* macros are valid and operate on pgd
3 levels {pgd, pmd, pte}:
  - pud is folded and pud_* macros point to pgd
  - pmd_* macros operate on actual pmd

code changes
____________

1. #include &lt;asm-generic/pgtable-nopud.h&gt;

2. Define CONFIG_PGTABLE_LEVELS 3

3a. Define PMD_SHIFT, PMD_SIZE, PMD_MASK, pmd_t
3b. Define pmd_val() which actually deals with pmd
    (pmd_offset(), pmd_index() are provided by generic code)
3c. pmd_alloc_one()/pmd_free() also provided by generic code
    (pmd_populate/pmd_free already exist)

4. Define pud_none(), pud_bad() macros based on generic pud_val() which
   internally pertains to pgd now.
4b. define pud_populate() to just setup pgd

Acked-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: mm: switch pgtable_t back to struct page *</title>
<updated>2021-08-26T20:42:42Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@kernel.org</email>
</author>
<published>2021-08-12T19:54:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d9820ff76f95fa26d33e412254a89cd65b23142d'/>
<id>urn:sha1:d9820ff76f95fa26d33e412254a89cd65b23142d</id>
<content type='text'>
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.

This also allows us to reuse generic THP depost/withdraw code.

There's some additional consideration for PGDIR_SHIFT in 4K page config.
Now due to page tables being PAGE_SIZE deep only, the address split
can't be really arbitrary.

Tested-by: kernel test robot &lt;lkp@intel.com&gt;
Suggested-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Acked-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: mm: move MMU specific bits out of ASID allocator</title>
<updated>2021-08-24T21:25:48Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@kernel.org</email>
</author>
<published>2019-09-13T22:20:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=89d0d42412a116563c28c763d9c1bdee83b5b6af'/>
<id>urn:sha1:89d0d42412a116563c28c763d9c1bdee83b5b6af</id>
<content type='text'>
And while at it, rewrite commentary on ASID allocator

Signed-off-by: Vineet Gupta &lt;vgupta@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: mm: Fixes to allow STRICT_MM_TYPECHECKS</title>
<updated>2021-08-24T21:25:48Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@kernel.org</email>
</author>
<published>2019-10-28T19:02:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=366440eec855dad6527adaf2f1dcc305fb5eef99'/>
<id>urn:sha1:366440eec855dad6527adaf2f1dcc305fb5eef99</id>
<content type='text'>
Signed-off-by: Vineet Gupta &lt;vgupta@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: mm: remove tlb paranoid code</title>
<updated>2021-08-24T21:25:48Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@kernel.org</email>
</author>
<published>2019-09-09T23:59:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=12e7804c264143c63d1cae7e3a62d21fbed06f59'/>
<id>urn:sha1:12e7804c264143c63d1cae7e3a62d21fbed06f59</id>
<content type='text'>
This was used back in arc700 days when ASID allocator was fragile.
Not needed in last 5 years

Signed-off-by: Vineet Gupta &lt;vgupta@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: mm: use SCRATCH_DATA0 register for caching pgdir in ARCv2 only</title>
<updated>2021-08-24T21:25:48Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@kernel.org</email>
</author>
<published>2020-01-13T17:16:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=6128df5be48f48d63efdc7c52022dd163f612373'/>
<id>urn:sha1:6128df5be48f48d63efdc7c52022dd163f612373</id>
<content type='text'>
MMU SCRATCH_DATA0 register is intended to cache task pgd. However in
ARC700 SMP port, it has to be repurposed for re-entrant interrupt
handling, while UP port doesn't. We currently handle these use-cases
using a fabricated #define which has usual issues of dependency nesting
and obvious ugliness.

So clean this up: for ARC700 don't use to cache pgd (even in UP) and do
the opposite for ARCv2.

And while here, switch to canonical pgd_offset().

Acked-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: retire MMUv1 and MMUv2 support</title>
<updated>2021-08-24T21:25:47Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@kernel.org</email>
</author>
<published>2019-09-10T00:36:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=288ff7de62af0936353c9394de9d0b2c6dd22c80'/>
<id>urn:sha1:288ff7de62af0936353c9394de9d0b2c6dd22c80</id>
<content type='text'>
There's no known/active customer using them with latest kernels anyways.

Removal helps cleanup code and remove the hack for
MMU_VER to MMU_V[3-4] conversion

Signed-off-by: Vineet Gupta &lt;vgupta@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: mm: PAE: use 40-bit physical page mask</title>
<updated>2021-05-10T19:38:59Z</updated>
<author>
<name>Vladimir Isaev</name>
<email>isaev@synopsys.com</email>
</author>
<published>2021-04-27T12:12:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c5f756d8c6265ebb1736a7787231f010a3b782e5'/>
<id>urn:sha1:c5f756d8c6265ebb1736a7787231f010a3b782e5</id>
<content type='text'>
32-bit PAGE_MASK can not be used as a mask for physical addresses
when PAE is enabled. PAGE_MASK_PHYS must be used for physical
addresses instead of PAGE_MASK.

Without this, init gets SIGSEGV if pte_modify was called:

| potentially unexpected fatal signal 11.
| Path: /bin/busybox
| CPU: 0 PID: 1 Comm: init Not tainted 5.12.0-rc5-00003-g1e43c377a79f-dirty
| Insn could not be fetched
|     @No matching VMA found
|  ECR: 0x00040000 EFA: 0x00000000 ERET: 0x00000000
| STAT: 0x80080082 [IE U     ]   BTA: 0x00000000
|  SP: 0x5f9ffe44  FP: 0x00000000 BLK: 0xaf3d4
| LPS: 0x000d093e LPE: 0x000d0950 LPC: 0x00000000
| r00: 0x00000002 r01: 0x5f9fff14 r02: 0x5f9fff20
| ...
| Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Signed-off-by: Vladimir Isaev &lt;isaev@synopsys.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: mm: fix spelling mistakes</title>
<updated>2020-11-18T04:12:01Z</updated>
<author>
<name>Flavio Suligoi</name>
<email>f.suligoi@asem.it</email>
</author>
<published>2020-11-09T13:21:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5f840df591a9554e4e1355ef1f8946bc2120ca9f'/>
<id>urn:sha1:5f840df591a9554e4e1355ef1f8946bc2120ca9f</id>
<content type='text'>
Signed-off-by: Flavio Suligoi &lt;f.suligoi@asem.it&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: mm: tlb flush optim: elide redundant uTLB invalidates for MMUv3</title>
<updated>2019-10-28T19:12:32Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2019-09-10T22:38:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2f4ecf68a048de44d72157d637bf9cbbbdb357b0'/>
<id>urn:sha1:2f4ecf68a048de44d72157d637bf9cbbbdb357b0</id>
<content type='text'>
For MMUv3 (and prior) the flush_tlb_{range,mm,page} API use the MMU
TLBWrite cmd which already nukes the entire uTLB, so NO need for
additional IVUTLB cmd from utlb_invalidate() - hence this patch

local_flush_tlb_all() is special since it uses a weaker TLBWriteNI
cmd (prec commit) to shoot down JTLB, hence we retain the explicit
uTLB flush

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
</feed>
