arch: arm64: Increase MAX_XLAT_TABLES for userspace tests

Memory protection and userspace tests require more MMU translation
tables than the default. Without this increase, tests fail with:

  E: CONFIG_MAX_XLAT_TABLES too small
  ASSERTION FAIL [ret == 0] @ arch/arm64/core/mmu.c:1244
	privatize_page_range() returned -12

Increase defaults when both USERSPACE and TEST are enabled:
- 32 tables for SMP configurations
- 24 tables for non-SMP configurations

This fixes:
- sample.kernel.memory_protection.shared_mem (all platforms)
- rtio.api.userspace (v8a, v9a)
- rtio.api.userspace.submit_sem (v8a, v9a)
- portability.posix.common.userspace

Consequently the demand paging test needed adjustment to its
qemu_cortex_a53 configs to keep working as this test is highly
sensitive to the amount of available free memory.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
diff --git a/arch/arm64/core/Kconfig b/arch/arm64/core/Kconfig
index 2d8a83d..05ff898 100644
--- a/arch/arm64/core/Kconfig
+++ b/arch/arm64/core/Kconfig
@@ -387,6 +387,8 @@
 
 config MAX_XLAT_TABLES
 	int "Maximum numbers of translation tables"
+	default 32 if USERSPACE && TEST && SMP
+	default 24 if USERSPACE && TEST
 	default 20 if USERSPACE && (ARM64_VA_BITS >= 40)
 	default 16 if USERSPACE
 	default 12 if (ARM64_VA_BITS >= 40)
diff --git a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf
index 9b04e2c..91a28ad 100644
--- a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf
+++ b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf
@@ -3,4 +3,4 @@
 
 CONFIG_BACKING_STORE_RAM=y
 CONFIG_BACKING_STORE_RAM_PAGES=24
-CONFIG_SRAM_SIZE=400
+CONFIG_SRAM_SIZE=440
diff --git a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.conf b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.conf
index e9347db..1ce923d 100644
--- a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.conf
+++ b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.conf
@@ -3,5 +3,5 @@
 
 CONFIG_BACKING_STORE_RAM=y
 CONFIG_BACKING_STORE_RAM_PAGES=24
-CONFIG_SRAM_SIZE=450
+CONFIG_SRAM_SIZE=560
 CONFIG_DEMAND_PAGING_ALLOW_IRQ=y