Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp526151rdb; Thu, 8 Feb 2024 12:50:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXH2MmWlF0C5eI4eLQMvndSTr0Z1MKmfwtw6ROK4WXcY663ssSSVJjYGMpfdDLEOm9lBVC3FTiK0p7d6aGehRcR3e8U6hLPnUUlkdJwZQ== X-Google-Smtp-Source: AGHT+IGxitq/AUT49fOm4XJKWIuFIOqTxDRt0jAbo2o+x4QjiCDVzPXsN2UL7puRmfJl9uI5RCWA X-Received: by 2002:a17:902:cf4a:b0:1d9:f87f:b17e with SMTP id e10-20020a170902cf4a00b001d9f87fb17emr455993plg.5.1707425449698; Thu, 08 Feb 2024 12:50:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707425449; cv=pass; d=google.com; s=arc-20160816; b=hwtWH/p3N3O55VnREfkVzrc22FO9YjeqKnKe8K2JvlPM5a/DJqlpFHb5y/O51b6Nt/ mDCWNnA5NP04+TNlCzEnsTwdJnL1xnTHX9CMSR72wuu9jRWGA0IRIdyPjUaKuiet6PyB Nx5LbjWKahmdexlnm0NTklgDMVXq2/HMuo+g4LeA+X3fmMFCFGFlLvLDnaJWg1c7lf9y o+SpDZScpedwj2euG5aFDulFQK9FL4Ki2nZlfYMyAbS52NlAogAtcE4VJ02sn62kLftd +k8/VfIqTrwC+xlUtStVX1f/RXY2sz5nqVCkKkSdXRd7+WA4IrEgRM3ezkFC3q/7Dcdd 6+qw== 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=N1jX8xaWWAWnTKGIXa8/O/uSBdB1VqMshiJadSRg6EY=; fh=ghQ11xYFcHoYF5ankJg9UdBXAOD1EO+NNqJdv9Hai+U=; b=b/WD4bXu/O4q0f51XJI6DYc1nVmFfFBltyoK3p0DrNqDOigjaxwxphPp82+TaA4cA+ CYmwtXoaNCqENBHmCcvnPuyEJfr8KzDtJFyGC7jwbZBLM4pqvqK2IEvDktmhKM1jDb/E A5KrKTTqv6OFmCFCBKs7qVgFxXI+6SIJEOLy/QqUfHl2foEtpnhLMasJgRO81gVOBSXF ngBeJNInbmO2Ept1tXOQyo8E7VpiQo3OuMiVRAQ5wFk0BFNMxy/FZAQAYeNJHFOe+ri8 ua/9M7b20tDBEd1Iwwso79+7FI8SKaNoWp5+t/COXmuKd0iM4atIuOnxPaUNlbr7JRdY TlMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PadS8ww8; 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-58679-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58679-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; AJvYcCVqdMPb44EJMrekiVgEraaHiE55NMVVeHqa3KPSNJeQdUIGfnVE6jdmCAdI7ENfnLt1cg8JyaeryKlHNBAa9wJstiyQj49ZGeva0gU4+g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g7-20020a1709029f8700b001d9a1f77bb6si296089plq.618.2024.02.08.12.50.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 12:50:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58679-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PadS8ww8; 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-58679-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58679-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9954B2876A0 for ; Thu, 8 Feb 2024 20:49:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD3924F5F1; Thu, 8 Feb 2024 20:48:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PadS8ww8" 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 857894C3BF for ; Thu, 8 Feb 2024 20:48:55 +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=1707425337; cv=none; b=Lsr0U4Edum8H/BE/WTdmB+0AgToFOuBp8rVuLU/p5r0Eoqqit9QYGVSHLaLQbBKSp/C2neRnFeHzjS6M/Q0bjEnN1X6Jx4q0eKjhtqSZCHqNjGed2/c3eez3pG/XELJptOs6ERaNYv3n7XvgixSk2mAuBtQnzNY2etPiKn21REY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707425337; c=relaxed/simple; bh=6P5K6g9DoGyrYeskFG3ZTud2y0Jy5ES1/MaotkbmBnY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RZE/5xmrLXbH9o57KHtN38WAIASKMvV+idgHy0uFM1IZOUWH/+/0hTnNMkD7gmCdCTUJc1rrBB3PUz9+oqdw/md0AGDETi4uwUCJ3Q+E9CipoPVqVdkcxsFBIDSxft12b1xyRODa6VoV1JUEysTlpvWcPsAg0vnQQ1Ydds5LpN4= 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=PadS8ww8; 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=1707425334; 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=N1jX8xaWWAWnTKGIXa8/O/uSBdB1VqMshiJadSRg6EY=; b=PadS8ww8zu+L0pjttN8FGTPMENowjujMFGXb9aalsZZZcq+ymD4Y8yo1pAHM1S59xDusZ/ 3XxM4RDsD6IJSRrRXIu7CnoE/x0AVr7Ihb2KDAu/Y80efKvj74DA3pY/oHAprzXWvjp8G0 dF++rfHuxuar/SM0WYfSuXOOcIZeaus= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-241-0BBqA1kPNaKq99Sr2-FHuA-1; Thu, 08 Feb 2024 15:48:52 -0500 X-MC-Unique: 0BBqA1kPNaKq99Sr2-FHuA-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 7FE3A8432A0; Thu, 8 Feb 2024 20:48:51 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id A63531C10C0C; Thu, 8 Feb 2024 20:48:49 +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 2/8] KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it Date: Thu, 8 Feb 2024 21:48:38 +0100 Message-ID: <20240208204844.119326-3-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 The regs structure just accidentally 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 Signed-off-by: Thomas Huth --- 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); -- 2.43.0