Skip to content

Commit 5d5fe17

Browse files
Changbin Duzhenyw
authored andcommitted
drm/i915/kvmgt: Sanitize PCI bar emulation
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@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
1 parent bb9d2d0 commit 5d5fe17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gvt/kvmgt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,6 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf,
661661
buf, count);
662662
break;
663663
case VFIO_PCI_BAR0_REGION_INDEX:
664-
case VFIO_PCI_BAR1_REGION_INDEX:
665664
if (is_write) {
666665
uint64_t bar0_start = intel_vgpu_get_bar0_addr(vgpu);
667666

@@ -674,6 +673,7 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf,
674673
bar0_start + pos, buf, count);
675674
}
676675
break;
676+
case VFIO_PCI_BAR1_REGION_INDEX:
677677
case VFIO_PCI_BAR2_REGION_INDEX:
678678
case VFIO_PCI_BAR3_REGION_INDEX:
679679
case VFIO_PCI_BAR4_REGION_INDEX:

0 commit comments

Comments
 (0)