From 14d06d9d73fb4b56257acee0d62fa247954218f9 Mon Sep 17 00:00:00 2001 From: Wenhui Fan Date: Thu, 13 Feb 2025 15:04:19 +0800 Subject: [PATCH] x86/amd_nb: Fix northbridge init warning in guest for Hygon family 18h model 4h hygon inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBM2BF CVE: NA --------------------------- When booting in guest on Hygon family 18h model 4h platform, there is warning as follows: "Hygon Fam18h Model4h northbridge init failed(-19)!" Avoid the northbridge init failure warning in guest since there is no northbridge. Fixes: 29203c13c08e ("x86/amd_nb: Add northbridge support for Hygon family 18h model 4h") Signed-off-by: Wenhui Fan --- arch/x86/kernel/amd_nb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index 8c64dc3a94d1..c83475923d3b 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c @@ -433,8 +433,9 @@ static int northbridge_init_f18h_m4h(const struct pci_device_id *root_ids, amd_northbridges.nb = NULL; ret: - pr_err("Hygon Fam%xh Model%xh northbridge init failed(%d)!\n", - boot_cpu_data.x86, boot_cpu_data.x86_model, err); + if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) + pr_err("Hygon Fam%xh Model%xh northbridge init failed(%d)!\n", + boot_cpu_data.x86, boot_cpu_data.x86_model, err); return err; } -- Gitee