All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron via <qemu-arm@nongnu.org>
To: Gavin Shan <gshan@redhat.com>
Cc: <qemu-arm@nongnu.org>, <qemu-devel@nongnu.org>,
	<david@redhat.com>, <eric.auger@redhat.com>, <drjones@redhat.com>,
	<imammedo@redhat.com>, <peter.maydell@linaro.org>,
	<richard.henderson@linaro.org>, <shan.gavin@gmail.com>
Subject: Re: [PATCH v2 0/2] hw/arm/virt: Support for virtio-mem-pci
Date: Fri, 3 Dec 2021 14:10:58 +0000	[thread overview]
Message-ID: <20211203141058.00006079@Huawei.com> (raw)
In-Reply-To: <20211203033522.27580-1-gshan@redhat.com>

On Fri,  3 Dec 2021 11:35:20 +0800
Gavin Shan <gshan@redhat.com> wrote:

> This series supports virtio-mem-pci device, by simply following the
> implementation on x86. The exception is the block size is 512MB on
> ARM64 instead of 128MB on x86, compatible with the memory section
> size in linux guest.
> 
> The work was done by David Hildenbrand and then Jonathan Cameron. I'm
> taking the patch and putting more efforts, which is all about testing
> to me at current stage.

Hi Gavin,

Thanks for taking this forwards.  What you have here looks good to me, but
I've not looked at this for a while, so I'll go with whatever David and
others say :)

Jonathan

> 
> Testing
> =======
> The upstream linux kernel (v5.16.rc3) is used on host/guest during
> the testing. The guest kernel includes changes to enable virtio-mem
> driver, which is simply to enable CONFIG_VIRTIO_MEM on ARM64.
> 
> Mutiple combinations like page sizes on host/guest, memory backend
> device etc are covered in the testing. Besides, migration is also
> tested. The following command lines are used for VM or virtio-mem-pci
> device hot-add. It's notable that virtio-mem-pci device hot-remove
> isn't supported, similar to what we have on x86. 
> 
>   host.pgsize  guest.pgsize  backend    hot-add  hot-remove  migration
>   ---------------------------------------------------------------------
>    4KB         4KB           normal     ok       ok          ok
>                              THP        ok       ok          ok
>                              hugeTLB    ok       ok          ok
>    4KB         64KB          normal     ok       ok          ok
>                              THP        ok       ok          ok
>                              hugeTLB    ok       ok          ok
>   64KB         4KB           normal     ok       ok          ok
>                              THP        ok       ok          ok
>                              hugeTLB    ok       ok          ok
>   64KB         64KB          normal     ok       ok          ok
>                              THP        ok       ok          ok
>                              hugeTLB    ok       ok          ok
> 
> The command lines are used for VM. When hugeTLBfs is used, all memory
> backend objects are popuated on /dev/hugepages-2048kB or
> /dev/hugepages-524288kB, depending on the host page sizes.
> 
>   /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64                       \
>   -accel kvm -machine virt,gic-version=host                                     \
>   -cpu host -smp 4,sockets=2,cores=2,threads=1                                  \
>   -m 1024M,slots=16,maxmem=64G                                                  \
>   -object memory-backend-ram,id=mem0,size=512M                                  \
>   -object memory-backend-ram,id=mem1,size=512M                                  \
>   -numa node,nodeid=0,cpus=0-1,memdev=mem0                                      \
>   -numa node,nodeid=1,cpus=2-3,memdev=mem1                                      \
>      :
>   -kernel /home/gavin/sandbox/linux.guest/arch/arm64/boot/Image                 \
>   -initrd /home/gavin/sandbox/images/rootfs.cpio.xz                             \
>   -append earlycon=pl011,mmio,0x9000000                                         \
>   -device pcie-root-port,bus=pcie.0,chassis=1,id=pcie.1                         \
>   -device pcie-root-port,bus=pcie.0,chassis=2,id=pcie.2                         \
>   -device pcie-root-port,bus=pcie.0,chassis=3,id=pcie.3                         \
>   -object memory-backend-ram,id=vmem0,size=512M                                 \
>   -device virtio-mem-pci,id=vm0,bus=pcie.1,memdev=vmem0,node=0,requested-size=0 \
>   -object memory-backend-ram,id=vmem1,size=512M                                 \
>   -device virtio-mem-pci,id=vm1,bus=pcie.2,memdev=vmem1,node=1,requested-size=0 
> 
> Command lines used for memory hot-add and hot-remove:
> 
>   (qemu) qom-set vm1 requested-size 512M
>   (qemu) qom-set vm1 requested-size 0
>   (qemu) qom-set vm1 requested-size 512M
> 
> Command lines used for virtio-mem-pci device hot-add:
> 
>   (qemu) object_add memory-backend-ram,id=hp-mem1,size=512M
>   (qemu) device_add virtio-mem-pci,id=hp-vm1,bus=pcie.3,memdev=hp-mem1,node=1
>   (qemu) qom-set hp-vm1 requested-size 512M
>   (qemu) qom-set hp-vm1 requested-size 0
>   (qemu) qom-set hp-vm1 requested-size 512M
> 
> Changelog
> =========
> v2:
>   * Include David/Jonathan as co-developers in the commit log           (David)
>   * Decrease VIRTIO_MEM_USABLE_EXTENT to 512MB on ARM64 in PATCH[1/2]   (David)
>   * PATCH[2/2] is added to correct the THP sizes on ARM64               (David)
> 
> Gavin Shan (2):
>   hw/arm/virt: Support for virtio-mem-pci
>   virtio-mem: Correct default THP size for ARM64
> 
>  hw/arm/Kconfig         |  1 +
>  hw/arm/virt.c          | 68 +++++++++++++++++++++++++++++++++++++++++-
>  hw/virtio/virtio-mem.c | 36 ++++++++++++++--------
>  3 files changed, 91 insertions(+), 14 deletions(-)
> 


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Gavin Shan <gshan@redhat.com>
Cc: <qemu-arm@nongnu.org>, <qemu-devel@nongnu.org>,
	<david@redhat.com>, <eric.auger@redhat.com>, <drjones@redhat.com>,
	<imammedo@redhat.com>, <peter.maydell@linaro.org>,
	<richard.henderson@linaro.org>, <shan.gavin@gmail.com>
Subject: Re: [PATCH v2 0/2] hw/arm/virt: Support for virtio-mem-pci
Date: Fri, 3 Dec 2021 14:10:58 +0000	[thread overview]
Message-ID: <20211203141058.00006079@Huawei.com> (raw)
In-Reply-To: <20211203033522.27580-1-gshan@redhat.com>

On Fri,  3 Dec 2021 11:35:20 +0800
Gavin Shan <gshan@redhat.com> wrote:

> This series supports virtio-mem-pci device, by simply following the
> implementation on x86. The exception is the block size is 512MB on
> ARM64 instead of 128MB on x86, compatible with the memory section
> size in linux guest.
> 
> The work was done by David Hildenbrand and then Jonathan Cameron. I'm
> taking the patch and putting more efforts, which is all about testing
> to me at current stage.

Hi Gavin,

Thanks for taking this forwards.  What you have here looks good to me, but
I've not looked at this for a while, so I'll go with whatever David and
others say :)

Jonathan

> 
> Testing
> =======
> The upstream linux kernel (v5.16.rc3) is used on host/guest during
> the testing. The guest kernel includes changes to enable virtio-mem
> driver, which is simply to enable CONFIG_VIRTIO_MEM on ARM64.
> 
> Mutiple combinations like page sizes on host/guest, memory backend
> device etc are covered in the testing. Besides, migration is also
> tested. The following command lines are used for VM or virtio-mem-pci
> device hot-add. It's notable that virtio-mem-pci device hot-remove
> isn't supported, similar to what we have on x86. 
> 
>   host.pgsize  guest.pgsize  backend    hot-add  hot-remove  migration
>   ---------------------------------------------------------------------
>    4KB         4KB           normal     ok       ok          ok
>                              THP        ok       ok          ok
>                              hugeTLB    ok       ok          ok
>    4KB         64KB          normal     ok       ok          ok
>                              THP        ok       ok          ok
>                              hugeTLB    ok       ok          ok
>   64KB         4KB           normal     ok       ok          ok
>                              THP        ok       ok          ok
>                              hugeTLB    ok       ok          ok
>   64KB         64KB          normal     ok       ok          ok
>                              THP        ok       ok          ok
>                              hugeTLB    ok       ok          ok
> 
> The command lines are used for VM. When hugeTLBfs is used, all memory
> backend objects are popuated on /dev/hugepages-2048kB or
> /dev/hugepages-524288kB, depending on the host page sizes.
> 
>   /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64                       \
>   -accel kvm -machine virt,gic-version=host                                     \
>   -cpu host -smp 4,sockets=2,cores=2,threads=1                                  \
>   -m 1024M,slots=16,maxmem=64G                                                  \
>   -object memory-backend-ram,id=mem0,size=512M                                  \
>   -object memory-backend-ram,id=mem1,size=512M                                  \
>   -numa node,nodeid=0,cpus=0-1,memdev=mem0                                      \
>   -numa node,nodeid=1,cpus=2-3,memdev=mem1                                      \
>      :
>   -kernel /home/gavin/sandbox/linux.guest/arch/arm64/boot/Image                 \
>   -initrd /home/gavin/sandbox/images/rootfs.cpio.xz                             \
>   -append earlycon=pl011,mmio,0x9000000                                         \
>   -device pcie-root-port,bus=pcie.0,chassis=1,id=pcie.1                         \
>   -device pcie-root-port,bus=pcie.0,chassis=2,id=pcie.2                         \
>   -device pcie-root-port,bus=pcie.0,chassis=3,id=pcie.3                         \
>   -object memory-backend-ram,id=vmem0,size=512M                                 \
>   -device virtio-mem-pci,id=vm0,bus=pcie.1,memdev=vmem0,node=0,requested-size=0 \
>   -object memory-backend-ram,id=vmem1,size=512M                                 \
>   -device virtio-mem-pci,id=vm1,bus=pcie.2,memdev=vmem1,node=1,requested-size=0 
> 
> Command lines used for memory hot-add and hot-remove:
> 
>   (qemu) qom-set vm1 requested-size 512M
>   (qemu) qom-set vm1 requested-size 0
>   (qemu) qom-set vm1 requested-size 512M
> 
> Command lines used for virtio-mem-pci device hot-add:
> 
>   (qemu) object_add memory-backend-ram,id=hp-mem1,size=512M
>   (qemu) device_add virtio-mem-pci,id=hp-vm1,bus=pcie.3,memdev=hp-mem1,node=1
>   (qemu) qom-set hp-vm1 requested-size 512M
>   (qemu) qom-set hp-vm1 requested-size 0
>   (qemu) qom-set hp-vm1 requested-size 512M
> 
> Changelog
> =========
> v2:
>   * Include David/Jonathan as co-developers in the commit log           (David)
>   * Decrease VIRTIO_MEM_USABLE_EXTENT to 512MB on ARM64 in PATCH[1/2]   (David)
>   * PATCH[2/2] is added to correct the THP sizes on ARM64               (David)
> 
> Gavin Shan (2):
>   hw/arm/virt: Support for virtio-mem-pci
>   virtio-mem: Correct default THP size for ARM64
> 
>  hw/arm/Kconfig         |  1 +
>  hw/arm/virt.c          | 68 +++++++++++++++++++++++++++++++++++++++++-
>  hw/virtio/virtio-mem.c | 36 ++++++++++++++--------
>  3 files changed, 91 insertions(+), 14 deletions(-)
> 



  parent reply	other threads:[~2021-12-03 14:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  3:35 [PATCH v2 0/2] hw/arm/virt: Support for virtio-mem-pci Gavin Shan
2021-12-03  3:35 ` [PATCH v2 1/2] " Gavin Shan
2021-12-03 18:18   ` David Hildenbrand
2021-12-03 23:23     ` Gavin Shan
2021-12-03  3:35 ` [PATCH v2 2/2] virtio-mem: Correct default THP size for ARM64 Gavin Shan
2021-12-03 18:16   ` David Hildenbrand
2021-12-03 23:25     ` Gavin Shan
2021-12-03 14:10 ` Jonathan Cameron via [this message]
2021-12-03 14:10   ` [PATCH v2 0/2] hw/arm/virt: Support for virtio-mem-pci Jonathan Cameron via
2021-12-03 23:06   ` Gavin Shan

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=20211203141058.00006079@Huawei.com \
    --to=qemu-arm@nongnu.org \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=david@redhat.com \
    --cc=drjones@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=gshan@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shan.gavin@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.