Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp525552rdb; Thu, 8 Feb 2024 12:49:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUxZsUY24JdOWaydXkFBEvdpaGTZ7sRmr3WVQcPP0jorz2xZRirWLlQfilhxkWbrs0y/4TTXUbJEjDvRrvk/Cc6v6wXrSOcKodYe6XlNg== X-Google-Smtp-Source: AGHT+IE++3lWddUD6YMTuB/7x/IR3B6zGfzEN+Xo1E8dX2GjZe7+6EzrsE3NsBgwHYZKATGqbQ69 X-Received: by 2002:a2e:90d6:0:b0:2d0:d974:4ee4 with SMTP id o22-20020a2e90d6000000b002d0d9744ee4mr321915ljg.12.1707425362108; Thu, 08 Feb 2024 12:49:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707425362; cv=pass; d=google.com; s=arc-20160816; b=lPsb4eOabumfN13GEVaRvgUEdULTGx4duG6gLgnF1ugdqQOMiVZRGZUw5WbEFab4US yjVBG/srEsSqAQ56MTKiAoRB9VRIhMECVxpIAmgqiKqHcxgL8RgmHcJkaJnLU+He1cqK Wo/yTW2lNXO1xtawuMhXQTB1N+Zde7uVW10eIzVcLkM/ZofYeJfJUXm9P7VG4Nu9MeTz +jz0beagwb5numUzKSGtcq02uPhnmdMjoZb4GLhnhrUI4f+BIi0PHyRe8zJPIFdWAtlk nkbLTm22A7EQkLECg11eiG+hlH1/TutwTlqX6JNUKUnkYQv2I41IGe2cqXKX6ow+qAFP Qfmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PCasFpB8v1Na9EwI6Mi6rw0rgrxuwPyRFuEHVoV49HM=; fh=7YuEhNWpm8uF1WWWJjGGSKKEsVnuOChWzp01CJFsJAg=; b=FReC8T+gBCMIfc5+iaJ8Q5Ho9J2iMCY2U1+UJtud/5LAW4lHe76J3hmA2TMz5w3ItJ cHRDqIaMkRkmLJTbamrv470unmgO0nY3jFqMkJjzWwby8EsBnH9y9s4g8Zf1b+QPb3+v b6LP3icj85eUgjxEmv1bE/EYRcER86hApX46VnnFXyG6o2jrv7R4kwo3njIxUh7TmQ/U Ghs0hatuytZFBcUYXlaewpcvL5fmr0uas2nkrqlZXN7nPOuA74QoEQrI5rzUfANQcubN fD+ZHnv5Y66FWkPmEzA8e+ThFBuSY90QwBQS/t1Ip1uGPqfGXuyN4c5aHfCIzKWKThW4 iu3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BIfuP+UD; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-58678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58678-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXYaEhQJv+RhFwhbXltQY49G88N0OHyh4iKnS0zZawcmYrsszKVIGQzJCfwBPyUTPURD9YhzpaPZmQtww3pEvfVusenRFSG/G21ifH57w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p27-20020a17090628db00b00a37e659a352si44734ejd.325.2024.02.08.12.49.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 12:49:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BIfuP+UD; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-58678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58678-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CEF5E1F2D582 for ; Thu, 8 Feb 2024 20:49:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FE774F1EE; Thu, 8 Feb 2024 20:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BIfuP+UD" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EEB8482F2 for ; Thu, 8 Feb 2024 20:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707425335; cv=none; b=l0x757RJZadPFxTxc1/ekwdHFMnYIcerucgbktXIwD0ZKQEEnwz5alAYoxzWD/yiH1GM7AkEMW/X0Ams6Cz7fqEuUy9wm5stAS9Ft7ivJs9jMsTxsrMIXNXOM7+Rc08t++Wicf7APFCW3E9fvk8sOXzkmNsvH6b8vjNxaTAg0mI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707425335; c=relaxed/simple; bh=HV990RK4YHXCeB1vdMLTrY2EFgaVgMfcRG6Z2YopDzA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C0zomqQQy8Aa1UXkMtpZJC81JPmyUYbopS0cmwIv00pouyqUFxuBcdi6LlrmbzUDr7hprktieOuvyFhkrPkwb71aPxuWT2vMB+DWMr0ixKHCtMywOVgDw9Dxnt4TJ8rQrKqO+Q8ehpOf3UdnWzkor2GH7NDTNe8hebvH90aJJYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BIfuP+UD; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707425333; 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=PCasFpB8v1Na9EwI6Mi6rw0rgrxuwPyRFuEHVoV49HM=; b=BIfuP+UDxL5EtE5S1qgPDc7nZqLyaiBa/fLZkAdal5bJzYWvlcQYMrY7SFq8VnsFCE0iqy mKWC/G6R687yzvYhJE4p6RAjs/xntEEkkudmEGYKa0KkXY4gby60LIn/FO2hyW47mhbqK5 63U05WE/YuMnlvlcXPDf+K/2oMwLT70= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-27-mdbhvoavPnuH9SjbGfktYg-1; Thu, 08 Feb 2024 15:48:50 -0500 X-MC-Unique: mdbhvoavPnuH9SjbGfktYg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 639B43810795; Thu, 8 Feb 2024 20:48:49 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1038F1C10C0C; Thu, 8 Feb 2024 20:48:47 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Sean Christopherson Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Andrew Jones Subject: [PATCH v3 1/8] KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate Date: Thu, 8 Feb 2024 21:48:37 +0100 Message-ID: <20240208204844.119326-2-thuth@redhat.com> In-Reply-To: <20240208204844.119326-1-thuth@redhat.com> References: <20240208204844.119326-1-thuth@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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.43.0