From nobody Mon Feb 9 01:15:39 2026 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 810B733437F for ; Mon, 10 Nov 2025 23:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762817236; cv=none; b=l1mCot8j46EONlU2JQNDnRy8Sb6fDN6pv58flXbUWR/ggd9bZVtnbxtNAB/pZj4X60J+ycdasuG0EeoW4hMFRhTsdwqeRF0RFRps3ivAVkKyAB/OmWksACKeJehBrEbkVl3+aBPXG/UEr/j+XZ4fAWLg1pC4WHMmlQGyxmRDHBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762817236; c=relaxed/simple; bh=Tf2WOo+nTdA0kHa5juQ5OUWkXPxlWSD/okXr3AMAQic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mmwFpMOYvB3g2Fp5C7pBiGT2EvRqflHWMGNK0zpXYgsdnSS7DDN0Trp41GUz1+Jp4cnDQyeUZA5t9wsWNJP03E4ecJrdYI1oKSvkbvKBBuMvJclM/rID2wW/3VaT8T+zsu12/i0kOzR7pw+I3Lskmo5BuFoOJyafl3LZP2BntQ4= 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=EhjnLSZi; arc=none smtp.client-ip=91.218.175.170 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="EhjnLSZi" 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=1762817232; 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=QN+Jb/sMTKw705goXC8AQxOha75Fi5974iJiM9D+sAM=; b=EhjnLSZi2hbQf2TDrsHHuE9WjfYeOq6pvHrlli78ZzLZedUwedLtc62AsQtHF8jSX5yKc7 /baZJOjHuJIbiRT2n8WyF0nyvLR7L7ZZzySy7WQkO1WqkM/NnpHQm1jYE7xRIjxRp5aHA0 VgqmHjm6h85AIOgtzRjvnEJXaiKMIbA= From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Kevin Cheng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH v3 07/14] x86/svm: Move report_svm_guest() to the top of svm_tests.c Date: Mon, 10 Nov 2025 23:26:35 +0000 Message-ID: <20251110232642.633672-8-yosry.ahmed@linux.dev> In-Reply-To: <20251110232642.633672-1-yosry.ahmed@linux.dev> References: <20251110232642.633672-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" Move the macro ahead of other tests that will start using it. Signed-off-by: Yosry Ahmed --- x86/svm_tests.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/x86/svm_tests.c b/x86/svm_tests.c index feeb27d61435b..61ab63db462dc 100644 --- a/x86/svm_tests.c +++ b/x86/svm_tests.c @@ -37,6 +37,21 @@ u64 latclgi_max; u64 latclgi_min; u64 runs; =20 +/* + * Report failures from SVM guest code, and on failure, set the stage to -= 1 and + * do VMMCALL to terminate the test (host side must treat -1 as "finished"= ). + * TODO: fix the tests that don't play nice with a straight report, e.g. t= he + * V_TPR test fails if report() is invoked. + */ +#define report_svm_guest(cond, test, fmt, args...) \ +do { \ + if (!(cond)) { \ + report_fail(fmt, ##args); \ + set_test_stage(test, -1); \ + vmmcall(); \ + } \ +} while (0) + static void null_test(struct svm_test *test) { } @@ -1074,21 +1089,6 @@ static bool lat_svm_insn_check(struct svm_test *test) return true; } =20 -/* - * Report failures from SVM guest code, and on failure, set the stage to -= 1 and - * do VMMCALL to terminate the test (host side must treat -1 as "finished"= ). - * TODO: fix the tests that don't play nice with a straight report, e.g. t= he - * V_TPR test fails if report() is invoked. - */ -#define report_svm_guest(cond, test, fmt, args...) \ -do { \ - if (!(cond)) { \ - report_fail(fmt, ##args); \ - set_test_stage(test, -1); \ - vmmcall(); \ - } \ -} while (0) - bool pending_event_ipi_fired; bool pending_event_guest_run; =20 --=20 2.51.2.1041.gc1ab5b90ca-goog