From patchwork Wed Oct 23 17:21:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yazen Ghannam X-Patchwork-Id: 13847672 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2067.outbound.protection.outlook.com [40.107.243.67]) (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 1EF7E1CF5E6; Wed, 23 Oct 2024 17:22:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729704131; cv=fail; b=XxtPwv1s5kxc/4/gEFAqHHtO7kqG5dbxIuLpTf03BXWWZNQMxGpngDQjwMQLqeulXEYztHJ/3G/Bglq3nK594kZmAhr9TyEX7a53rN1UOrzkcgoCGyRTW38nbDe1bTFPCs+qKExxlH1Ffl0fpl3Sm3839co8hV+XvqLWyG1uSkg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729704131; c=relaxed/simple; bh=OQxfHvFjuuNlVIxAhZTsaJrJUHybixhHLmQg3InXlSQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Tsf3vDDlXWowDxAkGm+P/rkExOM0UDl6uLkMt4SUzrsUAKEQH1S8SjVzPKUDtQ6i9j4TG1g4zaSdDFnv/kuVQlyBZd4vVrRj7pJCny3sblxaVEU3KmgX0c9FtQmL6Dtjgq1qhiVL/nk8I9lOA2a4pHMQ9DLQkPgMe+p1kNsppXY= 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=vkyuGYsU; arc=fail smtp.client-ip=40.107.243.67 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="vkyuGYsU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bbeui+/xRXpb2vgCUiG+EiK0W8a24+TFhlxugY0NumQpO/FDs88rxZW+NEQqg1DHuQiwfVFdIj7fqMfkl8vFwsLs6XxKDvlzmiZIwsp8Z/Eir+ghejMnU6CgHSkvb6B6QGRAlk/XB2JR+yNsZBSPDqGp8epc5BSTub2+WvcgcV6MC4sy3ZvTZ706srKSoPv2FArF8ZTk34SzXflXaxyqSCnfmyarUbXREc8lnaf0C5CV7aug3W5tzaumqnCaTc46SlGmGyDNOCKovhhBKg+VynOiTINeG4lewXZylmdvDMD4CIaTWYTpv1qoWgeVJkZjQyTBDK/VN4oxfZFD9iQGAA== 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=E18zgn1p3i/bkUeVRfSrWl7ziS2hVjpIPX/yFhMFfXE=; b=Pee7o1PDjm7OmauGx0+XvtCmswtnSHfckX/5oJ2j0FGdCnc5hmIbXUSKUIvydA7qzJMi6ggu+luH2e7JvKBXQmemMiKKenleV39aP3zaDHuNS9gTrstF1u8/4YeMwAE/0TsVa5+H+oUNBaggj3SVO2hjm7uNcggpLOTMhL6HSxQX8JsoqbjGaEkB46CgNZcxBJs/50Dnw5k1wKi2Krj657NYxiChPAz8J0CfN/gpmr/cpUBxzpmUaG0SmmfafKmglkrheHMHAlCerSj13cKcP2hYILMJlc1TfTPSDrJ/cJaqV531JolHoQXsK5ZBXvO/vXo8a4BpS68Ener/07VVjw== 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=E18zgn1p3i/bkUeVRfSrWl7ziS2hVjpIPX/yFhMFfXE=; b=vkyuGYsUxxZSJoD2PG/KQXH/1HsRm5GJYhTmpxLXf20pg/su+vKPKv5IJoyvUjBkD7koWNY5S7KwIbjGA/sUg5ajhABtuVvL7YLdaHbbecG5ou6HyLUa6p/WmZzRokFNE+vKTxHg0GEWdeHdopw8hG8gzjAC6fH6V0fucUvY6cY= Received: from BL1PR13CA0104.namprd13.prod.outlook.com (2603:10b6:208:2b9::19) by IA0PR12MB8863.namprd12.prod.outlook.com (2603:10b6:208:488::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Wed, 23 Oct 2024 17:22:06 +0000 Received: from BL6PEPF0001AB4D.namprd04.prod.outlook.com (2603:10b6:208:2b9:cafe::7) by BL1PR13CA0104.outlook.office365.com (2603:10b6:208:2b9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17 via Frontend Transport; Wed, 23 Oct 2024 17:22:06 +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 BL6PEPF0001AB4D.mail.protection.outlook.com (10.167.242.71) 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:06 +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:05 -0500 From: Yazen Ghannam To: CC: , , , , , , , , , , , , , , , , , , , Yazen Ghannam Subject: [PATCH 03/16] x86/amd_nb: Clean up early_is_amd_nb() Date: Wed, 23 Oct 2024 17:21:37 +0000 Message-ID: <20241023172150.659002-4-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-hwmon@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: BL6PEPF0001AB4D:EE_|IA0PR12MB8863:EE_ X-MS-Office365-Filtering-Correlation-Id: 06215daf-5333-43a6-f8a0-08dcf3873809 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|7416014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: yE7fDts+m4hehzna89ilUkeE9O9tdVC41tf6Ncr7P0Mq1BmlSesixMPUe0vfDCRhL8/yNJy1FHcFM2sb69tkCh3+GzSMQTpN12mfaO1yhFWhU2BaUUn3wjo61FEW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OO08g2tQqlskjOVzqspJaHRHOFFS3dBGSYqc/mcsgp/weMTzj7Giu9RJTnXRjOtizi5M6P6ILLdstyMZ4Irxf1xXHhVRAzxUXgAUBUnnjD9fhfdnJclJNbQDJFZo1P+Ml2pKvySHZnqKMEZOsAZvocuED7LLij3VZCsWnlxSBOvldHq71OVcofezK3T314Hz+0zu0yRJuV9c5Bt5wMbneIcFiKUrX/QCQ== 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)(376014)(82310400026)(7416014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 17:22:06.5298 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06215daf-5333-43a6-f8a0-08dcf3873809 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: BL6PEPF0001AB4D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8863 The check for early_is_amd_nb() is only useful for systems with GART or the NB_CFG register. Zen-based systems (both AMD and Hygon) have neither, so return early for them. Signed-off-by: Yazen Ghannam --- arch/x86/kernel/amd_nb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index 37b8244899d8..65884d0613f8 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c @@ -385,7 +385,6 @@ static int amd_cache_northbridges(void) */ bool __init early_is_amd_nb(u32 device) { - const struct pci_device_id *misc_ids = amd_nb_misc_ids; const struct pci_device_id *id; u32 vendor = device & 0xffff; @@ -393,11 +392,11 @@ bool __init early_is_amd_nb(u32 device) boot_cpu_data.x86_vendor != X86_VENDOR_HYGON) return false; - if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) - misc_ids = hygon_nb_misc_ids; + if (boot_cpu_has(X86_FEATURE_ZEN)) + return false; device >>= 16; - for (id = misc_ids; id->vendor; id++) + for (id = amd_nb_misc_ids; id->vendor; id++) if (vendor == id->vendor && device == id->device) return true; return false;