Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
7faa4ee1
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
7faa4ee1
编写于
5月 10, 2009
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
KVM: Add AMD cpuid bit: cr8_legacy, abm, misaligned sse, sse4, 3dnow prefetch
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
8d753f36
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
38 addition
and
33 deletion
+38
-33
arch/x86/kvm/x86.c
arch/x86/kvm/x86.c
+38
-33
未找到文件。
arch/x86/kvm/x86.c
浏览文件 @
7faa4ee1
...
@@ -1247,44 +1247,47 @@ static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function,
...
@@ -1247,44 +1247,47 @@ static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function,
entry
->
flags
=
0
;
entry
->
flags
=
0
;
}
}
#define F(x) bit(X86_FEATURE_##x)
static
void
do_cpuid_ent
(
struct
kvm_cpuid_entry2
*
entry
,
u32
function
,
static
void
do_cpuid_ent
(
struct
kvm_cpuid_entry2
*
entry
,
u32
function
,
u32
index
,
int
*
nent
,
int
maxnent
)
u32
index
,
int
*
nent
,
int
maxnent
)
{
{
const
u32
kvm_supported_word0_x86_features
=
bit
(
X86_FEATURE_FPU
)
|
unsigned
f_nx
=
is_efer_nx
()
?
F
(
NX
)
:
0
;
bit
(
X86_FEATURE_VME
)
|
bit
(
X86_FEATURE_DE
)
|
bit
(
X86_FEATURE_PSE
)
|
bit
(
X86_FEATURE_TSC
)
|
bit
(
X86_FEATURE_MSR
)
|
bit
(
X86_FEATURE_PAE
)
|
bit
(
X86_FEATURE_MCE
)
|
bit
(
X86_FEATURE_CX8
)
|
bit
(
X86_FEATURE_APIC
)
|
bit
(
X86_FEATURE_SEP
)
|
bit
(
X86_FEATURE_MTRR
)
|
bit
(
X86_FEATURE_PGE
)
|
bit
(
X86_FEATURE_MCA
)
|
bit
(
X86_FEATURE_CMOV
)
|
bit
(
X86_FEATURE_PAT
)
|
bit
(
X86_FEATURE_PSE36
)
|
bit
(
X86_FEATURE_CLFLSH
)
|
bit
(
X86_FEATURE_MMX
)
|
bit
(
X86_FEATURE_FXSR
)
|
bit
(
X86_FEATURE_XMM
)
|
bit
(
X86_FEATURE_XMM2
)
|
bit
(
X86_FEATURE_SELFSNOOP
);
const
u32
kvm_supported_word1_x86_features
=
bit
(
X86_FEATURE_FPU
)
|
bit
(
X86_FEATURE_VME
)
|
bit
(
X86_FEATURE_DE
)
|
bit
(
X86_FEATURE_PSE
)
|
bit
(
X86_FEATURE_TSC
)
|
bit
(
X86_FEATURE_MSR
)
|
bit
(
X86_FEATURE_PAE
)
|
bit
(
X86_FEATURE_CX8
)
|
bit
(
X86_FEATURE_APIC
)
|
bit
(
X86_FEATURE_PGE
)
|
bit
(
X86_FEATURE_CMOV
)
|
bit
(
X86_FEATURE_PSE36
)
|
bit
(
X86_FEATURE_MMX
)
|
bit
(
X86_FEATURE_FXSR
)
|
bit
(
X86_FEATURE_SYSCALL
)
|
(
is_efer_nx
()
?
bit
(
X86_FEATURE_NX
)
:
0
)
|
#ifdef CONFIG_X86_64
#ifdef CONFIG_X86_64
bit
(
X86_FEATURE_LM
)
|
unsigned
f_lm
=
F
(
LM
);
#else
unsigned
f_lm
=
0
;
#endif
#endif
bit
(
X86_FEATURE_FXSR_OPT
)
|
bit
(
X86_FEATURE_MMXEXT
)
|
/* cpuid 1.edx */
bit
(
X86_FEATURE_3DNOWEXT
)
|
const
u32
kvm_supported_word0_x86_features
=
bit
(
X86_FEATURE_3DNOW
);
F
(
FPU
)
|
F
(
VME
)
|
F
(
DE
)
|
F
(
PSE
)
|
const
u32
kvm_supported_word3_x86_features
=
F
(
TSC
)
|
F
(
MSR
)
|
F
(
PAE
)
|
F
(
MCE
)
|
bit
(
X86_FEATURE_XMM3
)
|
bit
(
X86_FEATURE_CX16
);
F
(
CX8
)
|
F
(
APIC
)
|
0
/* Reserved */
|
F
(
SEP
)
|
F
(
MTRR
)
|
F
(
PGE
)
|
F
(
MCA
)
|
F
(
CMOV
)
|
F
(
PAT
)
|
F
(
PSE36
)
|
0
/* PSN */
|
F
(
CLFLSH
)
|
0
/* Reserved, DS, ACPI */
|
F
(
MMX
)
|
F
(
FXSR
)
|
F
(
XMM
)
|
F
(
XMM2
)
|
F
(
SELFSNOOP
)
|
0
/* HTT, TM, Reserved, PBE */
;
/* cpuid 0x80000001.edx */
const
u32
kvm_supported_word1_x86_features
=
F
(
FPU
)
|
F
(
VME
)
|
F
(
DE
)
|
F
(
PSE
)
|
F
(
TSC
)
|
F
(
MSR
)
|
F
(
PAE
)
|
F
(
MCE
)
|
F
(
CX8
)
|
F
(
APIC
)
|
0
/* Reserved */
|
F
(
SYSCALL
)
|
F
(
MTRR
)
|
F
(
PGE
)
|
F
(
MCA
)
|
F
(
CMOV
)
|
F
(
PAT
)
|
F
(
PSE36
)
|
0
/* Reserved */
|
f_nx
|
0
/* Reserved */
|
F
(
MMXEXT
)
|
F
(
MMX
)
|
F
(
FXSR
)
|
F
(
FXSR_OPT
)
|
0
/* GBPAGES */
|
0
/* RDTSCP */
|
0
/* Reserved */
|
f_lm
|
F
(
3
DNOWEXT
)
|
F
(
3
DNOW
);
/* cpuid 1.ecx */
const
u32
kvm_supported_word4_x86_features
=
F
(
XMM3
)
|
F
(
CX16
);
/* cpuid 0x80000001.ecx */
const
u32
kvm_supported_word6_x86_features
=
const
u32
kvm_supported_word6_x86_features
=
bit
(
X86_FEATURE_LAHF_LM
)
|
bit
(
X86_FEATURE_CMP_LEGACY
)
|
F
(
LAHF_LM
)
|
F
(
CMP_LEGACY
)
|
F
(
SVM
)
|
0
/* ExtApicSpace */
|
bit
(
X86_FEATURE_SVM
);
F
(
CR8_LEGACY
)
|
F
(
ABM
)
|
F
(
SSE4A
)
|
F
(
MISALIGNSSE
)
|
F
(
3
DNOWPREFETCH
)
|
0
/* OSVW */
|
0
/* IBS */
|
F
(
SSE5
)
|
0
/* SKINIT */
|
0
/* WDT */
;
/* all calls to cpuid_count() should be made on the same cpu */
/* all calls to cpuid_count() should be made on the same cpu */
get_cpu
();
get_cpu
();
...
@@ -1297,7 +1300,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
...
@@ -1297,7 +1300,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
break
;
break
;
case
1
:
case
1
:
entry
->
edx
&=
kvm_supported_word0_x86_features
;
entry
->
edx
&=
kvm_supported_word0_x86_features
;
entry
->
ecx
&=
kvm_supported_word
3
_x86_features
;
entry
->
ecx
&=
kvm_supported_word
4
_x86_features
;
break
;
break
;
/* function 2 entries are STATEFUL. That is, repeated cpuid commands
/* function 2 entries are STATEFUL. That is, repeated cpuid commands
* may return different values. This forces us to get_cpu() before
* may return different values. This forces us to get_cpu() before
...
@@ -1359,6 +1362,8 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
...
@@ -1359,6 +1362,8 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
put_cpu
();
put_cpu
();
}
}
#undef F
static
int
kvm_dev_ioctl_get_supported_cpuid
(
struct
kvm_cpuid2
*
cpuid
,
static
int
kvm_dev_ioctl_get_supported_cpuid
(
struct
kvm_cpuid2
*
cpuid
,
struct
kvm_cpuid_entry2
__user
*
entries
)
struct
kvm_cpuid_entry2
__user
*
entries
)
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录