Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
ad7b8b33
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ad7b8b33
编写于
5月 08, 2009
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Introduce kvm_check_extension to check if KVM extensions are supported
Signed-off-by:
N
Anthony Liguori
<
aliguori@us.ibm.com
>
上级
4a794a62
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
17 deletion
+24
-17
kvm-all.c
kvm-all.c
+22
-17
kvm.h
kvm.h
+2
-0
未找到文件。
kvm-all.c
浏览文件 @
ad7b8b33
...
...
@@ -320,6 +320,18 @@ int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size)
return
ret
;
}
int
kvm_check_extension
(
KVMState
*
s
,
unsigned
int
extension
)
{
int
ret
;
ret
=
kvm_ioctl
(
s
,
KVM_CHECK_EXTENSION
,
extension
);
if
(
ret
<
0
)
{
ret
=
0
;
}
return
ret
;
}
int
kvm_init
(
int
smp_cpus
)
{
KVMState
*
s
;
...
...
@@ -368,10 +380,8 @@ int kvm_init(int smp_cpus)
* just use a user allocated buffer so we can use regular pages
* unmodified. Make sure we have a sufficiently modern version of KVM.
*/
ret
=
kvm_ioctl
(
s
,
KVM_CHECK_EXTENSION
,
KVM_CAP_USER_MEMORY
);
if
(
ret
<=
0
)
{
if
(
ret
==
0
)
ret
=
-
EINVAL
;
if
(
!
kvm_check_extension
(
s
,
KVM_CAP_USER_MEMORY
))
{
ret
=
-
EINVAL
;
fprintf
(
stderr
,
"kvm does not support KVM_CAP_USER_MEMORY
\n
"
);
goto
err
;
}
...
...
@@ -379,11 +389,8 @@ int kvm_init(int smp_cpus)
/* There was a nasty bug in < kvm-80 that prevents memory slots from being
* destroyed properly. Since we rely on this capability, refuse to work
* with any kernel without this capability. */
ret
=
kvm_ioctl
(
s
,
KVM_CHECK_EXTENSION
,
KVM_CAP_DESTROY_MEMORY_REGION_WORKS
);
if
(
ret
<=
0
)
{
if
(
ret
==
0
)
ret
=
-
EINVAL
;
if
(
!
kvm_check_extension
(
s
,
KVM_CAP_DESTROY_MEMORY_REGION_WORKS
))
{
ret
=
-
EINVAL
;
fprintf
(
stderr
,
"KVM kernel module broken (DESTROY_MEMORY_REGION)
\n
"
...
...
@@ -391,11 +398,10 @@ int kvm_init(int smp_cpus)
goto
err
;
}
s
->
coalesced_mmio
=
0
;
#ifdef KVM_CAP_COALESCED_MMIO
ret
=
kvm_ioctl
(
s
,
KVM_CHECK_EXTENSION
,
KVM_CAP_COALESCED_MMIO
);
if
(
ret
>
0
)
s
->
coalesced_mmio
=
ret
;
s
->
coalesced_mmio
=
kvm_check_extension
(
s
,
KVM_CAP_COALESCED_MMIO
);
#else
s
->
coalesced_mmio
=
0
;
#endif
ret
=
kvm_arch_init
(
s
,
smp_cpus
);
...
...
@@ -766,11 +772,10 @@ int kvm_has_sync_mmu(void)
#ifdef KVM_CAP_SYNC_MMU
KVMState
*
s
=
kvm_state
;
if
(
kvm_ioctl
(
s
,
KVM_CHECK_EXTENSION
,
KVM_CAP_SYNC_MMU
)
>
0
)
return
1
;
#endif
return
kvm_check_extension
(
s
,
KVM_CAP_SYNC_MMU
);
#else
return
0
;
#endif
}
void
kvm_setup_guest_memory
(
void
*
start
,
size_t
size
)
...
...
kvm.h
浏览文件 @
ad7b8b33
...
...
@@ -118,6 +118,8 @@ void kvm_arch_remove_all_hw_breakpoints(void);
void
kvm_arch_update_guest_debug
(
CPUState
*
env
,
struct
kvm_guest_debug
*
dbg
);
int
kvm_check_extension
(
KVMState
*
s
,
unsigned
int
extension
);
/* generic hooks - to be moved/refactored once there are more users */
static
inline
void
cpu_synchronize_state
(
CPUState
*
env
,
int
modified
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录