Skip to content

Commit e13f51b

Browse files
yghannambp3tk0v
authored andcommitted
x86/amd_nb: Clean up early_is_amd_nb()
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 <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bee9e84 commit e13f51b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/x86/kernel/amd_nb.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,19 +385,18 @@ static int amd_cache_northbridges(void)
385385
*/
386386
bool __init early_is_amd_nb(u32 device)
387387
{
388-
const struct pci_device_id *misc_ids = amd_nb_misc_ids;
389388
const struct pci_device_id *id;
390389
u32 vendor = device & 0xffff;
391390

392391
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
393392
boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)
394393
return false;
395394

396-
if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
397-
misc_ids = hygon_nb_misc_ids;
395+
if (cpu_feature_enabled(X86_FEATURE_ZEN))
396+
return false;
398397

399398
device >>= 16;
400-
for (id = misc_ids; id->vendor; id++)
399+
for (id = amd_nb_misc_ids; id->vendor; id++)
401400
if (vendor == id->vendor && device == id->device)
402401
return true;
403402
return false;

0 commit comments

Comments
 (0)