From patchwork Wed Oct 23 17:21:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yazen Ghannam X-Patchwork-Id: 13847661 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060.outbound.protection.outlook.com [40.107.223.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82D9875809; Wed, 23 Oct 2024 17:22:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729704130; cv=fail; b=J/ANrAF5tp3uZDfKSJeoRp7m7bfFQDElAwxbA/q6emUsO+/5iFpxHvdz9IRBAsEoYlS1tYSQ23Gy8WLTDMOypFd0K0qp4ID40DulbOdj+1mjMYk0/E4bJpzpKJLJGtwTg73sIOgMQ/nt4QXq7lMpJJaRHKN1toaZ0TITBwi3Pw0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729704130; c=relaxed/simple; bh=/uV2y9qYhLf9P9mABYvlYIAtQ6LQiCFoqUU1/0/I8Kg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tbm/UzhCfQhp6HBfHVvp1SzG/aRbaJN6bEsspzbdiw+pCH03S+wYoshbmdssq+9XE6NJ1lBYcvRQBOV1GiQuelTehcO0vR2XRIvqciA31As24BjJFQJ/E/0QtbDTOFqGZ7TkM80+Gv2vz5AVUpLSDMmgTe8j19fv3BACxYoLgms= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=CMlxkEZk; arc=fail smtp.client-ip=40.107.223.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="CMlxkEZk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QfIgjWS+PYjLyg8ah+gWPlVzKamZd6F/1L0BNAnCDWIaDyv+5klDk3n+CQwtnOs8WsPFur2hvahLGQffoN6RaNZ8TFFCacFE1YQDp7DdhA5F6GIPSvqZZoAtJRErO/CC4LKBkaC88TpF6jO+vjRsOyf7dHMaOUblmWCt5hJ+ie8HMRM3EY3zn6QzCb+vsKZkE0QJRJbZ9Vk8CYLgy8q0oieWmN5XVesrHtTHi6uLribRwaoUb/ofQWvo1iOUabJywOsR3VPR7tzw5ujd2xzJHcKGZhkrcFYhBLA8E7qBni3kClmCauSlvdBG1Pafd5aFJhuY3j19MzW/+E9HUMdLwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WYTLkH/mZD7UGt5ZYPEGA+hEksxYN49GsZlC9wOy8jA=; b=P/SAQxzbZuMeNb/c/plZdlBuHtBBlOSb2Gvd6k4zi2X9vbbaMoVfNT03e1OkEz9WJ9slMgieMYr3f96W8ENJCOhiUMz81VYyx1DvgFDbKdjPSsw/iLfmE2IkKuVgm7nhTw56EqRLNmeioli+zvCJZmS5lupOkkrk/qQwD/O0qAV48WWcfssUvK/C/3QHw91qiJHJ3qZ+M+K4RbfSOdVN7htlK/3mam3R2VhIvFwudSDuVQhaU052lTWJaEyIT89vkPe79+exthr224nJKQSIKELt8BsKVDgaVpPdejzYy0DncmWTEEz7btzp5zz8gbZfJ20g0jJ5pcCwnGkkwZB0mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WYTLkH/mZD7UGt5ZYPEGA+hEksxYN49GsZlC9wOy8jA=; b=CMlxkEZkZdy2DrrL1kVe7AwIWBJlruFTZ6ZhQ89kdhxQrk1f8PghFdg4q4AS5bLkFA26+t8pi8gc5r8hQkMqOTSVJnpod3hKKvn5RKvHqLMEKecRwgPdDpiDMb7DBpCg2mb6wkFf+XeH4bgKIZQ9qOXzfZHWzg2yFenTcCDkyU0= Received: from BN0PR08CA0009.namprd08.prod.outlook.com (2603:10b6:408:142::13) by MN0PR12MB5979.namprd12.prod.outlook.com (2603:10b6:208:37e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Wed, 23 Oct 2024 17:22:05 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:408:142:cafe::c8) by BN0PR08CA0009.outlook.office365.com (2603:10b6:408:142::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Wed, 23 Oct 2024 17:22:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 17:22:05 +0000 Received: from purico-9eb2host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 23 Oct 2024 12:22:04 -0500 From: Yazen Ghannam To: CC: , , , , , , , , , , , , , , , , , , , Yazen Ghannam Subject: [PATCH 02/16] x86/amd_nb: Restrict init function to AMD-based systems Date: Wed, 23 Oct 2024 17:21:36 +0000 Message-ID: <20241023172150.659002-3-yazen.ghannam@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241023172150.659002-1-yazen.ghannam@amd.com> References: <20241023172150.659002-1-yazen.ghannam@amd.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|MN0PR12MB5979:EE_ X-MS-Office365-Filtering-Correlation-Id: 02210d45-db06-440b-3062-08dcf3873771 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: wKja+YVymazqWY0OC9EqY2kfRXUxVulHmRHXEAG1TyDG+IeEOhgXaSp+ZZUjWFF62jRqi3ww3il1O3yj5NAHV28P6wddjMi6v7bdEcpFtaUnHJ+V5iM8zNJHIlXqsAl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e1k/YxnTjV1rc18iEGrE992gFm1NZFf1pgs3F3jCpRr6eOBqWJQBDTgx6aD5rGiyrxeLAdo0njpnLUCtZVaKTXdZmfj4OMiQcZFVrDTMUJ6OhmK1eN0SILL4WmMV59CmZHWPOcsNAL1D3IMNDz44lgIxVNbzRNRVotZrLvCEM7969f0JtJ5gZip7i2DGvrHr+pArrDPJcINPspXKTH7JRP0BNjRnTQb9c7g== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 17:22:05.5442 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02210d45-db06-440b-3062-08dcf3873771 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5979 The code implicitly operates on AMD-based systems by matching on PCI IDs. However, the use of these IDs is going away. Add an explicit CPU vendor check instead of relying on PCI IDs. Signed-off-by: Yazen Ghannam --- arch/x86/kernel/amd_nb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index 9fe9972d2071..37b8244899d8 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c @@ -582,6 +582,10 @@ static __init void fix_erratum_688(void) static __init int init_amd_nbs(void) { + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD && + boot_cpu_data.x86_vendor != X86_VENDOR_HYGON) + return 0; + amd_cache_northbridges(); amd_cache_gart();