Hi Henry,

On 13/10/2022 11:58, Julien Grall wrote:

+     * when the domain is created. Considering the worst case for page
+     * tables and keep a buffer, populate 16 pages to the P2M pages pool
here.
+     */
+    if ( (rc = p2m_set_allocation(d, 16, NULL)) != 0 )
+    {
+        p2m_set_allocation(d, 0, NULL);

Shouldn't this be done in p2m_fiinal_teardown() to cover so the pages
will be freed anything after this call will fail (include in the caller
domain_create())?

Hmm, yes, I will remove this p2m_set_allocation(d, 0, NULL); in v2.

Just to clarify, I meant that a call in p2m_final_teardown() *is* missing in p2m_final_teardown() (or wherever we decide to add).

This would make this one redundant.

While chatting with you on IRC, I realized that a call to p2m_set_allocation() will only freed unused P2M pages. If some of them are in the P2M then they would be skipped.

This means we also need to call p2m_teardown() (which would need to be optionally preemptible).

Cheers,

--
Julien Grall

Reply via email to