Hello,

I have some questions about how to change access rights in seL4. (I'm using native seL4, not camkes)

1) Currently, I'm using seL4_ARCH_Page_Remap to change an access right (from R/W to R/O) to a specific page (of other processes) at run-time. I'm doing as follows:

seL4_CPtr frame = vspace_get_cap(&(p.vspace), p.thread.stack_top-1); // only for the stack
int error = seL4_ARCH_Page_Remap(frame, ppd.cptr, seL4_CanRead, seL4_ARCH_Default_VMAttributes);

Am I doing it correctly? The code seems to work fine for me but I just want to double check.

2) If my understanding in 1) is correct, the remap function only takes 1 cap at a time. 
So if I want to modify access rights of many pages, do I have to call the remap function multiple times?
Or is there a more efficient way to do so?

3) I am also curious how the kernel handles the remap function. Does it simply flip/change some bits? Or does it involve page-related operations as well?
e.g. unmap that page first and then remap the same region with a new access right? I guess it should be the former but I need to be sure about that.

Thank you,

Oak


--
Norrathep (Oak) Rattanavipanon
M.S. in Computer Science
University of California - Irvine