Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932504Ab0GOFlI (ORCPT ); Thu, 15 Jul 2010 01:41:08 -0400 Received: from mga03.intel.com ([143.182.124.21]:53809 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932443Ab0GOFlE (ORCPT ); Thu, 15 Jul 2010 01:41:04 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.55,206,1278313200"; d="scan'208";a="300389752" Message-ID: <4C3E9F6E.1030508@intel.com> Date: Wed, 14 Jul 2010 22:41:02 -0700 From: Dan Williams User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: David Woodhouse CC: Chris Li , linux-kernel Subject: Re: BUG in drivers/dma/ioat/dma_v2.c:314 References: <4C2AC55E.3040303@intel.com> <1277923422.16256.8.camel@localhost> <4C2B9DAC.1030806@intel.com> <1277928125.18854.0.camel@localhost> <4C2BBACF.3080405@intel.com> <1277965264.18854.16.camel@localhost> <4C2C3B07.7050200@intel.com> <1277968336.4945.3.camel@localhost> <4C2C4319.6090906@intel.com> <1277972137.12558.2.camel@localhost> <4C2CCE67.6070600@intel.com> <1278324973.16975.68.camel@localhost> <1278463901.20082.34.camel@dwillia2-linux> <1278474039.31393.8.camel@localhost> <4C34BDCD.9080607@intel.com> <4C379462.1020704@intel.com> <1278720554.9522.18.camel@localhost> In-Reply-To: <1278720554.9522.18.camel@localhost> Content-Type: multipart/mixed; boundary="------------090005020002000602080408" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8443 Lines: 138 This is a multi-part message in MIME format. --------------090005020002000602080408 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/9/2010 5:09 PM, David Woodhouse wrote: > Actually, given that we know the chipset, can't we just read the VT BARs > directly from config space and check that the base address of the IOMMU > we get is the right one for the I/OAT device? > > Something like... > > pci_read_config_dword( ("0:0.0") , 0x48,&vtbar ); > if (drhd->base_address != vtbar) > WARN(); Ok, here is a patch that takes this approach. David, will you sign off on this? Chris, I'll add a tested-by line if you can give this a shot. Thanks, Dan --------------090005020002000602080408 Content-Type: text/plain; name="ioat-catch-broken-vtd-v4.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ioat-catch-broken-vtd-v4.patch" aW9hdDogY2F0Y2ggYW5kIHJlY292ZXIgZnJvbSBicm9rZW4gdnRkIGNvbmZpZ3VyYXRpb25z CgpGcm9tOiBEYW4gV2lsbGlhbXMgPGRhbi5qLndpbGxpYW1zQGludGVsLmNvbT4KCk9uIHNv bWUgcGxhdGZvcm1zIChNYWNQcm8zLDEpIHRoZSBCSU9TIGFzc2lnbnMgdGhlIGlvYXRkbWEg ZGV2aWNlIHRvIHRoZQppbmNvcnJlY3QgaW9tbXUgY2F1c2luZyBpb21tdS1mYXVsdHMgd2hl biB0aGUgZHJpdmVyIGluaXRpYWxpemVzLiAgQWRkIGEgcXVpcmsKdG8gY2F0Y2ggdGhpcyBt aXNjb25maWd1cmF0aW9uLCBhbmQgdGVhY2ggdGhlIGlvYXRkbWEgZHJpdmVyIHRvIHRyZWF0 CmluaXRpYWxpemF0aW9uIGZhaWx1cmVzIGFzIG5vbi1mYXRhbCAoanVzdCBmYWlsIHRoZSBk cml2ZXIgbG9hZCkuCgpSZXBvcnRlZC1ieTogQ2hyaXMgTGkgPGxrbWxAY2hyaXNsaS5vcmc+ ClNpZ25lZC1vZmYtYnk6IERhbiBXaWxsaWFtcyA8ZGFuLmoud2lsbGlhbXNAaW50ZWwuY29t PgotLS0KCiBkcml2ZXJzL2RtYS9pb2F0L2RtYS5oICAgIHwgICAgMSArCiBkcml2ZXJzL2Rt YS9pb2F0L2RtYV92Mi5jIHwgICAyNCArKysrKysrKysrKysrKysrKysrKysrLS0KIGRyaXZl cnMvZG1hL2lvYXQvZG1hX3Yz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id0IiBoYXBwZW4g Ki8KKwkJZGV2X2luZm8oJnBkZXYtPmRldiwgImZhaWxlZCB0byBydW4gdnQtZCBxdWlya1xu Iik7CisJCXJldHVybjsKKwl9CisJdnRiYXIgJj0gMHhmZmZmMDAwMDsKKworCWZvcl9lYWNo X2RyaGRfdW5pdChkcmhkKQorCQlmb3IgKGkgPSAwOyBpIDwgZHJoZC0+ZGV2aWNlc19jbnQ7 IGkrKykgeworCQkJLyogd2Uga25vdyB0aGF0IHRoZSB0aGlzIGRldmljZSdzIGlvbW11IGlz IGF0CisJCQkgKiBvZmZzZXQgMHhhMDAwIGZyb20gdnRiYXIKKwkJCSAqLworCQkJaWYgKGRy aGQtPmRldmljZXNbaV0gPT0gcGRldiAmJgorCQkJICAgIGRyaGQtPnJlZ19iYXNlX2FkZHIg LSB2dGJhciAhPSAweGEwMDApIHsKKwkJCQlXQVJOX1RBSU5UX09OQ0UoMSwgVEFJTlRfRklS TVdBUkVfV09SS0FST1VORCwKKwkJCQkJCSJCSU9TIGFzc2lnbmVkIGluY29ycmVjdCBWVC1k IHVuaXQgZm9yIEludGVsKFIpIFF1aWNrRGF0YSBUZWNobm9sb2d5IGRldmljZVxuIik7CisJ CQkJcGRldi0+ZGV2LmFyY2hkYXRhLmlvbW11ID0gRFVNTVlfREVWSUNFX0RPTUFJTl9JTkZP OworCQkJCXJldHVybjsKKwkJCX0KKwkJfQorfQorREVDTEFSRV9QQ0lfRklYVVBfRU5BQkxF KFBDSV9WRU5ET1JfSURfSU5URUwsIFBDSV9ERVZJQ0VfSURfSU5URUxfSU9BVF9TTkIsIHF1 aXJrX2lvYXRfc25iX2xvY2FsX2lvbW11KTsKKwogc3RhdGljIHZvaWQgX19pbml0IGluaXRf bm9fcmVtYXBwaW5nX2RldmljZXModm9pZCkKIHsKIAlzdHJ1Y3QgZG1hcl9kcmhkX3VuaXQg KmRyaGQ7Cg== --------------090005020002000602080408-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/