Exemplo n.º 1
0
Arquivo: ept.c Projeto: jyizheng/dune
int vmx_do_ept_fault(struct vmx_vcpu *vcpu, unsigned long gpa,
		     unsigned long gva, int fault_flags)
{
	int ret;
	unsigned long hva = gpa_to_hva(vcpu, current->mm, gpa);
	int make_write = (fault_flags & VMX_EPT_FAULT_WRITE) ? 1 : 0;

	pr_debug("ept: GPA: 0x%lx, GVA: 0x%lx, HVA: 0x%lx, flags: %x\n",
		 gpa, gva, hva, fault_flags);

	ret = ept_set_epte(vcpu, make_write, gpa, hva);

	return ret;
}
Exemplo n.º 2
0
int vmx_do_ept_fault(struct vmx_vcpu *vcpu, unsigned long gpa,
		     unsigned long gva, int fault_flags)
{
	int ret;
	unsigned long hva = gpa_to_hva(vcpu, current->mm, gpa);
	int make_write = (fault_flags & VMX_EPT_FAULT_WRITE) ? 1 : 0;

	if (unlikely(hva == ADDR_INVAL)) {
		printk(KERN_ERR "ept: gpa 0x%lx is out of range\n", gpa);
		return -EINVAL;
	}

	pr_debug("ept: GPA: 0x%lx, GVA: 0x%lx, HVA: 0x%lx, flags: %x\n",
		 gpa, gva, hva, fault_flags);

	ret = ept_set_epte(vcpu, make_write, gpa, hva);

	return ret;
}