Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753155AbbDBPyP (ORCPT ); Thu, 2 Apr 2015 11:54:15 -0400 Received: from mail-bn1on0132.outbound.protection.outlook.com ([157.56.110.132]:20144 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750771AbbDBPyN (ORCPT ); Thu, 2 Apr 2015 11:54:13 -0400 X-Greylist: delayed 70272 seconds by postgrey-1.27 at vger.kernel.org; Thu, 02 Apr 2015 11:54:13 EDT Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; 8bytes.org; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NM6S66-07-CV6-02 X-M-MSG: Message-ID: <551D661D.3030000@amd.com> Date: Thu, 2 Apr 2015 10:54:05 -0500 From: Aravind Gopalakrishnan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ingo Molnar CC: , , , , , , , , Subject: Re: [PATCH] x86, aperture: Check for GART before accessing GART registers References: <1427898728-3434-1-git-send-email-Aravind.Gopalakrishnan@amd.com> <20150402100135.GA5210@gmail.com> In-Reply-To: <20150402100135.GA5210@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.180.168.240] X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(428002)(199003)(51704005)(377454003)(24454002)(189002)(164054003)(479174004)(86362001)(19580405001)(19580395003)(50466002)(80316001)(33656002)(59896002)(92566002)(2950100001)(64126003)(120886001)(46102003)(83506001)(87936001)(47776003)(23746002)(36756003)(77156002)(50986999)(77096005)(106466001)(65816999)(110136001)(62966003)(105586002)(87266999)(54356999)(76176999)(3076001)(61793002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR02MB1298;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB1298; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:BY2PR02MB1298;BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB1298; X-Forefront-PRVS: 0534947130 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2015 15:54:08.9862 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1298 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1688 Lines: 40 On 4/2/2015 5:01 AM, Ingo Molnar wrote: > * Aravind Gopalakrishnan wrote: > >> GART registers are not present in newer processors (Fam15h, Model 10h >> and later). So, avoid accesses to GART registers in PCI config >> space by returning early in early_gart_iommu_check() and >> gart_iommu_hole_init() if GART is not available. > In what fashion did this problem manifest itself on real systems? > > This code doesn't break on existing processors. There are some other side effects though.. We get "AGP:" messages on kernel logs like this- [ 0.000000] AGP: Node 0: aperture [bus addr 0x00000000-0x01ffffff] (32MB) [ 0.000000] AGP: Your BIOS doesn't leave a aperture memory hole [ 0.000000] AGP: Please enable the IOMMU option in the BIOS setup [ 0.000000] AGP: This costs you 64MB of RAM [ 0.000000] AGP: Mapping aperture over RAM [mem 0xd4000000-0xd7ffffff] (65536KB) These are just noise on processors which have no GART. We can avoid calling allocate_aperture() and would not have to memblock_reserve() 64MB of RAM. Also, we can avoid having to loop through all PCI buses, devices (twice) searching for AGP bridge if we bail out early. For future processors though, we can't say how these registers will be implemented. If we have to provide PCI IDs for them in amd_nb_misc_ids[] and this code ends up reading/writing something else then that'd be another problem. Thanks, -Aravind. -- 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/