トップ «前の日記(2024-10-27) 最新 次の日記(2024-11-06)» 編集

Orz日記 by Akio Morita

ToDo:

  • 15 SAD Fit[]回りの障害事例の解析
  • 10 smart pointer版PEGクラスの再実装(Left Recursionまわり)
2006|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|06|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|07|08|09|10|11|12|
2013|01|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|06|07|08|10|12|
2016|01|02|03|05|06|08|10|11|
2017|01|02|03|04|05|06|07|09|10|11|12|
2018|01|02|03|04|06|07|08|09|10|11|12|
2019|01|03|04|05|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|04|05|06|07|08|09|10|11|

2024-10-28 [長年日記]

_ [FreeBSD][Ryzen]amdtemp on Ryzen 9 9950X

備忘録としてまとめておく

  • 既に動くRyzen 9 7950Xとの比較
    • amdsmn driverがprobeする hostb0@pci0:0:0:0のPCI device IDは同一 (device=0x14d8)
    • amdsmn/amdtemp driver共に FamilyID checkで拒絶される
  • FamilyID/ModelIDまとめ
Processor FamilyID ModelID Stepping
Ryzen 9 9950X 1Ah 44h 0
Ryzen 9 7950X 19h 61h 2
  • 最低限必要な修正
    • 1Ah Family support
    • 1Ah Family向けのamdtemp_probe_ccd__sensors19h相当関数
  • stable/14上で書いたパッチ
diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c
index a0a7b9db60f8..e5c5656c5f11 100644
--- a/sys/dev/amdsmn/amdsmn.c
+++ b/sys/dev/amdsmn/amdsmn.c
@@ -205,6 +205,7 @@ amdsmn_probe(device_t dev)
       case 0x15:
       case 0x17:
       case 0x19:
+      case 0x1a:
               break;
       default:
               return (ENXIO);
diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c
index 583ff80cac69..0220887134fd 100644
--- a/sys/dev/amdtemp/amdtemp.c
+++ b/sys/dev/amdtemp/amdtemp.c
@@ -229,6 +229,7 @@ static int32_t     amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor);
 static int32_t        amdtemp_gettemp17h(device_t dev, amdsensor_t sensor);
 static void   amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model);
 static void   amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model);
+static void   amdtemp_probe_ccd_sensors1ah(device_t dev, uint32_t model);
 static int    amdtemp_sysctl(SYSCTL_HANDLER_ARGS);

 static device_method_t amdtemp_methods[] = {
@@ -316,6 +317,7 @@ amdtemp_probe(device_t dev)
       case 0x16:
       case 0x17:
       case 0x19:
+      case 0x1a:
               break;
       default:
               return (ENXIO);
@@ -475,6 +477,7 @@ amdtemp_attach(device_t dev)
               break;
       case 0x17:
       case 0x19:
+      case 0x1a:
               sc->sc_ntemps = 1;
               sc->sc_gettemp = amdtemp_gettemp17h;
               needsmn = true;
@@ -538,6 +541,8 @@ amdtemp_attach(device_t dev)
               amdtemp_probe_ccd_sensors17h(dev, model);
       else if (family == 0x19)
               amdtemp_probe_ccd_sensors19h(dev, model);
+      else if (family == 0x1a)
+              amdtemp_probe_ccd_sensors1ah(dev, model);
       else if (sc->sc_ntemps > 1) {
               SYSCTL_ADD_PROC(sysctlctx,
                   SYSCTL_CHILDREN(sysctlnode),
@@ -889,3 +894,24 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model)

       amdtemp_probe_ccd_sensors(dev, maxreg);
 }
+
+static void
+amdtemp_probe_ccd_sensors1ah(device_t dev, uint32_t model)
+{
+      struct amdtemp_softc *sc = device_get_softc(dev);
+      uint32_t maxreg;
+
+      switch (model) {
+      case 0x40 ... 0x4f: /* Zen5 Ryzen "Granite Ridge" */
+              sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE;
+              maxreg = 8;
+              _Static_assert((int)NUM_CCDS >= 8, "");
+              break;
+      default:
+              device_printf(dev,
+                  "Unrecognized Family 1ah Model: %02xh\n", model);
+              return;
+      }
+
+      amdtemp_probe_ccd_sensors(dev, maxreg);
+}
  • それっぽく動く模様
CPU: AMD Ryzen 9 9950X 16-Core Processor             (4292.17-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0xb40f40  Family=0x1a  Model=0x44  Stepping=0
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x7ed8320b<SSE3,PCLMULQDQ,MON,SSSE3,FMA,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x75c237ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT,TCE,Topology,PCXC,PNXC,DBE,PL2I,MWAITX,ADMSKX>
  Structured Extended Features=0xf1bf97ab<FSGSBASE,TSCADJ,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,PQM,PQE,AVX512F,AVX512DQ,RDSEED,ADX,SMAP,AVX512IFMA,CLFLUSHOPT,CLWB,AVX512CD,SHA,AVX512BW,AVX512VL>
  Structured Extended Features2=0x19405fde<AVX512VBMI,UMIP,PKU,OSPKE,AVX512VBMI2,GFNI,VAES,VPCLMULQDQ,AVX512VNNI,AVX512BITALG,AVX512VPOPCNTDQ,RDPID,MOVDIRI,MOVDIR64B>
  Structured Extended Features3=0x10000110<FSRM,AVX512VP2INTERSECT,L1DFL>
  XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
  AMD Extended Feature Extensions ID EBX=0x791ef257<CLZERO,IRPerf,XSaveErPtr,RDPRU,BE,WBNOINVD,IBPB,INT_WBINVD,IBRS,STIBP,STIBP_ALWAYSON,PREFER_IBRS,SAMEMODE_IBRS,NOLMSLE,SSBD,CPPC,PSFD,BTC_NO,IBPB_RET>
  SVM: Features=0xfebb9dff<NP,LbrVirt,SVML,NRIPS,TscRateMsr,VmcbClean,FlushByAsid,DecodeAssist,<b8>,PauseFilter,EncryptedMcodePatch,PauseFilterThreshold,V_VMSAVE_VMLOAD,vGIF,GMET,<b19>,GuesSpecCtl,<b21>,<b23>,<b25>,<b26>,<b27>,<b28>,<b29>,<b30>,<b31>>
Revision=1, ASIDs=32768
  TSC: P-state invariant, performance statistics
...
amdsmn0: <AMD Family 1ah System Management Network> on hostb0
amdtemp0: <AMD CPU On-Die Thermal Sensors> on hostb0
amdtemp0: Found 32 cores and 1 sensors.
...
% sysctl dev.amdtemp
dev.amdtemp.0.ccd1: 40.2C
dev.amdtemp.0.ccd0: 40.0C
dev.amdtemp.0.core0.sensor0: 50.6C
dev.amdtemp.0.sensor_offset: 0
dev.amdtemp.0.%parent: hostb0
dev.amdtemp.0.%pnpinfo:
dev.amdtemp.0.%location:
dev.amdtemp.0.%driver: amdtemp
dev.amdtemp.0.%desc: AMD CPU On-Die Thermal Sensors
dev.amdtemp.%parent:

カテゴリー: Admin | Emacs | EPICS | Fortran | FreeBSD | GCC | hgsubversion | IPv6 | KEKB | LHC | Lisp | LLVM | MADX | Ryzen | SAD | samba | tDiary | unix | WWW | YaSAI | お仕事 | イベント | 出張 | 宴会 | 数学 | 艦これ | 買いもの | 追記 | 雑記