[PATCH] drm/i915/kvmgt: Sanitize PCI bar emulation
Zhenyu Wang
zhenyuw at linux.intel.com
Wed Aug 16 08:21:26 UTC 2017
On 2017.08.15 13:20:51 +0800, changbin.du at intel.com wrote:
> From: Changbin Du <changbin.du at intel.com>
>
> For PCI, 64bit bar consumes two BAR registers, but this doesn't mean
> both of two BAR are valid. Actually the second BAR is regarded as
> reserved in this case. So we shouldn't emulate the second BAR.
>
> Signed-off-by: Changbin Du <changbin.du at intel.com>
> ---
> drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index 83e88c7..9201db0 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -661,7 +661,6 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf,
> buf, count);
> break;
> case VFIO_PCI_BAR0_REGION_INDEX:
> - case VFIO_PCI_BAR1_REGION_INDEX:
> if (is_write) {
> uint64_t bar0_start = intel_vgpu_get_bar0_addr(vgpu);
>
> @@ -674,6 +673,7 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf,
> bar0_start + pos, buf, count);
> }
> break;
> + case VFIO_PCI_BAR1_REGION_INDEX:
> case VFIO_PCI_BAR2_REGION_INDEX:
> case VFIO_PCI_BAR3_REGION_INDEX:
> case VFIO_PCI_BAR4_REGION_INDEX:
applied this too, thx!
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20170816/9a94c04f/attachment.sig>
More information about the intel-gvt-dev
mailing list