mirror of
https://github.com/xemu-project/xemu.git
synced 2024-12-21 03:20:46 +00:00
bf05340cb6
We define ARMMMUIdx_Stage2 as being an MMU index which uses a QEMU TLB. However we never actually use the TLB -- all stage 2 lookups are done by direct calls to get_phys_addr_lpae() followed by a physical address load via address_space_ld*(). Remove Stage2 from the list of ARM MMU indexes which correspond to real core MMU indexes, and instead put it in the set of "NOTLB" ARM MMU indexes. This allows us to drop NB_MMU_MODES to 11. It also means we can safely add support for the ARMv8.3-TTS2UXN extension, which adds permission bits to the stage 2 descriptors which define execute permission separatel for EL0 and EL1; supporting that while keeping Stage2 in a QEMU TLB would require us to use separate TLBs for "Stage2 for an EL0 access" and "Stage2 for an EL1 access", which is a lot of extra complication given we aren't even using the QEMU TLB. In the process of updating the comment on our MMU index use, fix a couple of other minor errors: * NS EL2 EL2&0 was missing from the list in the comment * some text hadn't been updated from when we bumped NB_MMU_MODES above 8 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20200330210400.11724-2-peter.maydell@linaro.org
35 lines
720 B
C
35 lines
720 B
C
/*
|
|
* ARM cpu parameters for qemu.
|
|
*
|
|
* Copyright (c) 2003 Fabrice Bellard
|
|
* SPDX-License-Identifier: LGPL-2.0+
|
|
*/
|
|
|
|
#ifndef ARM_CPU_PARAM_H
|
|
#define ARM_CPU_PARAM_H 1
|
|
|
|
#ifdef TARGET_AARCH64
|
|
# define TARGET_LONG_BITS 64
|
|
# define TARGET_PHYS_ADDR_SPACE_BITS 48
|
|
# define TARGET_VIRT_ADDR_SPACE_BITS 48
|
|
#else
|
|
# define TARGET_LONG_BITS 32
|
|
# define TARGET_PHYS_ADDR_SPACE_BITS 40
|
|
# define TARGET_VIRT_ADDR_SPACE_BITS 32
|
|
#endif
|
|
|
|
#ifdef CONFIG_USER_ONLY
|
|
#define TARGET_PAGE_BITS 12
|
|
#else
|
|
/*
|
|
* ARMv7 and later CPUs have 4K pages minimum, but ARMv5 and v6
|
|
* have to support 1K tiny pages.
|
|
*/
|
|
# define TARGET_PAGE_BITS_VARY
|
|
# define TARGET_PAGE_BITS_MIN 10
|
|
#endif
|
|
|
|
#define NB_MMU_MODES 11
|
|
|
|
#endif
|