Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753372AbbDGUe1 (ORCPT ); Tue, 7 Apr 2015 16:34:27 -0400 Received: from mail-bn1bn0107.outbound.protection.outlook.com ([157.56.110.107]:10249 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750862AbbDGUeY (ORCPT ); Tue, 7 Apr 2015 16:34:24 -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: 0NMGEH3-08-1O7-02 X-M-MSG: Message-ID: <55243F4B.2090307@amd.com> Date: Tue, 7 Apr 2015 15:34:19 -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: <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> <5523EDC2.5080206@amd.com> <20150407145737.GB3681@pd.tnic> In-Reply-To: <20150407145737.GB3681@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)(479174004)(199003)(51704005)(24454002)(164054003)(189002)(377454003)(33656002)(80316001)(77096005)(62966003)(110136001)(50466002)(105586002)(101416001)(87936001)(86362001)(64126003)(77156002)(106466001)(92566002)(93886004)(99136001)(36756003)(23676002)(50986999)(76176999)(65816999)(120886001)(54356999)(83506001)(47776003)(65956001)(2950100001)(46102003)(61793002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0201MB0892;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:CY1PR0201MB0892; 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:CY1PR0201MB0892;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB0892; X-Forefront-PRVS: 0539EEBD11 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2015 20:34:21.2369 (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: CY1PR0201MB0892 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1979 Lines: 51 On 4/7/2015 9:57 AM, Borislav Petkov wrote: > On Tue, Apr 07, 2015 at 09:46:26AM -0500, Aravind Gopalakrishnan wrote: >> Okay. I'll do that and correct the typos Ingo pointed out earlier and >> resend. > Btw, I think you should do the same in early_gart_iommu_check() too. > > Doing the testing this way would mean that we first are testing for GART > hw presence and then do the rest of checks. If no GART hw, the rest of > the checks are meaningless. > > Also, when testing do a "pci=noearly" boot which should make > > !early_pci_allowed() > > true and thus test that path too. > Here are results from further testing: 1. on platforms with both iommu and gart - with pci=noearly, we break out of init routines in aperture_64.c early. amd_iommu_init() will run through it's init routine. - if amd_iommu_init() fails somewhere, we fall back to gart_iommu_init() - gart_iommu_init() fails since gart_iommu_aperture is not set. - fall back to swiotlb. - with amd_iommu=off - init routines in aperture_64.c run fine as both amd_gart_present() and early_pci_allowed() are true - amd_iommu_detect() fails due to command line arg. - fall back to gart iommu - with pci=noearly and amd_iommu=off - break out of aperture_64.c init routines, and amd_iommu_detect() fails. - fall back to swiotlb 2. on platform with no gart but iommu present, - pci=noearly option is not relevant as we break before that due to !amd_gart_present() - if amd_iommu_init() fails somewhere, we fall back to swiotlb, else use iommu 3. on platforms with no gart and no iommu - use swiotlb regardless of any command line options passed 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/