Conversation
Signed-off-by: Simon LUCIDO <simon.lucido@etu.umontpellier.fr>
Signed-off-by: Simon LUCIDO <simon.lucido@etu.umontpellier.fr>
Signed-off-by: Simon LUCIDO <simon.lucido@etu.umontpellier.fr>
| /// RAM | ||
| Ram, | ||
| /// MMIO | ||
| Mmio, |
There was a problem hiding this comment.
RAM or MMIO should not be states but types. You can have Free + Ram or Allocated + Mmio for a node.
There was a problem hiding this comment.
I disagree: a memory range marked as Ram is not free: it is allocated to be used as RAM, hence it is not free to use for anything else. Same thing goes for Mmio. Free means 'this memory range is not mapped to anything'.
ReservedUnallocated means This shall not be mapped to anything, like the upper 20MB of the 32bits address range for example.
The goal of these changes was to be able to specify the usage intended for allocated memory ranges. Instead of having only Allocated, you now have to specify what it is allocated for. This allows us to have different behaviors when actually registering memory with KVM. Memory ranges in the Ram state should be registered with KVM and added to E820, while Mmio and ReservedUnallocated should not, for example.
| Free, | ||
| /// Node is allocated. | ||
| Allocated, | ||
| /// Reserved, and should be allocated (x86's real mode for example). |
There was a problem hiding this comment.
What does Reserved mean here? How is it different from Allocated?
Also, do you mean can be allocated?
There was a problem hiding this comment.
Reserved is close to meaning to allocated, it is more or less a catch-all for all use cases that are not RAM neither MMIO.
I mean KVM should know about this memory region.
Hi !
This PR adds a more granular way to configure node in our allocator state. Instead of having a binary view (Free or Allocated), we know have more state, such as Ram, mmio or ReservedAllocated.
This allows us to use a single allocator to handle all of our memory mapping, hence making sure we don't have conflicts in our memory regions.
I've also added a way to retrieve all the current nodes in our allocator.