Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\amd.c Create Date:2022-07-28 07:58:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:init_amd_k6

Proto:static void init_amd_k6(struct cpuinfo_x86 *c)

Type:void

Parameter:

TypeParameterName
struct cpuinfo_x86 *c
120  mbytes = get_num_physpages() >> 20 - PAGE_SHIFT determines the page size
122  If x86_model < 6 Then
124  If x86_model == 0 Then
128  Return
131  If x86_model == 6 && x86_stepping == 1 Then
132  K6_BUG_LOOP = 1000000
137  pr_info("AMD K6 stepping B detected - ")
144  n = K6_BUG_LOOP
145  f_vide = B step AMD K6 before B 9730xxxx have hardware bugs that can cause* misexecution of code under Linux. Owners of such processors should* contact AMD for precise details and a CPU swap.* See http://www.multimania.com/poulot/k6bug.html* and section 2
146  Make the optimizer believe the variable can be manipulated arbitrarily. (f_vide)
147  d = dtsc() - returns the current TSC without ordering constraints* rdtsc() returns the result of RDTSC as a 64-bit integer
148  When n-- cycle
149  f_vide()
150  d2 = dtsc() - returns the current TSC without ordering constraints* rdtsc() returns the result of RDTSC as a 64-bit integer
151  d = d2 - d
153  If d > 20 * K6_BUG_LOOP Then Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("system stability may be impaired when more than 32 MB are used.\n")
155  Else Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("probably OK (after B9730xxxx).\n")
160  If x86_model < 8 || x86_model == 8 && x86_stepping < 8 Then
163  If mbytes > 508 Then mbytes = 508
166  Access to machine-specific registers (available on 586 and better only)* Note: the rd* operations modify the parameters directly (without using* pointer indirection), this allows gcc to optimize better(K6 MSRs , l, h)
167  If (l & 0x0000FFFF) == 0 Then
169  l = 1 << 0 | mbytes / 4 << 1
171  wbinvd()
172  wrmsr(K6 MSRs , l, h)
174  pr_info("Enabling old style K6 write allocation for %d Mb\n", mbytes)
177  Return
180  If x86_model == 8 && x86_stepping > 7 || x86_model == 9 || x86_model == 13 Then
184  If mbytes > 4092 Then mbytes = 4092
187  Access to machine-specific registers (available on 586 and better only)* Note: the rd* operations modify the parameters directly (without using* pointer indirection), this allows gcc to optimize better(K6 MSRs , l, h)
188  If (l & 0xFFFF0000) == 0 Then
190  l = mbytes >> 2 << 22 | 1 << 16
192  wbinvd()
193  wrmsr(K6 MSRs , l, h)
195  pr_info("Enabling new style K6 write allocation for %d Mb\n", mbytes)
199  Return
202  If x86_model == 10 Then
205  Return
Caller
NameDescribe
init_amd