dm: fix the issue when guest tries to disable memory range access

According to PCI spec 3.0 section 6.2.2 "Device Control", guest
could write the command register to control device response to
io/mem access.

The origial code register/unregister the memory range which is
not suitable because it can't handle the sequence:
  1. disble the device response to specific memory range
  2. reboot guest (DM will try to free the memory range which
     was freed in step 1 already)

Tracked-On: #1277
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
Yin Fengwei
2018-09-18 11:30:39 +08:00
committed by wenlingz
parent be0cde7dec
commit 8787b65fde
5 changed files with 182 additions and 4 deletions

View File

@@ -74,6 +74,8 @@ void init_inout(void);
int emulate_inout(struct vmctx *ctx, int *pvcpu, struct pio_request *req);
int register_inout(struct inout_port *iop);
int unregister_inout(struct inout_port *iop);
int enable_inout(struct inout_port *iop);
int disable_inout(struct inout_port *iop);
int init_bvmcons(void);
void deinit_bvmcons(void);
void enable_bvmcons(void);