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:
parent
b430b00a08
commit
605738fc0c
|
@ -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;
|
||||
|
|
|
@ -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 *)®ion, 0U, sizeof(region));
|
||||
|
||||
if (copy_from_gpa(vm, ®ion, 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, ®ion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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, ®ions[idx]);
|
||||
int ret = set_vm_memory_region(vm, target_vm, ®ions[idx]);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue