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=-8.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 60789C43461 for ; Fri, 4 Sep 2020 10:14:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 36190206D4 for ; Fri, 4 Sep 2020 10:14:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36190206D4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBDA46E21B; Fri, 4 Sep 2020 10:14:56 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D5E86E21B for ; Fri, 4 Sep 2020 10:14:55 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 488FFAF50; Fri, 4 Sep 2020 10:14:55 +0000 (UTC) Date: Fri, 4 Sep 2020 12:14:52 +0200 From: Joerg Roedel To: Chris Wilson Message-ID: <20200904101452.GD28643@suse.de> References: <20200822160209.28512-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200822160209.28512-1-chris@chris-wilson.co.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH] iommu/intel: Handle 36b addressing for x86-32 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: James Sewart , iommu@lists.linux-foundation.org, intel-gfx@lists.freedesktop.org, stable@vger.kernel.org, Lu Baolu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Sat, Aug 22, 2020 at 05:02:09PM +0100, Chris Wilson wrote: > Beware that the address size for x86-32 may exceed unsigned long. > > [ 0.368971] UBSAN: shift-out-of-bounds in drivers/iommu/intel/iommu.c:128:14 > [ 0.369055] shift exponent 36 is too large for 32-bit type 'long unsigned int' > > If we don't handle the wide addresses, the pages are mismapped and the > device read/writes go astray, detected as DMAR faults and leading to > device failure. The behaviour changed (from working to broken) in commit > fa954e683178 ("iommu/vt-d: Delegate the dma domain to upper layer"), but > the error looks older. > > Fixes: fa954e683178 ("iommu/vt-d: Delegate the dma domain to upper layer") > Signed-off-by: Chris Wilson > Cc: James Sewart > Cc: Lu Baolu > Cc: Joerg Roedel > Cc: # v5.3+ > --- > drivers/iommu/intel/iommu.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) Applied for v5.9, thanks. _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx 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=-8.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 CDB49C433E2 for ; Fri, 4 Sep 2020 10:15:02 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97620206D4 for ; Fri, 4 Sep 2020 10:15:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97620206D4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6E7BD86DE5; Fri, 4 Sep 2020 10:15:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vj6YWGr+TnUN; Fri, 4 Sep 2020 10:14:58 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 8502086DE4; Fri, 4 Sep 2020 10:14:58 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 70B5EC07FF; Fri, 4 Sep 2020 10:14:58 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id E7945C0051 for ; Fri, 4 Sep 2020 10:14:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CA0DA204C2 for ; Fri, 4 Sep 2020 10:14:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OQ58Q91fsulA for ; Fri, 4 Sep 2020 10:14:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by silver.osuosl.org (Postfix) with ESMTPS id C7D002035E for ; Fri, 4 Sep 2020 10:14:55 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 488FFAF50; Fri, 4 Sep 2020 10:14:55 +0000 (UTC) Date: Fri, 4 Sep 2020 12:14:52 +0200 From: Joerg Roedel To: Chris Wilson Subject: Re: [PATCH] iommu/intel: Handle 36b addressing for x86-32 Message-ID: <20200904101452.GD28643@suse.de> References: <20200822160209.28512-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200822160209.28512-1-chris@chris-wilson.co.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: iommu@lists.linux-foundation.org, intel-gfx@lists.freedesktop.org, stable@vger.kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Sat, Aug 22, 2020 at 05:02:09PM +0100, Chris Wilson wrote: > Beware that the address size for x86-32 may exceed unsigned long. > > [ 0.368971] UBSAN: shift-out-of-bounds in drivers/iommu/intel/iommu.c:128:14 > [ 0.369055] shift exponent 36 is too large for 32-bit type 'long unsigned int' > > If we don't handle the wide addresses, the pages are mismapped and the > device read/writes go astray, detected as DMAR faults and leading to > device failure. The behaviour changed (from working to broken) in commit > fa954e683178 ("iommu/vt-d: Delegate the dma domain to upper layer"), but > the error looks older. > > Fixes: fa954e683178 ("iommu/vt-d: Delegate the dma domain to upper layer") > Signed-off-by: Chris Wilson > Cc: James Sewart > Cc: Lu Baolu > Cc: Joerg Roedel > Cc: # v5.3+ > --- > drivers/iommu/intel/iommu.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) Applied for v5.9, thanks. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-8.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 1100EC28E83 for ; Fri, 4 Sep 2020 10:14:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E027A206D4 for ; Fri, 4 Sep 2020 10:14:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726171AbgIDKO4 (ORCPT ); Fri, 4 Sep 2020 06:14:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:54342 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726114AbgIDKOz (ORCPT ); Fri, 4 Sep 2020 06:14:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 488FFAF50; Fri, 4 Sep 2020 10:14:55 +0000 (UTC) Date: Fri, 4 Sep 2020 12:14:52 +0200 From: Joerg Roedel To: Chris Wilson Cc: iommu@lists.linux-foundation.org, intel-gfx@lists.freedesktop.org, James Sewart , Lu Baolu , stable@vger.kernel.org Subject: Re: [PATCH] iommu/intel: Handle 36b addressing for x86-32 Message-ID: <20200904101452.GD28643@suse.de> References: <20200822160209.28512-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200822160209.28512-1-chris@chris-wilson.co.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Sat, Aug 22, 2020 at 05:02:09PM +0100, Chris Wilson wrote: > Beware that the address size for x86-32 may exceed unsigned long. > > [ 0.368971] UBSAN: shift-out-of-bounds in drivers/iommu/intel/iommu.c:128:14 > [ 0.369055] shift exponent 36 is too large for 32-bit type 'long unsigned int' > > If we don't handle the wide addresses, the pages are mismapped and the > device read/writes go astray, detected as DMAR faults and leading to > device failure. The behaviour changed (from working to broken) in commit > fa954e683178 ("iommu/vt-d: Delegate the dma domain to upper layer"), but > the error looks older. > > Fixes: fa954e683178 ("iommu/vt-d: Delegate the dma domain to upper layer") > Signed-off-by: Chris Wilson > Cc: James Sewart > Cc: Lu Baolu > Cc: Joerg Roedel > Cc: # v5.3+ > --- > drivers/iommu/intel/iommu.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) Applied for v5.9, thanks.