Use SPCI_RXTX_MAP instead of hf_vm_configure.
Bug: 132421502
Change-Id: I26001820ec179dba1538e6bb12434cea16518323
diff --git a/main.c b/main.c
index fb32660..2a83c6e 100644
--- a/main.c
+++ b/main.c
@@ -943,6 +943,7 @@
.owner = THIS_MODULE,
};
int64_t ret;
+ struct spci_value spci_ret;
spci_vm_id_t i;
spci_vcpu_index_t j;
spci_vm_count_t secondary_vm_count;
@@ -967,16 +968,16 @@
* because the hypervisor will use them, even if the module is
* unloaded.
*/
- ret = hf_vm_configure(page_to_phys(hf_send_page),
- page_to_phys(hf_recv_page));
- if (ret) {
+ spci_ret = spci_rxtx_map(page_to_phys(hf_send_page),
+ page_to_phys(hf_recv_page));
+ if (spci_ret.func != SPCI_SUCCESS_32) {
__free_page(hf_send_page);
__free_page(hf_recv_page);
- /*
- * TODO: We may want to grab this information from hypervisor
- * and go from there.
- */
pr_err("Unable to configure VM\n");
+ if (spci_ret.func == SPCI_ERROR_32)
+ pr_err("SPCI error code %d\n", spci_ret.arg2);
+ else
+ pr_err("Unexpected SPCI function %#x\n", spci_ret.func);
return -EIO;
}