dm:gvt:reserve gvt bar regions in ACRN-DM

The current design has the following problem:
gvt uses some pci bar regions,
but ACRN-DM isn't aware of these regions.
So ACRN-DM may allocate these regions for other pci devices,
which will result in other pci devices bar regions
overlap with gvt bar regions.

The new design is the following:
(1) ACRN-DM reads gvt bar regions
which are provided by physical gpu;
(2) ACRN-DM reserves gvt bar regions

v6 -> v7:
	* use array to store reserved bar regions
	* rename some struct and func

v5 -> v6:
	* rename enable_gvt to gvt_enabled
	* add a interface to reserve bar regions
	* reserve gvt bar regions

Tracked-On: projectacrn#4005

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
Junming Liu
2019-11-12 19:18:50 +00:00
committed by wenlingz
parent 72644ac2b2
commit 1ac0b57c6a
5 changed files with 146 additions and 0 deletions

View File

@@ -67,6 +67,9 @@ struct vmctx {
/* BSP state. guest loader needs to fill it */
struct acrn_set_vcpu_regs bsp_regs;
/* if gvt-g is enabled for current VM */
bool gvt_enabled;
};
#define PROT_RW (PROT_READ | PROT_WRITE)