[svsm-devel] Allocating 4 contiguous pages and set them shared

Claudio Siqueira de Carvalho cclaudio at ibm.com
Thu Nov 2 03:57:03 CET 2023


Hello,

I could use the lines below to allocate and free 4 contiguous guest virtual
pages, but it will allocate a page of order 2, which IIUC is bigger than the
size requested.

let p = allocate_pages(get_order(4*PAGE_SIZE))?;
free_page(p);

My question is how should I share 4 pages with the hypervisor in this case? I
could call "this_cpu_mut().get_pgtable().set_shared_4k()" for the first 4
contiguous pages of p, but it seems that set_shared_4k() was meant for pages of
order zero. Am I missing something? Any thoughts?

Thank you.

Claudio




More information about the Svsm-devel mailing list