All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] acpi-build: tweak acpi migration limits
@ 2014-07-28 21:15 Michael S. Tsirkin
  2014-07-29  8:25 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2014-07-28 21:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini

- Tweak error message for legacy machine type:
  Basically if table size exceeds the limits we set all
  bets are off for migration: e.g. it can start failing even
  within given qemu minor version simply because of a bugfix.
- Increase table size to 128k.
- Make sure we notice it long before we start getting close to the
  128k limit: warn at 64k.
- Don't fail if we exceed the limit: most people don't care about
  migration, even less people care about cross version miration.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 2178894..816c6d9 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -62,7 +62,7 @@
 #define ACPI_BUILD_LEGACY_CPU_AML_SIZE    97
 #define ACPI_BUILD_ALIGN_SIZE             0x1000
 
-#define ACPI_BUILD_TABLE_SIZE             0x10000
+#define ACPI_BUILD_TABLE_SIZE             0x20000
 
 typedef struct AcpiCpuInfo {
     DECLARE_BITMAP(found_cpus, ACPI_CPU_HOTPLUG_ID_LIMIT);
@@ -1586,17 +1586,19 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
                      ACPI_BUILD_ALIGN_SIZE);
         if (tables->table_data->len > legacy_table_size) {
             /* Should happen only with PCI bridges and -M pc-i440fx-2.0.  */
-            error_report("Warning: migration to QEMU 2.0 may not work.");
+            error_report("Warning: migration may not work.");
         }
         g_array_set_size(tables->table_data, legacy_table_size);
     } else {
-        if (tables->table_data->len > ACPI_BUILD_TABLE_SIZE) {
+        /* Make sure we have a buffer in case we need to resize the tables. */
+        if (tables->table_data->len > ACPI_BUILD_TABLE_SIZE / 2) {
             /* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory slots.  */
-            error_report("ACPI tables are larger than 64k.  Please remove");
-            error_report("CPUs, NUMA nodes, memory slots or PCI bridges.");
-            exit(1);
+            error_report("Warning: ACPI tables are larger than 64k.");
+            error_report("Warning: migration may not work.");
+            error_report("Warning: please remove CPUs, NUMA nodes, "
+                         "memory slots or PCI bridges.");
         }
-        g_array_set_size(tables->table_data, ACPI_BUILD_TABLE_SIZE);
+        acpi_align_size(tables->table_data, ACPI_BUILD_TABLE_SIZE);
     }
 
     acpi_align_size(tables->linker, ACPI_BUILD_ALIGN_SIZE);
-- 
MST

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

* Re: [Qemu-devel] [PATCH] acpi-build: tweak acpi migration limits
  2014-07-28 21:15 [Qemu-devel] [PATCH] acpi-build: tweak acpi migration limits Michael S. Tsirkin
@ 2014-07-29  8:25 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2014-07-29  8:25 UTC (permalink / raw)
  To: Michael S. Tsirkin, qemu-devel

Il 28/07/2014 23:15, Michael S. Tsirkin ha scritto:
> - Tweak error message for legacy machine type:
>   Basically if table size exceeds the limits we set all
>   bets are off for migration: e.g. it can start failing even
>   within given qemu minor version simply because of a bugfix.
> - Increase table size to 128k.
> - Make sure we notice it long before we start getting close to the
>   128k limit: warn at 64k.
> - Don't fail if we exceed the limit: most people don't care about
>   migration, even less people care about cross version miration.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  hw/i386/acpi-build.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 2178894..816c6d9 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -62,7 +62,7 @@
>  #define ACPI_BUILD_LEGACY_CPU_AML_SIZE    97
>  #define ACPI_BUILD_ALIGN_SIZE             0x1000
>  
> -#define ACPI_BUILD_TABLE_SIZE             0x10000
> +#define ACPI_BUILD_TABLE_SIZE             0x20000
>  
>  typedef struct AcpiCpuInfo {
>      DECLARE_BITMAP(found_cpus, ACPI_CPU_HOTPLUG_ID_LIMIT);
> @@ -1586,17 +1586,19 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
>                       ACPI_BUILD_ALIGN_SIZE);
>          if (tables->table_data->len > legacy_table_size) {
>              /* Should happen only with PCI bridges and -M pc-i440fx-2.0.  */
> -            error_report("Warning: migration to QEMU 2.0 may not work.");
> +            error_report("Warning: migration may not work.");
>          }
>          g_array_set_size(tables->table_data, legacy_table_size);
>      } else {
> -        if (tables->table_data->len > ACPI_BUILD_TABLE_SIZE) {
> +        /* Make sure we have a buffer in case we need to resize the tables. */
> +        if (tables->table_data->len > ACPI_BUILD_TABLE_SIZE / 2) {
>              /* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory slots.  */
> -            error_report("ACPI tables are larger than 64k.  Please remove");
> -            error_report("CPUs, NUMA nodes, memory slots or PCI bridges.");
> -            exit(1);
> +            error_report("Warning: ACPI tables are larger than 64k.");
> +            error_report("Warning: migration may not work.");
> +            error_report("Warning: please remove CPUs, NUMA nodes, "
> +                         "memory slots or PCI bridges.");
>          }
> -        g_array_set_size(tables->table_data, ACPI_BUILD_TABLE_SIZE);
> +        acpi_align_size(tables->table_data, ACPI_BUILD_TABLE_SIZE);
>      }
>  
>      acpi_align_size(tables->linker, ACPI_BUILD_ALIGN_SIZE);
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

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

end of thread, other threads:[~2014-07-29  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-28 21:15 [Qemu-devel] [PATCH] acpi-build: tweak acpi migration limits Michael S. Tsirkin
2014-07-29  8:25 ` Paolo Bonzini

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.