Re: new cpuid bits

2010-11-22 Thread John Baldwin
On Friday, November 19, 2010 10:39:53 am Andriy Gapon wrote:
 
 Guys,
 
 I would like to add definitions for couple more useful CPUID bits, but I am
 greatly confused about how to name them.
 I failed to deduce the naming convention from the existing definitions and I 
 am
 not sure how to make the names proper and descriptive.
 
 The bits in question are returned by CPUID.6 in EAX and ECX.
 CPUID.6 block is described by both AMD and Intel as Thermal and Power 
 Management
 (Leaf).  Bits in EAX are defined only for Intel at present, the bit in ECX is
 defined for both.
 
 Description/naming of the bits from the specifications:
 EAX[0]: Digital temperature sensor is supported if set
 EAX[1]: Intel Turbo Boost Technology Available
 EAX[2]: ARAT. APIC-Timer-always-running feature is supported if set.
 ECX[0]:
   Intel: Hardware Coordination Feedback Capability (Presence of Bits MCNT and 
 ACNT
 MSRs).
   AMD:  EffFreq: effective frequency interface.
 
 How does the following look to you?
 I will appreciate suggestions/comments.

Looks fine to me.

-- 
John Baldwin
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


new cpuid bits

2010-11-19 Thread Andriy Gapon

Guys,

I would like to add definitions for couple more useful CPUID bits, but I am
greatly confused about how to name them.
I failed to deduce the naming convention from the existing definitions and I am
not sure how to make the names proper and descriptive.

The bits in question are returned by CPUID.6 in EAX and ECX.
CPUID.6 block is described by both AMD and Intel as Thermal and Power 
Management
(Leaf).  Bits in EAX are defined only for Intel at present, the bit in ECX is
defined for both.

Description/naming of the bits from the specifications:
EAX[0]: Digital temperature sensor is supported if set
EAX[1]: Intel Turbo Boost Technology Available
EAX[2]: ARAT. APIC-Timer-always-running feature is supported if set.
ECX[0]:
  Intel: Hardware Coordination Feedback Capability (Presence of Bits MCNT and 
ACNT
MSRs).
  AMD:  EffFreq: effective frequency interface.

How does the following look to you?
I will appreciate suggestions/comments.
Thanks!

Index: sys/amd64/include/specialreg.h
===
--- sys/amd64/include/specialreg.h  (revision 215524)
+++ sys/amd64/include/specialreg.h  (working copy)
@@ -136,6 +136,15 @@
 #defineCPUID2_AESNI0x0200

 /*
+ * Important bits in the Thermal and Power Management flags
+ * CPUID.6 EAX and ECX.
+ */
+#defineCPUTPM1_SENSOR  0x0001
+#defineCPUTPM1_TURBO   0x0002
+#defineCPUTPM1_ARAT0x0004
+#defineCPUTPM2_EFFREQ  0x0001
+
+/*
  * Important bits in the AMD extended cpuid flags
  */
 #defineAMDID_SYSCALL   0x0800

-- 
Andriy Gapon
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: new cpuid bits

2010-11-19 Thread Gary Jennejohn
On Fri, 19 Nov 2010 17:39:53 +0200
Andriy Gapon a...@freebsd.org wrote:

 
 Guys,
 
 I would like to add definitions for couple more useful CPUID bits, but I am
 greatly confused about how to name them.
 I failed to deduce the naming convention from the existing definitions and I 
 am
 not sure how to make the names proper and descriptive.
 
 The bits in question are returned by CPUID.6 in EAX and ECX.
 CPUID.6 block is described by both AMD and Intel as Thermal and Power 
 Management
 (Leaf).  Bits in EAX are defined only for Intel at present, the bit in ECX is
 defined for both.
 
 Description/naming of the bits from the specifications:
 EAX[0]: Digital temperature sensor is supported if set
 EAX[1]: Intel Turbo Boost Technology Available
 EAX[2]: ARAT. APIC-Timer-always-running feature is supported if set.
 ECX[0]:
   Intel: Hardware Coordination Feedback Capability (Presence of Bits MCNT and 
 ACNT
 MSRs).
   AMD:  EffFreq: effective frequency interface.
 
 How does the following look to you?
 I will appreciate suggestions/comments.
 Thanks!
 
 Index: sys/amd64/include/specialreg.h
 ===
 --- sys/amd64/include/specialreg.h(revision 215524)
 +++ sys/amd64/include/specialreg.h(working copy)
 @@ -136,6 +136,15 @@
  #define  CPUID2_AESNI0x0200
 
  /*
 + * Important bits in the Thermal and Power Management flags
 + * CPUID.6 EAX and ECX.
 + */
 +#define  CPUTPM1_SENSOR  0x0001
 +#define  CPUTPM1_TURBO   0x0002
 +#define  CPUTPM1_ARAT0x0004
 +#define  CPUTPM2_EFFREQ  0x0001
 +
 +/*
   * Important bits in the AMD extended cpuid flags
   */
  #define  AMDID_SYSCALL   0x0800
 

Maybe add a comment in which register the bits are to be found, like in the 
text?

-- 
Gary Jennejohn
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org