Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840AbbDGMhL (ORCPT ); Tue, 7 Apr 2015 08:37:11 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41352 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753106AbbDGMhG (ORCPT ); Tue, 7 Apr 2015 08:37:06 -0400 Date: Tue, 7 Apr 2015 14:34:57 +0200 From: Borislav Petkov To: Aravind Gopalakrishnan Cc: Ingo Molnar , tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, bhelgaas@google.com, linux-kernel@vger.kernel.org, Suravee.Suthikulpanit@amd.com, joro@8bytes.org Subject: Re: [PATCH] x86, aperture: Check for GART before accessing GART registers Message-ID: <20150407123457.GA3681@pd.tnic> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5523125E.2010605@amd.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1265 Lines: 39 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. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- 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/