From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2D99C31E5D for ; Tue, 18 Jun 2019 15:25:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6A662085A for ; Tue, 18 Jun 2019 15:25:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729347AbfFRPZV (ORCPT ); Tue, 18 Jun 2019 11:25:21 -0400 Received: from 8bytes.org ([81.169.241.247]:59816 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728982AbfFRPZV (ORCPT ); Tue, 18 Jun 2019 11:25:21 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 188C34B5; Tue, 18 Jun 2019 17:25:19 +0200 (CEST) Date: Tue, 18 Jun 2019 17:25:17 +0200 From: Joerg Roedel To: Arnd Bergmann Cc: Christoph Hellwig , Srinath Mannam , Lorenzo Pieralisi , Bjorn Helgaas , Oza Pawandeep , Robin Murphy , Eric Auger , Julien Grall , Marc Zyngier , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iommu: fix integer truncation Message-ID: <20190618152517.GB21128@8bytes.org> References: <20190617133101.2817807-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190617133101.2817807-1-arnd@arndb.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 03:30:54PM +0200, Arnd Bergmann wrote: > On 32-bit architectures, phys_addr_t may be different from dma_add_t, > both smaller and bigger. This can lead to an overflow during an assignment > that clang warns about: > > drivers/iommu/dma-iommu.c:230:10: error: implicit conversion from 'dma_addr_t' (aka 'unsigned long long') to > 'phys_addr_t' (aka 'unsigned int') changes value from 18446744073709551615 to 4294967295 [-Werror,-Wconstant-conversion] > > Use phys_addr_t here because that is the type that the variable was > declared as. > > Fixes: aadad097cd46 ("iommu/dma: Reserve IOVA for PCIe inaccessible DMA address") > Signed-off-by: Arnd Bergmann Applied, thanks.