Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Alexandru Elisei <alexandru.elisei@arm.com>,
	will@kernel.org, julien.thierry.kdev@gmail.com, maz@kernel.org,
	julien@xen.org, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, james.morse@arm.com,
	andre.przywara@arm.com
Subject: Re: [PATCH v4 kvmtool 00/12] arm64: Allow the user to set RAM base address
Date: Tue, 21 Jun 2022 18:03:22 +0100	[thread overview]
Message-ID: <f085b553-da9b-553f-17e2-1f4c43b25271@arm.com> (raw)
In-Reply-To: <20220616134828.129006-1-alexandru.elisei@arm.com>

On 16/06/2022 14:48, Alexandru Elisei wrote:
> The series can be found at [1]. It is loosely based on the patches that
> allow the user to define the VM memory layout (RAM + MMIO) [2]. I've
> cherry-picked a handful of patches from that series, the rest I wrote from
> scratch since there have been several changes to the way guest memory is
> handled. I've chosen to focus on specifying the RAM layout with only one
> RAM bank and leave the rest for a later series because this was relatively
> easy to accomplish, while still being very useful.
> 
> What this series does: for arm64, the user can now specify the base address
> for RAM:
> 
> $ ./lkvm run -m1G@2G .. # Equivalent to ./lkvm run -m1024
> 
> The memory units are B (bytes), K (kilobytes), M (megabytes), G
> (gigabytes), T (terrabytes), P (petabytes). Lowercase is also valid.
> 
> Want to put RAM at the top of the physical address range? Easy:
> 
> $ ./lkvm run -m2G@1022G .. # Assumes the maximum is 40 bits of IPA
> 
> There one limitation on the RAM base address: it must not overlap with the
> MMIO range that kvmtool uses for arm/arm64, which lives below 2GB.
> 
> Why this is useful, in my opinion:
> 
> 1. Testing how a payload handles different memory layouts without the need
> to hack kvmtool or find the hardware that implements the desired layout.
> 
> 2. It can serve as a development tool for adding support for larger PA
> ranges for Linux and KVM (currently capped at 48 bits for 4k/16k pages), or
> other payloads.
> 
> Summary of the series
> ======================
> 
> * The series starts with refactoring how kvm->cfg.ram_size is validated
>    and used, followed by several cleanups in the arm and arm64 code.
> 
> * Then patch #8 ("builtin_run: Allow standard size specifiers for memory")
>    introduced the ability to specify the measurement unit for memory. I
>    believe that typing the equivalent of 2TB in megabytes isn't appealing
>    for anyone.
> 
> * More cleanups in the arm/arm64 code follow, which are needed for patch
>    #12 ("arm64: Allow the user to specify the RAM base address"). This is
>    where the ability to specify the RAM base address is introduced.
> 
> Testing
> =======
> 
> Same testing as before:
> 
> - Build tested each patch for all architectures.
> 
> - Ran an x86 kernel with and without setting the amount of RAM using the
>    memory specifiers; tested that setting the RAM address results in an
>    error.
> 
> - Ran an arm64 kernel without setting the size, with setting the size and
>    with setting the size and address; tried different addresses (2G, 3G,
>    256G); also tested that going below 2G or above the maximum IPA correctly
>    results in an error.
> 
> - Ran all arm64 kvm-unit-test tests with similar combinations of memory
>    size and address (instead of 256G I used 128G, as that's where I/O lives
>    for qemu and kvm-unit-tests maps that unconditionally as I/O).
> 
> - Ran all 32bit arm tests on an arm64 host with various combinations of
>    memory size and address (base address at 2G and 2.5G only due to a
>    limitation in the way the tests are set up).

I have tested this series on arm64 Fast model, with memory placed from
32bit to 48bit IPA and it works well.

For the series:

Reviewed-and-Tested-by: Suzuki K Poulose <suzuki.poulose@arm.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-06-21 17:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 13:48 [PATCH v4 kvmtool 00/12] arm64: Allow the user to set RAM base address Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 01/12] Use MB for megabytes consistently Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 02/12] builtin-run: Always use RAM size in bytes Alexandru Elisei
2022-06-16 17:07   ` Andre Przywara
2022-06-16 13:48 ` [PATCH v4 kvmtool 03/12] builtin-run: Rework RAM size validation Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 04/12] builtin-run: Add arch hook to validate VM configuration Alexandru Elisei
2022-06-16 17:07   ` Andre Przywara
2022-06-16 13:48 ` [PATCH v4 kvmtool 05/12] arm/arm64: Fail if RAM size is too large for 32-bit guests Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 06/12] arm/arm64: Kill the ARM_MAX_MEMORY() macro Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 07/12] arm/arm64: Kill the ARM_HIMAP_MAX_MEMORY() macro Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 08/12] builtin_run: Allow standard size specifiers for memory Alexandru Elisei
2022-06-16 17:10   ` Andre Przywara
2022-06-16 13:48 ` [PATCH v4 kvmtool 09/12] kvm__arch_init: Remove hugetlbfs_path and ram_size as parameters Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 10/12] arm/arm64: Consolidate RAM initialization in kvm__init_ram() Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 11/12] Introduce kvm__arch_default_ram_address() Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 12/12] arm64: Allow the user to specify the RAM base address Alexandru Elisei
2022-06-21 17:03 ` Suzuki K Poulose [this message]
2022-06-22  9:27   ` [PATCH v4 kvmtool 00/12] arm64: Allow the user to set " Alexandru Elisei
2022-07-01 15:41 ` Will Deacon

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=f085b553-da9b-553f-17e2-1f4c43b25271@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=alexandru.elisei@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=julien@xen.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=will@kernel.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