qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Baptiste Reynal <b.reynal@virtualopensystems.com>
To: qemu-devel@nongnu.org
Cc: b.reynal@virtualopensystems.com, Jani.Kokkonen@huawei.com,
	tech@virtualopensystems.com, Claudio.Fontana@huawei.com
Subject: [Qemu-devel] [RFC v2 0/6] QEMU shared-memory backend
Date: Fri, 18 Mar 2016 10:13:52 +0100	[thread overview]
Message-ID: <1458292438-13909-1-git-send-email-b.reynal@virtualopensystems.com> (raw)

A new memory backend, the shared memory backend, based on
the file memory backend.

This new backend allows a master QEMU instance to share a part of
his main memory whith a slave QEMU instance. It is then possible to load
a firmware on this memory and trigger the slave boot using a SDM
signal.

Such new backend enables, on a master side, to allocate the whole
memory as shareable (e.g. /dev/shm, or hugetlbfs).
On the slave side it enables the startup of QEMU without any main memory
allocated. Then the slave goes in a waiting state, the same used in the
case of an incoming migration, and the file descriptor of the shared
memory is sent by the master over a socket.
The waiting state ends when the master sends to the slave a signal
with size and offset to mmap and use as memory as payload.

You can test those patches using modules and test application available
on https://git.virtualopensystems.com/dev/qemu-het-tools.
- SDM Platform module on branch sdm_test_mod_v1
- Test application on branch sdm_test_app
- Slave files on branch demo_slaves_sdm

 QEMU code is avalaible here https://git.virtualopensystems.com/dev/qemu on branch rfc_v2.

Run QEMU master instance:
./qemu-system-arm -nographic \
        -kernel zImage \
        -M virt -m 1G \
        -initrd busybox.cpio \
        -object multi-socket-backend,id=sock,path=sock,listen \
        -object memory-backend-shared,id=mem,size=1G,mem-path=/dev/hugepages,socket=sock,master \
        -object sdm-signal-shboot,id=boot,shm=mem \
        -object sdm-communication-socket,id=scomm,socket=sock \
        -device virtio-sdm-device,comm=scomm,master,num-slaves=1,len-signals=1,signals[0]=boot \
        -append "mem=512M memmap=512M$0x60000000" \
        -numa node,memdev=mem -m 1G

Run QEMU slave instance:
./qemu-system-arm -nographic \
        -kernel zImage \
        -M virt -m 1G \
        -initrd busybox.cpio \
        -object multi-socket-backend,id=sock,path=sock \
        -object memory-backend-shared,id=mem,size=512M,socket=sock \
        -object sdm-signal-shboot,id=boot,shm=mem \
        -object sdm-communication-socket,id=scomm,socket=sock \
        -device sdm-platform,comm=scomm,len-signals=1,signals[0]="boot" \
        -incoming "shared:mem" \
        -numa node,memdev=mem -m 512M

On the master, load the SDM module (insmod sdm_test_mod_v1) and trigger the boot with
the following command:
./sdm-test -b 0 1 zImage slave.dtb

zImage and slave.dtb are available on branch demo_slaves_sdm.

This patch serie is a follow-up to "[RFC PATCH 0/8] Towards an Heterogeneous QEMU":
https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg00171.html

This patch serie depends on:
- [RFC v2 0/6] SDM Interface
- [RFC v2 1/1] backend: multi-client-socket

This work has been sponsored by Huawei Technologies Duesseldorf GmbH.

Baptiste Reynal (3):
  backend: shared memory backend
  migration: add shared migration type
  hw/misc: sdm signal shboot

Christian Pinto (3):
  qemu: slave machine flag
  hw/arm: boot
  qemu: numa

 backends/Makefile.objs              |   2 +-
 backends/hostmem-shared.c           | 198 ++++++++++++++++++++++++++++++++++++
 hw/arm/boot.c                       |  13 +++
 hw/core/machine.c                   |  27 +++++
 hw/misc/Makefile.objs               |   1 +
 hw/misc/sdm-signal-shboot.c         |  62 +++++++++++
 include/hw/boards.h                 |   2 +
 include/hw/misc/sdm-signal-shboot.h |  38 +++++++
 include/migration/migration.h       |   2 +
 include/sysemu/hostmem-shared.h     |  66 ++++++++++++
 migration/Makefile.objs             |   2 +-
 migration/migration.c               |   2 +
 migration/shared.c                  |  33 ++++++
 numa.c                              |  17 +++-
 qemu-options.hx                     |   5 +-
 util/qemu-config.c                  |   5 +
 16 files changed, 471 insertions(+), 4 deletions(-)
 create mode 100644 backends/hostmem-shared.c
 create mode 100644 hw/misc/sdm-signal-shboot.c
 create mode 100644 include/hw/misc/sdm-signal-shboot.h
 create mode 100644 include/sysemu/hostmem-shared.h
 create mode 100644 migration/shared.c

-- 
2.7.3

             reply	other threads:[~2016-03-18  9:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18  9:13 Baptiste Reynal [this message]
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 1/6] backend: shared memory backend Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 2/6] migration: add shared migration type Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 3/6] hw/misc: sdm signal shboot Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 4/6] qemu: slave machine flag Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 5/6] hw/arm: boot Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 6/6] qemu: numa Baptiste Reynal
2016-03-22 14:14 ` [Qemu-devel] [RFC v2 0/6] QEMU shared-memory backend Markus Armbruster
2016-03-22 14:54   ` Baptiste Reynal
2016-04-07 16:27     ` Markus Armbruster
2016-04-08 12:52       ` Baptiste Reynal
2016-04-08 13:59         ` Markus Armbruster
2016-03-31  9:14 ` Stefan Hajnoczi
2016-04-05 12:00   ` Baptiste Reynal
2016-04-06  8:57     ` Stefan Hajnoczi
2016-04-06 13:47       ` Igor Mammedov
2016-04-08 12:46         ` Baptiste Reynal

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=1458292438-13909-1-git-send-email-b.reynal@virtualopensystems.com \
    --to=b.reynal@virtualopensystems.com \
    --cc=Claudio.Fontana@huawei.com \
    --cc=Jani.Kokkonen@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tech@virtualopensystems.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).