hv: hypercall: remove hcall_set_vm_memory_region

Since it's discarded.

Tracked-On: #1124
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Li, Fei1 2018-11-08 18:00:59 +08:00 committed by wenlingz
parent b430b00a08
commit 605738fc0c
4 changed files with 2 additions and 57 deletions

View File

@ -106,11 +106,6 @@ int vmcall_vmexit_handler(struct acrn_vcpu *vcpu)
(uint16_t)param2);
break;
case HC_VM_SET_MEMORY_REGION:
/* param1: vmid */
ret = hcall_set_vm_memory_region(vm, (uint16_t)param1, param2);
break;
case HC_VM_SET_MEMORY_REGIONS:
ret = hcall_set_vm_memory_regions(vm, param1);
break;

View File

@ -491,7 +491,7 @@ int32_t hcall_notify_ioreq_finish(uint16_t vmid, uint16_t vcpu_id)
/**
*@pre Pointer vm shall point to VM0
*/
static int32_t local_set_vm_memory_region(struct acrn_vm *vm,
static int32_t set_vm_memory_region(struct acrn_vm *vm,
struct acrn_vm *target_vm, const struct vm_memory_region *region)
{
uint64_t hpa, base_paddr, gpa_end;
@ -568,42 +568,6 @@ static int32_t local_set_vm_memory_region(struct acrn_vm *vm,
return 0;
}
/**
* @brief setup ept memory mapping
*
* @param vm Pointer to VM data structure
* @param vmid ID of the VM
* @param param guest physical address. This gpa points to
* struct vm_set_memmap
*
* @pre Pointer vm shall point to VM0
* @return 0 on success, non-zero on error.
*/
int32_t hcall_set_vm_memory_region(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
{
struct vm_memory_region region;
struct acrn_vm *target_vm = get_vm_from_vmid(vmid);
if (target_vm == NULL) {
return -EINVAL;
}
(void)memset((void *)&region, 0U, sizeof(region));
if (copy_from_gpa(vm, &region, param, sizeof(region)) != 0) {
pr_err("%s: Unable copy param to vm\n", __func__);
return -EFAULT;
}
if (is_vm0(target_vm)) {
pr_err("%s: Targeting to service vm", __func__);
return -EPERM;
}
return local_set_vm_memory_region(vm, target_vm, &region);
}
/**
* @brief setup ept memory mapping for multi regions
*
@ -646,7 +610,7 @@ int32_t hcall_set_vm_memory_regions(struct acrn_vm *vm, uint64_t param)
/* the force pointer change below is for back compatible
* to struct vm_memory_region, it will be removed in the future
*/
int ret = local_set_vm_memory_region(vm, target_vm, &regions[idx]);
int ret = set_vm_memory_region(vm, target_vm, &regions[idx]);
if (ret < 0) {
return ret;
}

View File

@ -212,19 +212,6 @@ int32_t hcall_set_ioreq_buffer(struct acrn_vm *vm, uint16_t vmid, uint64_t param
*/
int32_t hcall_notify_ioreq_finish(uint16_t vmid, uint16_t vcpu_id);
/**
* @brief setup ept memory mapping
*
* @param vm Pointer to VM data structure
* @param vmid ID of the VM
* @param param guest physical address. This gpa points to
* struct vm_set_memmap
*
* @pre Pointer vm shall point to VM0
* @return 0 on success, non-zero on error.
*/
int32_t hcall_set_vm_memory_region(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
/**
* @brief setup ept memory mapping for multi regions
*

View File

@ -52,7 +52,6 @@
/* Guest memory management */
#define HC_ID_MEM_BASE 0x40UL
#define HC_VM_SET_MEMORY_REGION BASE_HC_ID(HC_ID, HC_ID_MEM_BASE + 0x00UL)
#define HC_VM_GPA2HPA BASE_HC_ID(HC_ID, HC_ID_MEM_BASE + 0x01UL)
#define HC_VM_SET_MEMORY_REGIONS BASE_HC_ID(HC_ID, HC_ID_MEM_BASE + 0x02UL)
#define HC_VM_WRITE_PROTECT_PAGE BASE_HC_ID(HC_ID, HC_ID_MEM_BASE + 0x03UL)