|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 13/17] xen/riscv: Implement p2m_entry_from_mfn() and support PBMT configuration
On 7/21/25 2:18 PM, Jan Beulich wrote:
On 18.07.2025 11:52, Oleksii Kurochko wrote:On 7/17/25 12:25 PM, Jan Beulich wrote:On 17.07.2025 10:56, Oleksii Kurochko wrote:On 7/16/25 6:18 PM, Jan Beulich wrote:On 16.07.2025 18:07, Oleksii Kurochko wrote:On 7/16/25 1:31 PM, Jan Beulich wrote:On 15.07.2025 16:47, Oleksii Kurochko wrote:On 7/1/25 5:08 PM, Jan Beulich wrote:On 10.06.2025 15:05, Oleksii Kurochko wrote: Could you please clarify what do you mean here by "(Very) careful"? I thought about an introduction of an amount of possible keys in radix tree and if this amount is 0 then stop domain. And it is also unclear what should be a value for this amount. Probably, you have better idea. But generally your idea below ... Also, it seems this would just lead to the issue you mentioned earlier: when the memory runs out,|domain_crash()| will be called or PTE will be zapped.Or one domain exhausting memory would cause another domain to fail. A domain impacting just itself may be tolerable. But a domain affecting other domains isn't.But it seems like this issue could happen in any implementation. It won't happen only if we will have only pre-populated pool for any domain type (hardware, control, guest domain) without ability to extend them or allocate extra pages from domheap in runtime. Otherwise, if extra pages allocation is allowed then we can't really do something with this issue.But that's why I brought this up: You simply have to. Or, as indicated, the moment you mark Xen security-supported on RISC-V, there will be an XSA needed.Why it isn't XSA for other architectures? At least, Arm then should have such XSA.Does Arm use a radix tree for storing types? It uses one for mem-access, but it's not clear to me whether that's actually a supported feature.I don't understand why x86 won't have the same issue. Memory is the limited and shared resource, so if one of the domain will use to much memory then it could happen that other domains won't have enough memory for its purpose...The question is whether allocations are bounded. With this use of a radix tree, you give domains a way to have Xen allocate pretty much arbitrary amounts of memory to populate that tree. That unbounded-ness is the problem, not memory allocations in general.Isn't radix tree key bounded to an amount of GFNs given for a domain? We can't have more keys then a max GFN number for a domain. So a potential amount of necessary memory for radix tree is also bounded to an amount of GFNs.To some degree yes, hence why I said "pretty much arbitrary amounts". But recall that "amount of GFNs" is a fuzzy term; I think you mean to use it to describe the amount of memory pages given to the guest. GFNs can be used for other purposes, though. Guests could e.g. grant themselves access to their own memory, then map those grants at otherwise unused GFNs.Anyway, IIUC I just can't use radix tree for p2m types at all, right? If yes, does it make sense to borrow 2 bits from struct page_info->type_info as now it is used 9-bits for count of a frame?struct page_info describes MFNs, when you want to describe GFNs. As you mentioned earlier, multiple GFNs can in principle map to the same MFN. You would force them to all have the same properties, which would be in direct conflict with e.g. the grant P2M types. Just to mention one possible alternative to using radix trees: You could maintain a 2nd set of intermediate "page tables", just that leaf entries would hold meta data for the respective GFN. The memory for those "page tables" could come from the normal P2M pool (and allocation would thus only consume domain-specific resources). Of course in any model like this the question of lookup times (as mentioned above) would remain. ...looks like an optimal option. The only thing I worry about is that it will require some code duplication (I will think how to re-use the current one code), as for example, when setting/getting metadata, TLB flushing isn’t needed at all as we aren't working with with real P2M page tables. Agree that lookup won't be the best one, but nothing can be done with such models. ~ Oleksii
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |