2019-04-28 00:05:10 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Zhao Yakui <yakui.zhao@intel.com>
|
|
|
|
Date: Tue, 23 Apr 2019 13:14:35 +0800
|
|
|
|
Subject: [PATCH] acrn/vhm: HC_ASSIGN_PTDEV passes the bdf directly instead of
|
|
|
|
guest physical address
|
|
|
|
|
|
|
|
Currently the HC_ASSIGN/DEASSIGN_PTDEV is called to add/remove the
|
|
|
|
pass-through device and the bdf is passed by using guest_physical_addr
|
|
|
|
mode. This requires that the ACRN hypervisor looks up the GPA mapping
|
|
|
|
to get the bdf. In fact it looks much simpler that it is passed directly.
|
|
|
|
|
|
|
|
Tracked-On: projectacrn/acrn-hypervisor#1318
|
|
|
|
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
|
|
|
|
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
|
|
|
|
Tracked-On: PKT-2115
|
|
|
|
---
|
|
|
|
drivers/char/vhm/vhm_dev.c | 4 ++--
|
|
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/drivers/char/vhm/vhm_dev.c b/drivers/char/vhm/vhm_dev.c
|
2020-10-27 02:14:06 +08:00
|
|
|
index 2a51fadac057..f7fb72aa2947 100644
|
2019-04-28 00:05:10 +08:00
|
|
|
--- a/drivers/char/vhm/vhm_dev.c
|
|
|
|
+++ b/drivers/char/vhm/vhm_dev.c
|
|
|
|
@@ -433,7 +433,7 @@ static long vhm_dev_ioctl(struct file *filep,
|
|
|
|
(void *)ioctl_param, sizeof(uint16_t)))
|
|
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
- ret = hcall_assign_ptdev(vm->vmid, virt_to_phys(&bdf));
|
|
|
|
+ ret = hcall_assign_ptdev(vm->vmid, bdf);
|
|
|
|
if (ret < 0) {
|
|
|
|
pr_err("vhm: failed to assign ptdev!\n");
|
|
|
|
return -EFAULT;
|
|
|
|
@@ -447,7 +447,7 @@ static long vhm_dev_ioctl(struct file *filep,
|
|
|
|
(void *)ioctl_param, sizeof(uint16_t)))
|
|
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
- ret = hcall_deassign_ptdev(vm->vmid, virt_to_phys(&bdf));
|
|
|
|
+ ret = hcall_deassign_ptdev(vm->vmid, bdf);
|
|
|
|
if (ret < 0) {
|
|
|
|
pr_err("vhm: failed to deassign ptdev!\n");
|
|
|
|
return -EFAULT;
|
|
|
|
--
|
|
|
|
https://clearlinux.org
|
|
|
|
|