From patchwork Fri Jun 6 00:00:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nadav Amit X-Patchwork-Id: 4309251 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B021ABEEAA for ; Fri, 6 Jun 2014 00:00:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD2C620222 for ; Fri, 6 Jun 2014 00:00:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F12BA201D5 for ; Fri, 6 Jun 2014 00:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751871AbaFFAAf (ORCPT ); Thu, 5 Jun 2014 20:00:35 -0400 Received: from mailgw12.technion.ac.il ([132.68.225.12]:42127 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751739AbaFFAAf (ORCPT ); Thu, 5 Jun 2014 20:00:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhICABMEkVOERCABjGdsb2JhbABZslyNLYc+gQkWDgEBASc8gyVQgQEZiCnNZIUxF41uZB2EKgSKJaZigWo X-IPAS-Result: AhICABMEkVOERCABjGdsb2JhbABZslyNLYc+gQkWDgEBASc8gyVQgQEZiCnNZIUxF41uZB2EKgSKJaZigWo X-IronPort-AV: E=Sophos;i="4.98,984,1392156000"; d="scan'208";a="110197175" Received: from csa.cs.technion.ac.il ([132.68.32.1]) by mailgw12.technion.ac.il with ESMTP; 06 Jun 2014 03:00:33 +0300 Received: from csn.cs.technion.ac.il (csn.cs.technion.ac.il [132.68.32.15]) by csa.cs.technion.ac.il (Postfix) with ESMTP id BA399140036; Fri, 6 Jun 2014 03:00:32 +0300 (IDT) Received: from ds-had5.cs.technion.ac.il (ds-had5.cs.technion.ac.il [132.68.206.94]) by csn.cs.technion.ac.il (Postfix) with ESMTP id B06DE598004; Fri, 6 Jun 2014 03:00:32 +0300 (IDT) From: Nadav Amit To: pbonzini@redhat.com Cc: gleb@kernel.org, kvm@vger.kernel.org, Nadav Amit Subject: [PATCH] x86: realmode: report failures Date: Fri, 6 Jun 2014 03:00:28 +0300 Message-Id: <1402012828-30006-1-git-send-email-namit@cs.technion.ac.il> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current realmode tests always report success when done, regardless to whether any of the tests failed. Although the log includes the individual test results, this behavior complicates the life of the tester. Signed-off-by: Nadav Amit --- x86/realmode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x86/realmode.c b/x86/realmode.c index 6e74883..dc4a1d3 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -103,6 +103,8 @@ static void print_serial_u32(u32 value) print_serial(p); } +static int failed; + static void exit(int code) { outb(code, 0xf4); @@ -222,6 +224,8 @@ static void report(const char *name, u16 regs_ignore, _Bool ok) print_serial(ok ? "PASS: " : "FAIL: "); print_serial(name); print_serial("\n"); + if (!ok) + failed = 1; } #define MK_INSN(name, str) \ @@ -1715,7 +1719,7 @@ void realmode_start(void) test_perf_memory_store(); test_perf_memory_rmw(); - exit(0); + exit(failed); } unsigned long long r_gdt[] = { 0, 0x9b000000ffff, 0x93000000ffff };