On 27/03/2023 11:50, Oleksii wrote:
Hello Julien,

Hi,

On Tue, 2023-03-21 at 17:58 +0000, Julien Grall wrote:
+        /* Setup level0 table */
+        if ( !pte_is_valid(&zeroeth[index0]) )

On the previous version, you said it should be checked for each
level.
But here you still only check for a single level.

Furthermore, I would strongly suggest to also check the valid PTE is
the
same as you intend to write to catch any override (they are a pain to
debug).

Do you mean that I have to get a virtual address, extract the page
table index bits from it, traverse the page table hierarchy to locate
the PTE for the virtual address and the compare the gotten PTE address
with zeroeh[index0]?

No. I was suggesting to check the PTE you intend to write is the exact same that the one you are overwriting.

This could potentially be relaxed to allow permission flags to be changed.

Cheers,

--
Julien Grall

Reply via email to