All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform
@ 2015-11-03  6:58 Xulei (Stone, Euler)
  2015-11-04  0:48 ` Gonglei
  0 siblings, 1 reply; 43+ messages in thread
From: Xulei (Stone, Euler) @ 2015-11-03  6:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: wangxin (U), Gonglei (Arei), Huangweidong (C)

[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]

On qemu-kvm platform, when I reset a VM through "virsh reset", and coincidently
the VM is in process of internal rebooting at the same time. Then the VM will
not be successfully reseted any more due to the reset reentrancy. I found:
(1)SeaBios try to shutdown the VM after reseting it failed by apm_shutdown().
However, apm_shutdown() does not work on qemu-kvm platform;
(2)I add 1s sleep in qemu_prep_reset(), then continuously reset the VM twice,
aforementioned case must happen.
This patch fixes this issue by letting the VM always execute the reboot
routing while a reenrancy happenes instead of attempting apm_shutdown on
qemu-kvm platform.

Signed-off-by: Lei Xu <stone.xulei@huawei.com>
---
 roms/seabios/src/resume.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/roms/seabios/src/resume.c b/roms/seabios/src/resume.c
index 1903174..96ff79e 100644
--- a/roms/seabios/src/resume.c
+++ b/roms/seabios/src/resume.c
@@ -16,6 +16,7 @@
 #include "std/bda.h" // struct bios_data_area_s
 #include "string.h" // memset
 #include "util.h" // dma_setup
+#include "fw/paravirt.h" //runningOnKVM

 // Handler for post calls that look like a resume.
 void VISIBLE16
@@ -122,7 +123,11 @@ tryReboot(void)
         dprintf(1, "Unable to hard-reboot machine - attempting shutdown.\n");
         apm_shutdown();
     }
-    HaveAttemptedReboot = 1;
+    if (!runningOnKVM()) {
+        // Hard reboot has failed - try to shutdown machine.
+        HaveAttemptedReboot = 1;
+    }
+

     dprintf(1, "Attempting a hard reboot\n");

--
1.7.12.4


[-- Attachment #2: Type: text/html, Size: 2887 bytes --]

^ permalink raw reply related	[flat|nested] 43+ messages in thread
* [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform
@ 2015-11-04  0:19 Xulei (Stone, Euler)
  0 siblings, 0 replies; 43+ messages in thread
From: Xulei (Stone, Euler) @ 2015-11-04  0:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: Xulei (Stone, Euler), wangxin (U), Gonglei (Arei), Huangweidong (C)

[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]

On qemu-kvm platform, when I reset a VM through "virsh reset", and coincidently
the VM is in process of internal rebooting at the same time. Then the VM will
not be successfully reseted any more due to the reset reentrancy. I found:
(1)SeaBios try to shutdown the VM after reseting it failed by apm_shutdown().
However, apm_shutdown() does not work on qemu-kvm platform;
(2)I add 1s sleep in qemu_prep_reset(), then continuously reset the VM twice,
aforementioned case must happen.
This patch fixes this issue by letting the VM always execute the reboot
routing while a reenrancy happenes instead of attempting apm_shutdown on
qemu-kvm platform.

Signed-off-by: Lei Xu <stone.xulei@huawei.com>
---
 roms/seabios/src/resume.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/roms/seabios/src/resume.c b/roms/seabios/src/resume.c
index 1903174..96ff79e 100644
--- a/roms/seabios/src/resume.c
+++ b/roms/seabios/src/resume.c
@@ -16,6 +16,7 @@
 #include "std/bda.h" // struct bios_data_area_s
 #include "string.h" // memset
 #include "util.h" // dma_setup
+#include "fw/paravirt.h" //runningOnKVM

 // Handler for post calls that look like a resume.
 void VISIBLE16
@@ -122,7 +123,11 @@ tryReboot(void)
         dprintf(1, "Unable to hard-reboot machine - attempting shutdown.\n");
         apm_shutdown();
     }
-    HaveAttemptedReboot = 1;
+    if (!runningOnKVM()) {
+        // Hard reboot has failed - try to shutdown machine.
+        HaveAttemptedReboot = 1;
+    }
+

     dprintf(1, "Attempting a hard reboot\n");

--
1.7.12.4


[-- Attachment #2: Type: text/html, Size: 2887 bytes --]

^ permalink raw reply related	[flat|nested] 43+ messages in thread
* [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform
@ 2015-11-03  6:29 Xulei (Stone, Euler)
  0 siblings, 0 replies; 43+ messages in thread
From: Xulei (Stone, Euler) @ 2015-11-03  6:29 UTC (permalink / raw)
  To: Xulei (Stone, Euler), qemu-devel

On qemu-kvm platform, when I reset a VM through "virsh reset", and coincidently
the VM is in process of internal rebooting at the same time. Then the VM will 
not be successfully reseted any more due to the reset reentrancy. I found: 
(1)SeaBios try to shutdown the VM after reseting it failed by apm_shutdown(). 
However, apm_shutdown() does not work on qemu-kvm platform;
(2)I add 1s sleep in qemu_prep_reset(), then continuously reset the VM twice,
aforementioned case must happen.
This patch fixes this issue by letting the VM always execute the reboot
routing while a reenrancy happenes instead of attempting apm_shutdown on
qemu-kvm platform.

Signed-off-by: Lei Xu <stone.xulei@huawei.com>
---
 roms/seabios/src/resume.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/roms/seabios/src/resume.c b/roms/seabios/src/resume.c
index 1903174..96ff79e 100644
--- a/roms/seabios/src/resume.c
+++ b/roms/seabios/src/resume.c
@@ -16,6 +16,7 @@
 #include "std/bda.h" // struct bios_data_area_s
 #include "string.h" // memset
 #include "util.h" // dma_setup
+#include "fw/paravirt.h" //runningOnKVM
 
 // Handler for post calls that look like a resume.
 void VISIBLE16
@@ -122,7 +123,11 @@ tryReboot(void)
         dprintf(1, "Unable to hard-reboot machine - attempting shutdown.\n");
         apm_shutdown();
     }
-    HaveAttemptedReboot = 1;
+    if (!runningOnKVM()) {
+        // Hard reboot has failed - try to shutdown machine.
+        HaveAttemptedReboot = 1;
+    }
+
 
     dprintf(1, "Attempting a hard reboot\n");
 
--
1.7.12.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2015-12-23 18:06 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03  6:58 [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform Xulei (Stone, Euler)
2015-11-04  0:48 ` Gonglei
2015-11-04 17:42   ` Kevin O'Connor
2015-11-06  9:12     ` Xulei (Stone)
2015-11-09 13:32       ` Kevin O'Connor
2015-11-09 20:06         ` Kevin O'Connor
2015-11-09 20:27           ` Kevin O'Connor
2015-11-19  1:04             ` Xulei (Stone)
2015-11-19 12:42               ` Xulei (Stone)
2015-11-19 13:40                 ` Kevin O'Connor
2015-11-20  2:05                   ` Xulei (Stone)
     [not found]                   ` <33183CC9F5247A488A2544077AF19020B02B72BA@SZXEMA503-MBS.china.huawei.com>
2015-12-18 23:13                     ` Kevin O'Connor
2015-12-18 23:13                       ` Kevin O'Connor
2015-12-19  6:28                       ` Gonglei (Arei)
2015-12-19  6:28                         ` [Qemu-devel] " Gonglei (Arei)
2015-12-19 12:03                       ` Gonglei (Arei)
2015-12-19 12:03                         ` [Qemu-devel] " Gonglei (Arei)
2015-12-19 15:11                         ` Kevin O'Connor
2015-12-19 15:11                           ` Kevin O'Connor
2015-12-20  9:49                           ` Gonglei (Arei)
2015-12-20  9:49                             ` [Qemu-devel] " Gonglei (Arei)
2015-12-20 14:33                             ` Kevin O'Connor
2015-12-20 14:33                               ` Kevin O'Connor
2015-12-21  9:41                               ` Gonglei (Arei)
2015-12-21  9:41                                 ` [Qemu-devel] " Gonglei (Arei)
2015-12-21 18:47                                 ` Kevin O'Connor
2015-12-21 18:47                                   ` [Qemu-devel] " Kevin O'Connor
2015-12-22  2:14                                   ` Gonglei (Arei)
2015-12-22  2:14                                     ` Gonglei (Arei)
2015-12-22  3:15                                     ` Xulei (Stone)
2015-12-22  3:15                                       ` [Qemu-devel] " Xulei (Stone)
2015-12-22 15:38                                       ` Kevin O'Connor
2015-12-22 15:38                                         ` [Qemu-devel] " Kevin O'Connor
2015-12-22 15:51                                     ` Kevin O'Connor
2015-12-22 15:51                                       ` Kevin O'Connor
2015-12-23  6:40                                       ` Gonglei (Arei)
2015-12-23  6:40                                         ` [Qemu-devel] " Gonglei (Arei)
2015-12-23 18:06                                         ` Kevin O'Connor
2015-12-23 18:06                                           ` Kevin O'Connor
2015-12-19  1:08                   ` Gonglei (Arei)
2015-12-19  1:08                     ` [Qemu-devel] " Gonglei (Arei)
  -- strict thread matches above, loose matches on Subject: below --
2015-11-04  0:19 Xulei (Stone, Euler)
2015-11-03  6:29 Xulei (Stone, Euler)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.