From patchwork Tue May 30 16:09:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikos Nikoleris X-Patchwork-Id: 13260673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBB3AC7EE2E for ; Tue, 30 May 2023 16:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233353AbjE3QLX (ORCPT ); Tue, 30 May 2023 12:11:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233351AbjE3QLU (ORCPT ); Tue, 30 May 2023 12:11:20 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 03653193 for ; Tue, 30 May 2023 09:10:51 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 629AD175A; Tue, 30 May 2023 09:11:13 -0700 (PDT) Received: from godel.lab.cambridge.arm.com (godel.lab.cambridge.arm.com [10.7.66.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 18C313F663; Tue, 30 May 2023 09:10:26 -0700 (PDT) From: Nikos Nikoleris To: kvm@vger.kernel.org, kvmarm@lists.linux.dev, andrew.jones@linux.dev Cc: Alexandru Elisei , pbonzini@redhat.com, ricarkol@google.com, shahuang@redhat.com Subject: [kvm-unit-tests PATCH v6 29/32] lib: arm: Print test exit status Date: Tue, 30 May 2023 17:09:21 +0100 Message-Id: <20230530160924.82158-30-nikos.nikoleris@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230530160924.82158-1-nikos.nikoleris@arm.com> References: <20230530160924.82158-1-nikos.nikoleris@arm.com> MIME-Version: 1.0 X-ARM-No-Footer: FoSSMail Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Alexandru Elisei The arm tests can be run under kvmtool, which doesn't emulate a chr-testdev device. Print the test exit status to make it possible for the runner scripts to pick it up when they have support for it. Signed-off-by: Alexandru Elisei Signed-off-by: Nikos Nikoleris Reviewed-by: Andrew Jones Reviewed-by: Shaoqin Huang --- lib/arm/io.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/arm/io.c b/lib/arm/io.c index 19f93490..c15e57c4 100644 --- a/lib/arm/io.c +++ b/lib/arm/io.c @@ -149,6 +149,13 @@ extern void halt(int code); void exit(int code) { + /* + * Print the test return code in the following format which is + * consistent with powerpc and s390x. The runner can pick it + * up when chr-testdev is not present. + */ + printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1); + chr_testdev_exit(code); psci_system_off(); halt(code);