[RFC PATCH 10/15] drivers/acrn: add interrupt injection support

Zhao, Yakui yakui.zhao at intel.com
Mon Aug 19 04:59:31 UTC 2019



On 2019年08月16日 21:12, Dan Carpenter wrote:
> On Fri, Aug 16, 2019 at 10:25:51AM +0800, Zhao Yakui wrote:
>> +	case IC_VM_INTR_MONITOR: {
>> +		struct page *page;
>> +
>> +		ret = get_user_pages_fast(ioctl_param, 1, 1, &page);
>> +		if (unlikely(ret != 1) || !page) {
>                                         ^^^^^^^^
> Not required.

Do you mean that it is enough to check the condition of "ret != 1"?
OK. It will be removed.


> 
>> +			pr_err("acrn-dev: failed to pin intr hdr buffer!\n");
>> +			return -ENOMEM;
>> +		}
>> +
>> +		ret = hcall_vm_intr_monitor(vm->vmid, page_to_phys(page));
>> +		if (ret < 0) {
>> +			pr_err("acrn-dev: monitor intr data err=%ld\n", ret);
>> +			return -EFAULT;
>> +		}
>> +		break;
>> +	}
>> +
> 
> regards,
> dan carpenter
> 


More information about the devel mailing list