|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH early-RFC 4/5] xen/arm: mm: Rework switch_ttbr()
On 12/03/2022 01:31, Stefano Stabellini wrote: On Wed, 9 Mar 2022, Julien Grall wrote: Today switch_ttbr() is called before we initialized most of the memory layout. So clashing with the VMAP and frametable is not a problem. However, the identity mapping may also clash with the region used to map Xen. That said, technically, we are not able to handle Xen when its start address is in region 2MB + 4K to 4MB (Xen is loaded at a 4KB aligned address). The trouble is some features (e.g. UBSAN, GCOV) can generate Xen image over 2MB. IOW, the range where Xen cannot be loaded will increase. This is an issue because AFAIK, there is no away to tell GRUB "You can't load Xen at this region". But even if there were one, I feel this restriction is sort of random. I already wrote a patch to get rid of the restriction. The code is not too bad (we only need an extra indirection). But I haven't sent it yet because it is less critical with the re-shuffling of the memory layout. Anyway, that's a long way to say that it will soon become an issue if the ID mapping is clashing with Xen mappings. I am less sure about patch #5 but it doesn't seem it would be a problem there either. This is actually going to be problematic. On Arm64, the page-tables are shared with all the CPUs. You would need to prevent the CPUs to touch any of the mapping we removed. While booting, idle pCPUs will usually scrub the pages. So the frametable will be used. In theory, we could make sure the CPUs are not scrubbing. This would get trick for CPU hotpluggling (not yet supported) as CPU would need to idle. IMHO, this would be unnaceptable to block all the CPUs just to bring a new one. Furthermore, we would need to be careful anytime we define new regions in the memory layout or reshuffle it as we need to ensure that no-one else use them when the ID mapping is inplace. The memory layout is far from been full on Arm64. So to me, the extra risk is not worth it. The same goes for Arm32 (even thought the memory has much less space). Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |