From: Wen Congyang <wency@cn.fujitsu.com>
To: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Cc: gleb@redhat.com, kvm@vger.kernel.org, seabios@seabios.org,
qemu-devel@nongnu.org, blauwirbel@gmail.com, kevin@koconnor.net,
avi@redhat.com, anthony@codemonkey.ws, imammedo@redhat.com,
eblake@redhat.com, kraxel@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v3 09/19] pc: Add dimm paravirt SRAT info
Date: Thu, 27 Sep 2012 11:55:28 +0800 [thread overview]
Message-ID: <5063CE30.2020001@cn.fujitsu.com> (raw)
In-Reply-To: <1348226255-4226-10-git-send-email-vasilis.liaskovitis@profitbricks.com>
At 09/21/2012 07:17 PM, Vasilis Liaskovitis Wrote:
> The numa_fw_cfg paravirt interface is extended to include SRAT information for
> all hotplug-able dimms. There are 3 words for each hotplug-able memory slot,
> denoting start address, size and node proximity. The new info is appended after
> existing numa info, so that the fw_cfg layout does not break. This information
> is used by Seabios to build hotplug memory device objects at runtime.
> nb_numa_nodes is set to 1 by default (not 0), so that we always pass srat info
> to SeaBIOS.
You forgot to set nb_numa_nodes to 1...
Thanks
Wen Congyang
>
> v1->v2:
> Dimm SRAT info (#dimms) is appended at end of existing numa fw_cfg in order not
> to break existing layout
> Documentation of the new fwcfg layout is included in docs/specs/fwcfg.txt
>
> Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
> ---
> docs/specs/fwcfg.txt | 28 ++++++++++++++++++++++++++++
> hw/pc.c | 14 ++++++++++++--
> 2 files changed, 40 insertions(+), 2 deletions(-)
> create mode 100644 docs/specs/fwcfg.txt
>
> diff --git a/docs/specs/fwcfg.txt b/docs/specs/fwcfg.txt
> new file mode 100644
> index 0000000..55f96d9
> --- /dev/null
> +++ b/docs/specs/fwcfg.txt
> @@ -0,0 +1,28 @@
> +QEMU<->BIOS Paravirt Documentation
> +--------------------------------------
> +
> +This document describes paravirt data structures passed from QEMU to BIOS.
> +
> +FW_CFG_NUMA paravirt info
> +--------------------
> +The SRAT info passed from QEMU to BIOS has the following layout:
> +
> +-----------------------------------------------------------------------------------------------
> +#nodes | cpu0_pxm | cpu1_pxm | ... | cpulast_pxm | node0_mem | node1_mem | ... | nodelast_mem
> +
> +-----------------------------------------------------------------------------------------------
> +#dimms | dimm0_start | dimm0_sz | dimm0_pxm | ... | dimmlast_start | dimmlast_sz | dimmlast_pxm
> +
> +Entry 0 contains the number of numa nodes (nb_numa_nodes).
> +
> +Entries 1..max_cpus: The next max_cpus entries describe node proximity for each
> +one of the vCPUs in the system.
> +
> +Entries max_cpus+1..max_cpus+nb_numa_nodes+1: The next nb_numa_nodes entries
> +describe the memory size for each one of the NUMA nodes in the system.
> +
> +Entry max_cpus+nb_numa_nodes+1 contains the number of memory dimms (nb_hp_dimms)
> +
> +The last 3 * nb_hp_dimms entries are organized in triplets: Each triplet contains
> +the physical address offset, size (in bytes), and node proximity for the
> +respective dimm.
> diff --git a/hw/pc.c b/hw/pc.c
> index 2c9664d..f2604ae 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -598,6 +598,7 @@ static void *bochs_bios_init(void)
> uint8_t *smbios_table;
> size_t smbios_len;
> uint64_t *numa_fw_cfg;
> + uint64_t *hp_dimms_fw_cfg;
> int i, j;
>
> register_ioport_write(0x400, 1, 2, bochs_bios_write, NULL);
> @@ -632,8 +633,10 @@ static void *bochs_bios_init(void)
> /* allocate memory for the NUMA channel: one (64bit) word for the number
> * of nodes, one word for each VCPU->node and one word for each node to
> * hold the amount of memory.
> + * Finally one word for the number of hotplug memory slots and three words
> + * for each hotplug memory slot (start address, size and node proximity).
> */
> - numa_fw_cfg = g_malloc0((1 + max_cpus + nb_numa_nodes) * 8);
> + numa_fw_cfg = g_malloc0((2 + max_cpus + nb_numa_nodes + 3 * nb_hp_dimms) * 8);
> numa_fw_cfg[0] = cpu_to_le64(nb_numa_nodes);
> for (i = 0; i < max_cpus; i++) {
> for (j = 0; j < nb_numa_nodes; j++) {
> @@ -646,8 +649,15 @@ static void *bochs_bios_init(void)
> for (i = 0; i < nb_numa_nodes; i++) {
> numa_fw_cfg[max_cpus + 1 + i] = cpu_to_le64(node_mem[i]);
> }
> +
> + numa_fw_cfg[1 + max_cpus + nb_numa_nodes] = cpu_to_le64(nb_hp_dimms);
> +
> + hp_dimms_fw_cfg = numa_fw_cfg + 2 + max_cpus + nb_numa_nodes;
> + if (nb_hp_dimms)
> + setup_fwcfg_hp_dimms(hp_dimms_fw_cfg);
> +
> fw_cfg_add_bytes(fw_cfg, FW_CFG_NUMA, (uint8_t *)numa_fw_cfg,
> - (1 + max_cpus + nb_numa_nodes) * 8);
> + (2 + max_cpus + nb_numa_nodes + 3 * nb_hp_dimms) * 8);
>
> return fw_cfg;
> }
next prev parent reply other threads:[~2012-09-27 3:50 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-21 11:17 [Qemu-devel] [RFC PATCH v3 00/19] ACPI memory hotplug Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 01/19][SeaBIOS] Add ACPI_EXTRACT_DEVICE* macros Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 02/19][SeaBIOS] Add SSDT memory device support Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 03/19][SeaBIOS] acpi-dsdt: Implement functions for memory hotplug Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 04/19][SeaBIOS] acpi: generate hotplug memory devices Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 05/19] Implement dimm device abstraction Vasilis Liaskovitis
2012-09-24 6:02 ` Wen Congyang
2012-10-23 12:25 ` Stefan Hajnoczi
2012-10-24 8:06 ` liu ping fan
2012-10-24 10:15 ` Stefan Hajnoczi
2012-10-24 17:16 ` Vasilis Liaskovitis
2012-10-25 8:00 ` liu ping fan
2012-10-31 11:15 ` Avi Kivity
2012-10-31 12:18 ` Stefan Hajnoczi
2012-10-31 12:34 ` Avi Kivity
2012-10-31 12:34 ` Stefan Hajnoczi
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 06/19] Implement "-dimm" command line option Vasilis Liaskovitis
2012-09-22 13:46 ` Blue Swirl
2012-09-24 10:42 ` Vasilis Liaskovitis
2012-09-29 11:13 ` Blue Swirl
2012-10-09 17:04 ` Vasilis Liaskovitis
2012-10-13 8:57 ` Blue Swirl
2012-10-17 9:19 ` Vasilis Liaskovitis
2012-10-17 10:03 ` Avi Kivity
2012-10-18 9:27 ` Vasilis Liaskovitis
2012-10-18 12:33 ` Avi Kivity
2012-10-19 17:48 ` Blue Swirl
2012-10-22 10:55 ` Avi Kivity
2012-10-22 8:39 ` Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 07/19] acpi_piix4: Implement memory device hotplug registers Vasilis Liaskovitis
2012-09-22 13:49 ` Blue Swirl
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 08/19] pc: calculate dimm physical addresses and adjust memory map Vasilis Liaskovitis
2012-09-22 14:15 ` Blue Swirl
2012-09-24 15:27 ` Vasilis Liaskovitis
2012-09-29 11:27 ` Blue Swirl
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 09/19] pc: Add dimm paravirt SRAT info Vasilis Liaskovitis
2012-09-27 3:55 ` Wen Congyang [this message]
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 10/19] fix live-migration when "populated=on" is missing Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 11/19] Implement qmp and hmp commands for notification lists Vasilis Liaskovitis
2012-09-21 22:03 ` Eric Blake
2012-09-24 14:45 ` Vasilis Liaskovitis
2012-10-23 12:15 ` Stefan Hajnoczi
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 12/19] Implement "info memory-total" and "query-memory-total" Vasilis Liaskovitis
2012-09-21 22:36 ` Eric Blake
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 13/19] balloon: update with hotplugged memory Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 14/19][SeaBIOS] Add _OST dimm method Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 15/19] Add _OST dimm support Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 16/19] Update dimm state on reset Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 17/19][SeaBIOS] Implement _PS3 method for memory device Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 18/19] Implement _PS3 for dimm Vasilis Liaskovitis
2012-09-21 11:17 ` [Qemu-devel] [RFC PATCH v3 19/19][SeaBIOS] Calculate pcimem_start and pcimem64_start from SRAT entries Vasilis Liaskovitis
2012-09-21 11:19 ` [Qemu-devel] [RFC PATCH v3 19/19] alternative: Introduce paravirt interface QEMU_CFG_PCI_WINDOW Vasilis Liaskovitis
2012-09-21 11:20 ` [Qemu-devel] [RFC PATCH v3 20/19][SeaBIOS] alternative: Use paravirt interface for pci windows Vasilis Liaskovitis
2012-09-24 6:35 ` Wen Congyang
2012-09-24 10:46 ` Vasilis Liaskovitis
2012-09-24 6:51 ` [Qemu-devel] [RFC PATCH v3 19/19][SeaBIOS] Calculate pcimem_start and pcimem64_start from SRAT entries Wen Congyang
2012-09-22 14:17 ` [Qemu-devel] [RFC PATCH v3 00/19] ACPI memory hotplug Blue Swirl
2012-10-31 10:58 ` Stefan Hajnoczi
2012-10-31 11:16 ` Avi Kivity
2012-11-01 9:01 ` Vasilis Liaskovitis
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=5063CE30.2020001@cn.fujitsu.com \
--to=wency@cn.fujitsu.com \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=eblake@redhat.com \
--cc=gleb@redhat.com \
--cc=imammedo@redhat.com \
--cc=kevin@koconnor.net \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.org \
--cc=vasilis.liaskovitis@profitbricks.com \
/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).