From patchwork Fri Dec 12 16:06:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 5483721 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 51B04BEEBA for ; Fri, 12 Dec 2014 16:06:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C3C220148 for ; Fri, 12 Dec 2014 16:06:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C47520172 for ; Fri, 12 Dec 2014 16:06:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935037AbaLLQGq (ORCPT ); Fri, 12 Dec 2014 11:06:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47861 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935027AbaLLQG1 (ORCPT ); Fri, 12 Dec 2014 11:06:27 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBCG6RL3008484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 12 Dec 2014 11:06:27 -0500 Received: from hawk.usersys.redhat.com (dhcp-1-108.brq.redhat.com [10.34.1.108]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBCG6Kmk007006; Fri, 12 Dec 2014 11:06:27 -0500 From: Andrew Jones To: kvm@vger.kernel.org Subject: [PATCH 06/10] x86: asyncpf: use report Date: Fri, 12 Dec 2014 17:06:13 +0100 Message-Id: <1418400377-17388-7-git-send-email-drjones@redhat.com> In-Reply-To: <1418400377-17388-1-git-send-email-drjones@redhat.com> References: <1418400377-17388-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Signed-off-by: Andrew Jones --- x86/asyncpf.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/x86/asyncpf.c b/x86/asyncpf.c index 5d269f7346159..304d015888cfd 100644 --- a/x86/asyncpf.c +++ b/x86/asyncpf.c @@ -37,7 +37,6 @@ volatile uint32_t apf_reason __attribute__((aligned(64))); char *buf; volatile uint64_t i; volatile uint64_t phys; -bool fail; static inline uint32_t get_apf_reason(void) { @@ -53,21 +52,21 @@ static void pf_isr(struct ex_regs *r) switch (reason) { case 0: - printf("unexpected #PF at %p\n", read_cr2()); - fail = true; + report("unexpected #PF at %p\n", false, read_cr2()); break; case KVM_PV_REASON_PAGE_NOT_PRESENT: phys = virt_to_phys_cr3(virt); install_pte(phys_to_virt(read_cr3()), 1, virt, phys, 0); write_cr3(read_cr3()); - printf("Got not present #PF token %x virt addr %p phys addr %p\n", read_cr2(), virt, phys); + report("Got not present #PF token %x virt addr %p phys addr %p\n", + true, read_cr2(), virt, phys); while(phys) { safe_halt(); /* enables irq */ irq_disable(); } break; case KVM_PV_REASON_PAGE_READY: - printf("Got present #PF token %x\n", read_cr2()); + report("Got present #PF token %x\n", true, read_cr2()); if ((uint32_t)read_cr2() == ~0) break; install_pte(phys_to_virt(read_cr3()), 1, virt, phys | PTE_PRESENT | PTE_WRITE, 0); @@ -75,8 +74,7 @@ static void pf_isr(struct ex_regs *r) phys = 0; break; default: - printf("unexpected async pf reason %d\n", reason); - fail = true; + report("unexpected async pf reason %d\n", false, reason); break; } } @@ -107,6 +105,5 @@ int main(int ac, char **av) } irq_disable(); - printf("%s\n", fail ? "FAIL" : "PASS"); - return fail; + return report_summary(); }