# Xtensa

---

# Xtensa Architecture

_Peios Kernel / Hardware and drivers / Processor architectures / Xtensa_

> Reference for Xtensa Architecture.

<a id="rst-xtensa-architecture"></a>

<!-- SPDX-License-Identifier: GPL-2.0 -->

- [Atomic Operation Control (ATOMCTL) Register](</kernel/hardware/arch/xtensa/atomctl.md>)
- [Passing boot parameters to the kernel](</kernel/hardware/arch/xtensa/booting.md>)
- [MMUv3 initialization sequence](</kernel/hardware/arch/xtensa/mmu.md>)
- [features](<https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/arch/xtensa/features.rst?id=9021cc14f7d98b4a1d2c932f52c5343d4d0f6b92>)

---

# Atomic Operation Control (ATOMCTL) Register

_Peios Kernel / Hardware and drivers / Processor architectures / Xtensa_

> We Have Atomic Operation Control (ATOMCTL) Register. This register determines the effect of using a S32C1I instruction with various combinations of:

<a id="rst-atomic-operation-control-atomctl-register"></a>

We Have Atomic Operation Control (ATOMCTL) Register. This register determines the effect of using a S32C1I instruction with various combinations of:

> 1. With and without an Coherent Cache Controller which can do Atomic Transactions to the memory internally.
>
> 2. With and without An Intelligent Memory Controller which can do Atomic Transactions itself.

The Core comes up with a default value of for the three types of cache ops:



```text
0x28: (WB: Internal, WT: Internal, BY:Exception)
```

On the FPGA Cards we typically simulate an Intelligent Memory controller which can implement  RCW transactions. For FPGA cards with an External Memory controller we let it to the atomic operations internally while doing a Cached (WB) transaction and use the Memory RCW for un-cached operations.

For systems without an coherent cache controller, non-MX, we always use the memory controllers RCW, though non-MX controllers likely support the Internal Operation.

- **CUSTOMER-WARNING:**

  Virtually all customers buy their memory controllers from vendors that don't support atomic RCW memory transactions and will likely want to configure this register to not use RCW.

Developers might find using RCW in Bypass mode convenient when testing with the cache being bypassed; for example studying cache alias problems.

See Section 4.3.12.4 of ISA; Bits:



```text
  WB     WT      BY
5   4 | 3   2 | 1   0
```


<table>
<thead>
<tr>
<th>


2 Bit

</th>
<th>




</th>
<th>




</th>
<th>




</th>
</tr>
<tr>
<th>


Field

</th>
<th>




</th>
<th>




</th>
<th>




</th>
</tr>
<tr>
<th>


Values

</th>
<th>


WB - Write Back

</th>
<th>


WT - Write Thru

</th>
<th>


BY - Bypass

</th>
</tr>
</thead>
<tbody>
<tr>
<td>


0

</td>
<td>


Exception

</td>
<td>


Exception

</td>
<td>


Exception

</td>
</tr>
<tr>
<td>


1

</td>
<td>


RCW Transaction

</td>
<td>


RCW Transaction

</td>
<td>


RCW Transaction

</td>
</tr>
<tr>
<td>


2

</td>
<td>


Internal Operation

</td>
<td>


Internal Operation

</td>
<td>


Reserved

</td>
</tr>
<tr>
<td>


3

</td>
<td>


Reserved

</td>
<td>


Reserved

</td>
<td>


Reserved

</td>
</tr>
</tbody>
</table>

---

# Passing boot parameters to the kernel

_Peios Kernel / Hardware and drivers / Processor architectures / Xtensa_

> Boot parameters are represented as a TLV list in the memory. Please see arch/xtensa/include/asm/bootparam.h for definition of the bp_tag structure and tag value constants. First entry in the list must have type BP_TAG_FIRST, last entry…

<a id="rst-passing-boot-parameters-to-the-kernel"></a>

Boot parameters are represented as a TLV list in the memory. Please see arch/xtensa/include/asm/bootparam.h for definition of the bp_tag structure and tag value constants. First entry in the list must have type BP_TAG_FIRST, last entry must have type BP_TAG_LAST. The address of the first list entry is passed to the kernel in the register a2. The address type depends on MMU type:

- For configurations without MMU, with region protection or with MPU the address must be the physical address.

- For configurations with region translarion MMU or with MMUv3 and CONFIG_MMU=n the address must be a valid address in the current mapping. The kernel will not change the mapping on its own.

- For configurations with MMUv2 the address must be a virtual address in the default virtual mapping (0xd0000000..0xffffffff).

- For configurations with MMUv3 and CONFIG_MMU=y the address may be either a virtual or physical address. In either case it must be within the default virtual mapping. It is considered physical if it is within the range of physical addresses covered by the default KSEG mapping (XCHAL_KSEG_PADDR.. XCHAL_KSEG_PADDR + XCHAL_KSEG_SIZE), otherwise it is considered virtual.

---

# Feature status on xtensa architecture

_Peios Kernel / Hardware and drivers / Processor architectures / Xtensa_

> Reference for Feature status on xtensa architecture.

<!-- SPDX-License-Identifier: GPL-2.0 -->


| Subsystem | Feature | Kconfig | Status | Description |
|---|---|---|---|---|
| core | [cBPF-JIT](/kernel/administration/admin-guide/overview/features.md#feat-core-cBPF-JIT) | `HAVE_CBPF_JIT` | TODO | arch supports cBPF JIT optimizations |
| core | [eBPF-JIT](/kernel/administration/admin-guide/overview/features.md#feat-core-eBPF-JIT) | `HAVE_EBPF_JIT` | TODO | arch supports eBPF JIT optimizations |
| core | [generic-idle-thread](/kernel/administration/admin-guide/overview/features.md#feat-core-generic-idle-thread) | `GENERIC_SMP_IDLE_THREAD` | ok | arch makes use of the generic SMP idle thread facility |
| core | [jump-labels](/kernel/administration/admin-guide/overview/features.md#feat-core-jump-labels) | `HAVE_ARCH_JUMP_LABEL` | ok | arch supports live patched, high efficiency branches |
| core | [mseal-system-mappings](/kernel/administration/admin-guide/overview/features.md#feat-core-mseal-system-mappings) | `ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS` | N/A | arch supports mseal system mappings |
| core | [thread-info-in-task](/kernel/administration/admin-guide/overview/features.md#feat-core-thread-info-in-task) | `THREAD_INFO_IN_TASK` | TODO | arch makes use of the core kernel facility to embed thread\_info in task\_struct |
| core | [tracehook](/kernel/administration/admin-guide/overview/features.md#feat-core-tracehook) | `HAVE_ARCH_TRACEHOOK` | ok | arch supports tracehook (ptrace) register handling APIs |
| debug | [debug-vm-pgtable](/kernel/administration/admin-guide/overview/features.md#feat-debug-debug-vm-pgtable) | `ARCH_HAS_DEBUG_VM_PGTABLE` | ok | arch supports pgtable tests for semantics compliance |
| debug | [gcov-profile-all](/kernel/administration/admin-guide/overview/features.md#feat-debug-gcov-profile-all) | `ARCH_HAS_GCOV_PROFILE_ALL` | ok | arch supports whole-kernel GCOV code coverage profiling |
| debug | [KASAN](/kernel/administration/admin-guide/overview/features.md#feat-debug-KASAN) | `HAVE_ARCH_KASAN` | ok | arch supports the KASAN runtime memory checker |
| debug | [kcov](/kernel/administration/admin-guide/overview/features.md#feat-debug-kcov) | `ARCH_HAS_KCOV` | ok | arch supports kcov for coverage-guided fuzzing |
| debug | [kgdb](/kernel/administration/admin-guide/overview/features.md#feat-debug-kgdb) | `HAVE_ARCH_KGDB` | TODO | arch supports the kGDB kernel debugger |
| debug | [kmemleak](/kernel/administration/admin-guide/overview/features.md#feat-debug-kmemleak) | `HAVE_DEBUG_KMEMLEAK` | ok | arch supports the kernel memory leak detector |
| debug | [kprobes](/kernel/administration/admin-guide/overview/features.md#feat-debug-kprobes) | `HAVE_KPROBES` | TODO | arch supports live patched kernel probe |
| debug | [kprobes-on-ftrace](/kernel/administration/admin-guide/overview/features.md#feat-debug-kprobes-on-ftrace) | `HAVE_KPROBES_ON_FTRACE` | TODO | arch supports combined kprobes and ftrace live patching |
| debug | [kretprobes](/kernel/administration/admin-guide/overview/features.md#feat-debug-kretprobes) | `HAVE_KRETPROBES` | TODO | arch supports kernel function-return probes |
| debug | [optprobes](/kernel/administration/admin-guide/overview/features.md#feat-debug-optprobes) | `HAVE_OPTPROBES` | TODO | arch supports live patched optprobes |
| debug | [stackprotector](/kernel/administration/admin-guide/overview/features.md#feat-debug-stackprotector) | `HAVE_STACKPROTECTOR` | ok | arch supports compiler driven stack overflow protection |
| debug | [uprobes](/kernel/administration/admin-guide/overview/features.md#feat-debug-uprobes) | `ARCH_SUPPORTS_UPROBES` | TODO | arch supports live patched user probes |
| debug | [user-ret-profiler](/kernel/administration/admin-guide/overview/features.md#feat-debug-user-ret-profiler) | `HAVE_USER_RETURN_NOTIFIER` | TODO | arch supports user-space return from system call profiler |
| io | [dma-contiguous](/kernel/administration/admin-guide/overview/features.md#feat-io-dma-contiguous) | `HAVE_DMA_CONTIGUOUS` | ok | arch supports the DMA CMA (continuous memory allocator) |
| locking | [cmpxchg-local](/kernel/administration/admin-guide/overview/features.md#feat-locking-cmpxchg-local) | `HAVE_CMPXCHG_LOCAL` | TODO | arch supports the this\_cpu\_cmpxchg() API |
| locking | [lockdep](/kernel/administration/admin-guide/overview/features.md#feat-locking-lockdep) | `LOCKDEP_SUPPORT` | ok | arch supports the runtime locking correctness debug facility |
| locking | [queued-rwlocks](/kernel/administration/admin-guide/overview/features.md#feat-locking-queued-rwlocks) | `ARCH_USE_QUEUED_RWLOCKS` | ok | arch supports queued rwlocks |
| locking | [queued-spinlocks](/kernel/administration/admin-guide/overview/features.md#feat-locking-queued-spinlocks) | `ARCH_USE_QUEUED_SPINLOCKS` | ok | arch supports queued spinlocks |
| perf | [kprobes-event](/kernel/administration/admin-guide/overview/features.md#feat-perf-kprobes-event) | `HAVE_REGS_AND_STACK_ACCESS_API` | TODO | arch supports kprobes with perf events |
| perf | [perf-regs](/kernel/administration/admin-guide/overview/features.md#feat-perf-perf-regs) | `HAVE_PERF_REGS` | TODO | arch supports perf events register access |
| perf | [perf-stackdump](/kernel/administration/admin-guide/overview/features.md#feat-perf-perf-stackdump) | `HAVE_PERF_USER_STACK_DUMP` | TODO | arch supports perf events stack dumps |
| sched | [membarrier-sync-core](/kernel/administration/admin-guide/overview/features.md#feat-sched-membarrier-sync-core) | `ARCH_HAS_MEMBARRIER_SYNC_CORE` | TODO | arch supports core serializing membarrier |
| sched | [numa-balancing](/kernel/administration/admin-guide/overview/features.md#feat-sched-numa-balancing) | `ARCH_SUPPORTS_NUMA_BALANCING` | Not compatible | arch supports NUMA balancing |
| seccomp | [seccomp-filter](/kernel/administration/admin-guide/overview/features.md#feat-seccomp-seccomp-filter) | `HAVE_ARCH_SECCOMP_FILTER` | ok | arch supports seccomp filters |
| time | [arch-tick-broadcast](/kernel/administration/admin-guide/overview/features.md#feat-time-arch-tick-broadcast) | `ARCH_HAS_TICK_BROADCAST` | TODO | arch provides tick\_broadcast() |
| time | [clockevents](/kernel/administration/admin-guide/overview/features.md#feat-time-clockevents) | `!LEGACY_TIMER_TICK` | ok | arch support generic clock events |
| time | [irq-time-acct](/kernel/administration/admin-guide/overview/features.md#feat-time-irq-time-acct) | `HAVE_IRQ_TIME_ACCOUNTING` | ok | arch supports precise IRQ time accounting |
| time | [user-context-tracking](/kernel/administration/admin-guide/overview/features.md#feat-time-user-context-tracking) | `HAVE_CONTEXT_TRACKING_USER` | ok | arch supports user context tracking for NO\_HZ\_FULL |
| time | [virt-cpuacct](/kernel/administration/admin-guide/overview/features.md#feat-time-virt-cpuacct) | `HAVE_VIRT_CPU_ACCOUNTING` | ok | arch supports precise virtual CPU time accounting |
| vm | [batch-unmap-tlb-flush](/kernel/administration/admin-guide/overview/features.md#feat-vm-batch-unmap-tlb-flush) | `ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH` | TODO | arch supports deferral of TLB flush until multiple pages are unmapped |
| vm | [ELF-ASLR](/kernel/administration/admin-guide/overview/features.md#feat-vm-ELF-ASLR) | `ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT` | TODO | arch randomizes the stack, heap and binary images of ELF binaries |
| vm | [huge-vmap](/kernel/administration/admin-guide/overview/features.md#feat-vm-huge-vmap) | `HAVE_ARCH_HUGE_VMAP` | TODO | arch supports the arch\_vmap\_pud\_supported() and arch\_vmap\_pmd\_supported() VM APIs |
| vm | [ioremap\_prot](/kernel/administration/admin-guide/overview/features.md#feat-vm-ioremap_prot) | `HAVE_IOREMAP_PROT` | TODO | arch has ioremap\_prot() |
| vm | [pte\_special](/kernel/administration/admin-guide/overview/features.md#feat-vm-pte_special) | `ARCH_HAS_PTE_SPECIAL` | TODO | arch supports the pte\_special()/pte\_mkspecial() VM APIs |
| vm | [THP](/kernel/administration/admin-guide/overview/features.md#feat-vm-THP) | `HAVE_ARCH_TRANSPARENT_HUGEPAGE` | Not compatible | arch supports transparent hugepages |

---

# MMUv3 initialization sequence

_Peios Kernel / Hardware and drivers / Processor architectures / Xtensa_

> The code in the initialize_mmu macro sets up MMUv3 memory mapping identically to MMUv2 fixed memory mapping. Depending on CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX symbol this code is located in addresses it was linked for (symbol…

<a id="rst-mmuv3-initialization-sequence"></a>

The code in the initialize_mmu macro sets up MMUv3 memory mapping identically to MMUv2 fixed memory mapping. Depending on CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX symbol this code is located in addresses it was linked for (symbol undefined), or not (symbol defined), so it needs to be position-independent.

The code has the following assumptions:

> - This code fragment is run only on an MMU v3.
>
> - TLBs are in their reset state.
>
> - ITLBCFG and DTLBCFG are zero (reset state).
>
> - RASID is 0x04030201 (reset state).
>
> - PS.RING is zero (reset state).
>
> - LITBASE is zero (reset state, PC-relative literals); required to be PIC.

TLB setup proceeds along the following steps.

> Legend:
>
> > - VA = virtual address (two upper nibbles of it);
> >
> > - PA = physical address (two upper nibbles of it);
> >
> > - pc = physical range that contains this code;

After step 2, we jump to virtual address in the range 0x40000000..0x5fffffff or 0x00000000..0x1fffffff, depending on whether the kernel was loaded below 0x40000000 or above. That address corresponds to next instruction to execute in this code. After step 4, we jump to intended (linked) address of this code. The scheme below assumes that the kernel is loaded below 0x40000000.

>
> <table>
> <thead>
> <tr>
> <th>
>
>
> - <!-- empty source list item -->
>
> </th>
> <th>
>
>
> Step0
>
> </th>
> <th>
>
>
> Step1
>
> </th>
> <th>
>
>
> Step2
>
> </th>
> <th>
>
>
> Step3
>
> </th>
> <th>
>
>
>
>
> </th>
> <th>
>
>
> Step4
>
> </th>
> <th>
>
>
> Step5
>
> </th>
> </tr>
> <tr>
> <th>
>
>
> VA
>
> </th>
> <th>
>
>
> PA
>
> </th>
> <th>
>
>
> PA
>
> </th>
> <th>
>
>
> PA
>
> </th>
> <th>
>
>
> PA
>
> </th>
> <th>
>
>
> VA
>
> </th>
> <th>
>
>
> PA
>
> </th>
> <th>
>
>
> PA
>
> </th>
> </tr>
> </thead>
> <tbody>
> <tr>
> <td>
>
>
> E0..FF
>
> </td>
> <td>
>
>
> -&gt; E0
>
> </td>
> <td>
>
>
> -&gt; E0
>
> </td>
> <td>
>
>
> -&gt; E0
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> F0..FF
>
> </td>
> <td>
>
>
> -&gt; F0
>
> </td>
> <td>
>
>
> -&gt; F0
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> C0..DF
>
> </td>
> <td>
>
>
> -&gt; C0
>
> </td>
> <td>
>
>
> -&gt; C0
>
> </td>
> <td>
>
>
> -&gt; C0
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> E0..EF
>
> </td>
> <td>
>
>
> -&gt; F0
>
> </td>
> <td>
>
>
> -&gt; F0
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> A0..BF
>
> </td>
> <td>
>
>
> -&gt; A0
>
> </td>
> <td>
>
>
> -&gt; A0
>
> </td>
> <td>
>
>
> -&gt; A0
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> D8..DF
>
> </td>
> <td>
>
>
> -&gt; 00
>
> </td>
> <td>
>
>
> -&gt; 00
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> 80..9F
>
> </td>
> <td>
>
>
> -&gt; 80
>
> </td>
> <td>
>
>
> -&gt; 80
>
> </td>
> <td>
>
>
> -&gt; 80
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> D0..D7
>
> </td>
> <td>
>
>
> -&gt; 00
>
> </td>
> <td>
>
>
> -&gt; 00
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> 60..7F
>
> </td>
> <td>
>
>
> -&gt; 60
>
> </td>
> <td>
>
>
> -&gt; 60
>
> </td>
> <td>
>
>
> -&gt; 60
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> 40..5F
>
> </td>
> <td>
>
>
> -&gt; 40
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> -&gt; pc
>
> </td>
> <td>
>
>
> -&gt; pc
>
> </td>
> <td>
>
>
> 40..5F
>
> </td>
> <td>
>
>
> -&gt; pc
>
> </td>
> <td>
>
>
>
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> 20..3F
>
> </td>
> <td>
>
>
> -&gt; 20
>
> </td>
> <td>
>
>
> -&gt; 20
>
> </td>
> <td>
>
>
> -&gt; 20
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> 00..1F
>
> </td>
> <td>
>
>
> -&gt; 00
>
> </td>
> <td>
>
>
> -&gt; 00
>
> </td>
> <td>
>
>
> -&gt; 00
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
>
>
> </td>
> </tr>
> </tbody>
> </table>

The default location of IO peripherals is above 0xf0000000. This may be changed using a "ranges" property in a device tree simple-bus node. See the Devicetree Specification, section 4.5 for details on the syntax and semantics of simple-bus nodes. The following limitations apply:

1. Only top level simple-bus nodes are considered

2. Only one (first) simple-bus node is considered

3. Empty "ranges" properties are not supported

4. Only the first triplet in the "ranges" property is considered

5. The parent-bus-address value is rounded down to the nearest 256MB boundary

6. The IO area covers the entire 256MB segment of parent-bus-address; the "ranges" triplet length field is ignored

<a id="rst-mmuv3-address-space-layouts"></a>

## MMUv3 address space layouts.

Default MMUv2-compatible layout:



```text
                      Symbol                   VADDR       Size
+------------------+
| Userspace        |                           0x00000000  TASK_SIZE
+------------------+                           0x40000000
+------------------+
| Page table       |  XCHAL_PAGE_TABLE_VADDR   0x80000000  XCHAL_PAGE_TABLE_SIZE
+------------------+
| KASAN shadow map |  KASAN_SHADOW_START       0x80400000  KASAN_SHADOW_SIZE
+------------------+                           0x8e400000
+------------------+
| VMALLOC area     |  VMALLOC_START            0xc0000000  128MB - 64KB
+------------------+  VMALLOC_END
+------------------+
| Cache aliasing   |  TLBTEMP_BASE_1           0xc8000000  DCACHE_WAY_SIZE
| remap area 1     |
+------------------+
| Cache aliasing   |  TLBTEMP_BASE_2                       DCACHE_WAY_SIZE
| remap area 2     |
+------------------+
+------------------+
| KMAP area        |  PKMAP_BASE                           PTRS_PER_PTE *
|                  |                                       DCACHE_N_COLORS *
|                  |                                       PAGE_SIZE
|                  |                                       (4MB * DCACHE_N_COLORS)
+------------------+
| Atomic KMAP area |  FIXADDR_START                        KM_TYPE_NR *
|                  |                                       NR_CPUS *
|                  |                                       DCACHE_N_COLORS *
|                  |                                       PAGE_SIZE
+------------------+  FIXADDR_TOP              0xcffff000
+------------------+
| Cached KSEG      |  XCHAL_KSEG_CACHED_VADDR  0xd0000000  128MB
+------------------+
| Uncached KSEG    |  XCHAL_KSEG_BYPASS_VADDR  0xd8000000  128MB
+------------------+
| Cached KIO       |  XCHAL_KIO_CACHED_VADDR   0xe0000000  256MB
+------------------+
| Uncached KIO     |  XCHAL_KIO_BYPASS_VADDR   0xf0000000  256MB
+------------------+
```

256MB cached + 256MB uncached layout:



```text
                      Symbol                   VADDR       Size
+------------------+
| Userspace        |                           0x00000000  TASK_SIZE
+------------------+                           0x40000000
+------------------+
| Page table       |  XCHAL_PAGE_TABLE_VADDR   0x80000000  XCHAL_PAGE_TABLE_SIZE
+------------------+
| KASAN shadow map |  KASAN_SHADOW_START       0x80400000  KASAN_SHADOW_SIZE
+------------------+                           0x8e400000
+------------------+
| VMALLOC area     |  VMALLOC_START            0xa0000000  128MB - 64KB
+------------------+  VMALLOC_END
+------------------+
| Cache aliasing   |  TLBTEMP_BASE_1           0xa8000000  DCACHE_WAY_SIZE
| remap area 1     |
+------------------+
| Cache aliasing   |  TLBTEMP_BASE_2                       DCACHE_WAY_SIZE
| remap area 2     |
+------------------+
+------------------+
| KMAP area        |  PKMAP_BASE                           PTRS_PER_PTE *
|                  |                                       DCACHE_N_COLORS *
|                  |                                       PAGE_SIZE
|                  |                                       (4MB * DCACHE_N_COLORS)
+------------------+
| Atomic KMAP area |  FIXADDR_START                        KM_TYPE_NR *
|                  |                                       NR_CPUS *
|                  |                                       DCACHE_N_COLORS *
|                  |                                       PAGE_SIZE
+------------------+  FIXADDR_TOP              0xaffff000
+------------------+
| Cached KSEG      |  XCHAL_KSEG_CACHED_VADDR  0xb0000000  256MB
+------------------+
| Uncached KSEG    |  XCHAL_KSEG_BYPASS_VADDR  0xc0000000  256MB
+------------------+
+------------------+
| Cached KIO       |  XCHAL_KIO_CACHED_VADDR   0xe0000000  256MB
+------------------+
| Uncached KIO     |  XCHAL_KIO_BYPASS_VADDR   0xf0000000  256MB
+------------------+
```

512MB cached + 512MB uncached layout:



```text
                      Symbol                   VADDR       Size
+------------------+
| Userspace        |                           0x00000000  TASK_SIZE
+------------------+                           0x40000000
+------------------+
| Page table       |  XCHAL_PAGE_TABLE_VADDR   0x80000000  XCHAL_PAGE_TABLE_SIZE
+------------------+
| KASAN shadow map |  KASAN_SHADOW_START       0x80400000  KASAN_SHADOW_SIZE
+------------------+                           0x8e400000
+------------------+
| VMALLOC area     |  VMALLOC_START            0x90000000  128MB - 64KB
+------------------+  VMALLOC_END
+------------------+
| Cache aliasing   |  TLBTEMP_BASE_1           0x98000000  DCACHE_WAY_SIZE
| remap area 1     |
+------------------+
| Cache aliasing   |  TLBTEMP_BASE_2                       DCACHE_WAY_SIZE
| remap area 2     |
+------------------+
+------------------+
| KMAP area        |  PKMAP_BASE                           PTRS_PER_PTE *
|                  |                                       DCACHE_N_COLORS *
|                  |                                       PAGE_SIZE
|                  |                                       (4MB * DCACHE_N_COLORS)
+------------------+
| Atomic KMAP area |  FIXADDR_START                        KM_TYPE_NR *
|                  |                                       NR_CPUS *
|                  |                                       DCACHE_N_COLORS *
|                  |                                       PAGE_SIZE
+------------------+  FIXADDR_TOP              0x9ffff000
+------------------+
| Cached KSEG      |  XCHAL_KSEG_CACHED_VADDR  0xa0000000  512MB
+------------------+
| Uncached KSEG    |  XCHAL_KSEG_BYPASS_VADDR  0xc0000000  512MB
+------------------+
| Cached KIO       |  XCHAL_KIO_CACHED_VADDR   0xe0000000  256MB
+------------------+
| Uncached KIO     |  XCHAL_KIO_BYPASS_VADDR   0xf0000000  256MB
+------------------+
```
