From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 950827F for ; Mon, 17 Oct 2022 21:36:15 +0000 (UTC) Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1okXmL-0001p3-Ku; Mon, 17 Oct 2022 23:36:09 +0200 Message-ID: Date: Mon, 17 Oct 2022 23:36:04 +0200 Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Content-Language: en-US, pl-PL To: Gavin Shan Cc: kvmarm@lists.cs.columbia.edu, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, ajones@ventanamicro.com, pbonzini@redhat.com, maz@kernel.org, shuah@kernel.org, oliver.upton@linux.dev, seanjc@google.com, peterx@redhat.com, ricarkol@google.com, zhenyzha@redhat.com, shan.gavin@gmail.com References: <20221014071914.227134-1-gshan@redhat.com> <20221014071914.227134-6-gshan@redhat.com> From: "Maciej S. Szmigiero" Subject: Re: [PATCH 5/6] KVM: selftests: memslot_perf_test: Consolidate memory sizes In-Reply-To: <20221014071914.227134-6-gshan@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <20221017213604.3ciAqLQKsrKUTLQKp_vRGCr2lBh17jvYCqyMkc_rPS8@z> 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 > --- > .../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 > #include > > -#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