Input: xen-kbdfront - signal the backend that we disconnect
Subsystems (2)
PATCH 1/1 Input: xen-kbdfront - signal the backend that we disconnect
From: Oleksandr Andrushchenko <[email protected]>
While disconnecting from the backend we clean up shared resources (event channel, ring buffer), but never let the backend know about that. This may lead to inconsistent backend state and/or shared resources use.
Fix this by explicitly letting the backend know that frontend has destroyed shared resources by changing its Xen bus state accordingly.
--- drivers/input/misc/xen-kbdfront.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/input/misc/xen-kbdfront.c +2 -0
@@ -488,6 +488,8 @@ static int xenkbd_connect_backend(struct xenbus_device *dev,static void xenkbd_disconnect_backend (struct xenkbd_info *info) { +xenbus_switch_state (info->xbdev, XenbusStateClosing); +if (info->irq >=0 )unbind_from_irqhandler (info->irq, info); info->irq =-1 ;
Signature · 1 line
2.21.0
Quoted 20 lines · Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <[email protected]>
While disconnecting from the backend we clean up shared resources (event channel, ring buffer), but never let the backend know about that. This may lead to inconsistent backend state and/or shared resources use.
Fix this by explicitly letting the backend know that frontend has destroyed shared resources by changing its Xen bus state accordingly.Signed-off-by Oleksandr Andrushchenko <[email protected]>--- drivers/input/misc/xen-kbdfront.c | 2 ++ 1 file changed, 2 insertions(+)drivers/input/misc/xen-kbdfront.c +0
-0
drivers/input/misc/xen-kbdfront.c static int xenkbd_connect_backend(struct xenbus_device *dev, · line 495
Quoted 8 lines
drivers/input/misc/xen-kbdfront.c +2
-0@@ -488,6 +488,8 @@ static int xenkbd_connect_backend(struct xenbus_device *dev,static void xenkbd_disconnect_backend (struct xenkbd_info *info) { +xenbus_switch_state (info->xbdev, XenbusStateClosing); +if (info->irq >=0 )unbind_from_irqhandler (info->irq, info); info->irq =-1 ;
As already stated for the related netfront patch: I'm not sure this is really what we want. Have you tested xl save/restore or migration of the guest with your patch applied?
Juergen
Quoted 20 lines · Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <[email protected]>
While disconnecting from the backend we clean up shared resources (event channel, ring buffer), but never let the backend know about that. This may lead to inconsistent backend state and/or shared resources use.
Fix this by explicitly letting the backend know that frontend has destroyed shared resources by changing its Xen bus state accordingly.Signed-off-by Oleksandr Andrushchenko <[email protected]>--- drivers/input/misc/xen-kbdfront.c | 2 ++ 1 file changed, 2 insertions(+)drivers/input/misc/xen-kbdfront.c +0
-0
drivers/input/misc/xen-kbdfront.c static int xenkbd_connect_backend(struct xenbus_device *dev, · line 495
Quoted 8 lines
drivers/input/misc/xen-kbdfront.c +2
-0@@ -488,6 +488,8 @@ static int xenkbd_connect_backend(struct xenbus_device *dev,static void xenkbd_disconnect_backend (struct xenkbd_info *info) { +xenbus_switch_state (info->xbdev, XenbusStateClosing); +if (info->irq >=0 )unbind_from_irqhandler (info->irq, info); info->irq =-1 ;
As already stated for the related netfront patch: I'm not sure this is really what we want. Have you tested xl save/restore or migration of the guest with your patch applied?
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 21 lines · Juergen Gross
Quoted 20 lines · Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <[email protected]>
While disconnecting from the backend we clean up shared resources (event channel, ring buffer), but never let the backend know about that. This may lead to inconsistent backend state and/or shared resources use.
Fix this by explicitly letting the backend know that frontend has destroyed shared resources by changing its Xen bus state accordingly.Signed-off-by Oleksandr Andrushchenko <[email protected]>--- drivers/input/misc/xen-kbdfront.c | 2 ++ 1 file changed, 2 insertions(+)drivers/input/misc/xen-kbdfront.c +0
-0@@ -488,6 +488,8 @@ static int xenkbd_connect_backend(struct xenbus_device *dev,
Quoted 11 lines
drivers/input/misc/xen-kbdfront.c static int xenkbd_connect_backend(struct xenbus_device *dev, · line 495
Quoted 8 lines
drivers/input/misc/xen-kbdfront.c +2
-0static void xenkbd_disconnect_backend (struct xenkbd_info *info) { +xenbus_switch_state (info->xbdev, XenbusStateClosing); +if (info->irq >=0 )unbind_from_irqhandler (info->irq, info); info->irq =-1 ;As already stated for the related netfront patch: I'm not sure this is really what we want. Have you tested xl save/restore or migration of the guest with your patch applied?
Well, it comes out that this is not enough and needs much more work, so please let's abandon this patch
Quoted 2 lines
Juergen
Thank you,
Oleksandr
Quoted 21 lines · Juergen Gross
Quoted 20 lines · Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <[email protected]>
While disconnecting from the backend we clean up shared resources (event channel, ring buffer), but never let the backend know about that. This may lead to inconsistent backend state and/or shared resources use.
Fix this by explicitly letting the backend know that frontend has destroyed shared resources by changing its Xen bus state accordingly.Signed-off-by Oleksandr Andrushchenko <[email protected]>--- drivers/input/misc/xen-kbdfront.c | 2 ++ 1 file changed, 2 insertions(+)drivers/input/misc/xen-kbdfront.c +0
-0@@ -488,6 +488,8 @@ static int xenkbd_connect_backend(struct xenbus_device *dev,
Quoted 11 lines
drivers/input/misc/xen-kbdfront.c static int xenkbd_connect_backend(struct xenbus_device *dev, · line 495
Quoted 8 lines
drivers/input/misc/xen-kbdfront.c +2
-0static void xenkbd_disconnect_backend (struct xenkbd_info *info) { +xenbus_switch_state (info->xbdev, XenbusStateClosing); +if (info->irq >=0 )unbind_from_irqhandler (info->irq, info); info->irq =-1 ;As already stated for the related netfront patch: I'm not sure this is really what we want. Have you tested xl save/restore or migration of the guest with your patch applied?
Well, it comes out that this is not enough and needs much more work, so please let's abandon this patch
Quoted 2 lines
Juergen
Thank you,
Oleksandr
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel