[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cebafa0d-a2dc-c3f7-64c8-2637a254e3d0@maciej.szmigiero.name>
Date: Mon, 17 Oct 2022 23:36:04 +0200
From: "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>
To: Gavin Shan <gshan@...hat.com>
Cc: kvmarm@...ts.cs.columbia.edu, kvmarm@...ts.linux.dev,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
ajones@...tanamicro.com, pbonzini@...hat.com, maz@...nel.org,
shuah@...nel.org, oliver.upton@...ux.dev, seanjc@...gle.com,
peterx@...hat.com, ricarkol@...gle.com, zhenyzha@...hat.com,
shan.gavin@...il.com
Subject: Re: [PATCH 5/6] KVM: selftests: memslot_perf_test: Consolidate memory
sizes
On 14.10.2022 09:19, Gavin Shan wrote:
> The addresses and sizes passed to madvise() and vm_userspace_mem_region_add()
> should be aligned to host page size, which can be 64KB on aarch64. So it's
> wrong by passing additional fixed 4KB memory area to various tests.
>
> Fix it by passing additional fixed 64KB memory area to various tests. After
> it's applied, the following command works fine on 64KB-page-size-host and
> 4KB-page-size-guest.
>
> # ./memslot_perf_test -v -s 512
>
> Signed-off-by: Gavin Shan <gshan@...hat.com>
> ---
> .../testing/selftests/kvm/memslot_perf_test.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
> index d587bd952ff9..e6d34744b45d 100644
> --- a/tools/testing/selftests/kvm/memslot_perf_test.c
> +++ b/tools/testing/selftests/kvm/memslot_perf_test.c
> @@ -25,12 +25,14 @@
> #include <kvm_util.h>
> #include <processor.h>
>
> -#define MEM_SIZE ((512U << 20) + 4096)
> -#define MEM_GPA 0x10000000UL
> +#define MEM_EXTRA_SIZE 0x10000
So the biggest page size supported right now is 64 KiB - it would be
good to have an assert somewhere to explicitly check for this
(regardless of implicit checks present in other calculations).
Also, an expression like "(64 << 10)" is more readable than a "1"
with a tail of zeroes (it's easy to add one zero too many or be one
zero short).
Thanks,
Maciej
Powered by blists - more mailing lists