From patchwork Tue Mar 1 23:55:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 8472081 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8B2B69F2F0 for ; Tue, 1 Mar 2016 23:59:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DF632034E for ; Tue, 1 Mar 2016 23:59:01 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACE3E20260 for ; Tue, 1 Mar 2016 23:59:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aau8c-0005c8-UT; Tue, 01 Mar 2016 23:55:34 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aau8b-0005c2-2Y for xen-devel@lists.xenproject.org; Tue, 01 Mar 2016 23:55:33 +0000 Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id 09/2A-03497-4FB26D65; Tue, 01 Mar 2016 23:55:32 +0000 X-Env-Sender: bounce-md_30481620.56d62bf1.v1-e9fc8693202a4dc49fcac6bcdd74 9f61@mandrillapp.com X-Msg-Ref: server-2.tower-27.messagelabs.com!1456876529!26007749!1 X-Originating-IP: [205.201.137.77] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63434 invoked from network); 1 Mar 2016 23:55:31 -0000 Received: from mail333.us4.mandrillapp.com (HELO mail333.us4.mandrillapp.com) (205.201.137.77) by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 1 Mar 2016 23:55:31 -0000 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=mandrill; d=linuxfoundation.org; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=gregkh@linuxfoundation.org; bh=F4JtsSEaJsLsOzn5ADhJRgvm/a8=; b=CU1LQfdnqV0oVM4rAwWurxzXxHtMUbIlEDAgplyWcJNf3G2EZhdR2qgFU2zjEPM7pbHmR/g3CSYx zZ/lC2QgVfr3oS2QYsWnIgnbSJ5ftlCSNHNUs5t+03bDgav8vnMRtUblJi8f4SbJJkSEhyKMN/a3 xvxTHz+fuIkDjYNcLmI= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=mquky2XI/F0K4W7gGY1gQJk7fsWVEkyVV3Ui/vGv0fPrTQwTHP0twwubL9/yr4J6eVQpYGPs/KUj 2/OrimU4Dr48Zcx5hr5Fs2ruj0O9Cq78OCPw9Dqvi/F4ZMUysHu1pkVDhy8eOsoS96vaLNAyiByD lGb3ixgyjEiWDvgU+p4=; Received: from pmta03.dal05.mailchimp.com (127.0.0.1) by mail333.us4.mandrillapp.com id hqolv6174noi for ; Tue, 1 Mar 2016 23:55:29 +0000 (envelope-from ) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1456876529; h=From : Subject : To : Cc : Message-Id : In-Reply-To : References : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=PeY/MQOMkpz21B8rCzAlIfuRI+mjnyENboCbTc5T2lI=; b=Oq81W/dbogJxaGlo/AMqFMhlOBTrORgBcanBs0gaXOBSU4GSP5AVWU7nYq58dQTdy0ZfQl SXI83RXIYD1WiwAMVNzhOexJ3KrzUBkuW7jsED4nKy4z8IyGhhWndDHT1C+9MQl8jXOJIZE6 4J/T5OSR/LUo6hXJjl/CCZTO6lknw= From: Greg Kroah-Hartman Received: from [50.170.35.168] by mandrillapp.com id e9fc8693202a4dc49fcac6bcdd749f61; Tue, 01 Mar 2016 23:55:29 +0000 X-Mailer: git-send-email 2.7.2 To: Message-Id: <20160301234537.959099259@linuxfoundation.org> In-Reply-To: <20160301234527.990448862@linuxfoundation.org> References: <20160301234527.990448862@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.e9fc8693202a4dc49fcac6bcdd749f61 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:55:29 +0000 MIME-Version: 1.0 Cc: Ian Campbell , Stefano Stabellini , Greg Kroah-Hartman , stable@vger.kernel.org, xen-devel@lists.xenproject.org, linux-arm-kernel@lists.infradead.org Subject: [Xen-devel] [PATCH 4.4 312/342] xen/arm: correctly handle DMA mapping of compound pages 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID, UNPARSEABLE_RELAY, URIBL_GREY autolearn=no 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 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ian Campbell commit 52ba0746b3b44c86aee121babf3b2fd9b8f84090 upstream. Currently xen_dma_map_page concludes that DMA to anything other than the head page of a compound page must be foreign, since the PFN of the page is that of the head. Fix the check to instead consider the whole of a compound page to be local if the PFN of the head passes the 1:1 check. We can never see a compound page which is a mixture of foreign and local sub-pages. The comment already correctly described the intention, but fixup the spelling and some grammar. This fixes the various SSH protocol errors which we have been seeing on the cubietrucks in our automated test infrastructure. This has been broken since commit 3567258d281b ("xen/arm: use hypercall to flush caches in map_page"), which was in v3.19-rc1. NB arch/arm64/.../xen/page-coherent.h also includes this file. Signed-off-by: Ian Campbell Reviewed-by: Stefano Stabellini Cc: xen-devel@lists.xenproject.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman diff --git a/arch/arm/include/asm/xen/page-coherent.h b/arch/arm/include/asm/xen/page-coherent.h index 0375c8caa061..9408a994cc91 100644 --- a/arch/arm/include/asm/xen/page-coherent.h +++ b/arch/arm/include/asm/xen/page-coherent.h @@ -35,14 +35,21 @@ static inline void xen_dma_map_page(struct device *hwdev, struct page *page, dma_addr_t dev_addr, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) { - bool local = XEN_PFN_DOWN(dev_addr) == page_to_xen_pfn(page); + unsigned long page_pfn = page_to_xen_pfn(page); + unsigned long dev_pfn = XEN_PFN_DOWN(dev_addr); + unsigned long compound_pages = + (1<map_page(hwdev, page, offset, size, dir, attrs);