Project

General

Profile

Actions

Feature #16406

closed

zen topo should tolerate missing revision or ppin info

Added by Robert Mustacchi about 1 month ago. Updated 13 days ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

To make the zen topo module a little more useful for folks, there are two things that we should make it more tolerant of:

1. Missing a CPU identification string. This is driven by MSR_PPIN, but some BIOSes lock it out and even if you try to enable it it may not take. This will lead to the chip not having a serial number and us not adding it to the ASRU, but that's better than nothing at all.
2. When we have a CPU without a known explicit revision, the module will attempt to add a NULL string to a set of properties which will fail later on. Like the above we should just not fail.

Actions #1

Updated by Electric Monk about 1 month ago

  • Gerrit CR set to 3378
Actions #2

Updated by Robert Mustacchi 16 days ago

I tested this by manually loading the Zen topo module on i86pc with the following diff:

commit 8b9ffaf442e2aca4d5dbb7c9ea8ccea2c4f9e444 (HEAD -> stlouis)
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   Sat Mar 16 00:00:10 2024 +0000

    hack to use zen topo module

diff --git a/usr/src/lib/fm/topo/modules/i86pc/chip/Makefile b/usr/src/lib/fm/topo/modules/i86pc/chip/Makefile
index c6db9f09b6..e2d4de15e3 100644
--- a/usr/src/lib/fm/topo/modules/i86pc/chip/Makefile
+++ b/usr/src/lib/fm/topo/modules/i86pc/chip/Makefile
@@ -36,7 +36,7 @@ MODULESRCS += topo_sensor.c
 include ../../Makefile.plugin
 LDLIBS += -lipmi -lfmd_agent -lumem -lsmbios -lkstat

-CPPFLAGS += -I$(SHAREDDIR)
+CPPFLAGS += -I$(SHAREDDIR) -I../../common/zen

 %.o: $(SHAREDDIR)/%.c
        $(COMPILE.c) -o $@ $<
diff --git a/usr/src/lib/fm/topo/modules/i86pc/chip/chip.c b/usr/src/lib/fm/topo/modules/i86pc/chip/chip.c
index 183bace316..9ce65f877f 100644
--- a/usr/src/lib/fm/topo/modules/i86pc/chip/chip.c
+++ b/usr/src/lib/fm/topo/modules/i86pc/chip/chip.c
@@ -52,6 +52,7 @@
 #include <fm/topo_mod.h>

 #include "chip.h" 
+#include "topo_zen.h" 

 #define        MAX_DIMMNUM     7
 #define        MAX_CSNUM       7
@@ -768,6 +769,31 @@ chip_enum(topo_mod_t *mod, tnode_t *pnode, const char *name,
        char buf[BUFSIZ];
        const char *dom0 = "control_d";

+
+       if (topo_mod_load(mod, TOPO_MOD_ZEN, TOPO_VERSION) == NULL) {
+               topo_mod_dprintf(mod,
+                   "rm chip: Failed to load %s module: %s\n",
+                   CHIP, topo_strerror(topo_mod_errno(mod)));
+       } else {
+               topo_zen_chip_t chip = {
+                       .tzc_sockid = 0
+               };
+               topo_instance_t min = 0, max = 0;
+               topo_mod_dprintf(mod, "%s: calling" 
+                   " chip enum\n", "rm chip");
+               rv =
+                   topo_mod_enumerate(mod, pnode,
+                   TOPO_MOD_ZEN, CHIP, min, max,
+                   &chip);
+               min = max + 1;
+               if (rv != 0)
+                       topo_mod_dprintf(mod, "rm chip:%s" 
+                           "enumeration failed: \n",
+                           CHIP);
+
+               return (rv);
+       }
+
        /*
         * Create nothing if we're running in domU.
         */

From here, I used this on a system that didn't have ppin information available and another development system that doesn't have formal revision information yet. Both of these now allowed the Zen topology module to enumerate.

Actions #3

Updated by Electric Monk 13 days ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 019df03d95e2a1cb86c73dd53255176f9611836a

commit  019df03d95e2a1cb86c73dd53255176f9611836a
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2024-04-08T21:42:53.000Z

    16407 Raphael DF revision detection is incorrect
    16405 initial amdzen family 1ah and cpuid support
    16406 zen topo should tolerate missing revision or ppin info
    Reviewed by: Andy Fiddaman <illumos@fiddaman.net>
    Reviewed by: Luqman Aden <luqman@oxide.computer>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF