From patchwork Tue Jul 16 17:28:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11046551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C499746 for ; Tue, 16 Jul 2019 17:29:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20DA428685 for ; Tue, 16 Jul 2019 17:29:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14CF728689; Tue, 16 Jul 2019 17:29:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 927D428685 for ; Tue, 16 Jul 2019 17:29:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hnRFJ-0008MT-LV; Tue, 16 Jul 2019 17:28:09 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hnRFI-0008MN-Ab for xen-devel@lists.xenproject.org; Tue, 16 Jul 2019 17:28:08 +0000 X-Inumbo-ID: 115ffe5e-a7ef-11e9-be88-fba00a10b651 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 115ffe5e-a7ef-11e9-be88-fba00a10b651; Tue, 16 Jul 2019 17:28:04 +0000 (UTC) Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Qbv/xuPp/m2PlX63F33rRKOmiJj+2jq/t5PuFsb+XpS/RYB4i/A1QT+N8roUlVVE2jgFTTzL06 x4izIbgBmTeEFoJwypd901xGPJvy4rCAGUAnpI864pFEsof5h+23j6F+Fy1l7+zpbReiS1Hb6B imydqFnOjNx/1HvpybGCkRR4lB/3Fe0hmt0K3DrtbXrQzP58YT5J3NkPgdICoKsPQ7r5z+dDO3 3CDhnGFXwE+UcpuoSXVI9L7UTgtaVadZUZzhcjCqdKjkljK0FlvGuE5W53hgCwxLtRaK4HQwyn ZBw= X-SBRS: 2.7 X-MesageID: 3094588 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,499,1557201600"; d="scan'208";a="3094588" From: Andrew Cooper To: Xen-devel Date: Tue, 16 Jul 2019 18:28:01 +0100 Message-ID: <20190716172801.11518-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/mm: Provide more useful information in diagnostics X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP * alloc_l?_table() should identify the failure, not just state that there is one. * get_page() should use %pd for the two domains, to render system domains in a more obvious way. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné --- xen/arch/x86/mm.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 138662e777..0f0761d624 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1407,7 +1407,8 @@ static int alloc_l1_table(struct page_info *page) return 0; fail: - gdprintk(XENLOG_WARNING, "Failure in alloc_l1_table: slot %#x\n", i); + gdprintk(XENLOG_WARNING, + "Failure in alloc_l1_table: slot %#x, ret %d\n", i, ret); out: while ( i-- > 0 ) put_page_from_l1e(pl1e[i], d); @@ -1505,7 +1506,8 @@ static int alloc_l2_table(struct page_info *page, unsigned long type) } else if ( rc < 0 && rc != -EINTR ) { - gdprintk(XENLOG_WARNING, "Failure in alloc_l2_table: slot %#x\n", i); + gdprintk(XENLOG_WARNING, + "Failure in alloc_l2_table: slot %#x, rc %d\n", i, rc); if ( i ) { page->nr_validated_ptes = i; @@ -1599,7 +1601,8 @@ static int alloc_l3_table(struct page_info *page) rc = -EINVAL; if ( rc < 0 && rc != -ERESTART && rc != -EINTR ) { - gdprintk(XENLOG_WARNING, "Failure in alloc_l3_table: slot %#x\n", i); + gdprintk(XENLOG_WARNING, + "Failure in alloc_l3_table: slot %#x, rc %d\n", i, rc); if ( i ) { page->nr_validated_ptes = i; @@ -1767,7 +1770,7 @@ static int alloc_l4_table(struct page_info *page) { if ( rc != -EINTR ) gdprintk(XENLOG_WARNING, - "Failure in alloc_l4_table: slot %#x\n", i); + "Failure in alloc_l4_table: slot %#x, rc %d\n", i, rc); if ( i ) { page->nr_validated_ptes = i; @@ -2482,9 +2485,8 @@ int get_page(struct page_info *page, struct domain *domain) if ( !paging_mode_refcounts(domain) && !domain->is_dying ) gprintk(XENLOG_INFO, - "Error mfn %"PRI_mfn": rd=%d od=%d caf=%08lx taf=%" PRtype_info "\n", - mfn_x(page_to_mfn(page)), domain->domain_id, - owner ? owner->domain_id : DOMID_INVALID, + "Error mfn %"PRI_mfn": rd=%pd od=%pd caf=%08lx taf=%"PRtype_info"\n", + mfn_x(page_to_mfn(page)), domain, owner, page->count_info - !!owner, page->u.inuse.type_info); if ( owner )