Get/Set multiple message registers with the one syscall?
I'm looking at `seL4_GetMR()` and `seL4_SetMR()`, which requires a syscall for each get/set. To my naive eye, it seems like you're much better off running `seL4_GetIPCBuffer()->msg` then reading/writing to each index as needed, turning multiple syscalls (one for each get/set) into just the one. Am I missing anything? I was planning on replacing my Get/Set calls with direct array writes, but I'm wondering if I've missed reasons why I shouldn't. Thanks, Ben
Hi Ben,
If for performance reasons you want to set multiple registers at the same time, use the `withMRs` (e.g seL4_CallWithMRs) and other variants of the system calls. These place arguments directly into registers and avoid manipulating the IPC buffer at all (however you're limited to 4 message registers, and 1 on ia32).
Otherwise `seL4_GetMR` and friends are inline convenience functions and only manipulate the IPC buffer - the compiler should optimise these for you. They are not system calls and will not invoke the kernel.
Cheers,
Anna.
________________________________
From: Devel
Thanks for the overview. Looking at it again, I can see why I falsely
concluded that getting the message buffer was a system call.
The original source of confusion was based on thinking syscalls were
involved. With that corrected, everything else becomes clear.
Thanks!
To me, seeing that
On Tue, Mar 31, 2020 at 11:51 PM Anna Lyons
Hi Ben,
If for performance reasons you want to set multiple registers at the same time, use the `withMRs` (e.g seL4_CallWithMRs) and other variants of the system calls. These place arguments directly into registers and avoid manipulating the IPC buffer at all (however you're limited to 4 message registers, and 1 on ia32).
Otherwise `seL4_GetMR` and friends are inline convenience functions and only manipulate the IPC buffer - the compiler should optimise these for you. They are not system calls and will not invoke the kernel.
Cheers, Anna. ------------------------------ *From:* Devel
on behalf of Ben Ph < benphawke@gmail.com> *Sent:* Tuesday, 31 March 2020 9:12 PM *To:* devel@sel4.systems *Subject:* [seL4] Get/Set multiple message registers with the one syscall? I'm looking at `seL4_GetMR()` and `seL4_SetMR()`, which requires a syscall for each get/set. To my naive eye, it seems like you're much better off running `seL4_GetIPCBuffer()->msg` then reading/writing to each index as needed, turning multiple syscalls (one for each get/set) into just the one.
Am I missing anything? I was planning on replacing my Get/Set calls with direct array writes, but I'm wondering if I've missed reasons why I shouldn't.
Thanks, Ben _______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel ________________________________
WARNING This email originates from an e-mail address outside of Ghost Locomotion. Do not open attachments or click links unless you are sure this email comes from a known, trusted sender.
________________________________
*Confidentiality Note*:*This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorized use, dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient is strictly prohibited. If you have received this email in error, please notify the sender immediately and destroy the original message, any attachments thereto and all copies. *
participants (2)
-
Anna Lyons
-
Ben Ph