From nobody Sun Feb 8 23:23:17 2026 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 784A1358D1F; Tue, 28 Oct 2025 22:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761689573; cv=none; b=CATtMKOHH1H+pGEpxwWW4NDEtdYKEoApeIzMKVtgUaSDzB2pCtjDSlyE1FxvCSru1vYUNHGZa8kGDM1e5IK8DP4Fpn7Z9iWYZ7n1/mpXdLAj7O8dP4cLKnusVcZ0utu0BvEk3EBeWhN4XvklzRNWN1nKYsLS7dd/KzhJxR8xj0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761689573; c=relaxed/simple; bh=4LtXR1MFrLpUgKdjFe2eFpVq+CsdRnoldBQt2gwLI2o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HbF7EanfdPTEpjyXpz9JHTSmYzVHztAIZ8Nor8mZ6doG0hY/Sczi9LYIbO6xgTG4FyqxsW5MpRS6VLqPL4UXRSKAr3yKQnaWhbzBwoTCUJLFOR+2TL0zPI33HfhHA5F9Qnz+8cmQ/tt1Do4RUtuYFmXATbNtyM5+a0O9f+ZXfzE= 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=G6bN35oQ; arc=none smtp.client-ip=91.218.175.189 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="G6bN35oQ" 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=1761689569; 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=kV7XKkm5h17HxE9fn8bhOfc3i9LVxpvvTJ47xHYqFec=; b=G6bN35oQPMUMoBQyQn5HGfAQ6UD71mTQ4Hn9EzjUyt6l6LiqsjQUyR9/3zOVZOZnXeLB37 laKlrPITSFdkYzK4dCd0x8mQ23kiZ9ztqa51t2HAr1J2dwvye7oQ6TawY0tZJhJBNZx6L5 jpks3PKVllA1lvSPH2nK3NULTRMUdKs= From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [kvm-unit-tests v2 6/8] x86/svm: Move report_svm_guest() to the top of svm_tests.c Date: Tue, 28 Oct 2025 22:12:11 +0000 Message-ID: <20251028221213.1937120-7-yosry.ahmed@linux.dev> In-Reply-To: <20251028221213.1937120-1-yosry.ahmed@linux.dev> References: <20251028221213.1937120-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.1.851.g4ebd6896fd-goog