summaryrefslogtreecommitdiff
path: root/drivers/uio
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2018-01-09 12:57:31 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-12 12:32:19 +0200
commitd96a094c987f5409f0037aa4964eab989f6f4ea8 (patch)
treecec9eeed2b90544874b9d368525e0bcc680315dd /drivers/uio
parent28b35f9aa0c068075ca57ab646d87e2f607a9d5c (diff)
uio_hv_generic: check that host supports monitor page
[ Upstream commit 06028d15177a1b406b7b075ea47c6a352732f23a ] In order for userspace application to signal host, it needs the host to support the monitor page property. Check for the flag and fail if this is not supported. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uio')
-rw-r--r--drivers/uio/uio_hv_generic.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 48d5327d38d4..fe5cdda80b2c 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -124,6 +124,13 @@ hv_uio_probe(struct hv_device *dev,
if (ret)
goto fail;
+ /* Communicating with host has to be via shared memory not hypercall */
+ if (!dev->channel->offermsg.monitor_allocated) {
+ dev_err(&dev->device, "vmbus channel requires hypercall\n");
+ ret = -ENOTSUPP;
+ goto fail_close;
+ }
+
dev->channel->inbound.ring_buffer->interrupt_mask = 1;
set_channel_read_mode(dev->channel, HV_CALL_DIRECT);