From: Andrew Jones 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> References: <1418400377-17388-1-git-send-email-drjones@redhat.com> To: kvm@vger.kernel.org Return-path: 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 In-Reply-To: <1418400377-17388-1-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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(); } -- 1.9.3