€•댌sphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ%/translations/zh_CN/arch/x86/amd_hsmp”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/zh_TW/arch/x86/amd_hsmp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/it_IT/arch/x86/amd_hsmp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ja_JP/arch/x86/amd_hsmp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ko_KR/arch/x86/amd_hsmp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/pt_BR/arch/x86/amd_hsmp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/sp_SP/arch/x86/amd_hsmp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ?/var/lib/git/docbuild/linux/Documentation/arch/x86/amd_hsmp.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒAMD HSMP interface”h]”hŒAMD HSMP interface”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hŒÏNewer Fam19h(model 0x00-0x1f, 0x30-0x3f, 0x90-0x9f, 0xa0-0xaf), Fam1Ah(model 0x00-0x1f) EPYC server line of processors from AMD support system management functionality via HSMP (Host System Management Port).”h]”hŒÏNewer Fam19h(model 0x00-0x1f, 0x30-0x3f, 0x90-0x9f, 0xa0-0xaf), Fam1Ah(model 0x00-0x1f) EPYC server line of processors from AMD support system management functionality via HSMP (Host System Management Port).”…”�”}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)�”}”(hŒžThe Host System Management Port (HSMP) is an interface to provide OS-level software with access to system management functions via a set of mailbox registers.”h]”hŒžThe Host System Management Port (HSMP) is an interface to provide OS-level software with access to system management functions via a set of mailbox registers.”…”�”}”(hhíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhÊh²hubhÞ)�”}”(hŒ©More details on the interface can be found in chapter "7 Host System Management Port (HSMP)" of the family/model PPR Eg: https://docs.amd.com/v/u/en-US/55898_B1_pub_0_50”h]”(hŒ}More details on the interface can be found in chapter “7 Host System Management Port (HSMP)â€� of the family/model PPR Eg: ”…”�”}”(hhûh²hh³Nh´NubhŒ reference”“”)�”}”(hŒ0https://docs.amd.com/v/u/en-US/55898_B1_pub_0_50”h]”hŒ0https://docs.amd.com/v/u/en-US/55898_B1_pub_0_50”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”juh1jhhûubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)�”}”(hŒIHSMP interface is supported on EPYC line of server CPUs and MI300A (APU).”h]”hŒIHSMP interface is supported on EPYC line of server CPUs and MI300A (APU).”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ HSMP device”h]”hŒ HSMP device”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj(h²hh³hÇh´KubhÞ)�”}”(hŒ»amd_hsmp driver under drivers/platforms/x86/amd/hsmp/ has separate driver files for ACPI object based probing, platform device based probing and for the common code for these two drivers.”h]”hŒ»amd_hsmp driver under drivers/platforms/x86/amd/hsmp/ has separate driver files for ACPI object based probing, platform device based probing and for the common code for these two drivers.”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj(h²hubhÞ)�”}”(hX(Kconfig option CONFIG_AMD_HSMP_PLAT compiles plat.c and creates amd_hsmp.ko. Kconfig option CONFIG_AMD_HSMP_ACPI compiles acpi.c and creates hsmp_acpi.ko. Selecting any of these two configs automatically selects CONFIG_AMD_HSMP. This compiles common code hsmp.c and creates hsmp_common.ko module.”h]”hX(Kconfig option CONFIG_AMD_HSMP_PLAT compiles plat.c and creates amd_hsmp.ko. Kconfig option CONFIG_AMD_HSMP_ACPI compiles acpi.c and creates hsmp_acpi.ko. Selecting any of these two configs automatically selects CONFIG_AMD_HSMP. This compiles common code hsmp.c and creates hsmp_common.ko module.”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj(h²hubhÞ)�”}”(hŒtBoth the ACPI and plat drivers create the miscdevice /dev/hsmp to let user space programs run hsmp mailbox commands.”h]”hŒtBoth the ACPI and plat drivers create the miscdevice /dev/hsmp to let user space programs run hsmp mailbox commands.”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K#hj(h²hubhÞ)�”}”(hŒ@The ACPI object format supported by the driver is defined below.”h]”hŒ@The ACPI object format supported by the driver is defined below.”…”�”}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K&hj(h²hubhÞ)�”}”(hŒH$ ls -al /dev/hsmp crw-r--r-- 1 root root 10, 123 Jan 21 21:41 /dev/hsmp”h]”hŒH$ ls -al /dev/hsmp crw-r--r-- 1 root root 10, 123 Jan 21 21:41 /dev/hsmp”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K(hj(h²hubhŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒ•Characteristics of the dev node: * Write mode is used for running set/configure commands * Read mode is used for running get/status monitor commands ”h]”(hŒterm”“”)�”}”(hŒ Characteristics of the dev node:”h]”hŒ Characteristics of the dev node:”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jŠh³hÇh´K-hj†ubhŒ definition”“”)�”}”(hhh]”hŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒ5Write mode is used for running set/configure commands”h]”hÞ)�”}”(hj¨h]”hŒ5Write mode is used for running set/configure commands”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K,hj¦ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hj¡ubj¥)�”}”(hŒ:Read mode is used for running get/status monitor commands ”h]”hÞ)�”}”(hŒ9Read mode is used for running get/status monitor commands”h]”hŒ9Read mode is used for running get/status monitor commands”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K-hj½ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hj¡ubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jŸh³hÇh´K,hjœubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhj†ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÇh´K-hj�ubj…)�”}”(hŒ‰Access restrictions: * Only root user is allowed to open the file in write mode. * The file can be opened in read mode by all the users. ”h]”(j‹)�”}”(hŒAccess restrictions:”h]”hŒAccess restrictions:”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jŠh³hÇh´K1hjéubj›)�”}”(hhh]”j )�”}”(hhh]”(j¥)�”}”(hŒ9Only root user is allowed to open the file in write mode.”h]”hÞ)�”}”(hjh]”hŒ9Only root user is allowed to open the file in write mode.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K0hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjþubj¥)�”}”(hŒ6The file can be opened in read mode by all the users. ”h]”hÞ)�”}”(hŒ5The file can be opened in read mode by all the users.”h]”hŒ5The file can be opened in read mode by all the users.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K1hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjþubeh}”(h]”h ]”h"]”h$]”h&]”jÛjÜuh1jŸh³hÇh´K0hjûubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjéubeh}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÇh´K1hj�h²hubj…)�”}”(hŒ®In-kernel integration: * Other subsystems in the kernel can use the exported transport function hsmp_send_message(). * Locking across callers is taken care by the driver. ”h]”(j‹)�”}”(hŒIn-kernel integration:”h]”hŒIn-kernel integration:”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jŠh³hÇh´K7hjBubj›)�”}”(hhh]”j )�”}”(hhh]”(j¥)�”}”(hŒ[Other subsystems in the kernel can use the exported transport function hsmp_send_message().”h]”hÞ)�”}”(hŒ[Other subsystems in the kernel can use the exported transport function hsmp_send_message().”h]”hŒ[Other subsystems in the kernel can use the exported transport function hsmp_send_message().”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K4hjZubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjWubj¥)�”}”(hŒ5Locking across callers is taken care by the driver. ”h]”hÞ)�”}”(hŒ3Locking across callers is taken care by the driver.”h]”hŒ3Locking across callers is taken care by the driver.”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K6hjrubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjWubeh}”(h]”h ]”h"]”h$]”h&]”jÛjÜuh1jŸh³hÇh´K4hjTubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjBubeh}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÇh´K7hj�h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhj(h²hh³Nh´Nubeh}”(h]”Œ hsmp-device”ah ]”h"]”Œ hsmp device”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒHSMP sysfs interface”h]”hŒHSMP sysfs interface”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjªh²hh³hÇh´K:ubhŒenumerated_list”“”)�”}”(hhh]”j¥)�”}”(hŒMetrics table binary sysfs ”h]”hÞ)�”}”(hŒMetrics table binary sysfs”h]”hŒMetrics table binary sysfs”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjªh²hubhÞ)�”}”(hŒ¤The metrics table is made available as hexadecimal sysfs binary file under per socket sysfs directory created at /sys/devices/platform/amd_hsmp/socket%d/metrics_bin”h]”hŒ¤The metrics table is made available as hexadecimal sysfs binary file under per socket sysfs directory created at /sys/devices/platform/amd_hsmp/socket%d/metrics_bin”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KAhjªh²hubhÞ)�”}”(hŒ?Note: lseek() is not supported as entire metrics table is read.”h]”hŒ?Note: lseek() is not supported as entire metrics table is read.”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KEhjªh²hubhÞ)�”}”(hX}The sysfs metrics_bin path supports only HSMP protocol version 6 and, because it is a file read, can return a torn snapshot if userspace reads in pieces. The protocol version 7 metric table (~13 KB) also exceeds PAGE_SIZE, so a read returns ``-EOPNOTSUPP`` there. For atomic reads on any protocol version, use the ``HSMP_IOCTL_GET_TELEMETRY_DATA`` ioctl on /dev/hsmp (see below).”h]”(hŒòThe sysfs metrics_bin path supports only HSMP protocol version 6 and, because it is a file read, can return a torn snapshot if userspace reads in pieces. The protocol version 7 metric table (~13 KB) also exceeds PAGE_SIZE, so a read returns ”…”�”}”(hj h²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``-EOPNOTSUPP``”h]”hŒ -EOPNOTSUPP”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubhŒ; there. For atomic reads on any protocol version, use the ”…”�”}”(hj h²hh³Nh´Nubj)�”}”(hŒ!``HSMP_IOCTL_GET_TELEMETRY_DATA``”h]”hŒHSMP_IOCTL_GET_TELEMETRY_DATA”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubhŒ ioctl on /dev/hsmp (see below).”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KGhjªh²hubhÞ)�”}”(hŒqMetrics table definitions will be documented as part of Public PPR. The same is defined in the amd_hsmp.h header.”h]”hŒqMetrics table definitions will be documented as part of Public PPR. The same is defined in the amd_hsmp.h header.”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KNhjªh²hubj¼)�”}”(hhh]”j¥)�”}”(hŒHSMP telemetry sysfs files ”h]”hÞ)�”}”(hŒHSMP telemetry sysfs files”h]”hŒHSMP telemetry sysfs files”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KQhjRubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjOh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”jÞjßjàhjájâŒstart”Kuh1j»hjªh²hh³hÇh´KQubhÞ)�”}”(hŒJFollowing sysfs files are available at /sys/devices/platform/AMDI0097:0X/.”h]”hŒJFollowing sysfs files are available at /sys/devices/platform/AMDI0097:0X/.”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KShjªh²hubj )�”}”(hhh]”(j¥)�”}”(hŒ4c0_residency_input: Percentage of cores in C0 state.”h]”hÞ)�”}”(hj„h]”hŒ4c0_residency_input: Percentage of cores in C0 state.”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KUhj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒVprochot_status: Reports 1 if the processor is at thermal threshold value, 0 otherwise.”h]”hÞ)�”}”(hŒVprochot_status: Reports 1 if the processor is at thermal threshold value, 0 otherwise.”h]”hŒVprochot_status: Reports 1 if the processor is at thermal threshold value, 0 otherwise.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KVhj™ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒ%smu_fw_version: SMU firmware version.”h]”hÞ)�”}”(hj³h]”hŒ%smu_fw_version: SMU firmware version.”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KXhj±ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒ)protocol_version: HSMP interface version.”h]”hÞ)�”}”(hjÊh]”hŒ)protocol_version: HSMP interface version.”…”�”}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KYhjÈubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒ6ddr_max_bw: Theoretical maximum DDR bandwidth in GB/s.”h]”hÞ)�”}”(hjáh]”hŒ6ddr_max_bw: Theoretical maximum DDR bandwidth in GB/s.”…”�”}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KZhjßubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒ>ddr_utilised_bw_input: Current utilized DDR bandwidth in GB/s.”h]”hÞ)�”}”(hjøh]”hŒ>ddr_utilised_bw_input: Current utilized DDR bandwidth in GB/s.”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K[hjöubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒLddr_utilised_bw_perc_input(%): Percentage of current utilized DDR bandwidth.”h]”hÞ)�”}”(hjh]”hŒLddr_utilised_bw_perc_input(%): Percentage of current utilized DDR bandwidth.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K\hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒ mclk_input: Memory clock in MHz.”h]”hÞ)�”}”(hj&h]”hŒ mclk_input: Memory clock in MHz.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K]hj$ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒ fclk_input: Fabric clock in MHz.”h]”hÞ)�”}”(hj=h]”hŒ fclk_input: Fabric clock in MHz.”…”�”}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K^hj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒ-clk_fmax: Maximum frequency of socket in MHz.”h]”hÞ)�”}”(hjTh]”hŒ-clk_fmax: Maximum frequency of socket in MHz.”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K_hjRubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒ-clk_fmin: Minimum frequency of socket in MHz.”h]”hÞ)�”}”(hjkh]”hŒ-clk_fmin: Minimum frequency of socket in MHz.”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K`hjiubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒDcclk_freq_limit_input: Core clock frequency limit per socket in MHz.”h]”hÞ)�”}”(hj‚h]”hŒDcclk_freq_limit_input: Core clock frequency limit per socket in MHz.”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kahj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒOpwr_current_active_freq_limit: Current active frequency limit of socket in MHz.”h]”hÞ)�”}”(hŒOpwr_current_active_freq_limit: Current active frequency limit of socket in MHz.”h]”hŒOpwr_current_active_freq_limit: Current active frequency limit of socket in MHz.”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kbhj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubj¥)�”}”(hŒPpwr_current_active_freq_limit_source: Source of current active frequency limit. ”h]”hÞ)�”}”(hŒOpwr_current_active_freq_limit_source: Source of current active frequency limit.”h]”hŒOpwr_current_active_freq_limit_source: Source of current active frequency limit.”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kdhj¯ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÛjÜuh1jŸh³hÇh´KUhjªh²hubeh}”(h]”Œhsmp-sysfs-interface”ah ]”h"]”Œhsmp sysfs interface”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K:ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒACPI device object format”h]”hŒACPI device object format”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÕh²hh³hÇh´KhubhÞ)�”}”(hŒ^The ACPI object format expected from the amd_hsmp driver for socket with ID00 is given below::”h]”hŒ]The ACPI object format expected from the amd_hsmp driver for socket with ID00 is given below:”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KihjÕh²hubhŒ literal_block”“”)�”}”(hX[Device(HSMP) { Name(_HID, "AMDI0097") Name(_UID, "ID00") Name(HSE0, 0x00000001) Name(RBF0, ResourceTemplate() { Memory32Fixed(ReadWrite, 0xxxxxxx, 0x00100000) }) Method(_CRS, 0, NotSerialized) { Return(RBF0) } Method(_STA, 0, NotSerialized) { If(LEqual(HSE0, One)) { Return(0x0F) } Else { Return(Zero) } } Name(_DSD, Package(2) { Buffer(0x10) { 0x9D, 0x61, 0x4D, 0xB7, 0x07, 0x57, 0xBD, 0x48, 0xA6, 0x9F, 0x4E, 0xA2, 0x87, 0x1F, 0xC2, 0xF6 }, Package(3) { Package(2) {"MsgIdOffset", 0x00010934}, Package(2) {"MsgRspOffset", 0x00010980}, Package(2) {"MsgArgOffset", 0x000109E0} } }) }”h]”hX[Device(HSMP) { Name(_HID, "AMDI0097") Name(_UID, "ID00") Name(HSE0, 0x00000001) Name(RBF0, ResourceTemplate() { Memory32Fixed(ReadWrite, 0xxxxxxx, 0x00100000) }) Method(_CRS, 0, NotSerialized) { Return(RBF0) } Method(_STA, 0, NotSerialized) { If(LEqual(HSE0, One)) { Return(0x0F) } Else { Return(Zero) } } Name(_DSD, Package(2) { Buffer(0x10) { 0x9D, 0x61, 0x4D, 0xB7, 0x07, 0x57, 0xBD, 0x48, 0xA6, 0x9F, 0x4E, 0xA2, 0x87, 0x1F, 0xC2, 0xF6 }, Package(3) { Package(2) {"MsgIdOffset", 0x00010934}, Package(2) {"MsgRspOffset", 0x00010980}, Package(2) {"MsgArgOffset", 0x000109E0} } }) }”…”�”}”hjösbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´KlhjÕh²hubeh}”(h]”Œacpi-device-object-format”ah ]”h"]”Œacpi device object format”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KhubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒHSMP HWMON interface”h]”hŒHSMP HWMON interface”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj h²hh³hÇh´K•ubhÞ)�”}”(hXHSMP power sensors are registered with the hwmon interface. A separate hwmon directory is created for each socket and the following files are generated within the hwmon directory. - power1_input (read only) - power1_cap_max (read only) - power1_cap (read, write)”h]”hXHSMP power sensors are registered with the hwmon interface. A separate hwmon directory is created for each socket and the following files are generated within the hwmon directory. - power1_input (read only) - power1_cap_max (read only) - power1_cap (read, write)”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K–hj h²hubeh}”(h]”Œhsmp-hwmon-interface”ah ]”h"]”Œhsmp hwmon interface”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K•ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ An example”h]”hŒ An example”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj3h²hh³hÇh´KžubhÞ)�”}”(hŒPTo access hsmp device from a C program. First, you need to include the headers::”h]”hŒOTo access hsmp device from a C program. First, you need to include the headers:”…”�”}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hj3h²hubjõ)�”}”(hŒ#include ”h]”hŒ#include ”…”�”}”hjRsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´K£hj3h²hubhÞ)�”}”(hŒ1Which defines the supported messages/message IDs.”h]”hŒ1Which defines the supported messages/message IDs.”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¥hj3h²hubhÞ)�”}”(hŒ.Next thing, open the device file, as follows::”h]”hŒ-Next thing, open the device file, as follows:”…”�”}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K§hj3h²hubjõ)�”}”(hŒŒint file; file = open("/dev/hsmp", O_RDWR); if (file < 0) { /* ERROR HANDLING; you can check errno to see what went wrong */ exit(1); }”h]”hŒŒint file; file = open("/dev/hsmp", O_RDWR); if (file < 0) { /* ERROR HANDLING; you can check errno to see what went wrong */ exit(1); }”…”�”}”hj|sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´K©hj3h²hubhÞ)�”}”(hŒ!The following IOCTLs are defined:”h]”hŒ!The following IOCTLs are defined:”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K±hj3h²hubj€)�”}”(hhh]”(j…)�”}”(hX``ioctl(file, HSMP_IOCTL_CMD, struct hsmp_message *msg)`` The argument is a pointer to a:: struct hsmp_message { __u32 msg_id; /* Message ID */ __u16 num_args; /* Number of input argument words in message */ __u16 response_sz; /* Number of expected output/response words */ __u32 args[HSMP_MAX_MSG_LEN]; /* argument/response buffer */ __u16 sock_ind; /* socket number */ }; ”h]”(j‹)�”}”(hŒ9``ioctl(file, HSMP_IOCTL_CMD, struct hsmp_message *msg)``”h]”j)�”}”(hj¡h]”hŒ5ioctl(file, HSMP_IOCTL_CMD, struct hsmp_message *msg)”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjŸubah}”(h]”h ]”h"]”h$]”h&]”uh1jŠh³hÇh´K¼hj›ubj›)�”}”(hhh]”(hÞ)�”}”(hŒ The argument is a pointer to a::”h]”hŒThe argument is a pointer to a:”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K´hj¶ubjõ)�”}”(hX—struct hsmp_message { __u32 msg_id; /* Message ID */ __u16 num_args; /* Number of input argument words in message */ __u16 response_sz; /* Number of expected output/response words */ __u32 args[HSMP_MAX_MSG_LEN]; /* argument/response buffer */ __u16 sock_ind; /* socket number */ };”h]”hX—struct hsmp_message { __u32 msg_id; /* Message ID */ __u16 num_args; /* Number of input argument words in message */ __u16 response_sz; /* Number of expected output/response words */ __u32 args[HSMP_MAX_MSG_LEN]; /* argument/response buffer */ __u16 sock_ind; /* socket number */ };”…”�”}”hjÇsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´K¶hj¶ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jšhj›ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÇh´K¼hj˜ubj…)�”}”(hXÌ``ioctl(file, HSMP_IOCTL_GET_TELEMETRY_DATA, struct hsmp_telemetry_data *req)`` Atomically fetch the firmware metric (telemetry) table for a socket. The ioctl copies the table in one shot, so unlike the metrics_bin sysfs path it cannot return a torn snapshot and is not bounded by PAGE_SIZE. Required for HSMP protocol version 7+ (e.g. Family 1Ah Model 50h-5Fh, whose table is ~13 KB). Argument:: struct hsmp_telemetry_data { __u64 buf; /* User pointer to destination buffer */ __u32 size; /* Size of @buf in bytes */ __u16 sock_ind; /* Socket index */ __u16 reserved; /* Reserved, must be zero */ }; ``size`` must be non-zero and no larger than the table size firmware reports for that socket; a larger value is rejected with ``-EINVAL`` rather than short-written, and a smaller one returns the leading ``size`` bytes of the snapshot. A non-zero ``reserved`` is also rejected with ``-EINVAL``. The table layout depends on the protocol version, which userspace reads from the ``protocol_version`` sysfs attribute. On version 6 the table is ``struct hsmp_metric_table``, so callers pass ``sizeof(struct hsmp_metric_table)``. Later version metrics table layout is documented in the Public PPR. ”h]”(j‹)�”}”(hŒO``ioctl(file, HSMP_IOCTL_GET_TELEMETRY_DATA, struct hsmp_telemetry_data *req)``”h]”j)�”}”(hjçh]”hŒKioctl(file, HSMP_IOCTL_GET_TELEMETRY_DATA, struct hsmp_telemetry_data *req)”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjåubah}”(h]”h ]”h"]”h$]”h&]”uh1jŠh³hÇh´KÖhjáubj›)�”}”(hhh]”(hÞ)�”}”(hX>Atomically fetch the firmware metric (telemetry) table for a socket. The ioctl copies the table in one shot, so unlike the metrics_bin sysfs path it cannot return a torn snapshot and is not bounded by PAGE_SIZE. Required for HSMP protocol version 7+ (e.g. Family 1Ah Model 50h-5Fh, whose table is ~13 KB). Argument::”h]”hX=Atomically fetch the firmware metric (telemetry) table for a socket. The ioctl copies the table in one shot, so unlike the metrics_bin sysfs path it cannot return a torn snapshot and is not bounded by PAGE_SIZE. Required for HSMP protocol version 7+ (e.g. Family 1Ah Model 50h-5Fh, whose table is ~13 KB). Argument:”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¿hjüubjõ)�”}”(hŒÛstruct hsmp_telemetry_data { __u64 buf; /* User pointer to destination buffer */ __u32 size; /* Size of @buf in bytes */ __u16 sock_ind; /* Socket index */ __u16 reserved; /* Reserved, must be zero */ };”h]”hŒÛstruct hsmp_telemetry_data { __u64 buf; /* User pointer to destination buffer */ __u32 size; /* Size of @buf in bytes */ __u16 sock_ind; /* Socket index */ __u16 reserved; /* Reserved, must be zero */ };”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´KÅhjüubhÞ)�”}”(hX&``size`` must be non-zero and no larger than the table size firmware reports for that socket; a larger value is rejected with ``-EINVAL`` rather than short-written, and a smaller one returns the leading ``size`` bytes of the snapshot. A non-zero ``reserved`` is also rejected with ``-EINVAL``.”h]”(j)�”}”(hŒ``size``”h]”hŒsize”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒv must be non-zero and no larger than the table size firmware reports for that socket; a larger value is rejected with ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ ``-EINVAL``”h]”hŒ-EINVAL”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒB rather than short-written, and a smaller one returns the leading ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ``size``”h]”hŒsize”…”�”}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ$ bytes of the snapshot. A non-zero ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ ``reserved``”h]”hŒreserved”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ is also rejected with ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ ``-EINVAL``”h]”hŒ-EINVAL”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÌhjüubhÞ)�”}”(hX*The table layout depends on the protocol version, which userspace reads from the ``protocol_version`` sysfs attribute. On version 6 the table is ``struct hsmp_metric_table``, so callers pass ``sizeof(struct hsmp_metric_table)``. Later version metrics table layout is documented in the Public PPR.”h]”(hŒQThe table layout depends on the protocol version, which userspace reads from the ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ``protocol_version``”h]”hŒprotocol_version”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ- sysfs attribute. On version 6 the table is ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ``struct hsmp_metric_table``”h]”hŒstruct hsmp_metric_table”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ, so callers pass ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ$``sizeof(struct hsmp_metric_table)``”h]”hŒ sizeof(struct hsmp_metric_table)”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒF. Later version metrics table layout is documented in the Public PPR.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÒhjüubeh}”(h]”h ]”h"]”h$]”h&]”uh1jšhjáubeh}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÇh´KÖhj˜h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhj3h²hh³hÇh´NubhÞ)�”}”(hŒ|The ioctl would return a non-zero on failure; you can read errno to see what happened. The transaction returns 0 on success.”h]”hŒ|The ioctl would return a non-zero on failure; you can read errno to see what happened. The transaction returns 0 on success.”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KØhj3h²hubhÞ)�”}”(hŒÌMore details on the interface and message definitions can be found in chapter "7 Host System Management Port (HSMP)" of the respective family/model PPR eg: https://docs.amd.com/v/u/en-US/55898_B1_pub_0_50”h]”(hŒ More details on the interface and message definitions can be found in chapter “7 Host System Management Port (HSMP)â€� of the respective family/model PPR eg: ”…”�”}”(hjãh²hh³Nh´Nubj)�”}”(hŒ0https://docs.amd.com/v/u/en-US/55898_B1_pub_0_50”h]”hŒ0https://docs.amd.com/v/u/en-US/55898_B1_pub_0_50”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jíuh1jhjãubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÛhj3h²hubhÞ)�”}”(hŒÉUser space C-APIs are made available by linking against the esmi library, which is provided by the E-SMS project https://www.amd.com/en/developer/e-sms.html. See: https://github.com/amd/esmi_ib_library”h]”(hŒqUser space C-APIs are made available by linking against the esmi library, which is provided by the E-SMS project ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ+https://www.amd.com/en/developer/e-sms.html”h]”hŒ+https://www.amd.com/en/developer/e-sms.html”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j uh1jhjubhŒ. See: ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒ&https://github.com/amd/esmi_ib_library”h]”hŒ&https://github.com/amd/esmi_ib_library”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”juh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kßhj3h²hubeh}”(h]”Œ an-example”ah ]”h"]”Œ an example”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Kžubeh}”(h]”Œamd-hsmp-interface”ah ]”h"]”Œamd hsmp interface”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jcŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j=j:j§j¤jÒjÏj jj0j-j5j2uŒ nametypes”}”(j=‰j§‰jÒ‰j ‰j0‰j5‰uh}”(j:hÊj¤j(jÏjªjjÕj-j j2j3uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”hŒsystem_message”“”)�”}”(hhh]”hÞ)�”}”(hŒ:Enumerated list start value not ordinal-1: "2" (ordinal 2)”h]”hŒ>Enumerated list start value not ordinal-1: “2â€� (ordinal 2)”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjÇubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÇŒline”Kuh1jÅhjªh²hh³hÇh´KQubaŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.