From: Peter Dinda Date: Sun, 2 Aug 2015 23:15:28 +0000 (-0500) Subject: Have unregistered hypercalls fail to guest X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=4d1d8fadad33de7d3ebce2083d9782048f78b44e Have unregistered hypercalls fail to guest --- diff --git a/palacios/include/palacios/vmm_hypercall.h b/palacios/include/palacios/vmm_hypercall.h index 9b16618..58c73f9 100644 --- a/palacios/include/palacios/vmm_hypercall.h +++ b/palacios/include/palacios/vmm_hypercall.h @@ -56,7 +56,7 @@ typedef enum { VNET_HEADER_QUERY_HCALL = 0xe000, // Get the current header for a src/dest pair - HVM_HCALL = 0xf000, + HVM_HCALL = 0xf00d, } hcall_id_t; diff --git a/palacios/src/palacios/vmm_hypercall.c b/palacios/src/palacios/vmm_hypercall.c index 59e6484..21e6e96 100644 --- a/palacios/src/palacios/vmm_hypercall.c +++ b/palacios/src/palacios/vmm_hypercall.c @@ -181,9 +181,10 @@ int v3_handle_hypercall(struct guest_info * info) { struct hypercall * hcall = get_hypercall(info->vm_info, hypercall_id); if (!hcall) { - PrintError(info->vm_info, info, "Invalid Hypercall (%d(0x%x) not registered)\n", + PrintError(info->vm_info, info, "Invalid Hypercall (%d(0x%x) not registered) => ignored with rax=-1\n", hypercall_id, hypercall_id); - return -1; + info->vm_regs.rax=-1; + return 0; } if (hcall->hcall_fn(info, hypercall_id, hcall->priv_data) != 0) {