[PATCH 4/6] Input: Remove vmmouse port reservation
This port is used by quite a few guest-to-host communication capabilities, e.g. getting configuration, logging, etc. Currently multiple kernel modules, and one or more priviledged guest user mode app, e.g. open-vm-tools, use this port without reservation. It was determined that no reservation is required when accessing the port in this manner. Signed-off-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Cc: pv-driv...@vmware.com Cc: linux-graphics-maintai...@vmware.com Cc: virtualization@lists.linux-foundation.org Cc: linux-ker...@vger.kernel.org Cc: Greg Kroah-Hartman --- drivers/input/mouse/vmmouse.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/input/mouse/vmmouse.c b/drivers/input/mouse/vmmouse.c index d06daf6..85fb3d47 100644 --- a/drivers/input/mouse/vmmouse.c +++ b/drivers/input/mouse/vmmouse.c @@ -347,16 +347,10 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties) return -ENXIO; } - if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { - psmouse_dbg(psmouse, "VMMouse port in use.\n"); - return -EBUSY; - } - /* Check if the device is present */ response = ~VMMOUSE_PROTO_MAGIC; VMMOUSE_CMD(GETVERSION, 0, version, response, dummy1, dummy2); if (response != VMMOUSE_PROTO_MAGIC || version == 0xU) { - release_region(VMMOUSE_PROTO_PORT, 4); return -ENXIO; } @@ -366,8 +360,6 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties) psmouse->model = version; } - release_region(VMMOUSE_PROTO_PORT, 4); - return 0; } @@ -386,7 +378,6 @@ static void vmmouse_disconnect(struct psmouse *psmouse) psmouse_reset(psmouse); input_unregister_device(priv->abs_dev); kfree(priv); - release_region(VMMOUSE_PROTO_PORT, 4); } /** @@ -430,15 +421,10 @@ int vmmouse_init(struct psmouse *psmouse) struct input_dev *rel_dev = psmouse->dev, *abs_dev; int error; - if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { - psmouse_dbg(psmouse, "VMMouse port in use.\n"); - return -EBUSY; - } - psmouse_reset(psmouse); error = vmmouse_enable(psmouse); if (error) - goto release_region; + return error; priv = kzalloc(sizeof(*priv), GFP_KERNEL); abs_dev = input_allocate_device(); @@ -493,8 +479,5 @@ init_fail: kfree(priv); psmouse->private = NULL; -release_region: - release_region(VMMOUSE_PROTO_PORT, 4); - return error; } -- 1.9.1 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
[PATCH 4/6] Input: Remove vmmouse port reservation
This port is used by quite a few guest-to-host communication capabilities, e.g. getting configuration, logging, etc. Currently multiple kernel modules, and one or more priviledged guest user mode app, e.g. open-vm-tools, use this port without reservation. It was determined that no reservation is required when accessing the port in this manner. Signed-off-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Cc: pv-driv...@vmware.com Cc: linux-graphics-maintai...@vmware.com Cc: virtualization@lists.linux-foundation.org Cc: linux-ker...@vger.kernel.org Cc: Greg Kroah-Hartman --- drivers/input/mouse/vmmouse.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/input/mouse/vmmouse.c b/drivers/input/mouse/vmmouse.c index ddb152c..e881c87 100644 --- a/drivers/input/mouse/vmmouse.c +++ b/drivers/input/mouse/vmmouse.c @@ -347,16 +347,10 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties) return -ENXIO; } - if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { - psmouse_dbg(psmouse, "VMMouse port in use.\n"); - return -EBUSY; - } - /* Check if the device is present */ response = ~VMMOUSE_PROTO_MAGIC; VMMOUSE_CMD(GETVERSION, 0, version, response, dummy1, dummy2); if (response != VMMOUSE_PROTO_MAGIC || version == 0xU) { - release_region(VMMOUSE_PROTO_PORT, 4); return -ENXIO; } @@ -366,8 +360,6 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties) psmouse->model = version; } - release_region(VMMOUSE_PROTO_PORT, 4); - return 0; } @@ -386,7 +378,6 @@ static void vmmouse_disconnect(struct psmouse *psmouse) psmouse_reset(psmouse); input_unregister_device(priv->abs_dev); kfree(priv); - release_region(VMMOUSE_PROTO_PORT, 4); } /** @@ -430,15 +421,10 @@ int vmmouse_init(struct psmouse *psmouse) struct input_dev *rel_dev = psmouse->dev, *abs_dev; int error; - if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { - psmouse_dbg(psmouse, "VMMouse port in use.\n"); - return -EBUSY; - } - psmouse_reset(psmouse); error = vmmouse_enable(psmouse); if (error) - goto release_region; + return error; priv = kzalloc(sizeof(*priv), GFP_KERNEL); abs_dev = input_allocate_device(); @@ -493,8 +479,5 @@ init_fail: kfree(priv); psmouse->private = NULL; -release_region: - release_region(VMMOUSE_PROTO_PORT, 4); - return error; } -- 1.9.1 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH 4/6] Input: Remove vmmouse port reservation
On Tue, Dec 1, 2015 at 3:04 PM, Sinclair Yeh wrote: > Hi, > > On Tue, Dec 01, 2015 at 02:30:05PM -0800, Dmitry Torokhov wrote: >> Hi Sinclair, >> >> On Tue, Dec 1, 2015 at 2:18 PM, Sinclair Yeh wrote: >> > Port reservation is not required. >> >> You need to expand on why we do not need to reserve port. > > Thomas gave me this input earlier, too, so I added the one liner. > > There was a long discussion on accessing the port a few years ago: > https://lkml.org/lkml/2008/9/24/512 > >> >> > Furthermore, this port is shared >> > by other VMware services for host-side communication. >> >> What services would that be? Do they reserve the port? > > This port is used by quite a few guest-to-host communication capabilities, > e.g. getting configuration, logging, etc. Currently multiple kernel > modules, and one or more priviledged guest user mode app, e.g. > open-vmware-tools, use this port without reservation. Ah, I forgot that vmmouse does not have a dedicated port... > > After some internal discussions, it was determined that no reservation > is required when accessing the port in this manner. > > Do you want me to put the above in the commit message? Not about the bit about "internal discussions", but the rest - yes please. -- Dmitry ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH 4/6] Input: Remove vmmouse port reservation
Hi, On Tue, Dec 01, 2015 at 02:30:05PM -0800, Dmitry Torokhov wrote: > Hi Sinclair, > > On Tue, Dec 1, 2015 at 2:18 PM, Sinclair Yeh wrote: > > Port reservation is not required. > > You need to expand on why we do not need to reserve port. Thomas gave me this input earlier, too, so I added the one liner. There was a long discussion on accessing the port a few years ago: https://lkml.org/lkml/2008/9/24/512 > > > Furthermore, this port is shared > > by other VMware services for host-side communication. > > What services would that be? Do they reserve the port? This port is used by quite a few guest-to-host communication capabilities, e.g. getting configuration, logging, etc. Currently multiple kernel modules, and one or more priviledged guest user mode app, e.g. open-vmware-tools, use this port without reservation. After some internal discussions, it was determined that no reservation is required when accessing the port in this manner. Do you want me to put the above in the commit message? > > Thanks. > > -- > Dmitry ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH 4/6] Input: Remove vmmouse port reservation
Hi Sinclair, On Tue, Dec 1, 2015 at 2:18 PM, Sinclair Yeh wrote: > Port reservation is not required. You need to expand on why we do not need to reserve port. > Furthermore, this port is shared > by other VMware services for host-side communication. What services would that be? Do they reserve the port? Thanks. -- Dmitry ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
[PATCH 4/6] Input: Remove vmmouse port reservation
Port reservation is not required. Furthermore, this port is shared by other VMware services for host-side communication. Signed-off-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Cc: pv-driv...@vmware.com Cc: linux-graphics-maintai...@vmware.com Cc: virtualization@lists.linux-foundation.org Cc: linux-ker...@vger.kernel.org --- drivers/input/mouse/vmmouse.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/input/mouse/vmmouse.c b/drivers/input/mouse/vmmouse.c index d34e3e4..9109d54 100644 --- a/drivers/input/mouse/vmmouse.c +++ b/drivers/input/mouse/vmmouse.c @@ -347,16 +347,10 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties) return -ENXIO; } - if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { - psmouse_dbg(psmouse, "VMMouse port in use.\n"); - return -EBUSY; - } - /* Check if the device is present */ response = ~VMMOUSE_PROTO_MAGIC; VMMOUSE_CMD(GETVERSION, 0, version, response, dummy1, dummy2); if (response != VMMOUSE_PROTO_MAGIC || version == 0xU) { - release_region(VMMOUSE_PROTO_PORT, 4); return -ENXIO; } @@ -366,8 +360,6 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties) psmouse->model = version; } - release_region(VMMOUSE_PROTO_PORT, 4); - return 0; } @@ -386,7 +378,6 @@ static void vmmouse_disconnect(struct psmouse *psmouse) psmouse_reset(psmouse); input_unregister_device(priv->abs_dev); kfree(priv); - release_region(VMMOUSE_PROTO_PORT, 4); } /** @@ -430,15 +421,10 @@ int vmmouse_init(struct psmouse *psmouse) struct input_dev *rel_dev = psmouse->dev, *abs_dev; int error; - if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { - psmouse_dbg(psmouse, "VMMouse port in use.\n"); - return -EBUSY; - } - psmouse_reset(psmouse); error = vmmouse_enable(psmouse); if (error) - goto release_region; + return error; priv = kzalloc(sizeof(*priv), GFP_KERNEL); abs_dev = input_allocate_device(); @@ -493,8 +479,5 @@ init_fail: kfree(priv); psmouse->private = NULL; -release_region: - release_region(VMMOUSE_PROTO_PORT, 4); - return error; } -- 1.9.1 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization