From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Glauber Costa <glommer@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 15/22] machine: make max_cpus a -machine option
Date: Wed, 09 Jun 2010 09:47:26 +0200 [thread overview]
Message-ID: <4C0F470E.2020900@redhat.com> (raw)
In-Reply-To: <1275954730-8196-16-git-send-email-aliguori@us.ibm.com>
On 06/08/10 01:52, Anthony Liguori wrote:
> max_cpus is a weird property today. On the one hand, it represents the maximum
> CPUs a board can support and is used to validate the number of vcpus requested
> by the user.
>
> On the other hand, max_cpus can be set by the user in which case it is taken
> to mean the number of physical sockets that should be advertised by the
> firmware. Furthermore, if max_cpus isn't explicitly set by the user, it's
> defaulted to the number of smp_cpus. But there's actually a second copy of
> max_cpus that still represents the maximum cpus spported by the platform.
Sorry this is wrong, max_cpus never meant to advertise the number of
sockets, it means the number of cores (ie. cpus) as the limit advertised
by firmware.
> Yes, it's confusing. So let's be a bit more obvious. This patch introduces
> a sockets parameter that allows a user to explicitly set the number of
> advertised sockets apart from the number of maximum cpus.
>
> This is something of a stop gap. We really ought to specify a more rich
> NUMA topology as machine options but that will come later.
>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
[snip]
> diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
> index 22ebb50..de4454f 100644
> --- a/hw/fw_cfg.c
> +++ b/hw/fw_cfg.c
> @@ -321,7 +321,8 @@ int fw_cfg_add_file(FWCfgState *s, const char *dir, const char *filename,
> }
>
> FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
> - target_phys_addr_t ctl_addr, target_phys_addr_t data_addr)
> + target_phys_addr_t ctl_addr, target_phys_addr_t data_addr,
> + QemuOpts *opts)
> {
> FWCfgState *s;
> int io_ctl_memory, io_data_memory;
> @@ -349,7 +350,8 @@ FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
> fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16);
> fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)(display_type == DT_NOGRAPHIC));
> fw_cfg_add_i16(s, FW_CFG_NB_CPUS, (uint16_t)smp_cpus);
> - fw_cfg_add_i16(s, FW_CFG_MAX_CPUS, (uint16_t)max_cpus);
> + fw_cfg_add_i16(s, FW_CFG_MAX_CPUS,
> + (uint16_t)qemu_opt_get_number(opts, "sockets", smp_cpus));
> fw_cfg_add_i16(s, FW_CFG_BOOT_MENU, (uint16_t)boot_menu);
NACK this is just plain wrong!
Sorry Anthony, but max_cpus never meant number of sockets. It is used by
the BIOS to calculate table sizes for CPU entries, and that number is
based on cores, not sockets.
If you want to pass a number of sockets onto the BIOS, I will totally
support that, but you need to introduce FW_CFG_MAX_SOCKETS for that
instead, and tell the BIOS to use that for the SRAT.
Cheers,
Jes
next prev parent reply other threads:[~2010-06-09 7:47 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-07 23:51 [Qemu-devel] [PATCH 0/22] Refactor machine support Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 01/22] QemuOpts: fix a bug in QemuOpts when setting an option twice Anthony Liguori
2010-06-08 7:51 ` Gerd Hoffmann
2010-06-08 10:32 ` [Qemu-devel] " Paolo Bonzini
2010-06-08 13:07 ` Anthony Liguori
2010-06-08 13:44 ` Gerd Hoffmann
2010-06-08 15:17 ` Anthony Liguori
2010-06-08 15:37 ` Gerd Hoffmann
2010-06-08 16:04 ` Anthony Liguori
2010-06-09 7:01 ` Gerd Hoffmann
2010-06-08 14:38 ` Paul Brook
2010-06-08 15:14 ` Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 02/22] QemuOpts: make qemu_opts_validate() store the description list for later use Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 03/22] QemuOpts: add function to set QemuOpts from defaults Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 04/22] machine: package all init arguments into a QemuOpts (v2) Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 05/22] machine: pass all init options as a single QemuOpts Anthony Liguori
2010-06-08 7:58 ` Gerd Hoffmann
2010-06-07 23:51 ` [Qemu-devel] [PATCH 06/22] Make -acpi-enable a machine specific option Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 07/22] machine: introduce -machine option Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 08/22] machine: implement -kernel/-append/-initrd options in term of -machine Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 09/22] machine: implement -m in terms " Anthony Liguori
2010-06-07 23:51 ` [Qemu-devel] [PATCH 10/22] machine: allow boards to specify default values and use it in isapc Anthony Liguori
2010-06-08 8:03 ` Gerd Hoffmann
2010-06-08 13:09 ` Anthony Liguori
2010-06-08 13:29 ` Gerd Hoffmann
2010-06-07 23:51 ` [Qemu-devel] [PATCH 11/22] machine: replace compat_props with opts_default Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 12/22] machine: some sugary macros to simplify machine default options Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 13/22] machine: get rid of global default QEMUMachine members Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 14/22] machine: replace QEMUMachine.use_scsi with -machine default_drive Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 15/22] machine: make max_cpus a -machine option Anthony Liguori
2010-06-08 1:01 ` Paul Brook
2010-06-08 1:56 ` Anthony Liguori
2010-06-08 2:56 ` Paul Brook
2010-06-09 7:44 ` Jes Sorensen
2010-06-09 7:47 ` Jes Sorensen [this message]
2010-06-07 23:52 ` [Qemu-devel] [PATCH 16/22] machine: move default machine out of machine definitions Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 17/22] machine: kill machine->alias Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 18/22] machine: final conversion to pure QemuOpts Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 19/22] machine: introduce accel option to allow selection of kvm or tcg Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 20/22] machine: introduce machine core and split qemu_register_machine Anthony Liguori
2010-06-07 23:52 ` [Qemu-devel] [PATCH 21/22] machine: convert pc machines to split core vs machine API Anthony Liguori
2010-06-09 7:51 ` Jes Sorensen
2010-06-07 23:52 ` [Qemu-devel] [PATCH 22/22] machine: introduce -machine-def option to define a machine via config Anthony Liguori
2010-06-08 0:50 ` Anthony Liguori
2010-06-10 17:48 ` Daniel P. Berrange
2010-06-11 13:03 ` Daniel P. Berrange
2010-06-08 3:12 ` [Qemu-devel] [PATCH 0/22] Refactor machine support Paul Brook
2010-06-08 10:24 ` [Qemu-devel] " Paolo Bonzini
2010-06-08 14:30 ` Paul Brook
2010-06-08 15:28 ` Anthony Liguori
2010-06-08 15:36 ` Paul Brook
2010-06-08 15:58 ` Paolo Bonzini
2010-06-08 16:15 ` Anthony Liguori
2010-06-08 21:05 ` Alexander Graf
2010-06-08 21:16 ` Anthony Liguori
2010-06-08 17:23 ` Anthony Liguori
2010-06-09 2:11 ` Paul Brook
2010-06-09 13:55 ` Anthony Liguori
2010-06-09 14:30 ` Paul Brook
2010-06-09 20:47 ` Blue Swirl
2010-06-09 20:52 ` Anthony Liguori
2010-06-09 21:09 ` Blue Swirl
2010-06-09 22:26 ` Paul Brook
2010-06-08 14:04 ` [Qemu-devel] " Anthony Liguori
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=4C0F470E.2020900@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=glommer@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).