Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754645AbbDGPBE (ORCPT ); Tue, 7 Apr 2015 11:01:04 -0400 Received: from mail-bn1bon0135.outbound.protection.outlook.com ([157.56.111.135]:12640 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754448AbbDGPA7 (ORCPT ); Tue, 7 Apr 2015 11:00:59 -0400 X-Greylist: delayed 57030 seconds by postgrey-1.27 at vger.kernel.org; Tue, 07 Apr 2015 11:00:59 EDT Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; 8bytes.org; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NMFYDC-08-VOF-02 X-M-MSG: Message-ID: <5523EDC2.5080206@amd.com> Date: Tue, 7 Apr 2015 09:46:26 -0500 From: Aravind Gopalakrishnan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Borislav Petkov CC: Ingo Molnar , , , , , , , , 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> <551D661D.3030000@amd.com> <20150402160634.GB8045@gmail.com> <551D6CF5.1010604@amd.com> <20150402165356.GE4579@pd.tnic> <551D7695.2010509@amd.com> <20150402171705.GF4579@pd.tnic> <20150402181903.GA8723@gmail.com> <5523125E.2010605@amd.com> <20150407123457.GA3681@pd.tnic> In-Reply-To: <20150407123457.GA3681@pd.tnic> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.180.168.240] X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(428002)(377454003)(479174004)(199003)(189002)(51704005)(164054003)(83506001)(36756003)(105586002)(33656002)(106466001)(101416001)(65956001)(47776003)(23676002)(76176999)(50986999)(86362001)(54356999)(50466002)(77156002)(92566002)(120886001)(59896002)(87936001)(65816999)(46102003)(110136001)(87266999)(77096005)(2950100001)(93886004)(62966003)(61793002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0201MB0887;H:atltwp02.amd.com;FPR:;SPF:None;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB0887; 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:BY1PR0201MB0887;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB0887; X-Forefront-PRVS: 0539EEBD11 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2015 14:46:29.8489 (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.222];Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0201MB0887 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1360 Lines: 39 On 4/7/2015 7:34 AM, Borislav Petkov wrote: > On Mon, Apr 06, 2015 at 06:10:22PM -0500, Aravind Gopalakrishnan wrote: >>> So what happens if !early_pci_allowed() but the GART is present? We'll >>> set amd_northbridges.flags |= AMD_NB_GART, but won't run any of the >>> setup code in aperture_64.c, right? Is that a valid setup? >> It might be a valid setup. But it would work correctly only if BIOS did the >> right thing with setting up aperture space. >> >> If !early_pci_allowed() and BIOS did not setup aperture correctly, that >> would have caused problems already. >> But it has not been an issue so far right? > I think the right question to ask is: > > What are we doing when there's no GART? > > So what you probably want to do is: > > if (!amd_gart_present()) > return -ENODEV; > > *before* the compound check. > > Now, if we have detected a GART, i.e., amd_gart_present() is TRUE, the > code will behave as it used to behave before. > > This should be the least intrusive change going forward IMHO. > Okay. I'll do that and correct the typos Ingo pointed out earlier and resend. 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/