All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
	qemu-devel@nongnu.org, qemu-stable@nongnu.org
Cc: Laszlo Ersek <lersek@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] acpi: Use apic_id_limit when calculating legacy ACPI table size
Date: Fri, 12 Dec 2014 17:50:37 +0100	[thread overview]
Message-ID: <548B1CDD.4030206@redhat.com> (raw)
In-Reply-To: <1418402316-31738-1-git-send-email-ehabkost@redhat.com>



On 12/12/2014 17:38, Eduardo Habkost wrote:
> The code that calculates the legacy ACPI table size for migration
> compatibility uses max_cpus when calculating legacy_aml_len (the size of
> the DSDT and SSDT tables). However, the SSDT grows according to APIC ID
> limit, not max_cpus.
> 
> The bug is not triggered very often because of the 4k alignment on the
> table size. But it can be triggered if you are unlucky enough to cross a
> 4k boundary. For example, using the following:
> 
>   $ qemu-system-x86_64 -machine pc-i440fx-2.0 -smp 99,sockets=3,cores=33,threads=1
>   qemu-system-x86_64: Warning: migration may not work.
> 
> Change the legacy_aml_len calculation to use apic_id_limit, to calculate
> the right size.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  hw/i386/acpi-build.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index a4d0c0c..359fb43 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1675,7 +1675,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
>           */
>          int legacy_aml_len =
>              guest_info->legacy_acpi_table_size +
> -            ACPI_BUILD_LEGACY_CPU_AML_SIZE * max_cpus;
> +            ACPI_BUILD_LEGACY_CPU_AML_SIZE * guest_info->apic_id_limit;
>          int legacy_table_size =
>              ROUND_UP(tables->table_data->len - aml_len + legacy_aml_len,
>                       ACPI_BUILD_ALIGN_SIZE);
> 

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

      reply	other threads:[~2014-12-12 16:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 16:38 [Qemu-devel] [PATCH] acpi: Use apic_id_limit when calculating legacy ACPI table size Eduardo Habkost
2014-12-12 16:50 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=548B1CDD.4030206@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.