Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753041AbbDFXZk (ORCPT ); Mon, 6 Apr 2015 19:25:40 -0400 Received: from mail-bn1on0117.outbound.protection.outlook.com ([157.56.110.117]:7213 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751421AbbDFXZi (ORCPT ); Mon, 6 Apr 2015 19:25:38 -0400 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: 0NMER19-08-66H-02 X-M-MSG: Message-ID: <5523125E.2010605@amd.com> Date: Mon, 6 Apr 2015 18:10:22 -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: Ingo Molnar , Borislav Petkov 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> <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> In-Reply-To: <20150402181903.GA8723@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.222;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(428002)(189002)(164054003)(199003)(377454003)(24454002)(479174004)(87266999)(92566002)(120886001)(76176999)(54356999)(101416001)(46102003)(2950100001)(87936001)(50986999)(65816999)(65956001)(106466001)(105586002)(65806001)(93886004)(64126003)(83506001)(86362001)(33656002)(23746002)(36756003)(50466002)(47776003)(77096005)(62966003)(77156002)(61793002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0201MB0885;H:atltwp02.amd.com;FPR:;SPF:None;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB0885; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:BY1PR0201MB0885;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB0885; X-Forefront-PRVS: 0538A71254 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2015 23:10:25.6649 (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: BY1PR0201MB0885 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1674 Lines: 46 On 4/2/2015 1:19 PM, Ingo Molnar wrote: > >> + if (amd_gart_present()) >> amd_northbridges.flags |= AMD_NB_GART; >> >> /* >> diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c >> index 76164e173a24..1cb170b06853 100644 >> --- a/arch/x86/kernel/aperture_64.c >> +++ b/arch/x86/kernel/aperture_64.c >> @@ -262,7 +262,7 @@ void __init early_gart_iommu_check(void) >> u64 aper_base = 0, last_aper_base = 0; >> int aper_enabled = 0, last_aper_enabled = 0, last_valid = 0; >> >> - if (!early_pci_allowed()) >> + if (!early_pci_allowed() || !amd_gart_present()) >> return; >> >> /* This is mostly duplicate of iommu_hole_init */ >> @@ -356,7 +356,7 @@ int __init gart_iommu_hole_init(void) >> int i, node; >> >> if (gart_iommu_aperture_disabled || !fix_aperture || >> - !early_pci_allowed()) >> + !early_pci_allowed() || !amd_gart_present()) >> return -ENODEV; > 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? 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/