From patchwork Wed Nov 15 19:34:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 118992 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp3885370edl; Wed, 15 Nov 2017 11:36:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMY4h0olJ3zGYwjCIQ4b321Su5bP98rRJQikg0NVB4hy19KqS/gsQ+XJx1Rrqojah5HtojTF X-Received: by 10.36.36.19 with SMTP id f19mr21382551ita.96.1510774588067; Wed, 15 Nov 2017 11:36:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510774588; cv=none; d=google.com; s=arc-20160816; b=H/FUfP7u6F2/ph9xWRA18v4v7W3E8Yp6hXAK9by/mGNQMFxWzNTdRbna0CIqjlEoR4 /t9dV1aboPb0XZNPGNrXNyX757VCiIrGht3TgQa4jmTYuy+RrzVq/NF5y6Djh7zFaTrz LdQO6sJqjWaX6gL5bPqyQqa6kX5Q1fjuHehTY7Usl2t4pkPiY/en2T2TTEZ9RCoD6FBE tEx5O0eYyM2RVfTIz+P5MgMOTLSfeKBUNiWLCvUcSwLrZgTHR7lJUM9G6iPYmwZJudpx pIGrxpMvXyeB7woNw+s79v//2ynRo2G77aVfWuem6idd/4+jWPmiauKNlvsCZh+UJJXU KJhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=RWywhWRW5zqKkNdE2uIK9Cx2RUtfyc8WaJJGV+u44IQ=; b=AsJlGhFwtv5r9cGQkwLLcmMb6l8AjzYGrt+yPrmLapQ/QGT0OhdoXS/6yRfgEWkxSM oFpts3HpTUwc4XpbvEiNH5HBtUYX9th/o8Dye+ZOXL8L5/ZQ0QApDv8Tb2Dw1fRUEC2p p/XIsU+W9IHRd9uP7ZO+IlZwqrUGw3TjEYQajdTEz3NjAjrmi6hdZQqDRdwVXObMbNez 7PuT/MDWjShkhNva1KZXHQbcZt0jLg2ryYM8xh6cqrwnVPvzxrMiqr80vB42zgtzqOki Mzvx9OtZ6deZgpsawpVBldEPnLG1Q1JkfHB3RWkGTcmHLv+KAE/h4cNsU4IWcnT3TRpt gAlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=H3vdpMR7; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i62si17433077ioe.220.2017.11.15.11.36.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 11:36:28 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=H3vdpMR7; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eF3S3-0006Tt-59; Wed, 15 Nov 2017 19:34:23 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eF3S1-0006Tc-Os for xen-devel@lists.xen.org; Wed, 15 Nov 2017 19:34:21 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id C4/A4-32329-DB69C0A5; Wed, 15 Nov 2017 19:34:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDIsWRWlGSWpSXmKPExsXiVRvkortnGk+ UwaL5GhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bOdVeZC37zVGyYc4y5gbGNq4uRi0NIYCKj xKqNz1hBHBaBecwSD1ZcZwdxJAT6WSUOXPnF2MXICeTkSaz6cYIZwk6TuHutCcqukHj8ayVQN wfQKDWJNW+iIKb2MUm8u3aDESTOJqAjsW5GLUi5iIC0xLXPl8FGMgs4S7yb9IUFxBYW8Je4+W 0RmM0ioCpx/vNLMJtXwFqidfsiqFXyErvaLoKt4hSwkThzOBgkLARUMmnLaqYJjIILGBlWMWo UpxaVpRbpGhvqJRVlpmeU5CZm5ugaGpjp5aYWFyemp+YkJhXrJefnbmIEhhsDEOxgbFoUeIhR koNJSZTX+Td3lBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3oNTeaKEBItS01Mr0jJzgIEPk5bg4 FES4Q0FSfMWFyTmFmemQ6ROMdpzHNt0+Q8Tx749t4Dks5mvG5g5pl1tbWIWYsnLz0uVEudlBG kTAGnLKM2DGwqL1EuMslLCvIxAZwrxFKQW5WaWoMq/YhTnYFQS5p0GMoUnM68EbvcroLOYgM6 yucENclZJIkJKqoHRMYa3ednFmREznz6bnum9ZcZhXWWxSdfKGRf8dMrp2XXame/n/NeuMY6L bW+dydl5oi/J1zKL/fRl6XvmJU9eh394q3Tu3s2bMRPXMzEtk9B+9z1PzzJ0Z1Hzk4QDq/+dm tkaMaF8MavguqUc/qwtG7RT+KIE3So39DVerIu53Dbp/bcDQgePK7EUZyQaajEXFScCAPqaiN LPAgAA X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-16.tower-27.messagelabs.com!1510774460!116321043!1 X-Originating-IP: [74.125.82.68] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21777 invoked from network); 15 Nov 2017 19:34:20 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-16.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 15 Nov 2017 19:34:20 -0000 Received: by mail-wm0-f68.google.com with SMTP id v186so5130063wma.2 for ; Wed, 15 Nov 2017 11:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SnPtz2e1/xRWWms7J5nBwJhS67dNz3uSIPk37b6PmE4=; b=H3vdpMR7K3EyPmtrQLjr5gx0OvH7WSPKcrGQe6Rc9Nu4llmHcL6gwmaUt3PQg7PCkl Vmoseqj8IdzDna5EGDEH5FYGdWg16msBtgFDOYgdKNR726czkCwZC8imtjCzDViwvU7K u7Veq6NQyo4MTyTC5db/2/POy24BN4h+NhS3Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SnPtz2e1/xRWWms7J5nBwJhS67dNz3uSIPk37b6PmE4=; b=n4GBkLmP4oXgndZfWB8/VTv5Edt6VUrOXfVHvqLEEkJPvg/wuV1bzUmPjKqW1CNb6t OMPOOI1UMxUUmP5Ijb3cNftC9znz3aZ6FnL8t4KLVom5x7KHReVkQkXjAKJ8j4L0S8NG slFPzl0uqPVwiTCR//luCekznZ/wStaiH7NdWzqcc9PVpY4l+TbVoprgZf/ww/sAB9iV d0YogkoZbpBIIFzjLbHxDyJ9z/919dilKBgV5Mr5dsyhwuGb+0ShM/vv8CfFwLZaFMH8 Y4d9qqu2B7mvs/7x1PEWOfH2CpgJAFsbkVqeWG9gMxK63m0XZXV3Xzgzbuptwk5m3s8u d6xQ== X-Gm-Message-State: AJaThX49gOrsE/d+CrPHVSKk9KOMYFJXbqzQm6NrSqMLzHKMZjr0Gpf8 BRGr08qqarAuE0DC90EuxiqvNqTEG1Y= X-Received: by 10.28.140.15 with SMTP id o15mr11996638wmd.8.1510774460089; Wed, 15 Nov 2017 11:34:20 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id x63sm18534330wma.39.2017.11.15.11.34.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 11:34:19 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 15 Nov 2017 19:34:14 +0000 Message-Id: <20171115193414.7678-3-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171115193414.7678-1-julien.grall@linaro.org> References: <20171115193414.7678-1-julien.grall@linaro.org> Cc: sstabellini@kernel.org, Julien Grall Subject: [Xen-devel] [PATCH for-4.10 2/2] xen/arm: p2m: Add more debug in get_page_from_gva X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" The function get_page_from_gva is used by copy_*_guest helpers to translate a guest virtual address to a machine physical address and take reference on the page. There are a couple of errors path that will return the same value making difficult to know the exact error. Add more debug in each error patch only for debug-build. This should help narrowing down the intermittent failure with the hypercall GNTTABOP_copy (see [1]). [1] https://lists.xen.org/archives/html/xen-devel/2017-11/msg00942.html Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- xen/arch/arm/p2m.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index f6b3d8e421..417609ede2 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1428,16 +1428,29 @@ struct page_info *get_page_from_gva(struct vcpu *v, vaddr_t va, par = gvirt_to_maddr(va, &maddr, flags); if ( par ) + { + dprintk(XENLOG_G_DEBUG, + "%pv: gvirt_to_maddr failed va=%#"PRIvaddr" flags=0x%lx par=%#"PRIx64"\n", + v, va, flags, par); goto err; + } if ( !mfn_valid(maddr_to_mfn(maddr)) ) + { + dprintk(XENLOG_G_DEBUG, "%pv: Invalid MFN %#"PRI_mfn"\n", + v, mfn_x(maddr_to_mfn(maddr))); goto err; + } page = mfn_to_page(maddr_to_mfn(maddr)); ASSERT(page); if ( unlikely(!get_page(page, d)) ) + { + dprintk(XENLOG_G_DEBUG, "%pv: Failing to acquire the MFN %#"PRI_mfn"\n", + v, mfn_x(maddr_to_mfn(maddr))); page = NULL; + } err: if ( !page && p2m->mem_access_enabled )