Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp427604rdb; Thu, 5 Oct 2023 09:48:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqToSfggBQJ6l6KHBG1dff02jh8M+FeSsHaeQZySIXglZIJgazB95UFoB8nt9sNA+mslMy X-Received: by 2002:a17:90b:4387:b0:270:b961:1c3d with SMTP id in7-20020a17090b438700b00270b9611c3dmr5343588pjb.22.1696524481606; Thu, 05 Oct 2023 09:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696524481; cv=none; d=google.com; s=arc-20160816; b=qastflgLEekP2Mvg5XGprqav5M8PZOTHKemtSF6+sSAjVrXx4h22PoipcquaJZVKpW z0SoEjk9BG+XvfyFhdJ3jDz4i0EFpKTL3MOhcGA3GSBp5oP8bPkgspRCzFyfCuLEAygk 0noxU8NSLqI/anKMtcfqAmATN1d6O8IRoEXyIu4z3k6p8wZeNNUfXScaHYLvsPI0dNOn wvv6xhgFidEpggDRN5O4Iu/eG3nfIetbPNU3FB/j19oPW6UNaBhWQ8xIacJlA6dYofHj rFFms1SvSX0pPriyoh72AVFFvGmgVVpB+VIxfe/n8CVYC7k10D6L19YAjc5CLq9Z6Mfa p3uQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7fRALsU5S6eLAjk1M7NePd5tc1bB04QjkR7XwRkL9gc=; fh=WOoc99rHeo9qxHvnIaWffALNRebT/42m1dldSuRpBY0=; b=oMoBoropJjC2Slk5j7naMMabeQpcq5xUs3bAoVoEfFE6Of8gbUUqQc4gHF/9vV0Okn f/QnB3XID/x4TWxSyBg0IpYsYTsZst16/jgXzl6UzH4WKbd7TJH2+eC6A8dR/i04tR9D i+ty/bub/yfok725R+bBEwgh50kpGU5/b92JolepSx7iVzSwkSUOc44EnuOnZ51SCCWS zE8H6sNJ2NhDGrjRZvCRY9bYKSOwjkNvh6YRhAv8XWLPqXpHrjI6hyUJhfjPcemcahqU Bvx1WsVfYVrW+gZiAStYLY8Yf6prV0i/9JIjJVR5oxcpzVPncE2YDKX6nRKD8rEIERU+ 8blw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E91tY47N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id x8-20020a17090aca0800b00268278c51e3si4008249pjt.49.2023.10.05.09.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:48:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E91tY47N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 479B2851FE3E; Thu, 5 Oct 2023 09:47:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbjJEQok (ORCPT + 99 others); Thu, 5 Oct 2023 12:44:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233281AbjJEQm0 (ORCPT ); Thu, 5 Oct 2023 12:42:26 -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 B8C4427562 for ; Thu, 5 Oct 2023 07:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696516737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7fRALsU5S6eLAjk1M7NePd5tc1bB04QjkR7XwRkL9gc=; b=E91tY47NOVMJdqNsm8ogzd8Uek1wQGBp3G+xbczcH8Nv/7gocaY0hgEWpifWqbOvt8VNVI MTZvO1MN0cjk4uIBmaHJmxoijgjZfRbpSeEOD4WNtGDvPLJurqJEyQM1QUoI/Imk9Bm1ac pbZ4o3zc4/uYjUzWY4y83oMI/HGnpe8= 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-104-N2YAPGxPOrWyAqCYBD00Ag-1; Thu, 05 Oct 2023 10:38:44 -0400 X-MC-Unique: N2YAPGxPOrWyAqCYBD00Ag-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C227C8115DC; Thu, 5 Oct 2023 14:38:43 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 936C040C6EA8; Thu, 5 Oct 2023 14:38:42 +0000 (UTC) From: Thomas Huth To: Sean Christopherson , Paolo Bonzini , kvm@vger.kernel.org Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 1/7] KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate Date: Thu, 5 Oct 2023 16:38:33 +0200 Message-ID: <20231005143839.365297-2-thuth@redhat.com> In-Reply-To: <20231005143839.365297-1-thuth@redhat.com> References: <20231005143839.365297-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 05 Oct 2023 09:47:32 -0700 (PDT) In the spots where we are expecting a successful run, we should use vcpu_run() instead of _vcpu_run() to make sure that the run did not fail. Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/sync_regs_test.c b/tools/testing/selftests/kvm/x86_64/sync_regs_test.c index 00965ba33f730..8c3898cf79b31 100644 --- a/tools/testing/selftests/kvm/x86_64/sync_regs_test.c +++ b/tools/testing/selftests/kvm/x86_64/sync_regs_test.c @@ -259,7 +259,7 @@ int main(int argc, char *argv[]) /* Request and verify all valid register sets. */ /* TODO: BUILD TIME CHECK: TEST_ASSERT(KVM_SYNC_X86_NUM_FIELDS != 3); */ run->kvm_valid_regs = TEST_SYNC_FIELDS; - rv = _vcpu_run(vcpu); + vcpu_run(vcpu); TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); vcpu_regs_get(vcpu, ®s); @@ -278,7 +278,7 @@ int main(int argc, char *argv[]) run->kvm_valid_regs = TEST_SYNC_FIELDS; run->kvm_dirty_regs = KVM_SYNC_X86_REGS | KVM_SYNC_X86_SREGS; - rv = _vcpu_run(vcpu); + vcpu_run(vcpu); TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); TEST_ASSERT(run->s.regs.regs.rbx == 0xBAD1DEA + 1, "rbx sync regs value incorrect 0x%llx.", @@ -302,7 +302,7 @@ int main(int argc, char *argv[]) run->kvm_valid_regs = TEST_SYNC_FIELDS; run->kvm_dirty_regs = 0; run->s.regs.regs.rbx = 0xDEADBEEF; - rv = _vcpu_run(vcpu); + vcpu_run(vcpu); TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); TEST_ASSERT(run->s.regs.regs.rbx != 0xDEADBEEF, "rbx sync regs value incorrect 0x%llx.", @@ -317,7 +317,7 @@ int main(int argc, char *argv[]) run->s.regs.regs.rbx = 0xAAAA; regs.rbx = 0xBAC0; vcpu_regs_set(vcpu, ®s); - rv = _vcpu_run(vcpu); + vcpu_run(vcpu); TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); TEST_ASSERT(run->s.regs.regs.rbx == 0xAAAA, "rbx sync regs value incorrect 0x%llx.", @@ -334,7 +334,7 @@ int main(int argc, char *argv[]) run->kvm_valid_regs = 0; run->kvm_dirty_regs = TEST_SYNC_FIELDS; run->s.regs.regs.rbx = 0xBBBB; - rv = _vcpu_run(vcpu); + vcpu_run(vcpu); TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); TEST_ASSERT(run->s.regs.regs.rbx == 0xBBBB, "rbx sync regs value incorrect 0x%llx.", -- 2.41.0