Hi Wei,
On 25/02/2022 10:48, Wei Chen wrote:
> Armv8-R64 can support max to 256 MPU regions. But that's just
theoretical.
> So we don't want to define `pr_t mpu_regions[256]`, this is a memory
waste
> in most of time. So we decided to let the user specify through a
Kconfig
> option. `CONFIG_ARM_MPU_EL1_PROTECTION_REGIONS` default value can be
`32`,
> it's a typical implementation on Armv8-R64. Users will recompile Xen
when
> their platform changes. So when the MPU changes, respecifying the
MPU
> protection regions number will not cause additional problems.
I wonder if we could probe the number of MPU regions at runtime and
dynamically allocate the memory needed to store them in arch_vcpu.
We have considered to used a pr_t mpu_regions[0] in arch_vcpu. But it seems
we will encounter some static allocated arch_vcpu problems and sizeof issue.
Does it need to be embedded in arch_vcpu? If not, then we could allocate
memory outside and add a pointer in arch_vcpu.
Cheers,
--
Julien Grall