From patchwork Thu Feb 8 20:48:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 198585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp460647dyd; Thu, 8 Feb 2024 13:23:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUegAZ0orSBwT3LGSR/J5kAl1MJzgL26Pb97QvVjdSaVZapM7bx9BidjFbal9EiCoDSm4gXoGCQsn5un0scsvJyx5+StQ== X-Google-Smtp-Source: AGHT+IHNCEk14DNGfaoYKSKKfrXdtkv+DTKpYh5+4i1ZuucVV5eDk4YZzKsLgBrBxjtndqGgd4Q8 X-Received: by 2002:a17:90a:9487:b0:296:d466:71a1 with SMTP id s7-20020a17090a948700b00296d46671a1mr479656pjo.41.1707427420704; Thu, 08 Feb 2024 13:23:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707427420; cv=pass; d=google.com; s=arc-20160816; b=lYS3FgMMrhDc5GPDK4/Gb/h2S1YhARjCiz7iKyslTwDW3vPMpfjrZrCUbKPby5qa/a vKKlwHo9kdJ3kTmI9piYCdhcRA6363S4ygAXpsx8R3LxLgHNlw8ShD6Akxl7VqFCvx6w a24xyCTiWoj4RRpqGGrjLN7Agl5aYqRj71xKBwHGbMmiMJ/CS+DZYOvsVHFzS5Rvat92 ceERjyaRqqP0C+5Wv1qkTPGwI+eE92umx5nXc4cusqnTpXVKlMZIXutIYkP6oPtcAfWG NlSVlSCZSSR5gBxr8uSWSQB0jfzRRHjJe8vmU7AeJ6mRweTLIMTM/a/aZW8EL5YBw1Y/ 3Prg== 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=REn9uQENQfoe3Mvzl2OvXdRed3iSntIVD5IIyngBMoc=; b=Ur5i5aSWkFTBLeK9uMHIJ4ZOhQb1NQNFG3C1BsCVktJ1gjUnJ3FTJV93UjOoku+reh 2soSUUQxEjzidXmadq1kZdD6XJTRxAQZvlKLKtXwt8byyHN0UkthHP56gr2iay+SK5F5 moZX/YKWpGBkTUsE4PbrpJUDW3DUtENinu/RLOfy/lIT+t67A+GFfiAWlIx/Q9hHzQaN XjZmz4QV51mBthQhOgQ0eytiUeLmZpriFsFqQeqpWUqKlC2phOySsHkvFvRq3Hk5vYoa 1fQq8fGA6obmF6aslxwSPJT8N9Kon7aHwa0HtUdbP3AQX6l36jR27Wl38g4CScWTgetB 1P7g==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58678-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCX9fydrpc183xF84JejVtB0Qex9JiS202x8v+ZgQ4bcxrgfK9bi0TaG5Q7ELb9vbzttmylhl5D3aGje1wK73zN9kog4jw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w12-20020a17090ad60c00b0029664157d81si382157pju.59.2024.02.08.13.23.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 13:23:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58678-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58678-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CA0A9B28F31 for ; Thu, 8 Feb 2024 20:49:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 999BC4F614; Thu, 8 Feb 2024 20:48:58 +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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790367415079613604 X-GMAIL-MSGID: 1790367415079613604 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.",