Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1789808pxb; Wed, 10 Feb 2021 17:35:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSiRVAr2KZHFov3/vYJSU0PLHSHPxBvIzUp7EZHPbzoz9ICeFawY+jFbexWj/BllVJ/BfW X-Received: by 2002:aa7:c80a:: with SMTP id a10mr5850768edt.141.1613007338399; Wed, 10 Feb 2021 17:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613007338; cv=none; d=google.com; s=arc-20160816; b=K5X9cWyeXN18pNqA6mDeZ/M6MvezDOfnfZuZpsX6N/QKRvuJzk/vtE51YtDbFKgjch xX1g4hETJlBdF237jNwHYLM8bmsEdRMqHnhL+5F3gfi3LOwykYgjhnhrx8UiZ+txXUWa Uy/L1b2Vpdkleu45pFUoqIF4qqjxQ/wzr269maKxOStmqqGhjYpIQXz7/mN/cNha94Jw 6uG7DdCur8iW0NyxjAaQAWFfubUmDtiTZXxBoR/0ObeCx24NDBSZFxaGGaGw05Be8vuP FXajKbaKURo66X/BPyJhmGx9gvVMNIIeQkRnZLnavKL74qw8GCFtOHKO+O4R6sSKfMRI YZag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZX7gml4kCnX4JimWReE5M7FOebZs0Y/94tKJJjoRbEg=; b=exAKKKc9VKoxL+rvA6njMgN+7r3dbGFnDa5aEISEX5H/EcI/vBhh3dMhaKwpYsYQ3/ xMLObPoPjEtoNX73enmaZG1bqNtRUJpqPAiNx182lzHr/Y6JSP7H9PnLxkaeFkxLkcmI 7unlepXPhIuesySOwz/WQ2IAdrhJ/iuxW6A62S3D2CG1ClxMZB/f7UPRRcnGzw0dLYcH ep58h1WdZ+MeIb6tOIotNewPVpspbfAwefOblMahNLzMSNeH62/QScvtf/c2VAB770wP T9K0nQ50CXdOON+E/tizl7/kUaVgZyvAiaeQCRVAwVeGO8ZO/SwF1+fQewHMdCD2OkBm 8MUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=P+QcvpNH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si2929077ejl.444.2021.02.10.17.35.14; Wed, 10 Feb 2021 17:35:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=P+QcvpNH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbhBKBdr (ORCPT + 99 others); Wed, 10 Feb 2021 20:33:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229972AbhBKBdp (ORCPT ); Wed, 10 Feb 2021 20:33:45 -0500 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB3D6C06174A for ; Wed, 10 Feb 2021 17:33:04 -0800 (PST) Received: by mail-il1-x129.google.com with SMTP id q5so3714472ilc.10 for ; Wed, 10 Feb 2021 17:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZX7gml4kCnX4JimWReE5M7FOebZs0Y/94tKJJjoRbEg=; b=P+QcvpNHYJkwMopzAEZZFNujBRIkjXbjlnMcK1eu3ZYSAAgAx2YmRFKQxFBZFMkGdw dOKTidi7+ZgfkZrtkWhSfBq7IxOWNTmBSa1PLRgtVJYa2b1J5qlsp50RpRCHnghlvA24 obmp0RzQpaX21TBTTm25gZ8EkLaZs82f3nTUUn0yP9GeY39OhOZ2iYpUyLRULaY8hTwh BdVZzeWyW9cg/KaJDJ5zfAWVl0+UrowQSOGY2seV3++4jfeXm8vjLLLXqAqJIjJ4m1NI PatVxPXAgP3GDMJS5y0sN1I2TjIXbOSAPbitKtGvFpAYMmsb1A/e5dvbpVoBtmdVEfKH JqNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZX7gml4kCnX4JimWReE5M7FOebZs0Y/94tKJJjoRbEg=; b=IxTjXHO9EOVohlCVtNqkEmToIgpNG5HHlh+KYHN6MU1Ect2zRQw1n4oSL44kAoFCRq 4ASLLFhXEry5FP+9tHSGESbYsww61e989RwhFJUMt0bnfWoLsuFISEEEGjIE+txrdVI9 42QVPeFJ+DpvvmRkUNrKetOZTzAW3wXts2x1Qi2OIhz3+9oLFTCoBxiqjfJCviBeF55J 36zd2UtKPx8aLo1KMUGHe2RgX/hAUCnQkq05sM6TccoladC5GZvVmJXxJH0eIY1Vp8RC sryaoDtMY/D5yQf34XpC1d/9HIB2yLgibLm8YRpwv4YFhv08r6YxhkWsUZnWhac8yjtl Oe0Q== X-Gm-Message-State: AOAM530mQA5ApvkEKjv/6ah5ku5EmPMqL/woumHccB+NYs/dQrGs9bGT lJuzkduk59EaP1q951sFHd/7QT0QaVxOBT8/fI7fPA== X-Received: by 2002:a92:c54e:: with SMTP id a14mr1209089ilj.285.1613007184233; Wed, 10 Feb 2021 17:33:04 -0800 (PST) MIME-Version: 1.0 References: <20210210230625.550939-1-seanjc@google.com> <20210210230625.550939-12-seanjc@google.com> In-Reply-To: <20210210230625.550939-12-seanjc@google.com> From: Ben Gardon Date: Wed, 10 Feb 2021 17:32:53 -0800 Message-ID: Subject: Re: [PATCH 11/15] KVM: selftests: Create VM with adjusted number of guest pages for perf tests To: Sean Christopherson Cc: Paolo Bonzini , kvm , LKML , Yanan Wang , Andrew Jones , Peter Xu , Aaron Lewis Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 3:06 PM Sean Christopherson wrote: > > Use the already computed guest_num_pages when creating the so called > extra VM pages for a perf test, and add a comment explaining why the > pages are allocated as extra pages. > > Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon > --- > tools/testing/selftests/kvm/lib/perf_test_util.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/tools/testing/selftests/kvm/lib/perf_test_util.c b/tools/testing/selftests/kvm/lib/perf_test_util.c > index 982a86c8eeaa..9b0cfdf10772 100644 > --- a/tools/testing/selftests/kvm/lib/perf_test_util.c > +++ b/tools/testing/selftests/kvm/lib/perf_test_util.c > @@ -71,9 +71,12 @@ struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int vcpus, > TEST_ASSERT(vcpu_memory_bytes % pta->guest_page_size == 0, > "Guest memory size is not guest page size aligned."); > > - vm = vm_create_with_vcpus(mode, vcpus, > - (vcpus * vcpu_memory_bytes) / pta->guest_page_size, > - 0, guest_code, NULL); > + /* > + * Pass guest_num_pages to populate the page tables for test memory. > + * The memory is also added to memslot 0, but that's a benign side > + * effect as KVM allows aliasing HVAs in memslots. > + */ > + vm = vm_create_with_vcpus(mode, vcpus, 0, guest_num_pages, guest_code, NULL); > pta->vm = vm; > > /* > -- > 2.30.0.478.g8a0d178c01-goog >