18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef _ASM_X86_MSR_INDEX_H 38c2ecf20Sopenharmony_ci#define _ASM_X86_MSR_INDEX_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <linux/bits.h> 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci/* 88c2ecf20Sopenharmony_ci * CPU model specific register (MSR) numbers. 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * Do not add new entries to this file unless the definitions are shared 118c2ecf20Sopenharmony_ci * between multiple compilation units. 128c2ecf20Sopenharmony_ci */ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* x86-64 specific MSRs */ 158c2ecf20Sopenharmony_ci#define MSR_EFER 0xc0000080 /* extended feature register */ 168c2ecf20Sopenharmony_ci#define MSR_STAR 0xc0000081 /* legacy mode SYSCALL target */ 178c2ecf20Sopenharmony_ci#define MSR_LSTAR 0xc0000082 /* long mode SYSCALL target */ 188c2ecf20Sopenharmony_ci#define MSR_CSTAR 0xc0000083 /* compat mode SYSCALL target */ 198c2ecf20Sopenharmony_ci#define MSR_SYSCALL_MASK 0xc0000084 /* EFLAGS mask for syscall */ 208c2ecf20Sopenharmony_ci#define MSR_FS_BASE 0xc0000100 /* 64bit FS base */ 218c2ecf20Sopenharmony_ci#define MSR_GS_BASE 0xc0000101 /* 64bit GS base */ 228c2ecf20Sopenharmony_ci#define MSR_KERNEL_GS_BASE 0xc0000102 /* SwapGS GS shadow */ 238c2ecf20Sopenharmony_ci#define MSR_TSC_AUX 0xc0000103 /* Auxiliary TSC */ 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* EFER bits: */ 268c2ecf20Sopenharmony_ci#define _EFER_SCE 0 /* SYSCALL/SYSRET */ 278c2ecf20Sopenharmony_ci#define _EFER_LME 8 /* Long mode enable */ 288c2ecf20Sopenharmony_ci#define _EFER_LMA 10 /* Long mode active (read-only) */ 298c2ecf20Sopenharmony_ci#define _EFER_NX 11 /* No execute enable */ 308c2ecf20Sopenharmony_ci#define _EFER_SVME 12 /* Enable virtualization */ 318c2ecf20Sopenharmony_ci#define _EFER_LMSLE 13 /* Long Mode Segment Limit Enable */ 328c2ecf20Sopenharmony_ci#define _EFER_FFXSR 14 /* Enable Fast FXSAVE/FXRSTOR */ 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#define EFER_SCE (1<<_EFER_SCE) 358c2ecf20Sopenharmony_ci#define EFER_LME (1<<_EFER_LME) 368c2ecf20Sopenharmony_ci#define EFER_LMA (1<<_EFER_LMA) 378c2ecf20Sopenharmony_ci#define EFER_NX (1<<_EFER_NX) 388c2ecf20Sopenharmony_ci#define EFER_SVME (1<<_EFER_SVME) 398c2ecf20Sopenharmony_ci#define EFER_LMSLE (1<<_EFER_LMSLE) 408c2ecf20Sopenharmony_ci#define EFER_FFXSR (1<<_EFER_FFXSR) 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci/* Intel MSRs. Some also available on other CPUs */ 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci#define MSR_TEST_CTRL 0x00000033 458c2ecf20Sopenharmony_ci#define MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT 29 468c2ecf20Sopenharmony_ci#define MSR_TEST_CTRL_SPLIT_LOCK_DETECT BIT(MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT) 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#define MSR_IA32_SPEC_CTRL 0x00000048 /* Speculation Control */ 498c2ecf20Sopenharmony_ci#define SPEC_CTRL_IBRS BIT(0) /* Indirect Branch Restricted Speculation */ 508c2ecf20Sopenharmony_ci#define SPEC_CTRL_STIBP_SHIFT 1 /* Single Thread Indirect Branch Predictor (STIBP) bit */ 518c2ecf20Sopenharmony_ci#define SPEC_CTRL_STIBP BIT(SPEC_CTRL_STIBP_SHIFT) /* STIBP mask */ 528c2ecf20Sopenharmony_ci#define SPEC_CTRL_SSBD_SHIFT 2 /* Speculative Store Bypass Disable bit */ 538c2ecf20Sopenharmony_ci#define SPEC_CTRL_SSBD BIT(SPEC_CTRL_SSBD_SHIFT) /* Speculative Store Bypass Disable */ 548c2ecf20Sopenharmony_ci#define SPEC_CTRL_RRSBA_DIS_S_SHIFT 6 /* Disable RRSBA behavior */ 558c2ecf20Sopenharmony_ci#define SPEC_CTRL_RRSBA_DIS_S BIT(SPEC_CTRL_RRSBA_DIS_S_SHIFT) 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci#define MSR_IA32_PRED_CMD 0x00000049 /* Prediction Command */ 588c2ecf20Sopenharmony_ci#define PRED_CMD_IBPB BIT(0) /* Indirect Branch Prediction Barrier */ 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define MSR_PPIN_CTL 0x0000004e 618c2ecf20Sopenharmony_ci#define MSR_PPIN 0x0000004f 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci#define MSR_IA32_PERFCTR0 0x000000c1 648c2ecf20Sopenharmony_ci#define MSR_IA32_PERFCTR1 0x000000c2 658c2ecf20Sopenharmony_ci#define MSR_FSB_FREQ 0x000000cd 668c2ecf20Sopenharmony_ci#define MSR_PLATFORM_INFO 0x000000ce 678c2ecf20Sopenharmony_ci#define MSR_PLATFORM_INFO_CPUID_FAULT_BIT 31 688c2ecf20Sopenharmony_ci#define MSR_PLATFORM_INFO_CPUID_FAULT BIT_ULL(MSR_PLATFORM_INFO_CPUID_FAULT_BIT) 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci#define MSR_IA32_UMWAIT_CONTROL 0xe1 718c2ecf20Sopenharmony_ci#define MSR_IA32_UMWAIT_CONTROL_C02_DISABLE BIT(0) 728c2ecf20Sopenharmony_ci#define MSR_IA32_UMWAIT_CONTROL_RESERVED BIT(1) 738c2ecf20Sopenharmony_ci/* 748c2ecf20Sopenharmony_ci * The time field is bit[31:2], but representing a 32bit value with 758c2ecf20Sopenharmony_ci * bit[1:0] zero. 768c2ecf20Sopenharmony_ci */ 778c2ecf20Sopenharmony_ci#define MSR_IA32_UMWAIT_CONTROL_TIME_MASK (~0x03U) 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci/* Abbreviated from Intel SDM name IA32_CORE_CAPABILITIES */ 808c2ecf20Sopenharmony_ci#define MSR_IA32_CORE_CAPS 0x000000cf 818c2ecf20Sopenharmony_ci#define MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT_BIT 5 828c2ecf20Sopenharmony_ci#define MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT BIT(MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT_BIT) 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci#define MSR_PKG_CST_CONFIG_CONTROL 0x000000e2 858c2ecf20Sopenharmony_ci#define NHM_C3_AUTO_DEMOTE (1UL << 25) 868c2ecf20Sopenharmony_ci#define NHM_C1_AUTO_DEMOTE (1UL << 26) 878c2ecf20Sopenharmony_ci#define ATM_LNC_C6_AUTO_DEMOTE (1UL << 25) 888c2ecf20Sopenharmony_ci#define SNB_C3_AUTO_UNDEMOTE (1UL << 27) 898c2ecf20Sopenharmony_ci#define SNB_C1_AUTO_UNDEMOTE (1UL << 28) 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci#define MSR_MTRRcap 0x000000fe 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define MSR_IA32_ARCH_CAPABILITIES 0x0000010a 948c2ecf20Sopenharmony_ci#define ARCH_CAP_RDCL_NO BIT(0) /* Not susceptible to Meltdown */ 958c2ecf20Sopenharmony_ci#define ARCH_CAP_IBRS_ALL BIT(1) /* Enhanced IBRS support */ 968c2ecf20Sopenharmony_ci#define ARCH_CAP_RSBA BIT(2) /* RET may use alternative branch predictors */ 978c2ecf20Sopenharmony_ci#define ARCH_CAP_SKIP_VMENTRY_L1DFLUSH BIT(3) /* Skip L1D flush on vmentry */ 988c2ecf20Sopenharmony_ci#define ARCH_CAP_SSB_NO BIT(4) /* 998c2ecf20Sopenharmony_ci * Not susceptible to Speculative Store Bypass 1008c2ecf20Sopenharmony_ci * attack, so no Speculative Store Bypass 1018c2ecf20Sopenharmony_ci * control required. 1028c2ecf20Sopenharmony_ci */ 1038c2ecf20Sopenharmony_ci#define ARCH_CAP_MDS_NO BIT(5) /* 1048c2ecf20Sopenharmony_ci * Not susceptible to 1058c2ecf20Sopenharmony_ci * Microarchitectural Data 1068c2ecf20Sopenharmony_ci * Sampling (MDS) vulnerabilities. 1078c2ecf20Sopenharmony_ci */ 1088c2ecf20Sopenharmony_ci#define ARCH_CAP_PSCHANGE_MC_NO BIT(6) /* 1098c2ecf20Sopenharmony_ci * The processor is not susceptible to a 1108c2ecf20Sopenharmony_ci * machine check error due to modifying the 1118c2ecf20Sopenharmony_ci * code page size along with either the 1128c2ecf20Sopenharmony_ci * physical address or cache type 1138c2ecf20Sopenharmony_ci * without TLB invalidation. 1148c2ecf20Sopenharmony_ci */ 1158c2ecf20Sopenharmony_ci#define ARCH_CAP_TSX_CTRL_MSR BIT(7) /* MSR for TSX control is available. */ 1168c2ecf20Sopenharmony_ci#define ARCH_CAP_TAA_NO BIT(8) /* 1178c2ecf20Sopenharmony_ci * Not susceptible to 1188c2ecf20Sopenharmony_ci * TSX Async Abort (TAA) vulnerabilities. 1198c2ecf20Sopenharmony_ci */ 1208c2ecf20Sopenharmony_ci#define ARCH_CAP_SBDR_SSDP_NO BIT(13) /* 1218c2ecf20Sopenharmony_ci * Not susceptible to SBDR and SSDP 1228c2ecf20Sopenharmony_ci * variants of Processor MMIO stale data 1238c2ecf20Sopenharmony_ci * vulnerabilities. 1248c2ecf20Sopenharmony_ci */ 1258c2ecf20Sopenharmony_ci#define ARCH_CAP_FBSDP_NO BIT(14) /* 1268c2ecf20Sopenharmony_ci * Not susceptible to FBSDP variant of 1278c2ecf20Sopenharmony_ci * Processor MMIO stale data 1288c2ecf20Sopenharmony_ci * vulnerabilities. 1298c2ecf20Sopenharmony_ci */ 1308c2ecf20Sopenharmony_ci#define ARCH_CAP_PSDP_NO BIT(15) /* 1318c2ecf20Sopenharmony_ci * Not susceptible to PSDP variant of 1328c2ecf20Sopenharmony_ci * Processor MMIO stale data 1338c2ecf20Sopenharmony_ci * vulnerabilities. 1348c2ecf20Sopenharmony_ci */ 1358c2ecf20Sopenharmony_ci#define ARCH_CAP_FB_CLEAR BIT(17) /* 1368c2ecf20Sopenharmony_ci * VERW clears CPU fill buffer 1378c2ecf20Sopenharmony_ci * even on MDS_NO CPUs. 1388c2ecf20Sopenharmony_ci */ 1398c2ecf20Sopenharmony_ci#define ARCH_CAP_FB_CLEAR_CTRL BIT(18) /* 1408c2ecf20Sopenharmony_ci * MSR_IA32_MCU_OPT_CTRL[FB_CLEAR_DIS] 1418c2ecf20Sopenharmony_ci * bit available to control VERW 1428c2ecf20Sopenharmony_ci * behavior. 1438c2ecf20Sopenharmony_ci */ 1448c2ecf20Sopenharmony_ci#define ARCH_CAP_RRSBA BIT(19) /* 1458c2ecf20Sopenharmony_ci * Indicates RET may use predictors 1468c2ecf20Sopenharmony_ci * other than the RSB. With eIBRS 1478c2ecf20Sopenharmony_ci * enabled predictions in kernel mode 1488c2ecf20Sopenharmony_ci * are restricted to targets in 1498c2ecf20Sopenharmony_ci * kernel. 1508c2ecf20Sopenharmony_ci */ 1518c2ecf20Sopenharmony_ci#define ARCH_CAP_PBRSB_NO BIT(24) /* 1528c2ecf20Sopenharmony_ci * Not susceptible to Post-Barrier 1538c2ecf20Sopenharmony_ci * Return Stack Buffer Predictions. 1548c2ecf20Sopenharmony_ci */ 1558c2ecf20Sopenharmony_ci 1568c2ecf20Sopenharmony_ci#define MSR_IA32_FLUSH_CMD 0x0000010b 1578c2ecf20Sopenharmony_ci#define L1D_FLUSH BIT(0) /* 1588c2ecf20Sopenharmony_ci * Writeback and invalidate the 1598c2ecf20Sopenharmony_ci * L1 data cache. 1608c2ecf20Sopenharmony_ci */ 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ci#define MSR_IA32_BBL_CR_CTL 0x00000119 1638c2ecf20Sopenharmony_ci#define MSR_IA32_BBL_CR_CTL3 0x0000011e 1648c2ecf20Sopenharmony_ci 1658c2ecf20Sopenharmony_ci#define MSR_IA32_TSX_CTRL 0x00000122 1668c2ecf20Sopenharmony_ci#define TSX_CTRL_RTM_DISABLE BIT(0) /* Disable RTM feature */ 1678c2ecf20Sopenharmony_ci#define TSX_CTRL_CPUID_CLEAR BIT(1) /* Disable TSX enumeration */ 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci/* SRBDS support */ 1708c2ecf20Sopenharmony_ci#define MSR_IA32_MCU_OPT_CTRL 0x00000123 1718c2ecf20Sopenharmony_ci#define RNGDS_MITG_DIS BIT(0) 1728c2ecf20Sopenharmony_ci#define FB_CLEAR_DIS BIT(3) /* CPU Fill buffer clear disable */ 1738c2ecf20Sopenharmony_ci 1748c2ecf20Sopenharmony_ci#define MSR_IA32_SYSENTER_CS 0x00000174 1758c2ecf20Sopenharmony_ci#define MSR_IA32_SYSENTER_ESP 0x00000175 1768c2ecf20Sopenharmony_ci#define MSR_IA32_SYSENTER_EIP 0x00000176 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_CAP 0x00000179 1798c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_STATUS 0x0000017a 1808c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_CTL 0x0000017b 1818c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_EXT_CTL 0x000004d0 1828c2ecf20Sopenharmony_ci 1838c2ecf20Sopenharmony_ci#define MSR_OFFCORE_RSP_0 0x000001a6 1848c2ecf20Sopenharmony_ci#define MSR_OFFCORE_RSP_1 0x000001a7 1858c2ecf20Sopenharmony_ci#define MSR_TURBO_RATIO_LIMIT 0x000001ad 1868c2ecf20Sopenharmony_ci#define MSR_TURBO_RATIO_LIMIT1 0x000001ae 1878c2ecf20Sopenharmony_ci#define MSR_TURBO_RATIO_LIMIT2 0x000001af 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_ci#define MSR_LBR_SELECT 0x000001c8 1908c2ecf20Sopenharmony_ci#define MSR_LBR_TOS 0x000001c9 1918c2ecf20Sopenharmony_ci 1928c2ecf20Sopenharmony_ci#define MSR_IA32_POWER_CTL 0x000001fc 1938c2ecf20Sopenharmony_ci#define MSR_IA32_POWER_CTL_BIT_EE 19 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci#define MSR_LBR_NHM_FROM 0x00000680 1968c2ecf20Sopenharmony_ci#define MSR_LBR_NHM_TO 0x000006c0 1978c2ecf20Sopenharmony_ci#define MSR_LBR_CORE_FROM 0x00000040 1988c2ecf20Sopenharmony_ci#define MSR_LBR_CORE_TO 0x00000060 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci#define MSR_LBR_INFO_0 0x00000dc0 /* ... 0xddf for _31 */ 2018c2ecf20Sopenharmony_ci#define LBR_INFO_MISPRED BIT_ULL(63) 2028c2ecf20Sopenharmony_ci#define LBR_INFO_IN_TX BIT_ULL(62) 2038c2ecf20Sopenharmony_ci#define LBR_INFO_ABORT BIT_ULL(61) 2048c2ecf20Sopenharmony_ci#define LBR_INFO_CYC_CNT_VALID BIT_ULL(60) 2058c2ecf20Sopenharmony_ci#define LBR_INFO_CYCLES 0xffff 2068c2ecf20Sopenharmony_ci#define LBR_INFO_BR_TYPE_OFFSET 56 2078c2ecf20Sopenharmony_ci#define LBR_INFO_BR_TYPE (0xfull << LBR_INFO_BR_TYPE_OFFSET) 2088c2ecf20Sopenharmony_ci 2098c2ecf20Sopenharmony_ci#define MSR_ARCH_LBR_CTL 0x000014ce 2108c2ecf20Sopenharmony_ci#define ARCH_LBR_CTL_LBREN BIT(0) 2118c2ecf20Sopenharmony_ci#define ARCH_LBR_CTL_CPL_OFFSET 1 2128c2ecf20Sopenharmony_ci#define ARCH_LBR_CTL_CPL (0x3ull << ARCH_LBR_CTL_CPL_OFFSET) 2138c2ecf20Sopenharmony_ci#define ARCH_LBR_CTL_STACK_OFFSET 3 2148c2ecf20Sopenharmony_ci#define ARCH_LBR_CTL_STACK (0x1ull << ARCH_LBR_CTL_STACK_OFFSET) 2158c2ecf20Sopenharmony_ci#define ARCH_LBR_CTL_FILTER_OFFSET 16 2168c2ecf20Sopenharmony_ci#define ARCH_LBR_CTL_FILTER (0x7full << ARCH_LBR_CTL_FILTER_OFFSET) 2178c2ecf20Sopenharmony_ci#define MSR_ARCH_LBR_DEPTH 0x000014cf 2188c2ecf20Sopenharmony_ci#define MSR_ARCH_LBR_FROM_0 0x00001500 2198c2ecf20Sopenharmony_ci#define MSR_ARCH_LBR_TO_0 0x00001600 2208c2ecf20Sopenharmony_ci#define MSR_ARCH_LBR_INFO_0 0x00001200 2218c2ecf20Sopenharmony_ci 2228c2ecf20Sopenharmony_ci#define MSR_IA32_PEBS_ENABLE 0x000003f1 2238c2ecf20Sopenharmony_ci#define MSR_PEBS_DATA_CFG 0x000003f2 2248c2ecf20Sopenharmony_ci#define MSR_IA32_DS_AREA 0x00000600 2258c2ecf20Sopenharmony_ci#define MSR_IA32_PERF_CAPABILITIES 0x00000345 2268c2ecf20Sopenharmony_ci#define MSR_PEBS_LD_LAT_THRESHOLD 0x000003f6 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_CTL 0x00000570 2298c2ecf20Sopenharmony_ci#define RTIT_CTL_TRACEEN BIT(0) 2308c2ecf20Sopenharmony_ci#define RTIT_CTL_CYCLEACC BIT(1) 2318c2ecf20Sopenharmony_ci#define RTIT_CTL_OS BIT(2) 2328c2ecf20Sopenharmony_ci#define RTIT_CTL_USR BIT(3) 2338c2ecf20Sopenharmony_ci#define RTIT_CTL_PWR_EVT_EN BIT(4) 2348c2ecf20Sopenharmony_ci#define RTIT_CTL_FUP_ON_PTW BIT(5) 2358c2ecf20Sopenharmony_ci#define RTIT_CTL_FABRIC_EN BIT(6) 2368c2ecf20Sopenharmony_ci#define RTIT_CTL_CR3EN BIT(7) 2378c2ecf20Sopenharmony_ci#define RTIT_CTL_TOPA BIT(8) 2388c2ecf20Sopenharmony_ci#define RTIT_CTL_MTC_EN BIT(9) 2398c2ecf20Sopenharmony_ci#define RTIT_CTL_TSC_EN BIT(10) 2408c2ecf20Sopenharmony_ci#define RTIT_CTL_DISRETC BIT(11) 2418c2ecf20Sopenharmony_ci#define RTIT_CTL_PTW_EN BIT(12) 2428c2ecf20Sopenharmony_ci#define RTIT_CTL_BRANCH_EN BIT(13) 2438c2ecf20Sopenharmony_ci#define RTIT_CTL_MTC_RANGE_OFFSET 14 2448c2ecf20Sopenharmony_ci#define RTIT_CTL_MTC_RANGE (0x0full << RTIT_CTL_MTC_RANGE_OFFSET) 2458c2ecf20Sopenharmony_ci#define RTIT_CTL_CYC_THRESH_OFFSET 19 2468c2ecf20Sopenharmony_ci#define RTIT_CTL_CYC_THRESH (0x0full << RTIT_CTL_CYC_THRESH_OFFSET) 2478c2ecf20Sopenharmony_ci#define RTIT_CTL_PSB_FREQ_OFFSET 24 2488c2ecf20Sopenharmony_ci#define RTIT_CTL_PSB_FREQ (0x0full << RTIT_CTL_PSB_FREQ_OFFSET) 2498c2ecf20Sopenharmony_ci#define RTIT_CTL_ADDR0_OFFSET 32 2508c2ecf20Sopenharmony_ci#define RTIT_CTL_ADDR0 (0x0full << RTIT_CTL_ADDR0_OFFSET) 2518c2ecf20Sopenharmony_ci#define RTIT_CTL_ADDR1_OFFSET 36 2528c2ecf20Sopenharmony_ci#define RTIT_CTL_ADDR1 (0x0full << RTIT_CTL_ADDR1_OFFSET) 2538c2ecf20Sopenharmony_ci#define RTIT_CTL_ADDR2_OFFSET 40 2548c2ecf20Sopenharmony_ci#define RTIT_CTL_ADDR2 (0x0full << RTIT_CTL_ADDR2_OFFSET) 2558c2ecf20Sopenharmony_ci#define RTIT_CTL_ADDR3_OFFSET 44 2568c2ecf20Sopenharmony_ci#define RTIT_CTL_ADDR3 (0x0full << RTIT_CTL_ADDR3_OFFSET) 2578c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_STATUS 0x00000571 2588c2ecf20Sopenharmony_ci#define RTIT_STATUS_FILTEREN BIT(0) 2598c2ecf20Sopenharmony_ci#define RTIT_STATUS_CONTEXTEN BIT(1) 2608c2ecf20Sopenharmony_ci#define RTIT_STATUS_TRIGGEREN BIT(2) 2618c2ecf20Sopenharmony_ci#define RTIT_STATUS_BUFFOVF BIT(3) 2628c2ecf20Sopenharmony_ci#define RTIT_STATUS_ERROR BIT(4) 2638c2ecf20Sopenharmony_ci#define RTIT_STATUS_STOPPED BIT(5) 2648c2ecf20Sopenharmony_ci#define RTIT_STATUS_BYTECNT_OFFSET 32 2658c2ecf20Sopenharmony_ci#define RTIT_STATUS_BYTECNT (0x1ffffull << RTIT_STATUS_BYTECNT_OFFSET) 2668c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_ADDR0_A 0x00000580 2678c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_ADDR0_B 0x00000581 2688c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_ADDR1_A 0x00000582 2698c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_ADDR1_B 0x00000583 2708c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_ADDR2_A 0x00000584 2718c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_ADDR2_B 0x00000585 2728c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_ADDR3_A 0x00000586 2738c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_ADDR3_B 0x00000587 2748c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_CR3_MATCH 0x00000572 2758c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_OUTPUT_BASE 0x00000560 2768c2ecf20Sopenharmony_ci#define MSR_IA32_RTIT_OUTPUT_MASK 0x00000561 2778c2ecf20Sopenharmony_ci 2788c2ecf20Sopenharmony_ci#define MSR_MTRRfix64K_00000 0x00000250 2798c2ecf20Sopenharmony_ci#define MSR_MTRRfix16K_80000 0x00000258 2808c2ecf20Sopenharmony_ci#define MSR_MTRRfix16K_A0000 0x00000259 2818c2ecf20Sopenharmony_ci#define MSR_MTRRfix4K_C0000 0x00000268 2828c2ecf20Sopenharmony_ci#define MSR_MTRRfix4K_C8000 0x00000269 2838c2ecf20Sopenharmony_ci#define MSR_MTRRfix4K_D0000 0x0000026a 2848c2ecf20Sopenharmony_ci#define MSR_MTRRfix4K_D8000 0x0000026b 2858c2ecf20Sopenharmony_ci#define MSR_MTRRfix4K_E0000 0x0000026c 2868c2ecf20Sopenharmony_ci#define MSR_MTRRfix4K_E8000 0x0000026d 2878c2ecf20Sopenharmony_ci#define MSR_MTRRfix4K_F0000 0x0000026e 2888c2ecf20Sopenharmony_ci#define MSR_MTRRfix4K_F8000 0x0000026f 2898c2ecf20Sopenharmony_ci#define MSR_MTRRdefType 0x000002ff 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci#define MSR_IA32_CR_PAT 0x00000277 2928c2ecf20Sopenharmony_ci 2938c2ecf20Sopenharmony_ci#define MSR_IA32_DEBUGCTLMSR 0x000001d9 2948c2ecf20Sopenharmony_ci#define MSR_IA32_LASTBRANCHFROMIP 0x000001db 2958c2ecf20Sopenharmony_ci#define MSR_IA32_LASTBRANCHTOIP 0x000001dc 2968c2ecf20Sopenharmony_ci#define MSR_IA32_LASTINTFROMIP 0x000001dd 2978c2ecf20Sopenharmony_ci#define MSR_IA32_LASTINTTOIP 0x000001de 2988c2ecf20Sopenharmony_ci 2998c2ecf20Sopenharmony_ci#define MSR_IA32_PASID 0x00000d93 3008c2ecf20Sopenharmony_ci#define MSR_IA32_PASID_VALID BIT_ULL(31) 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ci/* DEBUGCTLMSR bits (others vary by model): */ 3038c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_LBR (1UL << 0) /* last branch recording */ 3048c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_BTF_SHIFT 1 3058c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_BTF (1UL << 1) /* single-step on branches */ 3068c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_TR (1UL << 6) 3078c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_BTS (1UL << 7) 3088c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_BTINT (1UL << 8) 3098c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_BTS_OFF_OS (1UL << 9) 3108c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_BTS_OFF_USR (1UL << 10) 3118c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_FREEZE_LBRS_ON_PMI (1UL << 11) 3128c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_FREEZE_PERFMON_ON_PMI (1UL << 12) 3138c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_FREEZE_IN_SMM_BIT 14 3148c2ecf20Sopenharmony_ci#define DEBUGCTLMSR_FREEZE_IN_SMM (1UL << DEBUGCTLMSR_FREEZE_IN_SMM_BIT) 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ci#define MSR_PEBS_FRONTEND 0x000003f7 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci#define MSR_IA32_MC0_CTL 0x00000400 3198c2ecf20Sopenharmony_ci#define MSR_IA32_MC0_STATUS 0x00000401 3208c2ecf20Sopenharmony_ci#define MSR_IA32_MC0_ADDR 0x00000402 3218c2ecf20Sopenharmony_ci#define MSR_IA32_MC0_MISC 0x00000403 3228c2ecf20Sopenharmony_ci 3238c2ecf20Sopenharmony_ci/* C-state Residency Counters */ 3248c2ecf20Sopenharmony_ci#define MSR_PKG_C3_RESIDENCY 0x000003f8 3258c2ecf20Sopenharmony_ci#define MSR_PKG_C6_RESIDENCY 0x000003f9 3268c2ecf20Sopenharmony_ci#define MSR_ATOM_PKG_C6_RESIDENCY 0x000003fa 3278c2ecf20Sopenharmony_ci#define MSR_PKG_C7_RESIDENCY 0x000003fa 3288c2ecf20Sopenharmony_ci#define MSR_CORE_C3_RESIDENCY 0x000003fc 3298c2ecf20Sopenharmony_ci#define MSR_CORE_C6_RESIDENCY 0x000003fd 3308c2ecf20Sopenharmony_ci#define MSR_CORE_C7_RESIDENCY 0x000003fe 3318c2ecf20Sopenharmony_ci#define MSR_KNL_CORE_C6_RESIDENCY 0x000003ff 3328c2ecf20Sopenharmony_ci#define MSR_PKG_C2_RESIDENCY 0x0000060d 3338c2ecf20Sopenharmony_ci#define MSR_PKG_C8_RESIDENCY 0x00000630 3348c2ecf20Sopenharmony_ci#define MSR_PKG_C9_RESIDENCY 0x00000631 3358c2ecf20Sopenharmony_ci#define MSR_PKG_C10_RESIDENCY 0x00000632 3368c2ecf20Sopenharmony_ci 3378c2ecf20Sopenharmony_ci/* Interrupt Response Limit */ 3388c2ecf20Sopenharmony_ci#define MSR_PKGC3_IRTL 0x0000060a 3398c2ecf20Sopenharmony_ci#define MSR_PKGC6_IRTL 0x0000060b 3408c2ecf20Sopenharmony_ci#define MSR_PKGC7_IRTL 0x0000060c 3418c2ecf20Sopenharmony_ci#define MSR_PKGC8_IRTL 0x00000633 3428c2ecf20Sopenharmony_ci#define MSR_PKGC9_IRTL 0x00000634 3438c2ecf20Sopenharmony_ci#define MSR_PKGC10_IRTL 0x00000635 3448c2ecf20Sopenharmony_ci 3458c2ecf20Sopenharmony_ci/* Run Time Average Power Limiting (RAPL) Interface */ 3468c2ecf20Sopenharmony_ci 3478c2ecf20Sopenharmony_ci#define MSR_RAPL_POWER_UNIT 0x00000606 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_ci#define MSR_PKG_POWER_LIMIT 0x00000610 3508c2ecf20Sopenharmony_ci#define MSR_PKG_ENERGY_STATUS 0x00000611 3518c2ecf20Sopenharmony_ci#define MSR_PKG_PERF_STATUS 0x00000613 3528c2ecf20Sopenharmony_ci#define MSR_PKG_POWER_INFO 0x00000614 3538c2ecf20Sopenharmony_ci 3548c2ecf20Sopenharmony_ci#define MSR_DRAM_POWER_LIMIT 0x00000618 3558c2ecf20Sopenharmony_ci#define MSR_DRAM_ENERGY_STATUS 0x00000619 3568c2ecf20Sopenharmony_ci#define MSR_DRAM_PERF_STATUS 0x0000061b 3578c2ecf20Sopenharmony_ci#define MSR_DRAM_POWER_INFO 0x0000061c 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_ci#define MSR_PP0_POWER_LIMIT 0x00000638 3608c2ecf20Sopenharmony_ci#define MSR_PP0_ENERGY_STATUS 0x00000639 3618c2ecf20Sopenharmony_ci#define MSR_PP0_POLICY 0x0000063a 3628c2ecf20Sopenharmony_ci#define MSR_PP0_PERF_STATUS 0x0000063b 3638c2ecf20Sopenharmony_ci 3648c2ecf20Sopenharmony_ci#define MSR_PP1_POWER_LIMIT 0x00000640 3658c2ecf20Sopenharmony_ci#define MSR_PP1_ENERGY_STATUS 0x00000641 3668c2ecf20Sopenharmony_ci#define MSR_PP1_POLICY 0x00000642 3678c2ecf20Sopenharmony_ci 3688c2ecf20Sopenharmony_ci#define MSR_AMD_PKG_ENERGY_STATUS 0xc001029b 3698c2ecf20Sopenharmony_ci#define MSR_AMD_RAPL_POWER_UNIT 0xc0010299 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_ci/* Config TDP MSRs */ 3728c2ecf20Sopenharmony_ci#define MSR_CONFIG_TDP_NOMINAL 0x00000648 3738c2ecf20Sopenharmony_ci#define MSR_CONFIG_TDP_LEVEL_1 0x00000649 3748c2ecf20Sopenharmony_ci#define MSR_CONFIG_TDP_LEVEL_2 0x0000064A 3758c2ecf20Sopenharmony_ci#define MSR_CONFIG_TDP_CONTROL 0x0000064B 3768c2ecf20Sopenharmony_ci#define MSR_TURBO_ACTIVATION_RATIO 0x0000064C 3778c2ecf20Sopenharmony_ci 3788c2ecf20Sopenharmony_ci#define MSR_PLATFORM_ENERGY_STATUS 0x0000064D 3798c2ecf20Sopenharmony_ci 3808c2ecf20Sopenharmony_ci#define MSR_PKG_WEIGHTED_CORE_C0_RES 0x00000658 3818c2ecf20Sopenharmony_ci#define MSR_PKG_ANY_CORE_C0_RES 0x00000659 3828c2ecf20Sopenharmony_ci#define MSR_PKG_ANY_GFXE_C0_RES 0x0000065A 3838c2ecf20Sopenharmony_ci#define MSR_PKG_BOTH_CORE_GFXE_C0_RES 0x0000065B 3848c2ecf20Sopenharmony_ci 3858c2ecf20Sopenharmony_ci#define MSR_CORE_C1_RES 0x00000660 3868c2ecf20Sopenharmony_ci#define MSR_MODULE_C6_RES_MS 0x00000664 3878c2ecf20Sopenharmony_ci 3888c2ecf20Sopenharmony_ci#define MSR_CC6_DEMOTION_POLICY_CONFIG 0x00000668 3898c2ecf20Sopenharmony_ci#define MSR_MC6_DEMOTION_POLICY_CONFIG 0x00000669 3908c2ecf20Sopenharmony_ci 3918c2ecf20Sopenharmony_ci#define MSR_ATOM_CORE_RATIOS 0x0000066a 3928c2ecf20Sopenharmony_ci#define MSR_ATOM_CORE_VIDS 0x0000066b 3938c2ecf20Sopenharmony_ci#define MSR_ATOM_CORE_TURBO_RATIOS 0x0000066c 3948c2ecf20Sopenharmony_ci#define MSR_ATOM_CORE_TURBO_VIDS 0x0000066d 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_ci 3978c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_LIMIT_REASONS 0x00000690 3988c2ecf20Sopenharmony_ci#define MSR_GFX_PERF_LIMIT_REASONS 0x000006B0 3998c2ecf20Sopenharmony_ci#define MSR_RING_PERF_LIMIT_REASONS 0x000006B1 4008c2ecf20Sopenharmony_ci 4018c2ecf20Sopenharmony_ci/* Hardware P state interface */ 4028c2ecf20Sopenharmony_ci#define MSR_PPERF 0x0000064e 4038c2ecf20Sopenharmony_ci#define MSR_PERF_LIMIT_REASONS 0x0000064f 4048c2ecf20Sopenharmony_ci#define MSR_PM_ENABLE 0x00000770 4058c2ecf20Sopenharmony_ci#define MSR_HWP_CAPABILITIES 0x00000771 4068c2ecf20Sopenharmony_ci#define MSR_HWP_REQUEST_PKG 0x00000772 4078c2ecf20Sopenharmony_ci#define MSR_HWP_INTERRUPT 0x00000773 4088c2ecf20Sopenharmony_ci#define MSR_HWP_REQUEST 0x00000774 4098c2ecf20Sopenharmony_ci#define MSR_HWP_STATUS 0x00000777 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_ci/* CPUID.6.EAX */ 4128c2ecf20Sopenharmony_ci#define HWP_BASE_BIT (1<<7) 4138c2ecf20Sopenharmony_ci#define HWP_NOTIFICATIONS_BIT (1<<8) 4148c2ecf20Sopenharmony_ci#define HWP_ACTIVITY_WINDOW_BIT (1<<9) 4158c2ecf20Sopenharmony_ci#define HWP_ENERGY_PERF_PREFERENCE_BIT (1<<10) 4168c2ecf20Sopenharmony_ci#define HWP_PACKAGE_LEVEL_REQUEST_BIT (1<<11) 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci/* IA32_HWP_CAPABILITIES */ 4198c2ecf20Sopenharmony_ci#define HWP_HIGHEST_PERF(x) (((x) >> 0) & 0xff) 4208c2ecf20Sopenharmony_ci#define HWP_GUARANTEED_PERF(x) (((x) >> 8) & 0xff) 4218c2ecf20Sopenharmony_ci#define HWP_MOSTEFFICIENT_PERF(x) (((x) >> 16) & 0xff) 4228c2ecf20Sopenharmony_ci#define HWP_LOWEST_PERF(x) (((x) >> 24) & 0xff) 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_ci/* IA32_HWP_REQUEST */ 4258c2ecf20Sopenharmony_ci#define HWP_MIN_PERF(x) (x & 0xff) 4268c2ecf20Sopenharmony_ci#define HWP_MAX_PERF(x) ((x & 0xff) << 8) 4278c2ecf20Sopenharmony_ci#define HWP_DESIRED_PERF(x) ((x & 0xff) << 16) 4288c2ecf20Sopenharmony_ci#define HWP_ENERGY_PERF_PREFERENCE(x) (((unsigned long long) x & 0xff) << 24) 4298c2ecf20Sopenharmony_ci#define HWP_EPP_PERFORMANCE 0x00 4308c2ecf20Sopenharmony_ci#define HWP_EPP_BALANCE_PERFORMANCE 0x80 4318c2ecf20Sopenharmony_ci#define HWP_EPP_BALANCE_POWERSAVE 0xC0 4328c2ecf20Sopenharmony_ci#define HWP_EPP_POWERSAVE 0xFF 4338c2ecf20Sopenharmony_ci#define HWP_ACTIVITY_WINDOW(x) ((unsigned long long)(x & 0xff3) << 32) 4348c2ecf20Sopenharmony_ci#define HWP_PACKAGE_CONTROL(x) ((unsigned long long)(x & 0x1) << 42) 4358c2ecf20Sopenharmony_ci 4368c2ecf20Sopenharmony_ci/* IA32_HWP_STATUS */ 4378c2ecf20Sopenharmony_ci#define HWP_GUARANTEED_CHANGE(x) (x & 0x1) 4388c2ecf20Sopenharmony_ci#define HWP_EXCURSION_TO_MINIMUM(x) (x & 0x4) 4398c2ecf20Sopenharmony_ci 4408c2ecf20Sopenharmony_ci/* IA32_HWP_INTERRUPT */ 4418c2ecf20Sopenharmony_ci#define HWP_CHANGE_TO_GUARANTEED_INT(x) (x & 0x1) 4428c2ecf20Sopenharmony_ci#define HWP_EXCURSION_TO_MINIMUM_INT(x) (x & 0x2) 4438c2ecf20Sopenharmony_ci 4448c2ecf20Sopenharmony_ci#define MSR_AMD64_MC0_MASK 0xc0010044 4458c2ecf20Sopenharmony_ci 4468c2ecf20Sopenharmony_ci#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x)) 4478c2ecf20Sopenharmony_ci#define MSR_IA32_MCx_STATUS(x) (MSR_IA32_MC0_STATUS + 4*(x)) 4488c2ecf20Sopenharmony_ci#define MSR_IA32_MCx_ADDR(x) (MSR_IA32_MC0_ADDR + 4*(x)) 4498c2ecf20Sopenharmony_ci#define MSR_IA32_MCx_MISC(x) (MSR_IA32_MC0_MISC + 4*(x)) 4508c2ecf20Sopenharmony_ci 4518c2ecf20Sopenharmony_ci#define MSR_AMD64_MCx_MASK(x) (MSR_AMD64_MC0_MASK + (x)) 4528c2ecf20Sopenharmony_ci 4538c2ecf20Sopenharmony_ci/* These are consecutive and not in the normal 4er MCE bank block */ 4548c2ecf20Sopenharmony_ci#define MSR_IA32_MC0_CTL2 0x00000280 4558c2ecf20Sopenharmony_ci#define MSR_IA32_MCx_CTL2(x) (MSR_IA32_MC0_CTL2 + (x)) 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_ci#define MSR_P6_PERFCTR0 0x000000c1 4588c2ecf20Sopenharmony_ci#define MSR_P6_PERFCTR1 0x000000c2 4598c2ecf20Sopenharmony_ci#define MSR_P6_EVNTSEL0 0x00000186 4608c2ecf20Sopenharmony_ci#define MSR_P6_EVNTSEL1 0x00000187 4618c2ecf20Sopenharmony_ci 4628c2ecf20Sopenharmony_ci#define MSR_KNC_PERFCTR0 0x00000020 4638c2ecf20Sopenharmony_ci#define MSR_KNC_PERFCTR1 0x00000021 4648c2ecf20Sopenharmony_ci#define MSR_KNC_EVNTSEL0 0x00000028 4658c2ecf20Sopenharmony_ci#define MSR_KNC_EVNTSEL1 0x00000029 4668c2ecf20Sopenharmony_ci 4678c2ecf20Sopenharmony_ci/* Alternative perfctr range with full access. */ 4688c2ecf20Sopenharmony_ci#define MSR_IA32_PMC0 0x000004c1 4698c2ecf20Sopenharmony_ci 4708c2ecf20Sopenharmony_ci/* Auto-reload via MSR instead of DS area */ 4718c2ecf20Sopenharmony_ci#define MSR_RELOAD_PMC0 0x000014c1 4728c2ecf20Sopenharmony_ci#define MSR_RELOAD_FIXED_CTR0 0x00001309 4738c2ecf20Sopenharmony_ci 4748c2ecf20Sopenharmony_ci/* 4758c2ecf20Sopenharmony_ci * AMD64 MSRs. Not complete. See the architecture manual for a more 4768c2ecf20Sopenharmony_ci * complete list. 4778c2ecf20Sopenharmony_ci */ 4788c2ecf20Sopenharmony_ci#define MSR_AMD64_PATCH_LEVEL 0x0000008b 4798c2ecf20Sopenharmony_ci#define MSR_AMD64_TSC_RATIO 0xc0000104 4808c2ecf20Sopenharmony_ci#define MSR_AMD64_NB_CFG 0xc001001f 4818c2ecf20Sopenharmony_ci#define MSR_AMD64_PATCH_LOADER 0xc0010020 4828c2ecf20Sopenharmony_ci#define MSR_AMD_PERF_CTL 0xc0010062 4838c2ecf20Sopenharmony_ci#define MSR_AMD_PERF_STATUS 0xc0010063 4848c2ecf20Sopenharmony_ci#define MSR_AMD_PSTATE_DEF_BASE 0xc0010064 4858c2ecf20Sopenharmony_ci#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140 4868c2ecf20Sopenharmony_ci#define MSR_AMD64_OSVW_STATUS 0xc0010141 4878c2ecf20Sopenharmony_ci#define MSR_AMD_PPIN_CTL 0xc00102f0 4888c2ecf20Sopenharmony_ci#define MSR_AMD_PPIN 0xc00102f1 4898c2ecf20Sopenharmony_ci#define MSR_AMD64_CPUID_FN_1 0xc0011004 4908c2ecf20Sopenharmony_ci#define MSR_AMD64_LS_CFG 0xc0011020 4918c2ecf20Sopenharmony_ci#define MSR_AMD64_DC_CFG 0xc0011022 4928c2ecf20Sopenharmony_ci 4938c2ecf20Sopenharmony_ci#define MSR_AMD64_DE_CFG 0xc0011029 4948c2ecf20Sopenharmony_ci#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1 4958c2ecf20Sopenharmony_ci#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE BIT_ULL(MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT) 4968c2ecf20Sopenharmony_ci 4978c2ecf20Sopenharmony_ci#define MSR_AMD64_BU_CFG2 0xc001102a 4988c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSFETCHCTL 0xc0011030 4998c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSFETCHLINAD 0xc0011031 5008c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSFETCHPHYSAD 0xc0011032 5018c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSFETCH_REG_COUNT 3 5028c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSFETCH_REG_MASK ((1UL<<MSR_AMD64_IBSFETCH_REG_COUNT)-1) 5038c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSOPCTL 0xc0011033 5048c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSOPRIP 0xc0011034 5058c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSOPDATA 0xc0011035 5068c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSOPDATA2 0xc0011036 5078c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSOPDATA3 0xc0011037 5088c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSDCLINAD 0xc0011038 5098c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSDCPHYSAD 0xc0011039 5108c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSOP_REG_COUNT 7 5118c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSOP_REG_MASK ((1UL<<MSR_AMD64_IBSOP_REG_COUNT)-1) 5128c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSCTL 0xc001103a 5138c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSBRTARGET 0xc001103b 5148c2ecf20Sopenharmony_ci#define MSR_AMD64_ICIBSEXTDCTL 0xc001103c 5158c2ecf20Sopenharmony_ci#define MSR_AMD64_IBSOPDATA4 0xc001103d 5168c2ecf20Sopenharmony_ci#define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */ 5178c2ecf20Sopenharmony_ci#define MSR_AMD64_SEV_ES_GHCB 0xc0010130 5188c2ecf20Sopenharmony_ci#define MSR_AMD64_SEV 0xc0010131 5198c2ecf20Sopenharmony_ci#define MSR_AMD64_SEV_ENABLED_BIT 0 5208c2ecf20Sopenharmony_ci#define MSR_AMD64_SEV_ES_ENABLED_BIT 1 5218c2ecf20Sopenharmony_ci#define MSR_AMD64_SEV_ENABLED BIT_ULL(MSR_AMD64_SEV_ENABLED_BIT) 5228c2ecf20Sopenharmony_ci#define MSR_AMD64_SEV_ES_ENABLED BIT_ULL(MSR_AMD64_SEV_ES_ENABLED_BIT) 5238c2ecf20Sopenharmony_ci 5248c2ecf20Sopenharmony_ci#define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f 5258c2ecf20Sopenharmony_ci 5268c2ecf20Sopenharmony_ci/* Fam 17h MSRs */ 5278c2ecf20Sopenharmony_ci#define MSR_F17H_IRPERF 0xc00000e9 5288c2ecf20Sopenharmony_ci 5298c2ecf20Sopenharmony_ci#define MSR_ZEN2_SPECTRAL_CHICKEN 0xc00110e3 5308c2ecf20Sopenharmony_ci#define MSR_ZEN2_SPECTRAL_CHICKEN_BIT BIT_ULL(1) 5318c2ecf20Sopenharmony_ci 5328c2ecf20Sopenharmony_ci/* Fam 16h MSRs */ 5338c2ecf20Sopenharmony_ci#define MSR_F16H_L2I_PERF_CTL 0xc0010230 5348c2ecf20Sopenharmony_ci#define MSR_F16H_L2I_PERF_CTR 0xc0010231 5358c2ecf20Sopenharmony_ci#define MSR_F16H_DR1_ADDR_MASK 0xc0011019 5368c2ecf20Sopenharmony_ci#define MSR_F16H_DR2_ADDR_MASK 0xc001101a 5378c2ecf20Sopenharmony_ci#define MSR_F16H_DR3_ADDR_MASK 0xc001101b 5388c2ecf20Sopenharmony_ci#define MSR_F16H_DR0_ADDR_MASK 0xc0011027 5398c2ecf20Sopenharmony_ci 5408c2ecf20Sopenharmony_ci/* Fam 15h MSRs */ 5418c2ecf20Sopenharmony_ci#define MSR_F15H_CU_PWR_ACCUMULATOR 0xc001007a 5428c2ecf20Sopenharmony_ci#define MSR_F15H_CU_MAX_PWR_ACCUMULATOR 0xc001007b 5438c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTL 0xc0010200 5448c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTL0 MSR_F15H_PERF_CTL 5458c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTL1 (MSR_F15H_PERF_CTL + 2) 5468c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTL2 (MSR_F15H_PERF_CTL + 4) 5478c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTL3 (MSR_F15H_PERF_CTL + 6) 5488c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTL4 (MSR_F15H_PERF_CTL + 8) 5498c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTL5 (MSR_F15H_PERF_CTL + 10) 5508c2ecf20Sopenharmony_ci 5518c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTR 0xc0010201 5528c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTR0 MSR_F15H_PERF_CTR 5538c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTR1 (MSR_F15H_PERF_CTR + 2) 5548c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTR2 (MSR_F15H_PERF_CTR + 4) 5558c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTR3 (MSR_F15H_PERF_CTR + 6) 5568c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTR4 (MSR_F15H_PERF_CTR + 8) 5578c2ecf20Sopenharmony_ci#define MSR_F15H_PERF_CTR5 (MSR_F15H_PERF_CTR + 10) 5588c2ecf20Sopenharmony_ci 5598c2ecf20Sopenharmony_ci#define MSR_F15H_NB_PERF_CTL 0xc0010240 5608c2ecf20Sopenharmony_ci#define MSR_F15H_NB_PERF_CTR 0xc0010241 5618c2ecf20Sopenharmony_ci#define MSR_F15H_PTSC 0xc0010280 5628c2ecf20Sopenharmony_ci#define MSR_F15H_IC_CFG 0xc0011021 5638c2ecf20Sopenharmony_ci#define MSR_F15H_EX_CFG 0xc001102c 5648c2ecf20Sopenharmony_ci 5658c2ecf20Sopenharmony_ci/* Fam 10h MSRs */ 5668c2ecf20Sopenharmony_ci#define MSR_FAM10H_MMIO_CONF_BASE 0xc0010058 5678c2ecf20Sopenharmony_ci#define FAM10H_MMIO_CONF_ENABLE (1<<0) 5688c2ecf20Sopenharmony_ci#define FAM10H_MMIO_CONF_BUSRANGE_MASK 0xf 5698c2ecf20Sopenharmony_ci#define FAM10H_MMIO_CONF_BUSRANGE_SHIFT 2 5708c2ecf20Sopenharmony_ci#define FAM10H_MMIO_CONF_BASE_MASK 0xfffffffULL 5718c2ecf20Sopenharmony_ci#define FAM10H_MMIO_CONF_BASE_SHIFT 20 5728c2ecf20Sopenharmony_ci#define MSR_FAM10H_NODE_ID 0xc001100c 5738c2ecf20Sopenharmony_ci 5748c2ecf20Sopenharmony_ci/* K8 MSRs */ 5758c2ecf20Sopenharmony_ci#define MSR_K8_TOP_MEM1 0xc001001a 5768c2ecf20Sopenharmony_ci#define MSR_K8_TOP_MEM2 0xc001001d 5778c2ecf20Sopenharmony_ci#define MSR_K8_SYSCFG 0xc0010010 5788c2ecf20Sopenharmony_ci#define MSR_K8_SYSCFG_MEM_ENCRYPT_BIT 23 5798c2ecf20Sopenharmony_ci#define MSR_K8_SYSCFG_MEM_ENCRYPT BIT_ULL(MSR_K8_SYSCFG_MEM_ENCRYPT_BIT) 5808c2ecf20Sopenharmony_ci#define MSR_K8_INT_PENDING_MSG 0xc0010055 5818c2ecf20Sopenharmony_ci/* C1E active bits in int pending message */ 5828c2ecf20Sopenharmony_ci#define K8_INTP_C1E_ACTIVE_MASK 0x18000000 5838c2ecf20Sopenharmony_ci#define MSR_K8_TSEG_ADDR 0xc0010112 5848c2ecf20Sopenharmony_ci#define MSR_K8_TSEG_MASK 0xc0010113 5858c2ecf20Sopenharmony_ci#define K8_MTRRFIXRANGE_DRAM_ENABLE 0x00040000 /* MtrrFixDramEn bit */ 5868c2ecf20Sopenharmony_ci#define K8_MTRRFIXRANGE_DRAM_MODIFY 0x00080000 /* MtrrFixDramModEn bit */ 5878c2ecf20Sopenharmony_ci#define K8_MTRR_RDMEM_WRMEM_MASK 0x18181818 /* Mask: RdMem|WrMem */ 5888c2ecf20Sopenharmony_ci 5898c2ecf20Sopenharmony_ci/* K7 MSRs */ 5908c2ecf20Sopenharmony_ci#define MSR_K7_EVNTSEL0 0xc0010000 5918c2ecf20Sopenharmony_ci#define MSR_K7_PERFCTR0 0xc0010004 5928c2ecf20Sopenharmony_ci#define MSR_K7_EVNTSEL1 0xc0010001 5938c2ecf20Sopenharmony_ci#define MSR_K7_PERFCTR1 0xc0010005 5948c2ecf20Sopenharmony_ci#define MSR_K7_EVNTSEL2 0xc0010002 5958c2ecf20Sopenharmony_ci#define MSR_K7_PERFCTR2 0xc0010006 5968c2ecf20Sopenharmony_ci#define MSR_K7_EVNTSEL3 0xc0010003 5978c2ecf20Sopenharmony_ci#define MSR_K7_PERFCTR3 0xc0010007 5988c2ecf20Sopenharmony_ci#define MSR_K7_CLK_CTL 0xc001001b 5998c2ecf20Sopenharmony_ci#define MSR_K7_HWCR 0xc0010015 6008c2ecf20Sopenharmony_ci#define MSR_K7_HWCR_SMMLOCK_BIT 0 6018c2ecf20Sopenharmony_ci#define MSR_K7_HWCR_SMMLOCK BIT_ULL(MSR_K7_HWCR_SMMLOCK_BIT) 6028c2ecf20Sopenharmony_ci#define MSR_K7_HWCR_IRPERF_EN_BIT 30 6038c2ecf20Sopenharmony_ci#define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT) 6048c2ecf20Sopenharmony_ci#define MSR_K7_FID_VID_CTL 0xc0010041 6058c2ecf20Sopenharmony_ci#define MSR_K7_FID_VID_STATUS 0xc0010042 6068c2ecf20Sopenharmony_ci 6078c2ecf20Sopenharmony_ci/* K6 MSRs */ 6088c2ecf20Sopenharmony_ci#define MSR_K6_WHCR 0xc0000082 6098c2ecf20Sopenharmony_ci#define MSR_K6_UWCCR 0xc0000085 6108c2ecf20Sopenharmony_ci#define MSR_K6_EPMR 0xc0000086 6118c2ecf20Sopenharmony_ci#define MSR_K6_PSOR 0xc0000087 6128c2ecf20Sopenharmony_ci#define MSR_K6_PFIR 0xc0000088 6138c2ecf20Sopenharmony_ci 6148c2ecf20Sopenharmony_ci/* Centaur-Hauls/IDT defined MSRs. */ 6158c2ecf20Sopenharmony_ci#define MSR_IDT_FCR1 0x00000107 6168c2ecf20Sopenharmony_ci#define MSR_IDT_FCR2 0x00000108 6178c2ecf20Sopenharmony_ci#define MSR_IDT_FCR3 0x00000109 6188c2ecf20Sopenharmony_ci#define MSR_IDT_FCR4 0x0000010a 6198c2ecf20Sopenharmony_ci 6208c2ecf20Sopenharmony_ci#define MSR_IDT_MCR0 0x00000110 6218c2ecf20Sopenharmony_ci#define MSR_IDT_MCR1 0x00000111 6228c2ecf20Sopenharmony_ci#define MSR_IDT_MCR2 0x00000112 6238c2ecf20Sopenharmony_ci#define MSR_IDT_MCR3 0x00000113 6248c2ecf20Sopenharmony_ci#define MSR_IDT_MCR4 0x00000114 6258c2ecf20Sopenharmony_ci#define MSR_IDT_MCR5 0x00000115 6268c2ecf20Sopenharmony_ci#define MSR_IDT_MCR6 0x00000116 6278c2ecf20Sopenharmony_ci#define MSR_IDT_MCR7 0x00000117 6288c2ecf20Sopenharmony_ci#define MSR_IDT_MCR_CTRL 0x00000120 6298c2ecf20Sopenharmony_ci 6308c2ecf20Sopenharmony_ci/* VIA Cyrix defined MSRs*/ 6318c2ecf20Sopenharmony_ci#define MSR_VIA_FCR 0x00001107 6328c2ecf20Sopenharmony_ci#define MSR_VIA_LONGHAUL 0x0000110a 6338c2ecf20Sopenharmony_ci#define MSR_VIA_RNG 0x0000110b 6348c2ecf20Sopenharmony_ci#define MSR_VIA_BCR2 0x00001147 6358c2ecf20Sopenharmony_ci 6368c2ecf20Sopenharmony_ci/* Transmeta defined MSRs */ 6378c2ecf20Sopenharmony_ci#define MSR_TMTA_LONGRUN_CTRL 0x80868010 6388c2ecf20Sopenharmony_ci#define MSR_TMTA_LONGRUN_FLAGS 0x80868011 6398c2ecf20Sopenharmony_ci#define MSR_TMTA_LRTI_READOUT 0x80868018 6408c2ecf20Sopenharmony_ci#define MSR_TMTA_LRTI_VOLT_MHZ 0x8086801a 6418c2ecf20Sopenharmony_ci 6428c2ecf20Sopenharmony_ci/* Intel defined MSRs. */ 6438c2ecf20Sopenharmony_ci#define MSR_IA32_P5_MC_ADDR 0x00000000 6448c2ecf20Sopenharmony_ci#define MSR_IA32_P5_MC_TYPE 0x00000001 6458c2ecf20Sopenharmony_ci#define MSR_IA32_TSC 0x00000010 6468c2ecf20Sopenharmony_ci#define MSR_IA32_PLATFORM_ID 0x00000017 6478c2ecf20Sopenharmony_ci#define MSR_IA32_EBL_CR_POWERON 0x0000002a 6488c2ecf20Sopenharmony_ci#define MSR_EBC_FREQUENCY_ID 0x0000002c 6498c2ecf20Sopenharmony_ci#define MSR_SMI_COUNT 0x00000034 6508c2ecf20Sopenharmony_ci 6518c2ecf20Sopenharmony_ci/* Referred to as IA32_FEATURE_CONTROL in Intel's SDM. */ 6528c2ecf20Sopenharmony_ci#define MSR_IA32_FEAT_CTL 0x0000003a 6538c2ecf20Sopenharmony_ci#define FEAT_CTL_LOCKED BIT(0) 6548c2ecf20Sopenharmony_ci#define FEAT_CTL_VMX_ENABLED_INSIDE_SMX BIT(1) 6558c2ecf20Sopenharmony_ci#define FEAT_CTL_VMX_ENABLED_OUTSIDE_SMX BIT(2) 6568c2ecf20Sopenharmony_ci#define FEAT_CTL_LMCE_ENABLED BIT(20) 6578c2ecf20Sopenharmony_ci 6588c2ecf20Sopenharmony_ci#define MSR_IA32_TSC_ADJUST 0x0000003b 6598c2ecf20Sopenharmony_ci#define MSR_IA32_BNDCFGS 0x00000d90 6608c2ecf20Sopenharmony_ci 6618c2ecf20Sopenharmony_ci#define MSR_IA32_BNDCFGS_RSVD 0x00000ffc 6628c2ecf20Sopenharmony_ci 6638c2ecf20Sopenharmony_ci#define MSR_IA32_XSS 0x00000da0 6648c2ecf20Sopenharmony_ci 6658c2ecf20Sopenharmony_ci#define MSR_IA32_APICBASE 0x0000001b 6668c2ecf20Sopenharmony_ci#define MSR_IA32_APICBASE_BSP (1<<8) 6678c2ecf20Sopenharmony_ci#define MSR_IA32_APICBASE_ENABLE (1<<11) 6688c2ecf20Sopenharmony_ci#define MSR_IA32_APICBASE_BASE (0xfffff<<12) 6698c2ecf20Sopenharmony_ci 6708c2ecf20Sopenharmony_ci#define MSR_IA32_TSCDEADLINE 0x000006e0 6718c2ecf20Sopenharmony_ci 6728c2ecf20Sopenharmony_ci#define MSR_IA32_UCODE_WRITE 0x00000079 6738c2ecf20Sopenharmony_ci#define MSR_IA32_UCODE_REV 0x0000008b 6748c2ecf20Sopenharmony_ci 6758c2ecf20Sopenharmony_ci#define MSR_IA32_SMM_MONITOR_CTL 0x0000009b 6768c2ecf20Sopenharmony_ci#define MSR_IA32_SMBASE 0x0000009e 6778c2ecf20Sopenharmony_ci 6788c2ecf20Sopenharmony_ci#define MSR_IA32_PERF_STATUS 0x00000198 6798c2ecf20Sopenharmony_ci#define MSR_IA32_PERF_CTL 0x00000199 6808c2ecf20Sopenharmony_ci#define INTEL_PERF_CTL_MASK 0xffff 6818c2ecf20Sopenharmony_ci 6828c2ecf20Sopenharmony_ci#define MSR_IA32_MPERF 0x000000e7 6838c2ecf20Sopenharmony_ci#define MSR_IA32_APERF 0x000000e8 6848c2ecf20Sopenharmony_ci 6858c2ecf20Sopenharmony_ci#define MSR_IA32_THERM_CONTROL 0x0000019a 6868c2ecf20Sopenharmony_ci#define MSR_IA32_THERM_INTERRUPT 0x0000019b 6878c2ecf20Sopenharmony_ci 6888c2ecf20Sopenharmony_ci#define THERM_INT_HIGH_ENABLE (1 << 0) 6898c2ecf20Sopenharmony_ci#define THERM_INT_LOW_ENABLE (1 << 1) 6908c2ecf20Sopenharmony_ci#define THERM_INT_PLN_ENABLE (1 << 24) 6918c2ecf20Sopenharmony_ci 6928c2ecf20Sopenharmony_ci#define MSR_IA32_THERM_STATUS 0x0000019c 6938c2ecf20Sopenharmony_ci 6948c2ecf20Sopenharmony_ci#define THERM_STATUS_PROCHOT (1 << 0) 6958c2ecf20Sopenharmony_ci#define THERM_STATUS_POWER_LIMIT (1 << 10) 6968c2ecf20Sopenharmony_ci 6978c2ecf20Sopenharmony_ci#define MSR_THERM2_CTL 0x0000019d 6988c2ecf20Sopenharmony_ci 6998c2ecf20Sopenharmony_ci#define MSR_THERM2_CTL_TM_SELECT (1ULL << 16) 7008c2ecf20Sopenharmony_ci 7018c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE 0x000001a0 7028c2ecf20Sopenharmony_ci 7038c2ecf20Sopenharmony_ci#define MSR_IA32_TEMPERATURE_TARGET 0x000001a2 7048c2ecf20Sopenharmony_ci 7058c2ecf20Sopenharmony_ci#define MSR_MISC_FEATURE_CONTROL 0x000001a4 7068c2ecf20Sopenharmony_ci#define MSR_MISC_PWR_MGMT 0x000001aa 7078c2ecf20Sopenharmony_ci 7088c2ecf20Sopenharmony_ci#define MSR_IA32_ENERGY_PERF_BIAS 0x000001b0 7098c2ecf20Sopenharmony_ci#define ENERGY_PERF_BIAS_PERFORMANCE 0 7108c2ecf20Sopenharmony_ci#define ENERGY_PERF_BIAS_BALANCE_PERFORMANCE 4 7118c2ecf20Sopenharmony_ci#define ENERGY_PERF_BIAS_NORMAL 6 7128c2ecf20Sopenharmony_ci#define ENERGY_PERF_BIAS_BALANCE_POWERSAVE 8 7138c2ecf20Sopenharmony_ci#define ENERGY_PERF_BIAS_POWERSAVE 15 7148c2ecf20Sopenharmony_ci 7158c2ecf20Sopenharmony_ci#define MSR_IA32_PACKAGE_THERM_STATUS 0x000001b1 7168c2ecf20Sopenharmony_ci 7178c2ecf20Sopenharmony_ci#define PACKAGE_THERM_STATUS_PROCHOT (1 << 0) 7188c2ecf20Sopenharmony_ci#define PACKAGE_THERM_STATUS_POWER_LIMIT (1 << 10) 7198c2ecf20Sopenharmony_ci 7208c2ecf20Sopenharmony_ci#define MSR_IA32_PACKAGE_THERM_INTERRUPT 0x000001b2 7218c2ecf20Sopenharmony_ci 7228c2ecf20Sopenharmony_ci#define PACKAGE_THERM_INT_HIGH_ENABLE (1 << 0) 7238c2ecf20Sopenharmony_ci#define PACKAGE_THERM_INT_LOW_ENABLE (1 << 1) 7248c2ecf20Sopenharmony_ci#define PACKAGE_THERM_INT_PLN_ENABLE (1 << 24) 7258c2ecf20Sopenharmony_ci 7268c2ecf20Sopenharmony_ci/* Thermal Thresholds Support */ 7278c2ecf20Sopenharmony_ci#define THERM_INT_THRESHOLD0_ENABLE (1 << 15) 7288c2ecf20Sopenharmony_ci#define THERM_SHIFT_THRESHOLD0 8 7298c2ecf20Sopenharmony_ci#define THERM_MASK_THRESHOLD0 (0x7f << THERM_SHIFT_THRESHOLD0) 7308c2ecf20Sopenharmony_ci#define THERM_INT_THRESHOLD1_ENABLE (1 << 23) 7318c2ecf20Sopenharmony_ci#define THERM_SHIFT_THRESHOLD1 16 7328c2ecf20Sopenharmony_ci#define THERM_MASK_THRESHOLD1 (0x7f << THERM_SHIFT_THRESHOLD1) 7338c2ecf20Sopenharmony_ci#define THERM_STATUS_THRESHOLD0 (1 << 6) 7348c2ecf20Sopenharmony_ci#define THERM_LOG_THRESHOLD0 (1 << 7) 7358c2ecf20Sopenharmony_ci#define THERM_STATUS_THRESHOLD1 (1 << 8) 7368c2ecf20Sopenharmony_ci#define THERM_LOG_THRESHOLD1 (1 << 9) 7378c2ecf20Sopenharmony_ci 7388c2ecf20Sopenharmony_ci/* MISC_ENABLE bits: architectural */ 7398c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_FAST_STRING_BIT 0 7408c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_FAST_STRING (1ULL << MSR_IA32_MISC_ENABLE_FAST_STRING_BIT) 7418c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_TCC_BIT 1 7428c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_TCC (1ULL << MSR_IA32_MISC_ENABLE_TCC_BIT) 7438c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_EMON_BIT 7 7448c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_EMON (1ULL << MSR_IA32_MISC_ENABLE_EMON_BIT) 7458c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL_BIT 11 7468c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL (1ULL << MSR_IA32_MISC_ENABLE_BTS_UNAVAIL_BIT) 7478c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL_BIT 12 7488c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1ULL << MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL_BIT) 7498c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP_BIT 16 7508c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP (1ULL << MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP_BIT) 7518c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_MWAIT_BIT 18 7528c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << MSR_IA32_MISC_ENABLE_MWAIT_BIT) 7538c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT 22 7548c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT) 7558c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT 23 7568c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT) 7578c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT 34 7588c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_XD_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT) 7598c2ecf20Sopenharmony_ci 7608c2ecf20Sopenharmony_ci/* MISC_ENABLE bits: model-specific, meaning may vary from core to core */ 7618c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_X87_COMPAT_BIT 2 7628c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_X87_COMPAT (1ULL << MSR_IA32_MISC_ENABLE_X87_COMPAT_BIT) 7638c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_TM1_BIT 3 7648c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_TM1 (1ULL << MSR_IA32_MISC_ENABLE_TM1_BIT) 7658c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE_BIT 4 7668c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE_BIT) 7678c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE_BIT 6 7688c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE_BIT) 7698c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK_BIT 8 7708c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK (1ULL << MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK_BIT) 7718c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT 9 7728c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) 7738c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_FERR_BIT 10 7748c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_FERR (1ULL << MSR_IA32_MISC_ENABLE_FERR_BIT) 7758c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX_BIT 10 7768c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX (1ULL << MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX_BIT) 7778c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_TM2_BIT 13 7788c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_TM2 (1ULL << MSR_IA32_MISC_ENABLE_TM2_BIT) 7798c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE_BIT 19 7808c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE_BIT) 7818c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK_BIT 20 7828c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK (1ULL << MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK_BIT) 7838c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_L1D_CONTEXT_BIT 24 7848c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_L1D_CONTEXT (1ULL << MSR_IA32_MISC_ENABLE_L1D_CONTEXT_BIT) 7858c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE_BIT 37 7868c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE_BIT) 7878c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE_BIT 38 7888c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_TURBO_DISABLE_BIT) 7898c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE_BIT 39 7908c2ecf20Sopenharmony_ci#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE_BIT) 7918c2ecf20Sopenharmony_ci 7928c2ecf20Sopenharmony_ci/* MISC_FEATURES_ENABLES non-architectural features */ 7938c2ecf20Sopenharmony_ci#define MSR_MISC_FEATURES_ENABLES 0x00000140 7948c2ecf20Sopenharmony_ci 7958c2ecf20Sopenharmony_ci#define MSR_MISC_FEATURES_ENABLES_CPUID_FAULT_BIT 0 7968c2ecf20Sopenharmony_ci#define MSR_MISC_FEATURES_ENABLES_CPUID_FAULT BIT_ULL(MSR_MISC_FEATURES_ENABLES_CPUID_FAULT_BIT) 7978c2ecf20Sopenharmony_ci#define MSR_MISC_FEATURES_ENABLES_RING3MWAIT_BIT 1 7988c2ecf20Sopenharmony_ci 7998c2ecf20Sopenharmony_ci#define MSR_IA32_TSC_DEADLINE 0x000006E0 8008c2ecf20Sopenharmony_ci 8018c2ecf20Sopenharmony_ci 8028c2ecf20Sopenharmony_ci#define MSR_TSX_FORCE_ABORT 0x0000010F 8038c2ecf20Sopenharmony_ci 8048c2ecf20Sopenharmony_ci#define MSR_TFA_RTM_FORCE_ABORT_BIT 0 8058c2ecf20Sopenharmony_ci#define MSR_TFA_RTM_FORCE_ABORT BIT_ULL(MSR_TFA_RTM_FORCE_ABORT_BIT) 8068c2ecf20Sopenharmony_ci 8078c2ecf20Sopenharmony_ci/* P4/Xeon+ specific */ 8088c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_EAX 0x00000180 8098c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_EBX 0x00000181 8108c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_ECX 0x00000182 8118c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_EDX 0x00000183 8128c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_ESI 0x00000184 8138c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_EDI 0x00000185 8148c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_EBP 0x00000186 8158c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_ESP 0x00000187 8168c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_EFLAGS 0x00000188 8178c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_EIP 0x00000189 8188c2ecf20Sopenharmony_ci#define MSR_IA32_MCG_RESERVED 0x0000018a 8198c2ecf20Sopenharmony_ci 8208c2ecf20Sopenharmony_ci/* Pentium IV performance counter MSRs */ 8218c2ecf20Sopenharmony_ci#define MSR_P4_BPU_PERFCTR0 0x00000300 8228c2ecf20Sopenharmony_ci#define MSR_P4_BPU_PERFCTR1 0x00000301 8238c2ecf20Sopenharmony_ci#define MSR_P4_BPU_PERFCTR2 0x00000302 8248c2ecf20Sopenharmony_ci#define MSR_P4_BPU_PERFCTR3 0x00000303 8258c2ecf20Sopenharmony_ci#define MSR_P4_MS_PERFCTR0 0x00000304 8268c2ecf20Sopenharmony_ci#define MSR_P4_MS_PERFCTR1 0x00000305 8278c2ecf20Sopenharmony_ci#define MSR_P4_MS_PERFCTR2 0x00000306 8288c2ecf20Sopenharmony_ci#define MSR_P4_MS_PERFCTR3 0x00000307 8298c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_PERFCTR0 0x00000308 8308c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_PERFCTR1 0x00000309 8318c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_PERFCTR2 0x0000030a 8328c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_PERFCTR3 0x0000030b 8338c2ecf20Sopenharmony_ci#define MSR_P4_IQ_PERFCTR0 0x0000030c 8348c2ecf20Sopenharmony_ci#define MSR_P4_IQ_PERFCTR1 0x0000030d 8358c2ecf20Sopenharmony_ci#define MSR_P4_IQ_PERFCTR2 0x0000030e 8368c2ecf20Sopenharmony_ci#define MSR_P4_IQ_PERFCTR3 0x0000030f 8378c2ecf20Sopenharmony_ci#define MSR_P4_IQ_PERFCTR4 0x00000310 8388c2ecf20Sopenharmony_ci#define MSR_P4_IQ_PERFCTR5 0x00000311 8398c2ecf20Sopenharmony_ci#define MSR_P4_BPU_CCCR0 0x00000360 8408c2ecf20Sopenharmony_ci#define MSR_P4_BPU_CCCR1 0x00000361 8418c2ecf20Sopenharmony_ci#define MSR_P4_BPU_CCCR2 0x00000362 8428c2ecf20Sopenharmony_ci#define MSR_P4_BPU_CCCR3 0x00000363 8438c2ecf20Sopenharmony_ci#define MSR_P4_MS_CCCR0 0x00000364 8448c2ecf20Sopenharmony_ci#define MSR_P4_MS_CCCR1 0x00000365 8458c2ecf20Sopenharmony_ci#define MSR_P4_MS_CCCR2 0x00000366 8468c2ecf20Sopenharmony_ci#define MSR_P4_MS_CCCR3 0x00000367 8478c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_CCCR0 0x00000368 8488c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_CCCR1 0x00000369 8498c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_CCCR2 0x0000036a 8508c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_CCCR3 0x0000036b 8518c2ecf20Sopenharmony_ci#define MSR_P4_IQ_CCCR0 0x0000036c 8528c2ecf20Sopenharmony_ci#define MSR_P4_IQ_CCCR1 0x0000036d 8538c2ecf20Sopenharmony_ci#define MSR_P4_IQ_CCCR2 0x0000036e 8548c2ecf20Sopenharmony_ci#define MSR_P4_IQ_CCCR3 0x0000036f 8558c2ecf20Sopenharmony_ci#define MSR_P4_IQ_CCCR4 0x00000370 8568c2ecf20Sopenharmony_ci#define MSR_P4_IQ_CCCR5 0x00000371 8578c2ecf20Sopenharmony_ci#define MSR_P4_ALF_ESCR0 0x000003ca 8588c2ecf20Sopenharmony_ci#define MSR_P4_ALF_ESCR1 0x000003cb 8598c2ecf20Sopenharmony_ci#define MSR_P4_BPU_ESCR0 0x000003b2 8608c2ecf20Sopenharmony_ci#define MSR_P4_BPU_ESCR1 0x000003b3 8618c2ecf20Sopenharmony_ci#define MSR_P4_BSU_ESCR0 0x000003a0 8628c2ecf20Sopenharmony_ci#define MSR_P4_BSU_ESCR1 0x000003a1 8638c2ecf20Sopenharmony_ci#define MSR_P4_CRU_ESCR0 0x000003b8 8648c2ecf20Sopenharmony_ci#define MSR_P4_CRU_ESCR1 0x000003b9 8658c2ecf20Sopenharmony_ci#define MSR_P4_CRU_ESCR2 0x000003cc 8668c2ecf20Sopenharmony_ci#define MSR_P4_CRU_ESCR3 0x000003cd 8678c2ecf20Sopenharmony_ci#define MSR_P4_CRU_ESCR4 0x000003e0 8688c2ecf20Sopenharmony_ci#define MSR_P4_CRU_ESCR5 0x000003e1 8698c2ecf20Sopenharmony_ci#define MSR_P4_DAC_ESCR0 0x000003a8 8708c2ecf20Sopenharmony_ci#define MSR_P4_DAC_ESCR1 0x000003a9 8718c2ecf20Sopenharmony_ci#define MSR_P4_FIRM_ESCR0 0x000003a4 8728c2ecf20Sopenharmony_ci#define MSR_P4_FIRM_ESCR1 0x000003a5 8738c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_ESCR0 0x000003a6 8748c2ecf20Sopenharmony_ci#define MSR_P4_FLAME_ESCR1 0x000003a7 8758c2ecf20Sopenharmony_ci#define MSR_P4_FSB_ESCR0 0x000003a2 8768c2ecf20Sopenharmony_ci#define MSR_P4_FSB_ESCR1 0x000003a3 8778c2ecf20Sopenharmony_ci#define MSR_P4_IQ_ESCR0 0x000003ba 8788c2ecf20Sopenharmony_ci#define MSR_P4_IQ_ESCR1 0x000003bb 8798c2ecf20Sopenharmony_ci#define MSR_P4_IS_ESCR0 0x000003b4 8808c2ecf20Sopenharmony_ci#define MSR_P4_IS_ESCR1 0x000003b5 8818c2ecf20Sopenharmony_ci#define MSR_P4_ITLB_ESCR0 0x000003b6 8828c2ecf20Sopenharmony_ci#define MSR_P4_ITLB_ESCR1 0x000003b7 8838c2ecf20Sopenharmony_ci#define MSR_P4_IX_ESCR0 0x000003c8 8848c2ecf20Sopenharmony_ci#define MSR_P4_IX_ESCR1 0x000003c9 8858c2ecf20Sopenharmony_ci#define MSR_P4_MOB_ESCR0 0x000003aa 8868c2ecf20Sopenharmony_ci#define MSR_P4_MOB_ESCR1 0x000003ab 8878c2ecf20Sopenharmony_ci#define MSR_P4_MS_ESCR0 0x000003c0 8888c2ecf20Sopenharmony_ci#define MSR_P4_MS_ESCR1 0x000003c1 8898c2ecf20Sopenharmony_ci#define MSR_P4_PMH_ESCR0 0x000003ac 8908c2ecf20Sopenharmony_ci#define MSR_P4_PMH_ESCR1 0x000003ad 8918c2ecf20Sopenharmony_ci#define MSR_P4_RAT_ESCR0 0x000003bc 8928c2ecf20Sopenharmony_ci#define MSR_P4_RAT_ESCR1 0x000003bd 8938c2ecf20Sopenharmony_ci#define MSR_P4_SAAT_ESCR0 0x000003ae 8948c2ecf20Sopenharmony_ci#define MSR_P4_SAAT_ESCR1 0x000003af 8958c2ecf20Sopenharmony_ci#define MSR_P4_SSU_ESCR0 0x000003be 8968c2ecf20Sopenharmony_ci#define MSR_P4_SSU_ESCR1 0x000003bf /* guess: not in manual */ 8978c2ecf20Sopenharmony_ci 8988c2ecf20Sopenharmony_ci#define MSR_P4_TBPU_ESCR0 0x000003c2 8998c2ecf20Sopenharmony_ci#define MSR_P4_TBPU_ESCR1 0x000003c3 9008c2ecf20Sopenharmony_ci#define MSR_P4_TC_ESCR0 0x000003c4 9018c2ecf20Sopenharmony_ci#define MSR_P4_TC_ESCR1 0x000003c5 9028c2ecf20Sopenharmony_ci#define MSR_P4_U2L_ESCR0 0x000003b0 9038c2ecf20Sopenharmony_ci#define MSR_P4_U2L_ESCR1 0x000003b1 9048c2ecf20Sopenharmony_ci 9058c2ecf20Sopenharmony_ci#define MSR_P4_PEBS_MATRIX_VERT 0x000003f2 9068c2ecf20Sopenharmony_ci 9078c2ecf20Sopenharmony_ci/* Intel Core-based CPU performance counters */ 9088c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_FIXED_CTR0 0x00000309 9098c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_FIXED_CTR1 0x0000030a 9108c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_FIXED_CTR2 0x0000030b 9118c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_FIXED_CTR3 0x0000030c 9128c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_FIXED_CTR_CTRL 0x0000038d 9138c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_STATUS 0x0000038e 9148c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_CTRL 0x0000038f 9158c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x00000390 9168c2ecf20Sopenharmony_ci 9178c2ecf20Sopenharmony_ci#define MSR_PERF_METRICS 0x00000329 9188c2ecf20Sopenharmony_ci 9198c2ecf20Sopenharmony_ci/* PERF_GLOBAL_OVF_CTL bits */ 9208c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_OVF_CTRL_TRACE_TOPA_PMI_BIT 55 9218c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_OVF_CTRL_TRACE_TOPA_PMI (1ULL << MSR_CORE_PERF_GLOBAL_OVF_CTRL_TRACE_TOPA_PMI_BIT) 9228c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_OVF_CTRL_OVF_BUF_BIT 62 9238c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_OVF_CTRL_OVF_BUF (1ULL << MSR_CORE_PERF_GLOBAL_OVF_CTRL_OVF_BUF_BIT) 9248c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_OVF_CTRL_COND_CHGD_BIT 63 9258c2ecf20Sopenharmony_ci#define MSR_CORE_PERF_GLOBAL_OVF_CTRL_COND_CHGD (1ULL << MSR_CORE_PERF_GLOBAL_OVF_CTRL_COND_CHGD_BIT) 9268c2ecf20Sopenharmony_ci 9278c2ecf20Sopenharmony_ci/* Geode defined MSRs */ 9288c2ecf20Sopenharmony_ci#define MSR_GEODE_BUSCONT_CONF0 0x00001900 9298c2ecf20Sopenharmony_ci 9308c2ecf20Sopenharmony_ci/* Intel VT MSRs */ 9318c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_BASIC 0x00000480 9328c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_PINBASED_CTLS 0x00000481 9338c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_PROCBASED_CTLS 0x00000482 9348c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_EXIT_CTLS 0x00000483 9358c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_ENTRY_CTLS 0x00000484 9368c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_MISC 0x00000485 9378c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_CR0_FIXED0 0x00000486 9388c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_CR0_FIXED1 0x00000487 9398c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_CR4_FIXED0 0x00000488 9408c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_CR4_FIXED1 0x00000489 9418c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_VMCS_ENUM 0x0000048a 9428c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_PROCBASED_CTLS2 0x0000048b 9438c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_EPT_VPID_CAP 0x0000048c 9448c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_TRUE_PINBASED_CTLS 0x0000048d 9458c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_TRUE_PROCBASED_CTLS 0x0000048e 9468c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_TRUE_EXIT_CTLS 0x0000048f 9478c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_TRUE_ENTRY_CTLS 0x00000490 9488c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_VMFUNC 0x00000491 9498c2ecf20Sopenharmony_ci 9508c2ecf20Sopenharmony_ci/* VMX_BASIC bits and bitmasks */ 9518c2ecf20Sopenharmony_ci#define VMX_BASIC_VMCS_SIZE_SHIFT 32 9528c2ecf20Sopenharmony_ci#define VMX_BASIC_TRUE_CTLS (1ULL << 55) 9538c2ecf20Sopenharmony_ci#define VMX_BASIC_64 0x0001000000000000LLU 9548c2ecf20Sopenharmony_ci#define VMX_BASIC_MEM_TYPE_SHIFT 50 9558c2ecf20Sopenharmony_ci#define VMX_BASIC_MEM_TYPE_MASK 0x003c000000000000LLU 9568c2ecf20Sopenharmony_ci#define VMX_BASIC_MEM_TYPE_WB 6LLU 9578c2ecf20Sopenharmony_ci#define VMX_BASIC_INOUT 0x0040000000000000LLU 9588c2ecf20Sopenharmony_ci 9598c2ecf20Sopenharmony_ci/* MSR_IA32_VMX_MISC bits */ 9608c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_MISC_INTEL_PT (1ULL << 14) 9618c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS (1ULL << 29) 9628c2ecf20Sopenharmony_ci#define MSR_IA32_VMX_MISC_PREEMPTION_TIMER_SCALE 0x1F 9638c2ecf20Sopenharmony_ci/* AMD-V MSRs */ 9648c2ecf20Sopenharmony_ci 9658c2ecf20Sopenharmony_ci#define MSR_VM_CR 0xc0010114 9668c2ecf20Sopenharmony_ci#define MSR_VM_IGNNE 0xc0010115 9678c2ecf20Sopenharmony_ci#define MSR_VM_HSAVE_PA 0xc0010117 9688c2ecf20Sopenharmony_ci 9698c2ecf20Sopenharmony_ci#endif /* _ASM_X86_MSR_INDEX_H */ 970