qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel.a@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH v3 2/6] pc: Move legacy_acpi_table_size global to PCMachineClass
Date: Wed, 2 Dec 2015 12:06:31 +0200	[thread overview]
Message-ID: <565EC2A7.8010407@redhat.com> (raw)
In-Reply-To: <1449010688-19205-3-git-send-email-ehabkost@redhat.com>

On 12/02/2015 12:58 AM, Eduardo Habkost wrote:
> This way we can set legacy_acpi_table_size on the machine_options()
> functions, instead of requirng code in pc_compat_*() functions.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>   hw/i386/pc_piix.c    | 40 +++++++++++++++++++---------------------
>   include/hw/i386/pc.h |  1 +
>   2 files changed, 20 insertions(+), 21 deletions(-)
>
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 7a7f748..5f23e9c 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -60,8 +60,6 @@ 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 int legacy_acpi_table_size;
> -
>   /* PC hardware initialisation */
>   static void pc_init1(MachineState *machine,
>                        const char *host_type, const char *pci_type)
> @@ -145,7 +143,7 @@ static void pc_init1(MachineState *machine,
>       guest_info = pc_guest_info_init(pcms);
>
>       guest_info->has_acpi_build = pcmc->has_acpi_build;
> -    guest_info->legacy_acpi_table_size = legacy_acpi_table_size;
> +    guest_info->legacy_acpi_table_size = pcmc->legacy_acpi_table_size;
>
>       guest_info->isapc_ram_fw = !pcmc->pci_enabled;
>       guest_info->has_reserved_memory = pcmc->has_reserved_memory;
> @@ -319,23 +317,6 @@ static void pc_compat_2_1(MachineState *machine)
>   static void pc_compat_2_0(MachineState *machine)
>   {
>       pc_compat_2_1(machine);
> -    /* This value depends on the actual DSDT and SSDT compiled into
> -     * the source QEMU; unfortunately it depends on the binary and
> -     * not on the machine type, so we cannot make pc-i440fx-1.7 work on
> -     * both QEMU 1.7 and QEMU 2.0.
> -     *
> -     * Large variations cause migration to fail for more than one
> -     * consecutive value of the "-smp" maxcpus option.
> -     *
> -     * For small variations of the kind caused by different iasl versions,
> -     * the 4k rounding usually leaves slack.  However, there could be still
> -     * one or two values that break.  For QEMU 1.7 and QEMU 2.0 the
> -     * slack is only ~10 bytes before one "-smp maxcpus" value breaks!
> -     *
> -     * 6652 is valid for QEMU 2.0, the right value for pc-i440fx-1.7 on
> -     * QEMU 1.7 it is 6414.  For RHEL/CentOS 7.0 it is 6418.
> -     */
> -    legacy_acpi_table_size = 6652;
>       pc_set_legacy_acpi_data_size();
>   }
>
> @@ -343,7 +324,6 @@ static void pc_compat_1_7(MachineState *machine)
>   {
>       pc_compat_2_0(machine);
>       option_rom_has_mr = true;
> -    legacy_acpi_table_size = 6414;
>       x86_cpu_change_kvm_default("x2apic", NULL);
>   }
>
> @@ -519,6 +499,23 @@ static void pc_i440fx_2_0_machine_options(MachineClass *m)
>       SET_MACHINE_COMPAT(m, PC_COMPAT_2_0);
>       pcmc->smbios_legacy_mode = true;
>       pcmc->has_reserved_memory = false;
> +    /* This value depends on the actual DSDT and SSDT compiled into
> +     * the source QEMU; unfortunately it depends on the binary and
> +     * not on the machine type, so we cannot make pc-i440fx-1.7 work on
> +     * both QEMU 1.7 and QEMU 2.0.
> +     *
> +     * Large variations cause migration to fail for more than one
> +     * consecutive value of the "-smp" maxcpus option.
> +     *
> +     * For small variations of the kind caused by different iasl versions,
> +     * the 4k rounding usually leaves slack.  However, there could be still
> +     * one or two values that break.  For QEMU 1.7 and QEMU 2.0 the
> +     * slack is only ~10 bytes before one "-smp maxcpus" value breaks!
> +     *
> +     * 6652 is valid for QEMU 2.0, the right value for pc-i440fx-1.7 on
> +     * QEMU 1.7 it is 6414.  For RHEL/CentOS 7.0 it is 6418.
> +     */
> +    pcmc->legacy_acpi_table_size = 6652;
>   }
>
>   DEFINE_I440FX_MACHINE(v2_0, "pc-i440fx-2.0", pc_compat_2_0,
> @@ -534,6 +531,7 @@ static void pc_i440fx_1_7_machine_options(MachineClass *m)
>       SET_MACHINE_COMPAT(m, PC_COMPAT_1_7);
>       pcmc->smbios_defaults = false;
>       pcmc->gigabyte_align = false;
> +    pcmc->legacy_acpi_table_size = 6414;
>   }
>
>   DEFINE_I440FX_MACHINE(v1_7, "pc-i440fx-1.7", pc_compat_1_7,
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 15171e9..7c2cc9f 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -76,6 +76,7 @@ struct PCMachineClass {
>       bool gigabyte_align;
>       bool has_reserved_memory;
>       bool kvmclock_enabled;
> +    int legacy_acpi_table_size;
>   };
>
>   #define TYPE_PC_MACHINE "generic-pc-machine"
>

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

  reply	other threads:[~2015-12-02 10:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 22:58 [Qemu-devel] [PATCH v3 0/6] pc: Initialization and compat function cleanup Eduardo Habkost
2015-12-01 22:58 ` [Qemu-devel] [PATCH v3 1/6] pc: Move compat boolean globals to PCMachineClass Eduardo Habkost
2015-12-02  9:57   ` Marcel Apfelbaum
2015-12-02 10:05     ` Marcel Apfelbaum
2015-12-01 22:58 ` [Qemu-devel] [PATCH v3 2/6] pc: Move legacy_acpi_table_size global " Eduardo Habkost
2015-12-02 10:06   ` Marcel Apfelbaum [this message]
2015-12-01 22:58 ` [Qemu-devel] [PATCH v3 3/6] pc: Move acpi_data_size " Eduardo Habkost
2015-12-02 10:09   ` Marcel Apfelbaum
2015-12-01 22:58 ` [Qemu-devel] [PATCH v3 4/6] pc: Move enforce_aligned_dimm " Eduardo Habkost
2015-12-01 22:58 ` [Qemu-devel] [PATCH v3 5/6] pc: Remove enforce-aligned-dimm QOM property Eduardo Habkost
2015-12-01 22:58 ` [Qemu-devel] [PATCH v3 6/6] pc: Move option_rom_has_mr/rom_file_has_mr globals to MachineClass Eduardo Habkost
2015-12-02 10:13   ` Marcel Apfelbaum

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=565EC2A7.8010407@redhat.com \
    --to=marcel@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@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 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).