Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
cdcf772e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cdcf772e
编写于
7月 28, 2008
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
x86 l3 cache index disable for 2 6 26 fix
Signed-off-by:
N
Ingo Molnar
<
mingo@elte.hu
>
上级
a24e8d36
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
19 deletion
+20
-19
arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86/kernel/cpu/intel_cacheinfo.c
+20
-19
未找到文件。
arch/x86/kernel/cpu/intel_cacheinfo.c
浏览文件 @
cdcf772e
/*
*
Routines to indentify caches on Intel CPU.
*
Routines to indentify caches on Intel CPU.
*
*
Changes:
*
Venkatesh Pallipadi : Adding cache identification through cpuid(4)
*
Changes:
*
Venkatesh Pallipadi : Adding cache identification through cpuid(4)
* Ashok Raj <ashok.raj@intel.com>: Work with CPU hotplug infrastructure.
* Andi Kleen / Andreas Herrmann : CPUID4 emulation on AMD.
*/
...
...
@@ -136,9 +136,9 @@ struct _cpuid4_info {
};
static
struct
pci_device_id
k8_nb_id
[]
=
{
{
PCI_DEVICE
(
PCI_VENDOR_ID_AMD
,
0x1103
)
},
{
PCI_DEVICE
(
PCI_VENDOR_ID_AMD
,
0x1203
)
},
{}
{
PCI_DEVICE
(
PCI_VENDOR_ID_AMD
,
0x1103
)
},
{
PCI_DEVICE
(
PCI_VENDOR_ID_AMD
,
0x1203
)
},
{}
};
unsigned
short
num_cache_leaves
;
...
...
@@ -190,9 +190,10 @@ static unsigned short assocs[] __cpuinitdata = {
static
unsigned
char
levels
[]
__cpuinitdata
=
{
1
,
1
,
2
,
3
};
static
unsigned
char
types
[]
__cpuinitdata
=
{
1
,
2
,
3
,
3
};
static
void
__cpuinit
amd_cpuid4
(
int
leaf
,
union
_cpuid4_leaf_eax
*
eax
,
union
_cpuid4_leaf_ebx
*
ebx
,
union
_cpuid4_leaf_ecx
*
ecx
)
static
void
__cpuinit
amd_cpuid4
(
int
leaf
,
union
_cpuid4_leaf_eax
*
eax
,
union
_cpuid4_leaf_ebx
*
ebx
,
union
_cpuid4_leaf_ecx
*
ecx
)
{
unsigned
dummy
;
unsigned
line_size
,
lines_per_tag
,
assoc
,
size_in_kb
;
...
...
@@ -264,7 +265,7 @@ amd_check_l3_disable(int index, struct _cpuid4_info *this_leaf)
{
if
(
index
<
3
)
return
;
this_leaf
->
can_disable
=
1
;
this_leaf
->
can_disable
=
1
;
}
static
int
...
...
@@ -474,7 +475,7 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
/* pointer to _cpuid4_info array (for each cache leaf) */
static
DEFINE_PER_CPU
(
struct
_cpuid4_info
*
,
cpuid4_info
);
#define CPUID4_INFO_IDX(x, y)
(&((per_cpu(cpuid4_info, x))[y]))
#define CPUID4_INFO_IDX(x, y)
(&((per_cpu(cpuid4_info, x))[y]))
#ifdef CONFIG_SMP
static
void
__cpuinit
cache_shared_cpu_map_setup
(
unsigned
int
cpu
,
int
index
)
...
...
@@ -511,7 +512,7 @@ static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index)
this_leaf
=
CPUID4_INFO_IDX
(
cpu
,
index
);
for_each_cpu_mask
(
sibling
,
this_leaf
->
shared_cpu_map
)
{
sibling_leaf
=
CPUID4_INFO_IDX
(
sibling
,
index
);
sibling_leaf
=
CPUID4_INFO_IDX
(
sibling
,
index
);
cpu_clear
(
cpu
,
sibling_leaf
->
shared_cpu_map
);
}
}
...
...
@@ -593,7 +594,7 @@ struct _index_kobject {
/* pointer to array of kobjects for cpuX/cache/indexY */
static
DEFINE_PER_CPU
(
struct
_index_kobject
*
,
index_kobject
);
#define INDEX_KOBJECT_PTR(x, y)
(&((per_cpu(index_kobject, x))[y]))
#define INDEX_KOBJECT_PTR(x, y)
(&((per_cpu(index_kobject, x))[y]))
#define show_one_plus(file_name, object, val) \
static ssize_t show_##file_name \
...
...
@@ -675,7 +676,7 @@ static struct pci_dev *get_k8_northbridge(int node)
if
(
!
dev
)
break
;
}
return
dev
;
return
dev
;
}
static
ssize_t
show_cache_disable
(
struct
_cpuid4_info
*
this_leaf
,
char
*
buf
)
...
...
@@ -736,7 +737,7 @@ store_cache_disable(struct _cpuid4_info *this_leaf, const char *buf,
printk
(
KERN_ERR
"Attempting AMD northbridge operation on a system with no northbridge
\n
"
);
return
-
EINVAL
;
}
pci_write_config_dword
(
dev
,
0x1BC
+
index
*
4
,
val
&
~
0x40000000
);
wbinvd
();
pci_write_config_dword
(
dev
,
0x1BC
+
index
*
4
,
val
);
...
...
@@ -789,7 +790,7 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr, char * buf)
ret
=
fattr
->
show
?
fattr
->
show
(
CPUID4_INFO_IDX
(
this_leaf
->
cpu
,
this_leaf
->
index
),
buf
)
:
0
;
0
;
return
ret
;
}
...
...
@@ -800,9 +801,9 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
struct
_index_kobject
*
this_leaf
=
to_object
(
kobj
);
ssize_t
ret
;
ret
=
fattr
->
store
?
fattr
->
store
(
CPUID4_INFO_IDX
(
this_leaf
->
cpu
,
this_leaf
->
index
),
buf
,
count
)
:
ret
=
fattr
->
store
?
fattr
->
store
(
CPUID4_INFO_IDX
(
this_leaf
->
cpu
,
this_leaf
->
index
),
buf
,
count
)
:
0
;
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录