cpuid for pcid
-
samiam95124
- Posts: 14
- Joined: Sun Sep 11, 2016 12:54 pm
cpuid for pcid
Hi, I just lost $300 playing "cpuid roulette" (bought a new AMD cpu, no pcid support)
Could some of you kind people try:
cpuid -1 | grep -i picid
On a AMD7000 or AMD9000 series CPU?
AMD5000:
samiam@samiam-h-pc-2:~/projects/vo$ cpuid -1 | grep -i pcid
PCID: process context identifiers = false
INVPCID instruction = true
samiam@samiam-h-pc-2:~/projects/vo$
Intel I7:
samiam@samiam-h-pc-2:~/projects/vo$ cpuid -1 | grep -i pcid
PCID: process context identifiers = true
INVPCID instruction = true
samiam@samiam-h-pc-2:~/projects/vo$
Thanks.
Could some of you kind people try:
cpuid -1 | grep -i picid
On a AMD7000 or AMD9000 series CPU?
AMD5000:
samiam@samiam-h-pc-2:~/projects/vo$ cpuid -1 | grep -i pcid
PCID: process context identifiers = false
INVPCID instruction = true
samiam@samiam-h-pc-2:~/projects/vo$
Intel I7:
samiam@samiam-h-pc-2:~/projects/vo$ cpuid -1 | grep -i pcid
PCID: process context identifiers = true
INVPCID instruction = true
samiam@samiam-h-pc-2:~/projects/vo$
Thanks.
- JackScott
- Member

- Posts: 1054
- Joined: Thu Dec 21, 2006 3:03 am
- Location: Hobart, Australia
- Mastodon: https://aus.social/@jackscottau
- Matrix: @JackScottAU:matrix.org
- GitHub: https://github.com/JackScottAU
- Contact:
Re: cpuid for pcid
Ryzen 7 7700:
Code: Select all
PCID: process context identifiers = false
INVPCID instruction = trueCode: Select all
CPU:
vendor_id = "AuthenticAMD"
version information (1/eax):
processor type = primary processor (0)
family = 0xf (15)
model = 0x1 (1)
stepping id = 0x2 (2)
extended family = 0xa (10)
extended model = 0x6 (6)
(family synth) = 0x19 (25)
(model synth) = 0x61 (97)-
samiam95124
- Posts: 14
- Joined: Sun Sep 11, 2016 12:54 pm
Re: cpuid for pcid
Thanks Jack, very helpful.
-
sebihepp
- Member

- Posts: 256
- Joined: Tue Aug 26, 2008 11:24 am
- GitHub: https://github.com/sebihepp
Re: cpuid for pcid
On my AMD Ryzen R7 7800X3D:
Code: Select all
cpuid -1 | grep -i pcid
PCID: process context identifiers = false
INVPCID instruction = true-
samiam95124
- Posts: 14
- Joined: Sun Sep 11, 2016 12:54 pm
Re: cpuid for pcid
so.. why?
pcid is the ability to execute tlb flushes specific to processes meaning that the entire tlb need not be flushed every time. Doing that is a major time sink when transitioning from one page map to another, and this is a drag on OS designs that attempt to isolate different processes into different page maps to increase OS security in general.
Intel implemented it specifically to go after the meltdown exploit, and that got implemented as page tree isolation in Linux and other operating systems. AMD was not subject to meltdown, and (apparently) didn't feel the need therefore to implement pcid and page directory isolation.
You would never know this by reading AMD documentation, which (programmers manual) claims they did implement it, but they are very grey on exactly when it was implemented. The evidence is that both the 5000 series (which I have) and the 7000 series didn't implement it.
Note that virtually all modern CPUs implement this feature, ARM, Risc-V, etc.
Scott
pcid is the ability to execute tlb flushes specific to processes meaning that the entire tlb need not be flushed every time. Doing that is a major time sink when transitioning from one page map to another, and this is a drag on OS designs that attempt to isolate different processes into different page maps to increase OS security in general.
Intel implemented it specifically to go after the meltdown exploit, and that got implemented as page tree isolation in Linux and other operating systems. AMD was not subject to meltdown, and (apparently) didn't feel the need therefore to implement pcid and page directory isolation.
You would never know this by reading AMD documentation, which (programmers manual) claims they did implement it, but they are very grey on exactly when it was implemented. The evidence is that both the 5000 series (which I have) and the 7000 series didn't implement it.
Note that virtually all modern CPUs implement this feature, ARM, Risc-V, etc.
Scott
-
Octocontrabass
- Member

- Posts: 6275
- Joined: Mon Mar 25, 2013 7:01 pm
-
samiam95124
- Posts: 14
- Joined: Sun Sep 11, 2016 12:54 pm
Re: cpuid for pcid
That is it exactly, you star!
-
samiam95124
- Posts: 14
- Joined: Sun Sep 11, 2016 12:54 pm
Re: cpuid for pcid
Thanks for that. It confirms. No AMD64 series has pcid. Even though it is in their manual.
-
Octocontrabass
- Member

- Posts: 6275
- Joined: Mon Mar 25, 2013 7:01 pm
Re: cpuid for pcid
What do you mean? I see PCID support in some of those CPUID dumps. It looks like AMD added PCID starting with the Zen 3 core, but only in EPYC and Threadripper (server and workstation) models.
Re: cpuid for pcid
Slightly off-topic: I'm a bit surprised it took until Zen 3 for AMD to add the feature, even if that's when. Isn't PCID a pretty notable performance improvement, that's been around for quite a while?
Be kind.
Re: cpuid for pcid
According EPYC - here a list for 4005 and 4004 series - both support INVPCID but lack PCID, then Embedded 3000 series which lacks INVPCID as well PCID
Intel server processors support both PCID as well INVPCID:
this customer grade embedded Intel CPU supports INVPCID but lacks PCID (while it surprisingly supports shadow_vmcs which is typically used in server CPUs)
Code: Select all
processor : 0
vendor_id : AuthenticAMD
cpu family : 26
model : 68
model name : AMD EPYC 4545P 16-Core Processor
stepping : 0
microcode : 0xb404032
cpu MHz : 3749.768
cache size : 1024 KB
physical id : 0
siblings : 32
core id : 0
cpu cores : 16
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 16
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk avx_vnni avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid bus_lock_detect movdiri movdir64b overflow_recov succor smca fsrm avx512_vp2intersect flush_l1d amd_lbr_pmc_freeze
bugs : sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass srso
bogomips : 5988.35
TLB size : 192 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]Code: Select all
processor : 0
vendor_id : AuthenticAMD
cpu family : 25
model : 97
model name : AMD EPYC 4344P 8-Core Processor
stepping : 2
microcode : 0xa601209
cpu MHz : 2994.000
cache size : 1024 KB
physical id : 0
siblings : 16
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 16
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d
bugs : sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass
bogomips : 7585.53
TLB size : 3584 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]Code: Select all
processor : 0
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD EPYC 3201 8-Core Processor
stepping : 2
microcode : 0x800126f
cpu MHz : 1200.000
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sev sev_es
bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 2999.99
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]Intel server processors support both PCID as well INVPCID:
Code: Select all
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 183
model name : Intel(R) Xeon(R) 6369P
stepping : 1
microcode : 0x12c
cpu MHz : 800.000
cache size : 24576 KB
physical id : 0
siblings : 16
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 32
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs pml ept_violation_ve ept_mode_based_exec tsc_scaling usr_wait_pause
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb bhi
bogomips : 6604.80
clflush size : 64
cache_alignment : 64
address sizes : 42 bits physical, 48 bits virtual
power management:Code: Select all
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 190
model name : Intel(R) N100
stepping : 0
microcode : 0x11
cpu MHz : 699.993
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 32
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs ept_mode_based_exec tsc_scaling usr_wait_pause
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs
bogomips : 1612.80
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:hypervisor-based solutions developer (Intel, AMD)
-
Octocontrabass
- Member

- Posts: 6275
- Joined: Mon Mar 25, 2013 7:01 pm
Re: cpuid for pcid
Maybe it's only enabled in the high-end server and workstation models? The EPYC 7003 and 7004 series definitely support PCID.
The 3001 series is too old, PCID support wasn't added until the Zen 3 cores.
