Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966019AbdIYUFv (ORCPT ); Mon, 25 Sep 2017 16:05:51 -0400 Received: from mail-dm3nam03on0133.outbound.protection.outlook.com ([104.47.41.133]:7187 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934287AbdIYUFu (ORCPT ); Mon, 25 Sep 2017 16:05:50 -0400 From: Casey Leedom To: Dan Williams CC: Robin Murphy , Herbert Xu , "Harsh Jain" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-crypto@vger.kernel.org" , "dwmw2@infradead.org" , David Woodhouse Subject: Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU Thread-Topic: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU Thread-Index: AQHTLrKuCX/YGlya50aETYTEmnILyqK9cAoAgAAkZQCACFcnkoAAINWAgAAIn0k= Date: Mon, 25 Sep 2017 20:05:45 +0000 Message-ID: References: <20170920080151.GA3348@gondor.apana.org.au> <26992a1e-edb3-ed78-ce8e-31e0739d75f4@arm.com> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leedom@chelsio.com; x-originating-ip: [12.32.117.8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR12MB1952;6:Wvr4Zjr4jf+TrbebpEW4iwrx7YR8s4AHcZtA98JbTG+RoatDrvfLsxoMG1mdtmPhjf0x38x9gSA2gvO8D6gTZs5mZgwHudw1Q3T/ZKJ/YrfqEt5h/wcK+ucgbyXsrncL1WJg0qGcNE1ckq8K65ah2b9V5JeIdFuJkoQYhBiEBBQB+KsBQgeuxVwD271CkrKaa+pgwAAm3W1IKO5QjzYmwWYlmNovdPBcXKCW0cqFPJEHhIXhiOqESViYwWAWU8+YcmTPVelRV/F73m3BXjpCvYew24hTwCUzmJCYq3j2FQAHo9ZIGIKH4aqXiLtZnrSeFicVPioBdG0jUKwoYNDAzg==;5:QIrcitYOTySgJUPjCCvCCnSQnuJoHjFbaGpPFXe5dmNUldkq/V0FBDDKQsvzeCBWwUJ3yVBM9p0BWGR8G6Sxfgiy1CoDvh8TrOCcMJezlZN9jw8r/yjoEL5jwAABXT1S8fOkMUp/+881hEfoIhtV+A==;24:1xUSSTMH+lGPY4k4Igmb+Q1G+5VXMb806ljX9a7M7beTbluO+zPfGd2jBrDQTtJ50PyRfqfdOkAAZrrLNMMJbeo0x0fbgMr7Hea3IAahf+8=;7:2B4LJzXPAhzY74X/ErGryXnoI8vkiSGQhLt/LwYN7dbQI/di5L7Dch+RVEnJlKpQyFD711GM8+5aHXog+WXIevehPzUAlcv4f31UR+7zHPiNrna0kVzpgBhYO5Rqjlxs4oQjrC1QmuIlfU5DEcFKiiLtqOju8Kyv22QYBrmAfVwlBCdO/6/d4nkLCX+XeYaKactYV1yUOIhe2T/WUbPs4mNhV2I1p1wOmGvebYT93Sc= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(6009001)(376002)(346002)(189002)(377454003)(199003)(93886005)(68736007)(2950100002)(3280700002)(508600001)(6916009)(81166006)(3660700001)(5660300001)(102836003)(7736002)(54906003)(3846002)(6436002)(305945005)(6116002)(74316002)(8936002)(6506006)(229853002)(99286003)(77096006)(6246003)(66066001)(97736004)(55016002)(50986999)(76176999)(105586002)(9686003)(25786009)(53936002)(54356999)(4326008)(106356001)(7696004)(8676002)(14454004)(2900100001)(81156014)(33656002)(86362001)(189998001)(2906002)(101416001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR12MB1952;H:MWHPR12MB1600.namprd12.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: b1a8e945-2b95-4515-11b3-08d50450ce8a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017082002075)(2017052603199)(201703131423075)(201702281549075);SRVR:MWHPR12MB1952; x-ms-traffictypediagnostic: MWHPR12MB1952: x-exchange-antispam-report-test: UriScan:(228905959029699); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123555025)(2016111802025)(20161123558100)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201703061421075)(6072148)(6043046)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR12MB1952;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR12MB1952; x-forefront-prvs: 04410E544A spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-OriginatorOrg: chelsio.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2017 20:05:45.0749 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 065db76d-a7ae-4c60-b78a-501e8fc17095 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1952 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v8PK6MNF002693 Content-Length: 491 Lines: 17 | From: Dan Williams | Sent: Monday, September 25, 2017 12:31 PM | ... | IIUC it looks like this has been broken ever since commit e1605495c716 | "intel-iommu: Introduce domain_sg_mapping() to speed up | intel_map_sg()". I.e. it looks like the calculation for pte_val should | be: | | ?? pteval = (page_to_phys(sg_page(sg)) + sg->offset) | prot; Hhmmm, shouldn't that be: pteval = (page_to_phys(sg_page(sg)) + (sg->offset>>PAGE_SHIFT)) | prot; ??? Casey