qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] pci, pc, pvpanic bug fixes
@ 2013-11-04 13:51 Michael S. Tsirkin
  2013-11-04 13:51 ` [Qemu-devel] [PULL 1/3] pc: disable acpi info for isapc and old pc machine Michael S. Tsirkin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2013-11-04 13:51 UTC (permalink / raw)
  To: qemu-devel

Please pull the following for 1.7.

The following changes since commit a126050a103c924b03388a9a64ce9af8c96b0969:

  Merge remote-tracking branch 'kwolf/tags/for-anthony' into staging (2013-10-31 17:02:26 +0100)

are available in the git repository at:


  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_anthony

for you to fetch changes up to df39076850958b842ac9e414dc3ab2895f1877bf:

  vl: allow "cont" from panicked state (2013-11-04 15:39:41 +0200)

----------------------------------------------------------------
pci, pc, pvpanic bug fixes

This fixes strange pvpanic behaviour: you had to
pause to let VM continue (and potentially reboot on panic
if enabled).

This also fixes two bugs reported by Andreas.
One is a long-standing bug exposed by recent pci changes,
the other affects old piix machine types and was caused
by recent acpi changes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Michael S. Tsirkin (2):
  pc: disable acpi info for isapc and old pc machine
  exec: limit system memory size

Paolo Bonzini (1):
  vl: allow "cont" from panicked state

 exec.c            | 7 ++++++-
 gdbstub.c         | 3 ---
 hw/i386/pc_piix.c | 2 ++
 vl.c              | 6 ++----
 4 files changed, 10 insertions(+), 8 deletions(-)

-- 
MST

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

* [Qemu-devel] [PULL 1/3] pc: disable acpi info for isapc and old pc machine
  2013-11-04 13:51 [Qemu-devel] [PULL 0/3] pci, pc, pvpanic bug fixes Michael S. Tsirkin
@ 2013-11-04 13:51 ` Michael S. Tsirkin
  2013-11-04 13:51 ` [Qemu-devel] [PULL 2/3] exec: limit system memory size Michael S. Tsirkin
  2013-11-04 13:51 ` [Qemu-devel] [PULL 3/3] vl: allow "cont" from panicked state Michael S. Tsirkin
  2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2013-11-04 13:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, =?UTF-8?q?Andreas=20F=C3=A4rber?=, Anthony Liguori

Disable acpi build for isapc and no_kvmclock machine
types (used by xen), since acpi build currently expects pci.

Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/pc_piix.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 24a98cb..4fdb7b6 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -309,6 +309,7 @@ static void pc_init_pci_1_2(QEMUMachineInitArgs *args)
 static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
+    has_acpi_build = false;
     disable_kvm_pv_eoi();
     enable_compat_apic_id_mode();
     pc_init1(args, 1, 0);
@@ -317,6 +318,7 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
 static void pc_init_isa(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
+    has_acpi_build = false;
     if (!args->cpu_model) {
         args->cpu_model = "486";
     }
-- 
MST

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

* [Qemu-devel] [PULL 2/3] exec: limit system memory size
  2013-11-04 13:51 [Qemu-devel] [PULL 0/3] pci, pc, pvpanic bug fixes Michael S. Tsirkin
  2013-11-04 13:51 ` [Qemu-devel] [PULL 1/3] pc: disable acpi info for isapc and old pc machine Michael S. Tsirkin
@ 2013-11-04 13:51 ` Michael S. Tsirkin
  2013-11-04 13:51 ` [Qemu-devel] [PULL 3/3] vl: allow "cont" from panicked state Michael S. Tsirkin
  2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2013-11-04 13:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-stable, =?UTF-8?q?Andreas=20F=C3=A4rber?=

The page table logic in exec.c assumes
that memory addresses are at most TARGET_PHYS_ADDR_SPACE_BITS.

But pci addresses are full 64 bit so if we try to render them ignoring
the extra bits, we get strange effects with sections overlapping each
other.

To fix, simply limit the system memory size to
 1 << TARGET_PHYS_ADDR_SPACE_BITS,
pci addresses will be rendered within that.

Cc: qemu-stable@nongnu.org
Reported-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 exec.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index b453713..79610ce 100644
--- a/exec.c
+++ b/exec.c
@@ -1741,7 +1741,12 @@ void address_space_destroy_dispatch(AddressSpace *as)
 static void memory_map_init(void)
 {
     system_memory = g_malloc(sizeof(*system_memory));
-    memory_region_init(system_memory, NULL, "system", INT64_MAX);
+
+    assert(TARGET_PHYS_ADDR_SPACE_BITS <= 64);
+
+    memory_region_init(system_memory, NULL, "system",
+                       TARGET_PHYS_ADDR_SPACE_BITS == 64 ?
+                       UINT64_MAX : (0x1ULL << TARGET_PHYS_ADDR_SPACE_BITS));
     address_space_init(&address_space_memory, system_memory, "memory");
 
     system_io = g_malloc(sizeof(*system_io));
-- 
MST

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

* [Qemu-devel] [PULL 3/3] vl: allow "cont" from panicked state
  2013-11-04 13:51 [Qemu-devel] [PULL 0/3] pci, pc, pvpanic bug fixes Michael S. Tsirkin
  2013-11-04 13:51 ` [Qemu-devel] [PULL 1/3] pc: disable acpi info for isapc and old pc machine Michael S. Tsirkin
  2013-11-04 13:51 ` [Qemu-devel] [PULL 2/3] exec: limit system memory size Michael S. Tsirkin
@ 2013-11-04 13:51 ` Michael S. Tsirkin
  2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2013-11-04 13:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Laszlo Ersek, Anthony Liguori, Luiz Capitulino

From: Paolo Bonzini <pbonzini@redhat.com>

After reporting the GUEST_PANICKED monitor event, QEMU stops the VM.
The reason for this is that events are edge-triggered, and can be lost if
management dies at the wrong time.  Stopping a panicked VM lets management
know of a panic even if it has crashed; management can learn about the
panic when it restarts and queries running QEMU processes.  The downside
is of course that the VM will be paused while management is not running,
but that is acceptable if it only happens with explicit "-device pvpanic".

Upon learning of a panic, management (if configured to do so) can pick a
variety of behaviors: leave the VM paused, reset it, destroy it.  In
addition to all of these behaviors, it is possible to dump the VM core
from the host.

However, right now, the panicked state is irreversible, and can only be
exited by resetting the machine.  This means that any policy decision
is entirely in the hands of the host.  In particular there is no way to
use the "reboot on panic" option together with pvpanic.

This patch makes the panicked state reversible (and removes various
workarounds that were there because of the state being irreversible).
With this change, management has a wider set of possible policies: it
can just log the crash and leave policy to the guest, it can leave the
VM paused.  In particular, the "log the crash and continue" is implemented
simply by sending a "cont" as soon as management learns about the panic.
Management could also implement the "irreversible paused state" itself.
And again, all such actions can be coupled with dumping the VM core.

Unfortunately we cannot change the behavior of 1.6.0.  Thus, even if
it uses "-device pvpanic", management should check for "cont" failures.
If "cont" fails, management can then log that the VM remained paused
and urge the administrator to update QEMU.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 gdbstub.c | 3 ---
 vl.c      | 6 ++----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/gdbstub.c b/gdbstub.c
index 0e5a3f5..e8ab0b2 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -368,9 +368,6 @@ static inline void gdb_continue(GDBState *s)
 #ifdef CONFIG_USER_ONLY
     s->running_state = 1;
 #else
-    if (runstate_check(RUN_STATE_GUEST_PANICKED)) {
-        runstate_set(RUN_STATE_DEBUG);
-    }
     if (!runstate_needs_reset()) {
         vm_start();
     }
diff --git a/vl.c b/vl.c
index efbff65..4ad15b8 100644
--- a/vl.c
+++ b/vl.c
@@ -638,9 +638,8 @@ static const RunStateTransition runstate_transitions_def[] = {
     { RUN_STATE_WATCHDOG, RUN_STATE_RUNNING },
     { RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE },
 
-    { RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED },
+    { RUN_STATE_GUEST_PANICKED, RUN_STATE_RUNNING },
     { RUN_STATE_GUEST_PANICKED, RUN_STATE_FINISH_MIGRATE },
-    { RUN_STATE_GUEST_PANICKED, RUN_STATE_DEBUG },
 
     { RUN_STATE_MAX, RUN_STATE_MAX },
 };
@@ -686,8 +685,7 @@ int runstate_is_running(void)
 bool runstate_needs_reset(void)
 {
     return runstate_check(RUN_STATE_INTERNAL_ERROR) ||
-        runstate_check(RUN_STATE_SHUTDOWN) ||
-        runstate_check(RUN_STATE_GUEST_PANICKED);
+        runstate_check(RUN_STATE_SHUTDOWN);
 }
 
 StatusInfo *qmp_query_status(Error **errp)
-- 
MST

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

end of thread, other threads:[~2013-11-04 13:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-04 13:51 [Qemu-devel] [PULL 0/3] pci, pc, pvpanic bug fixes Michael S. Tsirkin
2013-11-04 13:51 ` [Qemu-devel] [PULL 1/3] pc: disable acpi info for isapc and old pc machine Michael S. Tsirkin
2013-11-04 13:51 ` [Qemu-devel] [PULL 2/3] exec: limit system memory size Michael S. Tsirkin
2013-11-04 13:51 ` [Qemu-devel] [PULL 3/3] vl: allow "cont" from panicked state Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).