Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp793590pxp; Fri, 11 Mar 2022 15:17:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZeq7gbmWDO9fckh6dh0VpjsMoEt9RGyezHmzZnMEdBWPpkvowEpDwpm7Z+H3e0IZ0qjK/ X-Received: by 2002:a63:78cd:0:b0:376:46c:6585 with SMTP id t196-20020a6378cd000000b00376046c6585mr10499210pgc.313.1647040658581; Fri, 11 Mar 2022 15:17:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647040658; cv=none; d=google.com; s=arc-20160816; b=AWZ295vFQZ7B44MRzATgZ9mv+UNvt5QmhZeipRNGTp6U8u5+BQrVQ9z3TwzoyX4Jwn xA+K+8YxXCS9T7EEmEZWTwbDJJoaMmtTS0jOBAhyKpMO3YulHN3OYB4v2BWgiAV7kRYw 68rD5dAL7DVujjay2mUbmII0bMGdVQRdP389E7ollE6fSXIGpicGGSR8BBXP8IxJI4B5 lWJYuBuZppw4zaMneFv8U+/HhPImSxy3kLpPs9XNKmnYK5HC2alvXcr1YpHP/IH7+RHL 7YgJS4Lf/U47f6nFYT2azXSy1dxkcdvdiY07xbSIGDPIRGRIVEz56G29Ez2ZtuHm49Dd 4abQ== 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:dkim-signature; bh=o3uJ88GNV+YQmj/m0RYhTpW5VxFfvF1M+nMyDCpDOt0=; b=N+VYUn/E7bq53Xf9+A8uNawgV8oYutjs+TKe34FXuW+MB4jahXWJ66cvYetC+EmBsZ sbbAd4VwD/YqO/onYT5TceYTb1zlsRbX+xtQEosJ93vv4hjwW7djm9viJB4/yyr6r1Wf OHH0QIk/+xpsr9XY8ndYqOyV/S8vyH33L4r9moRCeJ/eZprLteeHxGwDeSZ4fxEXZ6Oa +MwTxu12l3NsxXYdHkclujHt7XnvBJvEcSmPylQgyMJ8IwLYfTFXVZ16pwevSZvJKQ/1 ZyF1hGwNlWWRbVoQ4Qhp0duuslYsNYZHZV4v6l25BwSuUMxztfM+VLnrukfUQcdXkvCN gx6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=fc5q73Hc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q16-20020a17090311d000b001517777221bsi10862078plh.256.2022.03.11.15.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 15:17:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=fc5q73Hc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AFB79393C56; Fri, 11 Mar 2022 14:03:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346787AbiCKF4B (ORCPT + 99 others); Fri, 11 Mar 2022 00:56:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346683AbiCKFxL (ORCPT ); Fri, 11 Mar 2022 00:53:11 -0500 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E023ECC63 for ; Thu, 10 Mar 2022 21:52:09 -0800 (PST) Received: by mail-pl1-x64a.google.com with SMTP id x10-20020a170902a38a00b00151e09a4e15so3993068pla.15 for ; Thu, 10 Mar 2022 21:52:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=o3uJ88GNV+YQmj/m0RYhTpW5VxFfvF1M+nMyDCpDOt0=; b=fc5q73HcXBegm+0tBM3/k1V4t9anDkQG+c1YNeo573WEBzqnlIBMexUmN4+VsKMiFf rDZynj4GPr43tQKhGkdNsGCS6InEH38WbtIE7uiWJUYhC7Ydvpem38imCTaJbiWTvquJ HAtmHlMcrsVErdfq05Igei4LempIIC4TUAp64/QEvnQud9PHQKRW5CJVcP2atrVm4FKz q+v2zARtfoNFx2cjPP/yCnUuFfV6KvGYFASJGSXRDphZWITLXEToG0j7wg2CTNVQ6LVN 8gXG38SH5bhr0SDoFyuY+EWhyLJtj8ePNJIJGPumBOePOmvAO3DHFW6R6aqPPpadTNMx hm3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=o3uJ88GNV+YQmj/m0RYhTpW5VxFfvF1M+nMyDCpDOt0=; b=pqGtubhnMnBa7JC+C9ReOfkOLfMM840gyinIsJCDp1Lvk6kcBZ7m6GrglDAntqo8bI B3EYB8U5Orhw2jj2lx7SV4H/wdo0XSXQti6J6W7kewNQDtq2Drl1Lf0HVuvIlPcpuFqs CgBpAVjn1wpUPIJ8CXAPr+3vSg6djvI2G1DqPgIcmH5AtkZrWuaBrzSief6eiAswzb4X 72hseUbt2YOtfY3j0U0gFyz4eVCN415bi4SxnSZT3/vDVkEFac5vJf8aUoZ9gOCTjjoy r6QsOUIJwAVa3pytcF9S56D4Sysq7YrFs5k6/oI5xUIBJ3aZkWzJ+Mkju03xi6W6rf4H u4mg== X-Gm-Message-State: AOAM530i97jAfVRLJs71+r8x7cm55FU3+lq2hPAXY1ALPLI/LGyGrK+k Pk2qNsnPFNHzauEGc8/ymlw+wkcNW1ui35/i7Z0dluk6PDKrGj2egpQAOlQERUUGnTm3MGp2iSf rdiRwlkaYOf377iyg5pZFopdj9cdm43D3CcLrx4bPOOPFSWru9sHEx0FZhRBUdnXVBN+avg== X-Received: from seanjc.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:3e5]) (user=seanjc job=sendgmr) by 2002:a05:6a00:2482:b0:4f7:644b:97b5 with SMTP id c2-20020a056a00248200b004f7644b97b5mr8668543pfv.37.1646977928571; Thu, 10 Mar 2022 21:52:08 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 11 Mar 2022 05:49:48 +0000 In-Reply-To: <20220311055056.57265-1-seanjc@google.com> Message-Id: <20220311055056.57265-38-seanjc@google.com> Mime-Version: 1.0 References: <20220311055056.57265-1-seanjc@google.com> X-Mailer: git-send-email 2.35.1.723.g4982287a31-goog Subject: [RFC PATCH 037/105] KVM: selftests: Convert vmx_tsc_adjust_test away from VCPU_ID From: Sean Christopherson To: linux-kernel@vger.kernel.org Cc: Sean Christopherson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Signed-off-by: Sean Christopherson --- .../selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c index e683d0ac3e45..d5ce21d3c513 100644 --- a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c +++ b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c @@ -33,7 +33,6 @@ #endif #define PAGE_SIZE 4096 -#define VCPU_ID 5 #define TSC_ADJUST_VALUE (1ll << 32) #define TSC_OFFSET_VALUE -(1ll << 48) @@ -128,26 +127,27 @@ static void report(int64_t val) int main(int argc, char *argv[]) { vm_vaddr_t vmx_pages_gva; + struct kvm_vcpu *vcpu; nested_vmx_check_supported(); - vm = vm_create_default(VCPU_ID, 0, (void *) l1_guest_code); + vm = vm_create_with_one_vcpu(&vcpu, (void *) l1_guest_code); /* Allocate VMX pages and shared descriptors (vmx_pages). */ vcpu_alloc_vmx(vm, &vmx_pages_gva); - vcpu_args_set(vm, VCPU_ID, 1, vmx_pages_gva); + vcpu_args_set(vm, vcpu->id, 1, vmx_pages_gva); for (;;) { - volatile struct kvm_run *run = vcpu_state(vm, VCPU_ID); + volatile struct kvm_run *run = vcpu->run; struct ucall uc; - vcpu_run(vm, VCPU_ID); + vcpu_run(vm, vcpu->id); TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, "Got exit_reason other than KVM_EXIT_IO: %u (%s)\n", run->exit_reason, exit_reason_str(run->exit_reason)); - switch (get_ucall(vm, VCPU_ID, &uc)) { + switch (get_ucall(vm, vcpu->id, &uc)) { case UCALL_ABORT: TEST_FAIL("%s", (const char *)uc.args[0]); /* NOT REACHED */ -- 2.35.1.723.g4982287a31-goog