mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-16 22:39:29 +00:00
DM: Add option of no check against ptdev reset
With '--ptdev_no_reset', DM doen not abort but warn when assign PCIe dev without reset capability. Signed-off-by: Edwin Zhai <edwin.zhai@intel.com> Acked-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
@@ -91,6 +91,11 @@ static pthread_mutex_t ref_cnt_mtx = PTHREAD_MUTEX_INITIALIZER;
|
||||
/* Prefer MSI over INTx for ptdev */
|
||||
static bool prefer_msi = true;
|
||||
|
||||
/* Not check reset capability before assign ptdev.
|
||||
* Set false by default, that is, always check.
|
||||
*/
|
||||
static bool no_reset = false;
|
||||
|
||||
struct passthru_dev {
|
||||
struct pci_vdev *dev;
|
||||
struct pcibar bar[PCI_BARMAX + 1];
|
||||
@@ -116,6 +121,11 @@ ptdev_prefer_msi(bool enable)
|
||||
prefer_msi = enable;
|
||||
}
|
||||
|
||||
void ptdev_no_reset(bool enable)
|
||||
{
|
||||
no_reset = enable;
|
||||
}
|
||||
|
||||
static int
|
||||
msi_caplen(int msgctrl)
|
||||
{
|
||||
@@ -846,7 +856,8 @@ cfginit(struct vmctx *ctx, struct passthru_dev *ptdev, int bus,
|
||||
warnx("No reset capability for PCIe %x/%x/%x, "
|
||||
"remove it from ptdev list!!\n",
|
||||
bus, slot, func);
|
||||
return -1;
|
||||
if (!no_reset)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user