I'm reviewing some of the design choices I took in past projects and one of the biggest doubts that
I have is how to handle page overlap. A simplified example:
1. The kernel maps vaddr 0xFF0200000 with a page size of 4KB. The valid range would be (0xFF0200000 - 0xFF0200FFF)
2. The kernel now maps vaddr 0xFF0200000 with a page size of 2MB. The valid range would be (0xFF0200000 - 0xFF03FFFFF)
You can clearly see that the ranges overlap. This is also true in case steps 1 and 2 get inverted. Even worse, the smaller range
doesn't have to start in the same address as the bigger one (0xFF0204000-0xFF0204FFF)...
In your opinion ¿How should this kind of situations be addressed?
My current approach is to respect the biggest mapping and if in a tie, respect the newer mapping.
Im eager to hear your opinion
Have a great day!


