Commit 2a7e1211 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'vfio-v4.18-rc5' of git://github.com/awilliam/linux-vfio

Pull VFIO fix from Alex Williamson:
 "Fix deadlock in mbochs sample driver (Alexey Khoroshilov)"

* tag 'vfio-v4.18-rc5' of git://github.com/awilliam/linux-vfio:
  sample: vfio-mdev: avoid deadlock in mdev_access()
parents 79facf30 498e8bf5
...@@ -178,6 +178,8 @@ static const char *vbe_name(u32 index) ...@@ -178,6 +178,8 @@ static const char *vbe_name(u32 index)
return "(invalid)"; return "(invalid)";
} }
static struct page *__mbochs_get_page(struct mdev_state *mdev_state,
pgoff_t pgoff);
static struct page *mbochs_get_page(struct mdev_state *mdev_state, static struct page *mbochs_get_page(struct mdev_state *mdev_state,
pgoff_t pgoff); pgoff_t pgoff);
...@@ -394,7 +396,7 @@ static ssize_t mdev_access(struct mdev_device *mdev, char *buf, size_t count, ...@@ -394,7 +396,7 @@ static ssize_t mdev_access(struct mdev_device *mdev, char *buf, size_t count,
MBOCHS_MEMORY_BAR_OFFSET + mdev_state->memsize) { MBOCHS_MEMORY_BAR_OFFSET + mdev_state->memsize) {
pos -= MBOCHS_MMIO_BAR_OFFSET; pos -= MBOCHS_MMIO_BAR_OFFSET;
poff = pos & ~PAGE_MASK; poff = pos & ~PAGE_MASK;
pg = mbochs_get_page(mdev_state, pos >> PAGE_SHIFT); pg = __mbochs_get_page(mdev_state, pos >> PAGE_SHIFT);
map = kmap(pg); map = kmap(pg);
if (is_write) if (is_write)
memcpy(map + poff, buf, count); memcpy(map + poff, buf, count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment