Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
5130713b
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5130713b
编写于
1月 27, 2010
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement cpuArchBaseline in x86 CPU driver
上级
7b5ae2f0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
86 addition
and
1 deletion
+86
-1
src/cpu/cpu_x86.c
src/cpu/cpu_x86.c
+86
-1
未找到文件。
src/cpu/cpu_x86.c
浏览文件 @
5130713b
...
...
@@ -137,6 +137,17 @@ x86cpuidClearBits(struct cpuX86cpuid *cpuid,
}
static
inline
void
x86cpuidAndBits
(
struct
cpuX86cpuid
*
cpuid
,
const
struct
cpuX86cpuid
*
mask
)
{
cpuid
->
eax
&=
mask
->
eax
;
cpuid
->
ebx
&=
mask
->
ebx
;
cpuid
->
ecx
&=
mask
->
ecx
;
cpuid
->
edx
&=
mask
->
edx
;
}
static
struct
cpuX86cpuid
*
x86DataCpuid
(
const
union
cpuData
*
data
,
uint32_t
function
)
...
...
@@ -477,6 +488,27 @@ x86ModelSubtract(struct x86_model *model1,
}
static
void
x86ModelIntersect
(
struct
x86_model
*
model1
,
const
struct
x86_model
*
model2
)
{
int
i
;
struct
cpuX86cpuid
*
cpuid
;
for
(
i
=
0
;
i
<
model1
->
ncpuid
;
i
++
)
{
struct
cpuX86cpuid
*
intersection
=
model1
->
cpuid
+
i
;
cpuid
=
x86cpuidFind
(
model2
->
cpuid
,
model2
->
ncpuid
,
intersection
->
function
);
if
(
cpuid
!=
NULL
)
x86cpuidAndBits
(
intersection
,
cpuid
);
else
x86cpuidClearBits
(
intersection
,
intersection
);
}
}
static
int
x86ModelAdd
(
struct
x86_model
*
model1
,
const
struct
x86_model
*
model2
)
...
...
@@ -1192,6 +1224,59 @@ error:
#endif
static
virCPUDefPtr
x86Baseline
(
virCPUDefPtr
*
cpus
,
unsigned
int
ncpus
,
const
char
**
models
,
unsigned
int
nmodels
)
{
struct
x86_map
*
map
=
NULL
;
struct
x86_model
*
base_model
=
NULL
;
union
cpuData
*
data
=
NULL
;
virCPUDefPtr
cpu
=
NULL
;
unsigned
int
i
;
if
(
!
(
map
=
x86LoadMap
()))
goto
error
;
if
(
!
(
base_model
=
x86ModelFromCPU
(
cpus
[
0
],
map
,
0
)))
goto
error
;
if
(
VIR_ALLOC
(
cpu
)
<
0
||
!
(
cpu
->
arch
=
strdup
(
cpus
[
0
]
->
arch
)))
goto
no_memory
;
for
(
i
=
1
;
i
<
ncpus
;
i
++
)
{
struct
x86_model
*
model
;
if
(
!
(
model
=
x86ModelFromCPU
(
cpus
[
i
],
map
,
0
)))
goto
error
;
x86ModelIntersect
(
base_model
,
model
);
x86ModelFree
(
model
);
}
if
(
!
(
data
=
x86DataFromModel
(
base_model
)))
goto
no_memory
;
if
(
x86Decode
(
cpu
,
data
,
models
,
nmodels
)
<
0
)
goto
error
;
cleanup:
x86DataFree
(
data
);
x86ModelFree
(
base_model
);
x86MapFree
(
map
);
return
cpu
;
no_memory:
virReportOOMError
();
error:
virCPUDefFree
(
cpu
);
cpu
=
NULL
;
goto
cleanup
;
}
struct
cpuArchDriver
cpuDriverX86
=
{
.
name
=
"x86"
,
.
arch
=
archs
,
...
...
@@ -1206,5 +1291,5 @@ struct cpuArchDriver cpuDriverX86 = {
.
nodeData
=
NULL
,
#endif
.
guestData
=
x86GuestData
,
.
baseline
=
NULL
,
.
baseline
=
x86Baseline
,
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录