* [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default
2013-08-11 15:10 [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type Marcel Apfelbaum
@ 2013-08-11 15:10 ` Marcel Apfelbaum
2013-08-12 3:06 ` Hu Tao
` (2 more replies)
2013-08-11 15:10 ` [Qemu-devel] [PATCH for-1.6 V2 2/2] hw/misc: make pvpanic known to user Marcel Apfelbaum
` (3 subsequent siblings)
4 siblings, 3 replies; 18+ messages in thread
From: Marcel Apfelbaum @ 2013-08-11 15:10 UTC (permalink / raw)
To: qemu-devel
Cc: aliguori, gleb, mst, hutao, Marcel Apfelbaum, kraxel, pbonzini,
afaerber, vrozenfe
This patch is based on Hu Tao's:
http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html
No need to hard-code pvpanic as part of the machine.
It can be added with "-device pvpanic" from command line (The next patch).
Anyway, for backport compatibility it is still part of 1.5
machine.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
---
Changes from v1:
- Keep pvpanic device enabled by default for 1.5
for backport compatibility
hw/i386/pc_piix.c | 9 ++++-----
hw/i386/pc_q35.c | 7 ++++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index ab25458..679d2e5 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -56,7 +56,7 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
-static bool has_pvpanic = true;
+static bool has_pvpanic;
static bool has_pci_info = true;
/* PC hardware initialisation */
@@ -252,14 +252,15 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
static void pc_init_pci_1_5(QEMUMachineInitArgs *args)
{
has_pci_info = false;
+ has_pvpanic = true;
pc_init_pci(args);
}
static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
{
- has_pvpanic = false;
x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
- pc_init_pci_1_5(args);
+ has_pci_info = false;
+ pc_init_pci(args);
}
static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
@@ -290,7 +291,6 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
const char *kernel_cmdline = args->kernel_cmdline;
const char *initrd_filename = args->initrd_filename;
const char *boot_device = args->boot_device;
- has_pvpanic = false;
has_pci_info = false;
disable_kvm_pv_eoi();
enable_compat_apic_id_mode();
@@ -309,7 +309,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
const char *kernel_cmdline = args->kernel_cmdline;
const char *initrd_filename = args->initrd_filename;
const char *boot_device = args->boot_device;
- has_pvpanic = false;
has_pci_info = false;
if (cpu_model == NULL)
cpu_model = "486";
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 2f35d12..d2bb248 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -46,7 +46,7 @@
/* ICH9 AHCI has 6 ports */
#define MAX_SATA_PORTS 6
-static bool has_pvpanic = true;
+static bool has_pvpanic;
static bool has_pci_info = true;
/* PC hardware initialisation */
@@ -220,14 +220,15 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
{
has_pci_info = false;
+ has_pvpanic = true;
pc_q35_init(args);
}
static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
{
- has_pvpanic = false;
x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
- pc_q35_init_1_5(args);
+ has_pci_info = false;
+ pc_q35_init(args);
}
static QEMUMachine pc_q35_machine_v1_6 = {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default
2013-08-11 15:10 ` [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default Marcel Apfelbaum
@ 2013-08-12 3:06 ` Hu Tao
2013-08-12 15:59 ` Andreas Färber
2013-08-13 11:26 ` Markus Armbruster
2 siblings, 0 replies; 18+ messages in thread
From: Hu Tao @ 2013-08-12 3:06 UTC (permalink / raw)
To: Marcel Apfelbaum
Cc: aliguori, gleb, mst, qemu-devel, vrozenfe, pbonzini, afaerber, kraxel
On Sun, Aug 11, 2013 at 06:10:42PM +0300, Marcel Apfelbaum wrote:
> This patch is based on Hu Tao's:
> http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html
>
> No need to hard-code pvpanic as part of the machine.
> It can be added with "-device pvpanic" from command line (The next patch).
> Anyway, for backport compatibility it is still part of 1.5
> machine.
>
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default
2013-08-11 15:10 ` [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default Marcel Apfelbaum
2013-08-12 3:06 ` Hu Tao
@ 2013-08-12 15:59 ` Andreas Färber
2013-08-13 11:26 ` Markus Armbruster
2 siblings, 0 replies; 18+ messages in thread
From: Andreas Färber @ 2013-08-12 15:59 UTC (permalink / raw)
To: Marcel Apfelbaum, aliguori
Cc: gleb, mst, hutao, qemu-devel, kraxel, pbonzini, vrozenfe
Am 11.08.2013 17:10, schrieb Marcel Apfelbaum:
> This patch is based on Hu Tao's:
> http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html
>
> No need to hard-code pvpanic as part of the machine.
> It can be added with "-device pvpanic" from command line (The next patch).
> Anyway, for backport compatibility it is still part of 1.5
> machine.
>
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
> ---
> Changes from v1:
> - Keep pvpanic device enabled by default for 1.5
> for backport compatibility
>
> hw/i386/pc_piix.c | 9 ++++-----
> hw/i386/pc_q35.c | 7 ++++---
> 2 files changed, 8 insertions(+), 8 deletions(-)
Reviewed-by: Andreas Färber <afaerber@suse.de>
Anthony, note that my pending CPU pull adds a line to the two _1_4
functions, so that they trivially conflict.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default
2013-08-11 15:10 ` [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default Marcel Apfelbaum
2013-08-12 3:06 ` Hu Tao
2013-08-12 15:59 ` Andreas Färber
@ 2013-08-13 11:26 ` Markus Armbruster
2 siblings, 0 replies; 18+ messages in thread
From: Markus Armbruster @ 2013-08-13 11:26 UTC (permalink / raw)
To: Marcel Apfelbaum
Cc: aliguori, gleb, mst, hutao, qemu-devel, kraxel, pbonzini,
afaerber, vrozenfe
*** Mismerged! ***
Marcel Apfelbaum <marcel.a@redhat.com> writes:
> This patch is based on Hu Tao's:
> http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html
>
> No need to hard-code pvpanic as part of the machine.
> It can be added with "-device pvpanic" from command line (The next patch).
> Anyway, for backport compatibility it is still part of 1.5
> machine.
>
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
> ---
> Changes from v1:
> - Keep pvpanic device enabled by default for 1.5
> for backport compatibility
>
> hw/i386/pc_piix.c | 9 ++++-----
> hw/i386/pc_q35.c | 7 ++++---
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index ab25458..679d2e5 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -56,7 +56,7 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
> static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
> static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
>
> -static bool has_pvpanic = true;
> +static bool has_pvpanic;
> static bool has_pci_info = true;
>
> /* PC hardware initialisation */
> @@ -252,14 +252,15 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
> static void pc_init_pci_1_5(QEMUMachineInitArgs *args)
> {
> has_pci_info = false;
> + has_pvpanic = true;
> pc_init_pci(args);
> }
>
This hunk got applied to pc_init_pci_1_6() instead of pc_init_pci_1_5().
> static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
> {
> - has_pvpanic = false;
> x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
> - pc_init_pci_1_5(args);
> + has_pci_info = false;
> + pc_init_pci(args);
> }
>
> static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
> @@ -290,7 +291,6 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
> const char *kernel_cmdline = args->kernel_cmdline;
> const char *initrd_filename = args->initrd_filename;
> const char *boot_device = args->boot_device;
> - has_pvpanic = false;
> has_pci_info = false;
> disable_kvm_pv_eoi();
> enable_compat_apic_id_mode();
> @@ -309,7 +309,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
> const char *kernel_cmdline = args->kernel_cmdline;
> const char *initrd_filename = args->initrd_filename;
> const char *boot_device = args->boot_device;
> - has_pvpanic = false;
> has_pci_info = false;
> if (cpu_model == NULL)
> cpu_model = "486";
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index 2f35d12..d2bb248 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -46,7 +46,7 @@
> /* ICH9 AHCI has 6 ports */
> #define MAX_SATA_PORTS 6
>
> -static bool has_pvpanic = true;
> +static bool has_pvpanic;
> static bool has_pci_info = true;
>
> /* PC hardware initialisation */
> @@ -220,14 +220,15 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
> static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
> {
> has_pci_info = false;
> + has_pvpanic = true;
> pc_q35_init(args);
> }
>
This hunk got applied to pc_q35_init_1_6() instead of pc_q35_init_1_5().
> static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
> {
> - has_pvpanic = false;
> x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
> - pc_q35_init_1_5(args);
> + has_pci_info = false;
> + pc_q35_init(args);
> }
>
> static QEMUMachine pc_q35_machine_v1_6 = {
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH for-1.6 V2 2/2] hw/misc: make pvpanic known to user
2013-08-11 15:10 [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type Marcel Apfelbaum
2013-08-11 15:10 ` [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default Marcel Apfelbaum
@ 2013-08-11 15:10 ` Marcel Apfelbaum
2013-08-12 3:07 ` Hu Tao
2013-08-12 15:53 ` [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type Eric Blake
` (2 subsequent siblings)
4 siblings, 1 reply; 18+ messages in thread
From: Marcel Apfelbaum @ 2013-08-11 15:10 UTC (permalink / raw)
To: qemu-devel
Cc: aliguori, gleb, mst, hutao, Marcel Apfelbaum, kraxel, pbonzini,
afaerber, vrozenfe
This patch is based on Hu Tao's:
http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00125.html
The pvpanic device may be enabled now with "-device pvpanic"
from command line.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
---
Changes from V1:
- Addressed Andreas Färber review (removed bus type)
- Small changes to be posible to enable pvpanic
both from command line and from machine_init
- Added pvpanic to MISC category
hw/misc/pvpanic.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index 7bb49a5..b64e3bb 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -97,29 +97,24 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp)
{
ISADevice *d = ISA_DEVICE(dev);
PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
+ FWCfgState *fw_cfg = fw_cfg_find();
+ uint16_t *pvpanic_port;
- isa_register_ioport(d, &s->io, s->ioport);
-}
+ if (!fw_cfg) {
+ return;
+ }
-static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg)
-{
- PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
- uint16_t *pvpanic_port = g_malloc(sizeof(*pvpanic_port));
+ pvpanic_port = g_malloc(sizeof(*pvpanic_port));
*pvpanic_port = cpu_to_le16(s->ioport);
-
fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port,
sizeof(*pvpanic_port));
+
+ isa_register_ioport(d, &s->io, s->ioport);
}
void pvpanic_init(ISABus *bus)
{
- ISADevice *dev;
- FWCfgState *fw_cfg = fw_cfg_find();
- if (!fw_cfg) {
- return;
- }
- dev = isa_create_simple (bus, TYPE_ISA_PVPANIC_DEVICE);
- pvpanic_fw_cfg(dev, fw_cfg);
+ isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE);
}
static Property pvpanic_isa_properties[] = {
@@ -132,8 +127,8 @@ static void pvpanic_isa_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = pvpanic_isa_realizefn;
- dc->no_user = 1;
dc->props = pvpanic_isa_properties;
+ set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}
static TypeInfo pvpanic_isa_info = {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 2/2] hw/misc: make pvpanic known to user
2013-08-11 15:10 ` [Qemu-devel] [PATCH for-1.6 V2 2/2] hw/misc: make pvpanic known to user Marcel Apfelbaum
@ 2013-08-12 3:07 ` Hu Tao
0 siblings, 0 replies; 18+ messages in thread
From: Hu Tao @ 2013-08-12 3:07 UTC (permalink / raw)
To: Marcel Apfelbaum
Cc: aliguori, gleb, mst, qemu-devel, vrozenfe, pbonzini, afaerber, kraxel
On Sun, Aug 11, 2013 at 06:10:43PM +0300, Marcel Apfelbaum wrote:
> This patch is based on Hu Tao's:
> http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00125.html
>
> The pvpanic device may be enabled now with "-device pvpanic"
> from command line.
>
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-11 15:10 [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type Marcel Apfelbaum
2013-08-11 15:10 ` [Qemu-devel] [PATCH for-1.6 V2 1/2] hw/misc: don't create pvpanic device by default Marcel Apfelbaum
2013-08-11 15:10 ` [Qemu-devel] [PATCH for-1.6 V2 2/2] hw/misc: make pvpanic known to user Marcel Apfelbaum
@ 2013-08-12 15:53 ` Eric Blake
2013-08-12 16:26 ` Marcel Apfelbaum
2013-08-14 7:02 ` Ronen Hod
2013-08-14 16:27 ` Anthony Liguori
4 siblings, 1 reply; 18+ messages in thread
From: Eric Blake @ 2013-08-12 15:53 UTC (permalink / raw)
To: Marcel Apfelbaum
Cc: aliguori, gleb, mst, hutao, qemu-devel, vrozenfe, pbonzini,
afaerber, kraxel
[-- Attachment #1: Type: text/plain, Size: 1796 bytes --]
On 08/11/2013 09:10 AM, Marcel Apfelbaum wrote:
> Creating the pvpanic device as part of the machine type has the
> potential to trigger guest OS, guest firmware and driver bugs.
> The potential of such was originally viewed as minimal.
> However, since releasing 1.5 with pvpanic as part
> of the builtin machine type, several issues were observed
> in the field:
> - Some Windows versions triggered 'New Hardware Wizard' and
> an unidentified device appeared in Device Manager.
> - Issue reported off list: on Linux >= 3.10
> the pvpanic driver breaks the reset on crash option:
> VM stops instead of being reset.
>
> pvpanic device also changes monitor command behaviour in some cases,
> such silent incompatible changes aren't expected by management tools:
> - Monitor command requires 'cont' before 'system_reset'
> in order to restart the VM after kernel panic/BSOD
>
> Note that libvirt is the main user and libvirt people indicated their
> preference to creating device with -device pvpanic rather than a
> built-in one that can't be removed.
>
> These issues were raised at last KVM call. The agreement reached
> there was that we were a bit too rash to make the device
> a builtin, and that for 1.6 we should drop the pvpanic device from the
> default machine type, instead teach management tools to add it by
> default using -device pvpanic.
> It's not clear whether changing 1.5 behaviour at this point
> is a sane thing, so this patchset doesn't touch 1.5 machine type.
Thanks for doing this; it makes sense to get this in for 1.6. From the
libvirt point of view:
Series: Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-12 15:53 ` [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type Eric Blake
@ 2013-08-12 16:26 ` Marcel Apfelbaum
0 siblings, 0 replies; 18+ messages in thread
From: Marcel Apfelbaum @ 2013-08-12 16:26 UTC (permalink / raw)
To: Eric Blake
Cc: aliguori, gleb, mst, hutao, qemu-devel, vrozenfe, pbonzini,
afaerber, kraxel
On Mon, 2013-08-12 at 09:53 -0600, Eric Blake wrote:
> On 08/11/2013 09:10 AM, Marcel Apfelbaum wrote:
> > Creating the pvpanic device as part of the machine type has the
> > potential to trigger guest OS, guest firmware and driver bugs.
> > The potential of such was originally viewed as minimal.
> > However, since releasing 1.5 with pvpanic as part
> > of the builtin machine type, several issues were observed
> > in the field:
> > - Some Windows versions triggered 'New Hardware Wizard' and
> > an unidentified device appeared in Device Manager.
> > - Issue reported off list: on Linux >= 3.10
> > the pvpanic driver breaks the reset on crash option:
> > VM stops instead of being reset.
> >
> > pvpanic device also changes monitor command behaviour in some cases,
> > such silent incompatible changes aren't expected by management tools:
> > - Monitor command requires 'cont' before 'system_reset'
> > in order to restart the VM after kernel panic/BSOD
> >
> > Note that libvirt is the main user and libvirt people indicated their
> > preference to creating device with -device pvpanic rather than a
> > built-in one that can't be removed.
> >
> > These issues were raised at last KVM call. The agreement reached
> > there was that we were a bit too rash to make the device
> > a builtin, and that for 1.6 we should drop the pvpanic device from the
> > default machine type, instead teach management tools to add it by
> > default using -device pvpanic.
> > It's not clear whether changing 1.5 behaviour at this point
> > is a sane thing, so this patchset doesn't touch 1.5 machine type.
>
> Thanks for doing this; it makes sense to get this in for 1.6. From the
> libvirt point of view:
Eric, my pleasure!
And I really think that using "-device pvpanic" is the right thing to to do.
Marcel
>
> Series: Reviewed-by: Eric Blake <eblake@redhat.com>
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-11 15:10 [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type Marcel Apfelbaum
` (2 preceding siblings ...)
2013-08-12 15:53 ` [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type Eric Blake
@ 2013-08-14 7:02 ` Ronen Hod
2013-08-21 8:03 ` Marcel Apfelbaum
2013-08-14 16:27 ` Anthony Liguori
4 siblings, 1 reply; 18+ messages in thread
From: Ronen Hod @ 2013-08-14 7:02 UTC (permalink / raw)
To: Marcel Apfelbaum
Cc: aliguori, gleb, mst, hutao, qemu-devel, kraxel, pbonzini,
afaerber, vrozenfe
How about adding a flag that tells QEMU whether to pause or reboot the guest
after the panic?
We cannot assume that we always have a management layer that takes care
of this.
One example is Microsoft's WHQL that deliberately generates a BSOD, and then
examines the dump files.
Ronen.
On 08/11/2013 06:10 PM, Marcel Apfelbaum wrote:
> Creating the pvpanic device as part of the machine type has the
> potential to trigger guest OS, guest firmware and driver bugs.
> The potential of such was originally viewed as minimal.
> However, since releasing 1.5 with pvpanic as part
> of the builtin machine type, several issues were observed
> in the field:
> - Some Windows versions triggered 'New Hardware Wizard' and
> an unidentified device appeared in Device Manager.
> - Issue reported off list: on Linux >= 3.10
> the pvpanic driver breaks the reset on crash option:
> VM stops instead of being reset.
>
> pvpanic device also changes monitor command behaviour in some cases,
> such silent incompatible changes aren't expected by management tools:
> - Monitor command requires 'cont' before 'system_reset'
> in order to restart the VM after kernel panic/BSOD
>
> Note that libvirt is the main user and libvirt people indicated their
> preference to creating device with -device pvpanic rather than a
> built-in one that can't be removed.
>
> These issues were raised at last KVM call. The agreement reached
> there was that we were a bit too rash to make the device
> a builtin, and that for 1.6 we should drop the pvpanic device from the
> default machine type, instead teach management tools to add it by
> default using -device pvpanic.
> It's not clear whether changing 1.5 behaviour at this point
> is a sane thing, so this patchset doesn't touch 1.5 machine type.
>
> This patch series reworks the patchset from Hu Tao
> (don't create pvpanic device by default)
> addressing comments and modifying behaviour according
> to what was discussed on the call.
> Please review and consider for 1.6.
>
> A related discussion can be followed at
> http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00036.html.
>
> This is a continuation of patches sent by Hu Tao:
> http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html
> http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00125.html
>
> Changes from v1 (by Hu Tao):
> - Keep pvpanic device enabled by default for 1.5
> for backport compatibility
> - Addressed Andreas Färber review (removed bus type)
> - Small changes to be posible to enable pvpanic
> both from command line and from machine_init
> - Added pvpanic to MISC category
>
> Marcel Apfelbaum (2):
> hw/misc: don't create pvpanic device by default
> hw/misc: make pvpanic known to user
>
> hw/i386/pc_piix.c | 9 ++++-----
> hw/i386/pc_q35.c | 7 ++++---
> hw/misc/pvpanic.c | 25 ++++++++++---------------
> 3 files changed, 18 insertions(+), 23 deletions(-)
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-14 7:02 ` Ronen Hod
@ 2013-08-21 8:03 ` Marcel Apfelbaum
2013-08-21 8:18 ` Paolo Bonzini
0 siblings, 1 reply; 18+ messages in thread
From: Marcel Apfelbaum @ 2013-08-21 8:03 UTC (permalink / raw)
To: Ronen Hod
Cc: aliguori, gleb, mst, hutao, qemu-devel, kraxel, pbonzini,
afaerber, vrozenfe
On Wed, 2013-08-14 at 10:02 +0300, Ronen Hod wrote:
> How about adding a flag that tells QEMU whether to pause or reboot the guest
> after the panic?
> We cannot assume that we always have a management layer that takes care
> of this.
> One example is Microsoft's WHQL that deliberately generates a BSOD, and then
> examines the dump files.
After this patch the pvpanic is not part of the global devices anymore so just
don't enable it if you want to reboot on BSOD.
In my opinion "reboot after panic" equals "run without pvpanic device"
Marcel
>
> Ronen.
>
> On 08/11/2013 06:10 PM, Marcel Apfelbaum wrote:
> > Creating the pvpanic device as part of the machine type has the
> > potential to trigger guest OS, guest firmware and driver bugs.
> > The potential of such was originally viewed as minimal.
> > However, since releasing 1.5 with pvpanic as part
> > of the builtin machine type, several issues were observed
> > in the field:
> > - Some Windows versions triggered 'New Hardware Wizard' and
> > an unidentified device appeared in Device Manager.
> > - Issue reported off list: on Linux >= 3.10
> > the pvpanic driver breaks the reset on crash option:
> > VM stops instead of being reset.
> >
> > pvpanic device also changes monitor command behaviour in some cases,
> > such silent incompatible changes aren't expected by management tools:
> > - Monitor command requires 'cont' before 'system_reset'
> > in order to restart the VM after kernel panic/BSOD
> >
> > Note that libvirt is the main user and libvirt people indicated their
> > preference to creating device with -device pvpanic rather than a
> > built-in one that can't be removed.
> >
> > These issues were raised at last KVM call. The agreement reached
> > there was that we were a bit too rash to make the device
> > a builtin, and that for 1.6 we should drop the pvpanic device from the
> > default machine type, instead teach management tools to add it by
> > default using -device pvpanic.
> > It's not clear whether changing 1.5 behaviour at this point
> > is a sane thing, so this patchset doesn't touch 1.5 machine type.
> >
> > This patch series reworks the patchset from Hu Tao
> > (don't create pvpanic device by default)
> > addressing comments and modifying behaviour according
> > to what was discussed on the call.
> > Please review and consider for 1.6.
> >
> > A related discussion can be followed at
> > http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00036.html.
> >
> > This is a continuation of patches sent by Hu Tao:
> > http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html
> > http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00125.html
> >
> > Changes from v1 (by Hu Tao):
> > - Keep pvpanic device enabled by default for 1.5
> > for backport compatibility
> > - Addressed Andreas Färber review (removed bus type)
> > - Small changes to be posible to enable pvpanic
> > both from command line and from machine_init
> > - Added pvpanic to MISC category
> >
> > Marcel Apfelbaum (2):
> > hw/misc: don't create pvpanic device by default
> > hw/misc: make pvpanic known to user
> >
> > hw/i386/pc_piix.c | 9 ++++-----
> > hw/i386/pc_q35.c | 7 ++++---
> > hw/misc/pvpanic.c | 25 ++++++++++---------------
> > 3 files changed, 18 insertions(+), 23 deletions(-)
> >
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-21 8:03 ` Marcel Apfelbaum
@ 2013-08-21 8:18 ` Paolo Bonzini
2013-08-21 9:42 ` Michael S. Tsirkin
0 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2013-08-21 8:18 UTC (permalink / raw)
To: Marcel Apfelbaum
Cc: aliguori, gleb, mst, hutao, qemu-devel, Ronen Hod, kraxel,
afaerber, vrozenfe
Il 21/08/2013 10:03, Marcel Apfelbaum ha scritto:
> On Wed, 2013-08-14 at 10:02 +0300, Ronen Hod wrote:
>> How about adding a flag that tells QEMU whether to pause or reboot the guest
>> after the panic?
>> We cannot assume that we always have a management layer that takes care
>> of this.
>> One example is Microsoft's WHQL that deliberately generates a BSOD, and then
>> examines the dump files.
> After this patch the pvpanic is not part of the global devices anymore so just
> don't enable it if you want to reboot on BSOD.
> In my opinion "reboot after panic" equals "run without pvpanic device"
This is not entirely possible, since "reboot after panic" is a guest
setting while "run without pvpanic device" is a host setting (that the
guest administrator may not even have access to: Ronen's case is a good
example of this, because the "administrator" there is the WHQL harness).
However, I think this is a driver problem. The driver should just probe
the "reboot after panic" setting and not issue the outb to the pvpanic port.
Paolo
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-21 8:18 ` Paolo Bonzini
@ 2013-08-21 9:42 ` Michael S. Tsirkin
2013-08-21 9:56 ` Hu Tao
2013-08-21 9:59 ` Paolo Bonzini
0 siblings, 2 replies; 18+ messages in thread
From: Michael S. Tsirkin @ 2013-08-21 9:42 UTC (permalink / raw)
To: Paolo Bonzini
Cc: aliguori, gleb, Marcel Apfelbaum, hutao, qemu-devel, Ronen Hod,
kraxel, afaerber, vrozenfe
On Wed, Aug 21, 2013 at 10:18:23AM +0200, Paolo Bonzini wrote:
> Il 21/08/2013 10:03, Marcel Apfelbaum ha scritto:
> > On Wed, 2013-08-14 at 10:02 +0300, Ronen Hod wrote:
> >> How about adding a flag that tells QEMU whether to pause or reboot the guest
> >> after the panic?
> >> We cannot assume that we always have a management layer that takes care
> >> of this.
> >> One example is Microsoft's WHQL that deliberately generates a BSOD, and then
> >> examines the dump files.
> > After this patch the pvpanic is not part of the global devices anymore so just
> > don't enable it if you want to reboot on BSOD.
> > In my opinion "reboot after panic" equals "run without pvpanic device"
>
> This is not entirely possible, since "reboot after panic" is a guest
> setting while "run without pvpanic device" is a host setting (that the
> guest administrator may not even have access to: Ronen's case is a good
> example of this, because the "administrator" there is the WHQL harness).
>
> However, I think this is a driver problem. The driver should just probe
> the "reboot after panic" setting and not issue the outb to the pvpanic port.
>
> Paolo
This might or might not be possible on different OS-es.
What exactly is gained by doing vmstop on outb of pvpanic?
We want a notification about the panic but
adding yet another way to halt seems kind of useless.
Why not let VM continue? If it wants to stop it
can always call halt.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-21 9:42 ` Michael S. Tsirkin
@ 2013-08-21 9:56 ` Hu Tao
2013-08-21 9:59 ` Paolo Bonzini
1 sibling, 0 replies; 18+ messages in thread
From: Hu Tao @ 2013-08-21 9:56 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: aliguori, gleb, Marcel Apfelbaum, qemu-devel, Ronen Hod, kraxel,
Paolo Bonzini, afaerber, vrozenfe
On Wed, Aug 21, 2013 at 12:42:37PM +0300, Michael S. Tsirkin wrote:
> On Wed, Aug 21, 2013 at 10:18:23AM +0200, Paolo Bonzini wrote:
> > Il 21/08/2013 10:03, Marcel Apfelbaum ha scritto:
> > > On Wed, 2013-08-14 at 10:02 +0300, Ronen Hod wrote:
> > >> How about adding a flag that tells QEMU whether to pause or reboot the guest
> > >> after the panic?
> > >> We cannot assume that we always have a management layer that takes care
> > >> of this.
> > >> One example is Microsoft's WHQL that deliberately generates a BSOD, and then
> > >> examines the dump files.
> > > After this patch the pvpanic is not part of the global devices anymore so just
> > > don't enable it if you want to reboot on BSOD.
> > > In my opinion "reboot after panic" equals "run without pvpanic device"
> >
> > This is not entirely possible, since "reboot after panic" is a guest
> > setting while "run without pvpanic device" is a host setting (that the
> > guest administrator may not even have access to: Ronen's case is a good
> > example of this, because the "administrator" there is the WHQL harness).
> >
> > However, I think this is a driver problem. The driver should just probe
> > the "reboot after panic" setting and not issue the outb to the pvpanic port.
> >
> > Paolo
>
> This might or might not be possible on different OS-es.
> What exactly is gained by doing vmstop on outb of pvpanic?
This gives management apps (libvirt) a chance to take care of the situation.
It can reboot, poweroff, or dump guest.
> We want a notification about the panic but
> adding yet another way to halt seems kind of useless.
> Why not let VM continue? If it wants to stop it
> can always call halt.
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-21 9:42 ` Michael S. Tsirkin
2013-08-21 9:56 ` Hu Tao
@ 2013-08-21 9:59 ` Paolo Bonzini
2013-08-21 10:16 ` Michael S. Tsirkin
1 sibling, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2013-08-21 9:59 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: aliguori, gleb, Marcel Apfelbaum, hutao, qemu-devel, Ronen Hod,
kraxel, afaerber, vrozenfe
Il 21/08/2013 11:42, Michael S. Tsirkin ha scritto:
> On Wed, Aug 21, 2013 at 10:18:23AM +0200, Paolo Bonzini wrote:
>> Il 21/08/2013 10:03, Marcel Apfelbaum ha scritto:
>>> On Wed, 2013-08-14 at 10:02 +0300, Ronen Hod wrote:
>>>> How about adding a flag that tells QEMU whether to pause or reboot the guest
>>>> after the panic?
>>>> We cannot assume that we always have a management layer that takes care
>>>> of this.
>>>> One example is Microsoft's WHQL that deliberately generates a BSOD, and then
>>>> examines the dump files.
>>> After this patch the pvpanic is not part of the global devices anymore so just
>>> don't enable it if you want to reboot on BSOD.
>>> In my opinion "reboot after panic" equals "run without pvpanic device"
>>
>> This is not entirely possible, since "reboot after panic" is a guest
>> setting while "run without pvpanic device" is a host setting (that the
>> guest administrator may not even have access to: Ronen's case is a good
>> example of this, because the "administrator" there is the WHQL harness).
>>
>> However, I think this is a driver problem. The driver should just probe
>> the "reboot after panic" setting and not issue the outb to the pvpanic port.
>
> This might or might not be possible on different OS-es.
> What exactly is gained by doing vmstop on outb of pvpanic?
Because events are edge-triggered, and can be lost if management dies at
the wrong time, each event that QEMU sends must go together with a way
for management to poll the state.
For panic, the way to poll the state is "info status". This matches
what we do for watchdogs, for example. Management can issue "info
status" to learn of the panic state, even if it happens while management
itself is not running:
libvirtd QEMU guest
---------------------------------------------------------------
stops
<- pvpanic outb
emits panic event
(no one receives it)
starts
info status ->
<- PANICKED
Because there is only one running state, this means the VM has to be
stopped.
But actually, fixing the driver would only be required if pvpanic were
mandatory.
Now that pvpanic is optional, "reboot after panic" can also be fixed in
libvirt. Let's remove the "must reset after panic" limitation; then,
libvirt can simply do itself a "continue" after receiving the panicked
event (or after seeing that the guest is in panicked state). The
panicked event will never be sent unless management explicitly requests
it (with "-device pvpanic"), so backwards compatibility is preserved.
The pause will still happen if management was stopped, but that's a fair
compromise IMHO.
It will mean also that "reboot after panic" will be broken in 1.6.0,
unfortunately. Perhaps we can have a quick 1.6.1 release with this patch:
diff --git a/vl.c b/vl.c
index 25b8f2f..25e890a 100644
--- a/vl.c
+++ b/vl.c
@@ -685,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)
By the way, this means two things:
- I am now sold on the idea that explicitly enabling of pvpanic is the
right thing to do;
- on the other hand this is the proof that the change was not fully
understood, and rushing it in 1.6 was the wrong thing to do.
Paolo
> We want a notification about the panic but
> adding yet another way to halt seems kind of useless.
> Why not let VM continue? If it wants to stop it
> can always call halt.
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-21 9:59 ` Paolo Bonzini
@ 2013-08-21 10:16 ` Michael S. Tsirkin
2013-08-21 10:37 ` Paolo Bonzini
0 siblings, 1 reply; 18+ messages in thread
From: Michael S. Tsirkin @ 2013-08-21 10:16 UTC (permalink / raw)
To: Paolo Bonzini
Cc: aliguori, gleb, Marcel Apfelbaum, hutao, qemu-devel, Ronen Hod,
kraxel, afaerber, vrozenfe
On Wed, Aug 21, 2013 at 11:59:36AM +0200, Paolo Bonzini wrote:
> Il 21/08/2013 11:42, Michael S. Tsirkin ha scritto:
> > On Wed, Aug 21, 2013 at 10:18:23AM +0200, Paolo Bonzini wrote:
> >> Il 21/08/2013 10:03, Marcel Apfelbaum ha scritto:
> >>> On Wed, 2013-08-14 at 10:02 +0300, Ronen Hod wrote:
> >>>> How about adding a flag that tells QEMU whether to pause or reboot the guest
> >>>> after the panic?
> >>>> We cannot assume that we always have a management layer that takes care
> >>>> of this.
> >>>> One example is Microsoft's WHQL that deliberately generates a BSOD, and then
> >>>> examines the dump files.
> >>> After this patch the pvpanic is not part of the global devices anymore so just
> >>> don't enable it if you want to reboot on BSOD.
> >>> In my opinion "reboot after panic" equals "run without pvpanic device"
> >>
> >> This is not entirely possible, since "reboot after panic" is a guest
> >> setting while "run without pvpanic device" is a host setting (that the
> >> guest administrator may not even have access to: Ronen's case is a good
> >> example of this, because the "administrator" there is the WHQL harness).
> >>
> >> However, I think this is a driver problem. The driver should just probe
> >> the "reboot after panic" setting and not issue the outb to the pvpanic port.
> >
> > This might or might not be possible on different OS-es.
> > What exactly is gained by doing vmstop on outb of pvpanic?
>
> Because events are edge-triggered, and can be lost if management dies at
> the wrong time, each event that QEMU sends must go together with a way
> for management to poll the state.
>
> For panic, the way to poll the state is "info status". This matches
> what we do for watchdogs, for example. Management can issue "info
> status" to learn of the panic state, even if it happens while management
> itself is not running:
>
> libvirtd QEMU guest
> ---------------------------------------------------------------
> stops
> <- pvpanic outb
> emits panic event
> (no one receives it)
> starts
> info status ->
> <- PANICKED
>
>
> Because there is only one running state, this means the VM has to be
> stopped.
>
> But actually, fixing the driver would only be required if pvpanic were
> mandatory.
>
> Now that pvpanic is optional, "reboot after panic" can also be fixed in
> libvirt. Let's remove the "must reset after panic" limitation; then,
> libvirt can simply do itself a "continue" after receiving the panicked
> event (or after seeing that the guest is in panicked state). The
> panicked event will never be sent unless management explicitly requests
> it (with "-device pvpanic"), so backwards compatibility is preserved.
>
> The pause will still happen if management was stopped, but that's a fair
> compromise IMHO.
>
> It will mean also that "reboot after panic" will be broken in 1.6.0,
> unfortunately. Perhaps we can have a quick 1.6.1 release with this patch:
>
> diff --git a/vl.c b/vl.c
> index 25b8f2f..25e890a 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -685,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)
>
>
> By the way, this means two things:
>
> - I am now sold on the idea that explicitly enabling of pvpanic is the
> right thing to do;
>
> - on the other hand this is the proof that the change was not fully
> understood, and rushing it in 1.6 was the wrong thing to do.
>
> Paolo
You mean 1.5.
pvpanic was a builtin in 1.5 and that was clearly the wrong thing to do.
We fixed that in 1.6, thankfully.
> > We want a notification about the panic but
> > adding yet another way to halt seems kind of useless.
> > Why not let VM continue? If it wants to stop it
> > can always call halt.
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-21 10:16 ` Michael S. Tsirkin
@ 2013-08-21 10:37 ` Paolo Bonzini
0 siblings, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2013-08-21 10:37 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: aliguori, gleb, Marcel Apfelbaum, hutao, qemu-devel, Ronen Hod,
kraxel, afaerber, vrozenfe
Il 21/08/2013 12:16, Michael S. Tsirkin ha scritto:
> >
> > By the way, this means two things:
> >
> > - I am now sold on the idea that explicitly enabling of pvpanic is the
> > right thing to do;
> >
> > - on the other hand this is the proof that the change was not fully
> > understood, and rushing it in 1.6 was the wrong thing to do.
>
> You mean 1.5.
> pvpanic was a builtin in 1.5 and that was clearly the wrong thing to do.
> We fixed that in 1.6, thankfully.
No, even taking it out in 1.6 is a mistake. It happened too close to
the release.
Now we have 1.5 which has it, 1.6 which doesn't have it and requires
reset after panic, 1.7 which doesn't have it and in all likelihood will
not require reset after panic.
Paolo
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type
2013-08-11 15:10 [Qemu-devel] [PATCH for-1.6 V2 0/2] pvpanic: Separate pvpanic from machine type Marcel Apfelbaum
` (3 preceding siblings ...)
2013-08-14 7:02 ` Ronen Hod
@ 2013-08-14 16:27 ` Anthony Liguori
4 siblings, 0 replies; 18+ messages in thread
From: Anthony Liguori @ 2013-08-14 16:27 UTC (permalink / raw)
To: Marcel Apfelbaum, qemu-devel
Cc: aliguori, gleb, hutao, mst, kraxel, pbonzini, afaerber, vrozenfe
Applied. Thanks.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 18+ messages in thread