Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1716111pxb; Wed, 10 Feb 2021 15:14:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxH9+uJklcQlZXh+uPXc77IxoeqdaUgtl4bnTb3C3mc42gDCk+4BzXkgD+OhBHcyD9pCfzw X-Received: by 2002:a17:906:2b15:: with SMTP id a21mr5354175ejg.338.1612998898091; Wed, 10 Feb 2021 15:14:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612998898; cv=none; d=google.com; s=arc-20160816; b=XTFC3roCHRZnJ6Ei06+DVQXXVvo2HWOFmPMdZixTxdRCI1LdJEMrSYdqkU7tkhaB7G MZVuL46gkQxEzMSB62s7Qzwj1Q93DlNb7U5NWSO48/ezhHQGII1IuDO2FMzxEhCSHgYj rUCVB8c0yNlGStPtUdy522Nj/ihtiFSmo5ESJpPmqj7IhY9jIaa8kyeuKQd17YWoJ6be DjrG4s6QJiYrYIfzYxzwYf1a3AXw7JL1i7CCvS8dQkQ7O3F09LxIQO0g3xAo9lgrZcXA xJwJjcQ4Oost9YvStoxc4lXXRFZ4xHIXss0dXyzYK/nALsYAkZmft5dYTrIBb3ekb6tl 3FjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:reply-to:sender:dkim-signature; bh=bqMGTJ5vOw+semy7dsWveGKT1K6fm5k0VBXJ6jv82pA=; b=fccnedcX30XF47sSaXVAlhvSzcSe5GnxtbAQpr4YvBzP/cCLLC/EKIngNIDGFwAT6v jkCPTBxadiS1SfsHatL3n0rJCRtr7g7NxmymGYlTQfoGh+p0Srk78UejUV6tqAAmh+xG A1oAYIqiDZoAAQ8nSXsF0lzaJsdm0O1NcA2Hui3pyaem0JRsLJlcW8o4sPH6yfPvI4NO z8IVlnauUBdltyliM/+30QjfwKNb5thxpi2Gj6Vz7FFDU6zlOMVUM51VMaTKYDyG5Zx6 bv2DtaKbQ74YhUZzB1efr6pk+hqws1CcW9ukSjLAnyyqhFwfnUpTnnZMtNeobM2KrVcG Kf/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DDPfRlAN; 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 hr24si1967468ejc.620.2021.02.10.15.14.34; Wed, 10 Feb 2021 15:14:58 -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=DDPfRlAN; 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 S233956AbhBJXJ7 (ORCPT + 99 others); Wed, 10 Feb 2021 18:09:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233861AbhBJXIA (ORCPT ); Wed, 10 Feb 2021 18:08:00 -0500 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05F9FC0617AA for ; Wed, 10 Feb 2021 15:06:49 -0800 (PST) Received: by mail-qv1-xf4a.google.com with SMTP id j4so2659272qvi.8 for ; Wed, 10 Feb 2021 15:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=bqMGTJ5vOw+semy7dsWveGKT1K6fm5k0VBXJ6jv82pA=; b=DDPfRlAN3/unXQuVAovsk/1lAj+LjkZkhNvYdbKLUODsxhaiN4I8Oe+oDNQDktWy03 ar7L13rV4vJTXc2WMNN353xkhag1VI84Fq8McGnYrSqH0/29qG06s4od94m7wsDVAAmc asS/uLUCm25RZQHKVBwLbCmqFkZv2UvKEHrrPhV7zUBtgR7WW4RnHvdbCZUleGIuvueY WKCs+49ZHXiHfJ1FUA0nwMQS091YhF9fXmlsM98rcDAFBU6J7VEqD6CvgyI2l7xnchJI 7xkPcSdZHR9Ka+0fHfTe2al7fCT0puVGB1FMkoc5qWPJgSYF5PcBZQUvK/bv/fUeRmiL BKGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=bqMGTJ5vOw+semy7dsWveGKT1K6fm5k0VBXJ6jv82pA=; b=ZjCACZjEvmdvtT9ovJu9V9jERIYrI0cA28k8WntTj3+CVGKDCVDP4E0+okPQWWH/bb 45w82lEfXERUWtBIUviNNmcLDJsSPZwyW3QDKRm2Mr1G1s2VMhwUV8mXivDWTzEUSGZv TMJBBr5glnlrZcot1NRn2x+60klV+qF7SogTwen72KBvboSqMbK3gyabvoY128Qa1ece PcuuiW6u2BEZF3J1/sXoa9DPyxfdcc28gGMwB5PeLYx8RDfbv2g/LKSDJix896PhWHi9 XCQZ5dd+v9aqVaPG3E8LIUF6i6arG8qLaYY8w1HukW+3xbrKQLtwAN9ARBgyM7sX/256 PnSw== X-Gm-Message-State: AOAM533/KlL+SITEO1Z9BsURsGrcFRJxzPY4n0/9lMz6uXkgkvEGyIz+ AAKvvoxtdHjiUC9Sw0ogAL2e20w4Z58= Sender: "seanjc via sendgmr" X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:f:10:11fc:33d:bf1:4cb8]) (user=seanjc job=sendgmr) by 2002:a0c:e5c9:: with SMTP id u9mr5391387qvm.55.1612998408158; Wed, 10 Feb 2021 15:06:48 -0800 (PST) Reply-To: Sean Christopherson Date: Wed, 10 Feb 2021 15:06:17 -0800 In-Reply-To: <20210210230625.550939-1-seanjc@google.com> Message-Id: <20210210230625.550939-8-seanjc@google.com> Mime-Version: 1.0 References: <20210210230625.550939-1-seanjc@google.com> X-Mailer: git-send-email 2.30.0.478.g8a0d178c01-goog Subject: [PATCH 07/15] KVM: selftests: Capture per-vCPU GPA in perf_test_vcpu_args From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson , Ben Gardon , 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 Capture the per-vCPU GPA in perf_test_vcpu_args so that tests can get the GPA without having to calculate the GPA on their own. No functional change intended. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/include/perf_test_util.h | 1 + tools/testing/selftests/kvm/lib/perf_test_util.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/kvm/include/perf_test_util.h b/tools/testing/selftests/kvm/include/perf_test_util.h index 005f2143adeb..4d53238b139f 100644 --- a/tools/testing/selftests/kvm/include/perf_test_util.h +++ b/tools/testing/selftests/kvm/include/perf_test_util.h @@ -18,6 +18,7 @@ #define PERF_TEST_MEM_SLOT_INDEX 1 struct perf_test_vcpu_args { + uint64_t gpa; uint64_t gva; uint64_t pages; diff --git a/tools/testing/selftests/kvm/lib/perf_test_util.c b/tools/testing/selftests/kvm/lib/perf_test_util.c index 73b0fccc28b9..f22ce1836547 100644 --- a/tools/testing/selftests/kvm/lib/perf_test_util.c +++ b/tools/testing/selftests/kvm/lib/perf_test_util.c @@ -127,7 +127,6 @@ void perf_test_setup_vcpus(struct kvm_vm *vm, int vcpus, bool partition_vcpu_memory_access) { struct perf_test_args *pta = &perf_test_args; - vm_paddr_t vcpu_gpa; struct perf_test_vcpu_args *vcpu_args; int vcpu_id; @@ -140,17 +139,17 @@ void perf_test_setup_vcpus(struct kvm_vm *vm, int vcpus, (vcpu_id * vcpu_memory_bytes); vcpu_args->pages = vcpu_memory_bytes / pta->guest_page_size; - vcpu_gpa = guest_test_phys_mem + - (vcpu_id * vcpu_memory_bytes); + vcpu_args->gpa = guest_test_phys_mem + + (vcpu_id * vcpu_memory_bytes); } else { vcpu_args->gva = guest_test_virt_mem; vcpu_args->pages = (vcpus * vcpu_memory_bytes) / pta->guest_page_size; - vcpu_gpa = guest_test_phys_mem; + vcpu_args->gpa = guest_test_phys_mem; } pr_debug("Added VCPU %d with test mem gpa [%lx, %lx)\n", - vcpu_id, vcpu_gpa, vcpu_gpa + + vcpu_id, vcpu_args->gpa, vcpu_args->gpa + (vcpu_args->pages * pta->guest_page_size)); } } -- 2.30.0.478.g8a0d178c01-goog