From patchwork Wed Nov 12 11:40:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 40661 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E2BB6206A5 for ; Wed, 12 Nov 2014 11:48:00 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id c41sf7995950eek.0 for ; Wed, 12 Nov 2014 03:48:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=CZKpZc3Tul7YklXzlMe/Egw3nda7bhCfOdioxNsE2m4=; b=DESbvhL7s4CzXVuWl9CkgDxNMGUanxJZvwQT3j36DuurddZoCSa/MmVoVF7zPDHrcl TfqSAe2tnDzeE736PbD//VJ/8bI+KS0bpFxKPXNquyohMnX08hdtYpQnMrPLlNEV78Vj P1CQkDfoyGw9L4ESvBcy0qE3+10gwwtPwmGAZi7zkJJKLBzH5bOkubAVNW0WyvMENAHM 2Groxn+TuaKVIt2ksEAgo9cTP2+UxDnFT6Rqa21gwCXLujoHZG2r2TZDUbCxhWCLDvmd /cbRCT8hHJiZ+PY3cF6NHvoz2Rh/HzdX5kg3nHIJT63wB2stFGA2N4s0IauwQ3OJkf/X AsNg== X-Gm-Message-State: ALoCoQlBJnQVuZqQp6Mk07Im+ug+Rb9C+eIs2r7GDOgSZhOLdlRx1WCkuA8ZUa6jpnaE31418ynC X-Received: by 10.194.178.163 with SMTP id cz3mr7861482wjc.1.1415792880111; Wed, 12 Nov 2014 03:48:00 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.98 with SMTP id lb2ls199853lab.81.gmail; Wed, 12 Nov 2014 03:47:59 -0800 (PST) X-Received: by 10.152.21.167 with SMTP id w7mr41971875lae.70.1415792879354; Wed, 12 Nov 2014 03:47:59 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id ui10si34648240lbb.62.2014.11.12.03.47.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Nov 2014 03:47:59 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id gm9so10973766lab.5 for ; Wed, 12 Nov 2014 03:47:59 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr41340695lbc.23.1415792879213; Wed, 12 Nov 2014 03:47:59 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp408819lbc; Wed, 12 Nov 2014 03:47:58 -0800 (PST) X-Received: by 10.67.14.201 with SMTP id fi9mr18027691pad.133.1415792877586; Wed, 12 Nov 2014 03:47:57 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id it5si15386343pbb.192.2014.11.12.03.47.56 for ; Wed, 12 Nov 2014 03:47:57 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752404AbaKLLrz (ORCPT + 25 others); Wed, 12 Nov 2014 06:47:55 -0500 Received: from smtp.citrix.com ([66.165.176.89]:34943 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507AbaKLLrx (ORCPT ); Wed, 12 Nov 2014 06:47:53 -0500 X-IronPort-AV: E=Sophos;i="5.07,368,1413244800"; d="scan'208";a="190476323" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Wed, 12 Nov 2014 06:47:53 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XoWIP-0003Gl-5b; Wed, 12 Nov 2014 11:41:09 +0000 From: Stefano Stabellini To: CC: , , , , , , , Stefano Stabellini Subject: [PATCH v9 13/13] swiotlb-xen: remove BUG_ON in xen_bus_to_phys Date: Wed, 12 Nov 2014 11:40:54 +0000 Message-ID: <1415792454-23161-13-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On x86 truncation cannot occur because config XEN depends on X86_64 || (X86_32 && X86_PAE). On ARM truncation can occur without CONFIG_ARM_LPAE, when the dma operation involves foreign grants. However in that case the physical address returned by xen_bus_to_phys is actually invalid (there is no mfn to pfn tracking for foreign grants on ARM) and it is not used. Signed-off-by: Stefano Stabellini Reviewed-by: Catalin Marinas Acked-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 498b654..153cf14 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -96,8 +96,6 @@ static inline phys_addr_t xen_bus_to_phys(dma_addr_t baddr) dma_addr_t dma = (dma_addr_t)pfn << PAGE_SHIFT; phys_addr_t paddr = dma; - BUG_ON(paddr != dma); /* truncation has occurred, should never happen */ - paddr |= baddr & ~PAGE_MASK; return paddr;