VHE: Update code to use vm_mem_get_mode
Updated code base to use vm_mem_get_mode as opposed to using
mm_vm_get_mode directly, to account for el0 partitions.
Change-Id: Ie9d31aecc8e1e60705cb4983dfdcb222f5787f2e
Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
diff --git a/src/api.c b/src/api.c
index 9fff085..5533c9b 100644
--- a/src/api.c
+++ b/src/api.c
@@ -973,8 +973,8 @@
* Ensure the pages are valid, owned and exclusive to the VM and that
* the VM has the required access to the memory.
*/
- if (!mm_vm_get_mode(&vm_locked.vm->ptable, send,
- ipa_add(send, PAGE_SIZE), &orig_send_mode) ||
+ if (!vm_mem_get_mode(vm_locked, send, ipa_add(send, PAGE_SIZE),
+ &orig_send_mode) ||
!api_mode_valid_owned_and_exclusive(orig_send_mode) ||
(orig_send_mode & MM_MODE_R) == 0 ||
(orig_send_mode & MM_MODE_W) == 0) {
@@ -982,8 +982,8 @@
goto out;
}
- if (!mm_vm_get_mode(&vm_locked.vm->ptable, recv,
- ipa_add(recv, PAGE_SIZE), &orig_recv_mode) ||
+ if (!vm_mem_get_mode(vm_locked, recv, ipa_add(recv, PAGE_SIZE),
+ &orig_recv_mode) ||
!api_mode_valid_owned_and_exclusive(orig_recv_mode) ||
(orig_recv_mode & MM_MODE_R) == 0) {
ret = ffa_error(FFA_INVALID_PARAMETERS);