cpuid

Rdrand instrucrtion SIGILL

霸气de小男生 提交于 2019-12-13 07:39:21
问题 Cpuid says that I have rdrand on my system, but rdrand instruction throws sigill. I'm using linux mint inside VmWare workstation 11, I googled workstation support of rdrand, and they say that it enabled since 9th version. Proccess of host is i5-2550k and it should support rdrand. Can I somehow fix this? Here is gdb listing: Breakpoint 1, 0x08048060 in _start () (gdb) x/5i $eip => 0x8048060 <_start>: mov $0x1,%eax 0x8048065 <_start+5>: cpuid 0x8048067 <_start+7>: rdrand %eax 0x804806a <_start

How to get TLB page size with cpuid

 ̄綄美尐妖づ 提交于 2019-12-11 17:28:50
问题 For Intel I use: mov, eax, 2h cpuid it gives "descriptor decode value" - ok; For AMD I use: mov, eax, 80000005h cpuid It gives associativity and entries for 4MB in eax (4KB in ebx). Here it is : EAX = FF30FF10 EBX = FF30FF20" FF - full assoc. data, 48d entries data, FF - full assoc. instr, 16d entries instr So I have both 4KB and 4MB or what? P.S. i`m right that TLB page and L1 cache - different things? Or maybe L1 instr. cache size is what I need? 回答1: This entry on wikipedia may help you

Using inline assembly with serialization instructions

冷暖自知 提交于 2019-12-11 06:09:11
问题 We consider that we are using GCC (or GCC -compatible) compiler on a X86_64 architecture, and that eax , ebx , ecx , edx and level are variables ( unsigned int or unsigned int* ) for input and output of the instruction (like here). asm("CPUID":::); asm volatile("CPUID":::); asm volatile("CPUID":::"memory"); asm volatile("CPUID":"=a"(eax),"=b"(ebx),"=c"(ecx),"=d"(edx)::"memory"); asm volatile("CPUID":"=a"(eax):"0"(level):"memory"); asm volatile("CPUID"::"a"(level):"memory"); // Not sure of

How to call cpuid instruction in a Mac framework?

試著忘記壹切 提交于 2019-12-09 00:36:19
问题 I want to use the cpuid instruction to identify features of an Intel CPU. I found the cpuid.h header in Kernel.framework, so I added Kernel.framework to my project and included <Kernel/i386/cpuid.h> in my source file. That produced kern/kern_types.h: No such file or directory which I don't understand. But the function do_cpuid , which is what I think I want to use, is defined inline, so I tried just copying that into my source. static inline void do_cpuid(uint32_t selector, uint32_t *data) {

How to use CPUID as a serializing instruction?

大兔子大兔子 提交于 2019-12-07 22:50:09
问题 CPUID can be used as a serializing instruction as described here and here. What is the minimal/simplest asm syntax to use it in that way in C++? // Is that enough? // What to do with registers and memory? // Is volatile necessary? asm volatile("CPUID":::); 回答1: Is there a reason you're not using the fence operations? If the goal is to serialize a section of code you can do something like asm __volatile__ ( " mfence \n" " lfence \n" ); Your code asm __volatile__ ( " mfence \n" " lfence \n" );

How to use CPUID as a serializing instruction?

ぐ巨炮叔叔 提交于 2019-12-06 09:40:22
CPUID can be used as a serializing instruction as described here and here . What is the minimal/simplest asm syntax to use it in that way in C++? // Is that enough? // What to do with registers and memory? // Is volatile necessary? asm volatile("CPUID":::); Is there a reason you're not using the fence operations? If the goal is to serialize a section of code you can do something like asm __volatile__ ( " mfence \n" " lfence \n" ); Your code asm __volatile__ ( " mfence \n" " lfence \n" ); 来源: https://stackoverflow.com/questions/48502569/how-to-use-cpuid-as-a-serializing-instruction

Determine CPUID as listed in the Intel Intrinsics Guide

隐身守侯 提交于 2019-12-06 03:47:35
问题 In the Intel Intrinsics Guide there are 'Latency and Throughput Information' at the bottom of several Intrinsics, listing the performance for several CPUID(s). For example, the table in the Intrinsics Guide looks as follows for the Intrinsic _mm_hadd_pd : CPUID(s) Parameters Latency Throughput 0F_03 13 4 06_2A xmm1, xmm2 5 2 06_25/2C/1A/1E/1F/2E xmm1, xmm2 5 2 06_17/1D xmm1, xmm2 6 1 06_0F xmm1, xmm2 5 2 Now: How do I determine, what ID my CPU has? I'm using Kubuntu 12.04 and tried with sudo

How to ensure that RDTSC is accurate?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 14:31:47
I've read that RDTSC can gives false readings and should not be relied upon. Is this true and if so what can be done about it? Very old CPU's have a RDTSC that is accurate. The problem However newer CPU's have a problem. Engineers decided that RDTSC would be great for telling time. However if a CPU throttles the frequency RDTSC is useless for telling time. The aforementioned braindead engineers then decided to 'fix' this problem by having the TSC always run at the same frequency, even if the CPU slows down. This has the 'advantage' that TSC can be used for telling elapsed (wall clock) time.

Determine CPUID as listed in the Intel Intrinsics Guide

≡放荡痞女 提交于 2019-12-04 06:58:50
In the Intel Intrinsics Guide there are 'Latency and Throughput Information' at the bottom of several Intrinsics, listing the performance for several CPUID(s). For example, the table in the Intrinsics Guide looks as follows for the Intrinsic _mm_hadd_pd : CPUID(s) Parameters Latency Throughput 0F_03 13 4 06_2A xmm1, xmm2 5 2 06_25/2C/1A/1E/1F/2E xmm1, xmm2 5 2 06_17/1D xmm1, xmm2 6 1 06_0F xmm1, xmm2 5 2 Now: How do I determine, what ID my CPU has? I'm using Kubuntu 12.04 and tried with sudo dmidecode -t 4 and also with the little program cpuid from the Ubuntu packages, but their output isn't

Getting CPU ID code from C# to be in C++

人走茶凉 提交于 2019-12-04 03:36:07
问题 I have this C# code to get Processor ID but I'm not able to pass it to C++, I tried a lot but I really can't, I just started in C++ and I would like to be able to get the CPU ID with C++ like I used to get with C# This is the code I have in C#: public static string GetProcessorID() { string sProcessorID = ""; string sQuery = "SELECT ProcessorId FROM Win32_Processor"; ManagementObjectSearcher oManagementObjectSearcher = new ManagementObjectSearcher(sQuery); ManagementObjectCollection