public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Cc: seabios@seabios.org, qemu-devel@nongnu.org, kvm@vger.kernel.org,
	avi@redhat.com
Subject: Re: [RFC PATCH 0/9] ACPI memory hotplug
Date: Sun, 22 Apr 2012 16:56:19 +0300	[thread overview]
Message-ID: <20120422135618.GA15413@redhat.com> (raw)
In-Reply-To: <1334844527-18869-1-git-send-email-vasilis.liaskovitis@profitbricks.com>

On Thu, Apr 19, 2012 at 04:08:38PM +0200, Vasilis Liaskovitis wrote:
> This is a prototype for ACPI memory hotplug on x86_64 target. Based on some
> earlier work and comments from Gleb.
> 
> Memslot devices are modeled with a new qemu command line 
> 
> "-memslot id=name,start=start_addr,size=sz,node=pxm"
> 
> user is responsible for defining memslots with meaningful start/size values,
> e.g. not defining a memory slot over a PCI-hole. Alternatively, the start size
> could also be handled/assigned automatically from the specific emulated hardware
> (for hw/pc.c PCI hole is currently [below_4g_mem_size, 4G), so hotplugged memory
> should start from max(4G, above_4g_mem_size).
> 
> Node is defining numa proximity for this memslot. When not defined it defaults
> to zero.
> 
> e.g. "-memslot id=hot1,start=4294967296,size=536870912,node=0"
> will define a 512M memory slot starting at physical address 4G, belonging to numa node 0.
> 
> Memory slots are added or removed with a new hmp command "memslot":
> Hot-add syntax: "memslot id add"
> Hot-remove syntax: "memslot id delete"
> 
> - All memslots are initially unpopulated. Memslots are currently modeling only
We can add ,populated=true to -memslot to make slot populated from the
start. We will need it for migration anyway.

> hotplug-able memory slots i.e. initial system memory is not modeled with
> memslots. The concept could be generalized to include all memory though, or it
> could more closely follow kvm-memory slots.
OK, I hope final version will allow for memory < 4G to be hot-pluggable.

> 
> - Memslots are abstracted as qdevices attached to the main system bus. However,
> memory hotplugging has its own side channel ignoring main_system_bus's hotplug
> incapability. A cleaner integration would be needed. What's  the preferred
> way of modeling memory devices in qom? Would it be better to attach memory
> devices as children-links of an acpi-capable device (in the pc case acpi_piix4)
> instead of the system bus?
> 
> - Refcounting memory slots has been discussed (but is not included in this 
> series yet). Depopulating a memory region happens on a guestOS _EJ callback,
> which means the guestOS will not be using the region anymore. However, guest
> addresses from the depopulated region need to also be unmapped from the qemu
> address space using cpu_physical_memory_unmap(). Does memory_region_del_subregion()
> or some other memory API call guarantee that a memoryregion has been unmapped
> from qemu's address space?
> 
> - What is the expected behaviour of hotplugged memory after a reboot? Is it
> supposed to be persistent after reboots? The last 2 patches in the series try to
> make hotplugged memslots persistent after reboot by creating and consulting e820
> map entries.  A better solution is needed for hot-remove after a reboot, because
> e820 entries can be merged.
> 
> series is based on uq/master for qemu-kvm, and master for seabios. Can be found
> also at:
> 
> 
> Vasilis Liaskovitis (9):
>   Seabios: Add SSDT memory device support
>   Seabios, acpi: Implement acpi-dsdt functions for memory hotplug.
>   Seabios, acpi: generate hotplug memory devices.
>   Implement memslot device abstraction
>   acpi_piix4: Implement memory device hotplug registers and handlers. 
>   pc: pass paravirt info for hotplug memory slots to BIOS
>   Implement memslot command-line option and memslot hmp monitor command
>   pc: adjust e820 map on hot-add and hot-remove
>   Seabios, acpi: enable memory devices if e820 entry is present
> 
>  Makefile.objs   |    2 +-
>  hmp-commands.hx |   15 ++++
>  hw/acpi_piix4.c |  103 +++++++++++++++++++++++++++-
>  hw/memslot.c    |  201 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  hw/memslot.h    |   44 ++++++++++++
>  hw/pc.c         |   87 ++++++++++++++++++++++--
>  hw/pc.h         |    1 +
>  monitor.c       |    8 ++
>  monitor.h       |    1 +
>  qemu-config.c   |   25 +++++++
>  qemu-options.hx |    8 ++
>  sysemu.h        |    1 +
>  vl.c            |   44 ++++++++++++-
>  13 files changed, 528 insertions(+), 12 deletions(-)
>  create mode 100644 hw/memslot.c
>  create mode 100644 hw/memslot.h
> 
>  create mode 100644 src/ssdt-mem.dsl
>  src/acpi-dsdt.dsl |   68 ++++++++++++++++++++++-
>  src/acpi.c        |  155 +++++++++++++++++++++++++++++++++++++++++++++++++++--
>  src/memmap.c      |   15 +++++
>  src/ssdt-mem.dsl  |   66 ++++++++++++++++++++++
>  4 files changed, 298 insertions(+), 6 deletions(-)
>  create mode 100644 src/ssdt-mem.dsl
> 
> -- 
> 1.7.9

--
			Gleb.

  parent reply	other threads:[~2012-04-22 13:56 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 14:08 [RFC PATCH 0/9] ACPI memory hotplug Vasilis Liaskovitis
2012-04-19 14:08 ` [RFC PATCH 1/9][SeaBIOS] Add SSDT memory device support Vasilis Liaskovitis
2012-04-19 14:08 ` [RFC PATCH 2/9][SeaBIOS] Implement acpi-dsdt functions for memory hotplug Vasilis Liaskovitis
2012-04-20 10:55   ` Igor Mammedov
2012-04-20 14:11     ` [Qemu-devel] " Vasilis Liaskovitis
2012-04-19 14:08 ` [RFC PATCH 3/9][SeaBIOS] acpi: generate hotplug memory devices Vasilis Liaskovitis
2012-04-23 23:37   ` Kevin O'Connor
2012-04-24  8:27     ` Vasilis Liaskovitis
2012-04-19 14:08 ` [RFC PATCH 4/9] Implement memslot device abstraction Vasilis Liaskovitis
2012-04-19 14:08 ` [RFC PATCH 5/9] acpi_piix4: Implement memory device hotplug registers Vasilis Liaskovitis
2012-04-19 14:08 ` [RFC PATCH 6/9] pc: pass paravirt info for hotplug memory slots to BIOS Vasilis Liaskovitis
2012-04-19 14:21   ` Avi Kivity
2012-04-20 10:33   ` Igor Mammedov
2012-04-20 16:35     ` [Qemu-devel] " Vasilis Liaskovitis
2012-04-19 14:08 ` [RFC PATCH 7/9] Implement memslot command-line option and memslot hmp command Vasilis Liaskovitis
2012-04-19 14:22   ` Avi Kivity
2012-04-19 18:10     ` Vasilis Liaskovitis
2012-04-19 14:08 ` [RFC PATCH 8/9] pc: adjust e820 map on hot-add and hot-remove Vasilis Liaskovitis
2012-04-22 13:58   ` Gleb Natapov
2012-04-23 11:27     ` Vasilis Liaskovitis
2012-04-23 11:30       ` Gleb Natapov
2012-04-19 14:08 ` [RFC PATCH 9/9][SeaBIOS] enable memory devices if e820 entry is present Vasilis Liaskovitis
2012-04-26  0:58   ` [SeaBIOS] [RFC PATCH 9/9] " Wen Congyang
2012-04-19 14:49 ` [Qemu-devel] [RFC PATCH 0/9] ACPI memory hotplug Anthony Liguori
2012-04-19 18:09   ` Vasilis Liaskovitis
2012-04-20 14:20 ` Vasilis Liaskovitis
2012-04-22 13:56 ` Gleb Natapov [this message]
2012-04-22 14:06   ` Avi Kivity
2012-04-22 14:09     ` Gleb Natapov
2012-04-22 14:13       ` Avi Kivity
2012-04-22 14:20         ` Gleb Natapov
2012-04-23 12:31           ` Vasilis Liaskovitis
2012-04-24  7:52             ` Gleb Natapov
2012-04-24  8:24               ` Vasilis Liaskovitis
2012-04-24  8:34                 ` Gleb Natapov
2012-04-23 13:31           ` Avi Kivity
2012-04-24  7:21             ` Gleb Natapov
2012-04-24  9:09               ` Avi Kivity

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=20120422135618.GA15413@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@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