From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bandan Das Subject: Re: [PATCH] x86: realmode: report failures Date: Mon, 09 Jun 2014 17:43:54 -0400 Message-ID: References: <1402012828-30006-1-git-send-email-namit@cs.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain Cc: pbonzini@redhat.com, gleb@kernel.org, kvm@vger.kernel.org To: Nadav Amit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:4390 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbaFIVoF (ORCPT ); Mon, 9 Jun 2014 17:44:05 -0400 In-Reply-To: <1402012828-30006-1-git-send-email-namit@cs.technion.ac.il> (Nadav Amit's message of "Fri, 6 Jun 2014 03:00:28 +0300") Sender: kvm-owner@vger.kernel.org List-ID: Nadav Amit writes: > 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. Please include kvm-unit-tests in the subject line for easier identifiability where the patch belongs. > 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; > } I was confused at first since there is also a common "report" function in lib/report.c We should probably rename this function to something else, eg- realmode_report() if the common function can't be reused here. > #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 };