Tests for hf_vm_configure.
Adds a check that the same page isn't being used for the send and
receive pages.
Change-Id: I0a24b28e36dced56246a18e276ac85cf82c2eb9a
diff --git a/src/api.c b/src/api.c
index 6da649c..f6895ca 100644
--- a/src/api.c
+++ b/src/api.c
@@ -146,6 +146,12 @@
goto exit;
}
+ /* Fail if the same page is used for the send and receive pages. */
+ if (pa_addr(pa_send_begin) == pa_addr(pa_recv_begin)) {
+ ret = -1;
+ goto exit;
+ }
+
pa_send_end = pa_add(pa_send_begin, PAGE_SIZE);
pa_recv_end = pa_add(pa_recv_begin, PAGE_SIZE);