[v2,2/7] KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it
Message ID | 20231005143839.365297-3-thuth@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2016:b0:403:3b70:6f57 with SMTP id fe22csp355630vqb; Thu, 5 Oct 2023 07:59:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFT96s968ef83HYIpduTNny9IfvV8W+KaIrCiWIwRDpG62q00waPxF1sPaekW2fQx0I81fI X-Received: by 2002:a05:6a21:33a6:b0:15d:1646:285a with SMTP id yy38-20020a056a2133a600b0015d1646285amr4230744pzb.21.1696517986405; Thu, 05 Oct 2023 07:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696517986; cv=none; d=google.com; s=arc-20160816; b=0jcqtMrHO6TWL1IQ3rOZeEY7x56IrUP8CM/iaZnF129Hwmizgcr7qZTqaKiZ2Sx+px 6ed8k3hntdWp2TNL8i8Bo2HvBzfpkY5otUklnmBriLZQwLnIY/KPWpeVJXrAiR8cFTZo AjEBftrYzuMh0/FM4EZb16hZ/Ofyg12DY3FX/WAVxYKNZVARaFYRhoaX2LhF3TjHs3Ro 5wHhi+J5CVnWCPU2lKoSSE5kZ5R55gyIfgFx7+8KxcehO0aXROSz6yj3lbwuCoy1SehO TG74dfDao0JW/E3+VUUgVdhoQKp7mUfduM84ca8hNKmhgqnAyBdrd70m9H7u2ZIWtNBL CrfQ== 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=nomghUslg4Iyvv3Vz3Tvghec7CwG436Cn/tuDQA6cKI=; fh=WOoc99rHeo9qxHvnIaWffALNRebT/42m1dldSuRpBY0=; b=Bq4PCRNWwS235SSsLgSpa7hR1saIMOOIel3NOwZqZ15sYIPdZlYddwvB0XU/GqrJYC oK5rV6F2si8f8WnmYjVsLBXQFAXfBPY8sJhqdb2Q3J3KEEuRlHVI1YShFyLTZXuWaZEA wgpKNHZHBp8EZnoK8K6nAK3gBpmMf0Xau4pnI74/u8DEkNdPOrcBNwd3W+YfiqEQZvnx bQJD+U7GlwPaLVcrkZu/lIZ/+dkyu8g1wd1DtMvz3qw2X+ja84EVCcD0X6BLivFhJcUC NvoaeArLAahmIpk9gJneZa2oNKK4uWdLY8BP+npvdmNSaftAZ03L1J9ymEKz1biQtcB9 Q5QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HZwwKisX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x69-20020a638648000000b005859cea158fsi1519088pgd.207.2023.10.05.07.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HZwwKisX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 4E6D682F7FA5; Thu, 5 Oct 2023 07:59:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233254AbjJEO7M (ORCPT <rfc822;ezelljr.billy@gmail.com> + 19 others); Thu, 5 Oct 2023 10:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234447AbjJEO5R (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 5 Oct 2023 10:57:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9CD526A50 for <linux-kernel@vger.kernel.org>; Thu, 5 Oct 2023 07:38:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696516730; 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=nomghUslg4Iyvv3Vz3Tvghec7CwG436Cn/tuDQA6cKI=; b=HZwwKisXAC+1aIuCVL9x1pKH9nEt/2D9zU/jedY4B6Fw2EOqtqwHr7ezdZaimmlddJRNzo VmQAEellGV3yAHFot6gc8nwM1eOxXtlU8RLxFg7j6pRXD7Y+8nnW8GOASjRiJMMM21TAYx 52QnZmKJt6zgH132JPg9iEStWBX2rdo= 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-199-_87W7J7TNkGAVM6VMBmiFw-1; Thu, 05 Oct 2023 10:38:46 -0400 X-MC-Unique: _87W7J7TNkGAVM6VMBmiFw-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 45FF118172C2; Thu, 5 Oct 2023 14:38:45 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13F8540C6EA8; Thu, 5 Oct 2023 14:38:43 +0000 (UTC) From: Thomas Huth <thuth@redhat.com> To: Sean Christopherson <seanjc@google.com>, Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org Cc: Shuah Khan <shuah@kernel.org>, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 2/7] KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it Date: Thu, 5 Oct 2023 16:38:34 +0200 Message-ID: <20231005143839.365297-3-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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:59:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778928044053300263 X-GMAIL-MSGID: 1778928044053300263 |
Series |
Use TAP in some more x86 KVM selftests
|
|
Commit Message
Thomas Huth
Oct. 5, 2023, 2:38 p.m. UTC
The regs structure just accidentially contains the right values
from the previous test in the spot where we want to change rbx.
It's cleaner if we properly initialize the structure here before
using it.
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 1 +
1 file changed, 1 insertion(+)
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 8c3898cf79b31..1cd19dfa0046c 100644 --- a/tools/testing/selftests/kvm/x86_64/sync_regs_test.c +++ b/tools/testing/selftests/kvm/x86_64/sync_regs_test.c @@ -315,6 +315,7 @@ int main(int argc, char *argv[]) run->kvm_valid_regs = 0; run->kvm_dirty_regs = 0; run->s.regs.regs.rbx = 0xAAAA; + vcpu_regs_get(vcpu, ®s); regs.rbx = 0xBAC0; vcpu_regs_set(vcpu, ®s); vcpu_run(vcpu);