Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp460111rwi; Thu, 20 Oct 2022 00:35:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7AuGWwhmeKPXxpwXVU5vew9F+YdHR9XA7iWkr4+DsAsiIxQ1iXd4ulf7miYLEaKJuvLchr X-Received: by 2002:a17:907:c18:b0:78d:8577:7c30 with SMTP id ga24-20020a1709070c1800b0078d85777c30mr9301149ejc.413.1666251355445; Thu, 20 Oct 2022 00:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666251355; cv=none; d=google.com; s=arc-20160816; b=PLh6CVbfwP9NqRt3mx9140RwyuU9zZn2brm8LfI8YtgHrcXO1G2gN6EacP8/jIXfzM BhrA4zorBPUHygHis8crOa6n3Zm9ARoXyqUVlDasOdoDz2xI7wscKRHwMZIlQruGjaYi FiE0w7kHdp1yfmluhp9YLvozLb5Tlu5FPSblmRSJqVc7Szi8hVPfMIeWSOzDDcji1DvG pXhH2WAKkoQzfhInw+Nn3s/jHxX9Y4Adn8F+XlVAs8+22EX1mR2IZB1hYfwdnW+0xdJ1 yqltVPuAoXP7sI/wYNF0DzDpirnQiise0JEiVM7ACvfl/cG3b7UcSZYl1xaXoTyozgnx ke6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iSbqsg4g0J+uDTur4nOLOrDlqWhjBL7zIdyxmPl56wI=; b=mS5hUNZgDOiNFKP3SpDwBsOb+DWGNP5MLda8m4cZzAoKr4JhVxNn9KALwvkPAdCxsY M/35ttkCMkRHx3M21XyvehGAkvCsnBSRcC583rcpkIXcgCsb//69PcOAUZa9IpJ8123S T1FopptJCf+tNW6WitklpijqXO0tM+P1VXbB0IDZIV9t5gaVEB9BKS3c11cr5UGXCn57 segcMaqMP6+LBmcn6cnciRYxlmfi3JelrGNZAw59Mi7uSwJmiJ8x0GQTsrYB4Nt+16UB jFcNaap5s+yMvucCnJgSIT2Qo/Zmgw2qkBU2ZERib2TiZmBO3CvCZYLz9ObI2hKHJ8hE 2I7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JBb5P3wS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr11-20020a170907720b00b00783afe864c6si18127661ejc.124.2022.10.20.00.35.27; Thu, 20 Oct 2022 00:35:55 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JBb5P3wS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbiJTHMy (ORCPT + 99 others); Thu, 20 Oct 2022 03:12:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbiJTHMv (ORCPT ); Thu, 20 Oct 2022 03:12:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08335159A23 for ; Thu, 20 Oct 2022 00:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666249968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iSbqsg4g0J+uDTur4nOLOrDlqWhjBL7zIdyxmPl56wI=; b=JBb5P3wSgMJfLi30+oCzV1VB7373nMV1LjGrmE5PySTrSnLcUDznAXSMJLqhevPvEPh+04 y9A3rU8jSCrwd9X1/MrTdg+TqatO0kLy92WBGYgB92zwUCbJgd23V29Mxkv7XwDMvelXwS IOiTvgrqdg7L/pfQiPWFlt8kj0dfamk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-Va38NGliOg6Us14EzfvzXA-1; Thu, 20 Oct 2022 03:12:44 -0400 X-MC-Unique: Va38NGliOg6Us14EzfvzXA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C45BE101A52A; Thu, 20 Oct 2022 07:12:43 +0000 (UTC) Received: from gshan.redhat.com (vpn2-54-70.bne.redhat.com [10.64.54.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7703C40C6EC2; Thu, 20 Oct 2022 07:12:38 +0000 (UTC) From: Gavin Shan To: kvmarm@lists.linux.dev Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mail@maciej.szmigiero.name, maz@kernel.org, pbonzini@redhat.com, ajones@ventanamicro.com, shuah@kernel.org, peterx@redhat.com, oliver.upton@linux.dev, seanjc@google.com, ricarkol@google.com, zhenyzha@redhat.com, shan.gavin@gmail.com Subject: [PATCH v3 0/6] KVM: selftests: memslot_perf_test: aarch64 cleanup/fixes Date: Thu, 20 Oct 2022 15:12:03 +0800 Message-Id: <20221020071209.559062-1-gshan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 kvm/selftests/memslots_perf_test doesn't work with 64KB-page-size-host and 4KB-page-size-guest on aarch64. In the implementation, the host and guest page size have been hardcoded to 4KB. It's ovbiously not working on aarch64 which supports 4KB, 16KB, 64KB individually on host and guest. This series tries to fix it. After the series is applied, the test runs successfully with 64KB-page-size-host and 4KB-page-size-guest. # ./memslots_perf_tests -v -s 512 Since we're here, the code is cleaned up a bit as PATCH[1-3] do. The other patches are fixes to handle the mismatched host/guest page sized. v1: https://lore.kernel.org/kvmarm/20221014071914.227134-1-gshan@redhat.com/T/#t v2: https://lore.kernel.org/kvmarm/20221018040454.405719-1-gshan@redhat.com/T/#t Changelog ========= v3: * Improved comments about MEM_TEST_MOVE_SIZE, which is set to 64KB in PATCH[v3 4/6] and finally fixed to 192KB in PATCH[v3 5/6]. (Maciej) * Use size instead of pages to do the comparison in test_memslot_move_prepare() (Maciej) * Use tools/include/linux/sizes.h instead of inventing our own macros. (Oliver) v2: * Pick the smaller value between the ones specified by user or probed from KVM_CAP_NR_MEMSLOTS in PATCH[v2 3/6] (Maciej) * Improved comments about MEM_TEST_MOVE_SIZE in PATCH[v2 4/6] (Maciej) * Avoid mismatched guest page size after VM is started in prepare_vm() in PATCH[v2 4/6] (Maciej) * Fix condition to check MEM_TEST_{UNMAP, UNMAP_CHUNK}_SIZE in check_memory_size() in PATCH[v2 4/6] (Maciej) * Define base and huge page size in kvm_util_base.h in PATCH[v2 5/6] (Sean) * Add checks on host/guest page size in check_memory_size() and fail early if any of them exceeds 64KB in PATCH[v2 5/6] (Maciej) Gavin Shan (6): KVM: selftests: memslot_perf_test: Use data->nslots in prepare_vm() KVM: selftests: memslot_perf_test: Consolidate loop conditions in prepare_vm() KVM: selftests: memslot_perf_test: Probe memory slots for once KVM: selftests: memslot_perf_test: Support variable guest page size KVM: selftests: memslot_perf_test: Consolidate memory KVM: selftests: memslot_perf_test: Report optimal memory slots .../testing/selftests/kvm/memslot_perf_test.c | 317 ++++++++++++------ 1 file changed, 208 insertions(+), 109 deletions(-) -- 2.23.0