Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5046315rwi; Mon, 17 Oct 2022 14:46:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kU1dV51HbVNoZSyArgCKvHRoItGKoDict2SCwv5FCYmGIHJcZHH7RnuY0+Pn9nmSaZ5CA X-Received: by 2002:a05:6a00:22cf:b0:563:9633:298c with SMTP id f15-20020a056a0022cf00b005639633298cmr14449272pfj.54.1666043192953; Mon, 17 Oct 2022 14:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666043192; cv=none; d=google.com; s=arc-20160816; b=hkTBtGxNN1rDwiVz9XKyf7plVpnXaJUVwamZHcUPH1GTd58Xi/aR3jVKNxbzo7TErk 7nNDc3J69ablVTpBvEkc9r+P+5dg1Hq4vKzA49QtRG+naZFXJr1g1q6u8aY25rQDNyKT jang8LlIwaut2cQ4WwiC7WCurHfW7M836RB2X0Fjg283fn9rMqnonO2wFBYYdva2jZrT rnZ/twap1+C62pwWjQXvzkLiji4AjKlVVX+TdxgWPI0veD3wHPnEUsfmkhms8a0pOosC So8YSgTIMr2Ic6g+rvkc8CYJcyKG7CI2QIAWR0p/u0AYOVrSIc6AiX8JRtvLNxfyPLYS nYMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=qmnebhorrpJtpONjM2T+2qOoQRt3JadKHsfz8EHovSQ=; b=LWjwEYlraTOC9cLKvYvhpk0mS79xVSz9bNmzlQOXaM+yg55QkM5Zc9hEmV5xWTN/X5 O3A2i949YtgNwMX7rC0/XPN+2oXFGpFN0+9Z5/zSOpZ8V0B36ZQ4k0Tk5JbhAPnsORos GIQRHlJSh0P8/U6htAHNHpHct1C2SpMDT4HWrN7CbfDQ6MobA8P8w1qpCLXZUckGbUDN iV0BDDHBj8fwjnbLhEoGF963vpdGHRrbPqiUS/Vepp2Qiep82x5nN69PN9/wv0acCScA T/0G6JUAcPpQ2lD2VOiN2nxDfB72RzRsMi4mYww4UqAt71Nl6stTcYnnGLHqS6O7ZuFY W7MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020a056a0016cc00b005281e5606b2si13498486pfc.32.2022.10.17.14.46.20; Mon, 17 Oct 2022 14:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbiJQVpA (ORCPT + 99 others); Mon, 17 Oct 2022 17:45:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbiJQVoh (ORCPT ); Mon, 17 Oct 2022 17:44:37 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8A1A8049C; Mon, 17 Oct 2022 14:36:17 -0700 (PDT) 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 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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