Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp602305ybb; Wed, 25 Mar 2020 06:12:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuGgTFgIY1joXXWY+WJKKCA16PWBRXDa2cNMjLbEhqune4bG5HTtsY8eCcnhwhR3483UXpD X-Received: by 2002:a9d:d0f:: with SMTP id 15mr2448697oti.161.1585141936475; Wed, 25 Mar 2020 06:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585141936; cv=none; d=google.com; s=arc-20160816; b=YXxAeAC5n73NGHEUCLCbEaqpt/atlHtlaBSUvUgiVc9DdiqLE33gKR6rbB73YdPA47 wwq0RBwCfmnUq1sUDFYbcZn0zKZQR83IZYjN4rHZ5TSR3UId/wqfSJ9SUOz7N9+XLSBv qBKWjnc4pLnt9RO8BV3X6t/2lQipbM5TyhGg9Jv9/6CKFPaFmhPQ+LBYsM9Agb31tPz1 ycbtLzyoCxGx7VmavZJ2GZgszORc26vdAmry3sYPxVCStECTZj8HjOrbYuTvCRnHXN6/ fjkpWnnw1IhQDS0ADwMKgbGgmS1INgT7bdLYygk0yAEXuL2yPJQMFpgx8MogOOpTI+TP 3uaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=JXXm+HhY8m7YdyZpSpi5tqOa94E9o/2r79KujkCGNl8=; b=MiaNfdSw6riiaexeJzsqsUI4XAKkV/DJOv0ryUhFTWHMuuX+7+UrmCt3tfk9ppH/ST emF7vB+9ADB+9YIAbt9+mphWD1LZxh9EXvP1fBGAImHzz+YAIrlK6VvnYCXF4Jz4DMQ4 LZGNZ9jB7Zuvh7Kq2SC2FYwV7m2vT8CLScKvd2HJkoQ9TW297R0QDuU/68vgUtjNt8zq Vfxgta7d4kaoD+V5CRHAZCnm+YhMCIpk5r6pVXbIlHsmeqNNCjguFyQPaNETZxFtWCKn b/UO7plygCnEXoPgfIfuI7N3g8ljh7ZWxEamNeE5KkG/xkQJH25mX/ELKCTfwXV0Y8z0 /v7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si864195otm.3.2020.03.25.06.11.59; Wed, 25 Mar 2020 06:12:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727351AbgCYNLN convert rfc822-to-8bit (ORCPT + 99 others); Wed, 25 Mar 2020 09:11:13 -0400 Received: from mga03.intel.com ([134.134.136.65]:31955 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbgCYNLN (ORCPT ); Wed, 25 Mar 2020 09:11:13 -0400 IronPort-SDR: +pyz6I9cTDgx6JJ06qvs5VuPsZZ9Io4xt7lN7Dmem0jqnoUFy6DiZdFR8Rzd0kZqUI/4k17RF5 ODPS5cHPDvsg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 06:11:12 -0700 IronPort-SDR: clQRKiwbv1/99tLauQvTCow+r5cSYsqoMQeYRPTxir5so2wx7LWxTTxyY0AXS8lLb00XYjuQFP F0zXB9bRkTzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="326220818" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 25 Mar 2020 06:11:12 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 06:11:11 -0700 Received: from fmsmsx107.amr.corp.intel.com ([169.254.6.38]) by fmsmsx117.amr.corp.intel.com ([169.254.3.48]) with mapi id 14.03.0439.000; Wed, 25 Mar 2020 06:11:11 -0700 From: "Ruhl, Michael J" To: Shane Francis , "dri-devel@lists.freedesktop.org" CC: "airlied@linux.ie" , "linux-kernel@vger.kernel.org" , "amd-gfx-request@lists.freedesktop.org" , "alexander.deucher@amd.com" , "christian.koenig@amd.com" Subject: RE: [PATCH v4 0/3] AMDGPU / RADEON / DRM Fix mapping of user pages Thread-Topic: [PATCH v4 0/3] AMDGPU / RADEON / DRM Fix mapping of user pages Thread-Index: AQHWAoUBcHg2O0WoqkuGqDdXnKtf46hZSF3A Date: Wed, 25 Mar 2020 13:11:11 +0000 Message-ID: <14063C7AD467DE4B82DEDB5C278E8663FFFBD36E@fmsmsx107.amr.corp.intel.com> References: <20200325090741.21957-1-bigbeeshane@gmail.com> In-Reply-To: <20200325090741.21957-1-bigbeeshane@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >-----Original Message----- >From: dri-devel On Behalf Of >Shane Francis >Sent: Wednesday, March 25, 2020 5:08 AM >To: dri-devel@lists.freedesktop.org >Cc: airlied@linux.ie; linux-kernel@vger.kernel.org; bigbeeshane@gmail.com; >amd-gfx-request@lists.freedesktop.org; alexander.deucher@amd.com; >christian.koenig@amd.com >Subject: [PATCH v4 0/3] AMDGPU / RADEON / DRM Fix mapping of user pages > >This patch set is to fix a bug in amdgpu / radeon drm that results in >a crash when dma_map_sg combines elemnets within a scatterlist table. s/elemnets/elements >There are 2 shortfalls in the current kernel. > >1) AMDGPU / RADEON assumes that the requested and created scatterlist > table lengths using from dma_map_sg are equal. This may not be the > case using the newer dma-iommu implementation > >2) drm_prime does not fetch the length of the scatterlist > via the correct dma macro, this can use the incorrect length > being used (>0) in places where dma_map_sg has updated the table > elements. > > The sg_dma_len macro is representative of the length of the sg item > after dma_map_sg > >Example Crash : >> [drm:amdgpu_ttm_backend_bind [amdgpu]] *ERROR* failed to pin userptr > >This happens in OpenCL applications, causing them to crash or hang, on >either amdgpu-pro or ROCm OpenCL implementations > >I have verified this fixes the above on kernel 5.5 and 5.5rc using an >AMD Vega 64 GPU > >Shane Francis (3): > drm/prime: use dma length macro when mapping sg to arrays > drm/amdgpu: fix scatter-gather mapping with user pages > drm/radeon: fix scatter-gather mapping with user pages > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- > drivers/gpu/drm/drm_prime.c | 2 +- > drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > >-- >2.26.0 > >_______________________________________________ >dri-devel mailing list >dri-devel@lists.freedesktop.org >https://lists.freedesktop.org/mailman/listinfo/dri-devel