From nobody Tue Dec 2 01:26:14 2025 Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (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 3D574242D84 for ; Fri, 21 Nov 2025 20:48:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763758116; cv=none; b=S8gx5peogpoyPj+RrhB37cncL8xUzc1eSSxv6V5F6hvg/26ORigbnRy8g4YWuvL1EckecPqBttfwA/Ng95TZScPIIQn6uNgOQaKbxoSP061beZHqOWZfbwQ7nNyogwAIigIHm9A3ZdkTBO3g4SCUCgmQN7Ek52hgOEQ9Jl2BvDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763758116; c=relaxed/simple; bh=E/pbZsTNV6EVLhqEcJiIuP7sCTobRfFdyjCdk23ENsw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y20+DXEHwIRwGRv6+Zk1pa0ddUZN1zPlvGJ01eHifYGg2ZB8iHC9DTsQswPUl+lGWfSDtFj0OezTUYDq47UCGMkbJZOcMvoK870BSADxwt2D5d8/XhJgy6E5WhfPmWpQE29lTZH93du82eBKjObdgofo1sWM/dqQRLBeSRASFBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=mwxqhy/J; arc=none smtp.client-ip=91.218.175.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="mwxqhy/J" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763758112; 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=NR1mAOfD6GGa4N4aOKbQBGg1YiLNhhyOF6jSLT9XhW4=; b=mwxqhy/J61ry8TwgHWNDaa75iZSuL/ksmRUUBWTRe+M8BcmCuL8QxrCTPKbJN/olO4e2N9 hosUxiVkSfJhoHTNsgh2aOpMdl3H92ZChh5MmubZpALjsMZVjp+A/p7gcOHcQ7843dRFaz etrAKlsvpeh2IpthzuwtOaMGPGjIV30= From: Yosry Ahmed To: Paolo Bonzini Cc: Sean Christopherson , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH v3 3/4] KVM: selftests: Use TEST_ASSERT_EQ() in test_vmx_nested_state() Date: Fri, 21 Nov 2025 20:48:02 +0000 Message-ID: <20251121204803.991707-4-yosry.ahmed@linux.dev> In-Reply-To: <20251121204803.991707-1-yosry.ahmed@linux.dev> References: <20251121204803.991707-1-yosry.ahmed@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The assert messages do not add much value, so use TEST_ASSERT_EQ(), which also nicely displays the addresses in hex. While at it, also assert the values of state->flags. Signed-off-by: Yosry Ahmed --- tools/testing/selftests/kvm/x86/vmx_set_nested_state_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/x86/vmx_set_nested_state_test.c b/= tools/testing/selftests/kvm/x86/vmx_set_nested_state_test.c index 67a62a5a8895..b59a8a17084d 100644 --- a/tools/testing/selftests/kvm/x86/vmx_set_nested_state_test.c +++ b/tools/testing/selftests/kvm/x86/vmx_set_nested_state_test.c @@ -241,8 +241,10 @@ void test_vmx_nested_state(struct kvm_vcpu *vcpu) TEST_ASSERT(state->size >=3D sizeof(*state) && state->size <=3D state_sz, "Size must be between %ld and %d. The size returned was %d.", sizeof(*state), state_sz, state->size); - TEST_ASSERT(state->hdr.vmx.vmxon_pa =3D=3D -1ull, "vmxon_pa must be -1ull= ."); - TEST_ASSERT(state->hdr.vmx.vmcs12_pa =3D=3D -1ull, "vmcs_pa must be -1ull= ."); + + TEST_ASSERT_EQ(state->hdr.vmx.vmxon_pa, -1ull); + TEST_ASSERT_EQ(state->hdr.vmx.vmcs12_pa, -1ull); + TEST_ASSERT_EQ(state->flags, 0); =20 free(state); } --=20 2.52.0.rc2.455.g230fcf2819-goog