[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v3 5/6] x86/MCE: add default switch case in init_nonfatal_mce_checker()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Sergiy Kibrik <sergiy_kibrik@xxxxxxxx>
  • Date: Mon, 20 May 2024 12:41:22 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=qKKzr/TNqZsZXKYVtC1RvRlyBxT4+FNoFnSIEiFpoWk=; b=b/Empw2ivvld5dgTqEd0cLsHviE2GlcVX/Tnc9Tdxj26ljsdE5L2bYBNC2thoNwwaybCE+ModwiNZQABDgkbrBq61H27wjgpmmG/Z914/72C02e6Wv/cV09CtqGzX0xuk5KrOYcARH7aHtzLr6RdoTgRKqkNroStegGhDEUcYvA8zDVn4ngtAjRHiBXRQ9S/BgZkUP56TeXuHo3YmMYLtmAuxRv7/AVa2r8wp65xPL0Lgn5ZF5lmD9FrxZJk/7uEBfeb1stkzQRRkW1tTpARSsSzK0GXxWuUMrJSo6vMwPqbw8vZe5HbEu2V6JCd8+pmA149FhkqJnmnlgcHnpZlCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lxhm+6vaNKYwHefwNWxRrc65D0f1dqGz3mLkHDDK0jUE50eaNkZ0bkk4tzMCQ42/gHJohalCYXOKWvNgjuuzCt0Glv9bAd0x0AoP8UZvoqrHyLosGpizKgNkV4FygpZvraegnfvmEbncolI6QycPcRDjrTreUGbYzwT0EGKFp/OhyhlJEGxkhfUmNs6tQ/rvXh01Re2IKyT0ZZhsBv2MgA40ak2IWo/WFrujF06m/gSmS56SHIdCk2VYFlwow8j2TFRF6xz7NwLvxveAlRSu102+9xltgoMgMQ/HBygefjHtFWjKtyiBIRQA8J8R579kBIWVSOs/cx+aHiKZGQDNPw==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 20 May 2024 09:41:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

16.05.24 12:46, Jan Beulich:
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c
@@ -29,9 +29,13 @@ static int __init cf_check init_nonfatal_mce_checker(void)
                /* Assume we are on K8 or newer AMD or Hygon CPU here */
                amd_nonfatal_mcheck_init(c);
                break;
+
        case X86_VENDOR_INTEL:
                intel_nonfatal_mcheck_init(c);
                break;
+
+       default:
+               return -ENODEV;
        }
        printk(KERN_INFO "mcheck_poll: Machine check polling timer started.\n");
        return 0;
... converting this to an error return still isn't justified. On one hand it's
benign because we still don't check return values from initcalls. Yet otoh it
isn't really an error, is it?
I realize earlier in the function there are error returns, too. I question at
least the former of them as well. And the latter shouldn't be an error at least
when the vendor isn't going to be handled in the switch().

I'll just return 0 then, and maybe leave a comment, as this code will start to look a bit unnatural to me.

  -Sergiy



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.