Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
986563b1
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看板
提交
986563b1
编写于
8月 08, 2011
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
上级
03952339
ac363c90
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
44 addition
and
19 deletion
+44
-19
cutils.c
cutils.c
+11
-5
hw/kvmclock.c
hw/kvmclock.c
+2
-5
kvm-all.c
kvm-all.c
+0
-8
qemu-common.h
qemu-common.h
+2
-0
target-i386/cpu.h
target-i386/cpu.h
+1
-0
target-i386/cpuid.c
target-i386/cpuid.c
+13
-0
target-i386/kvm.c
target-i386/kvm.c
+15
-1
未找到文件。
cutils.c
浏览文件 @
986563b1
...
...
@@ -322,7 +322,8 @@ int fcntl_setfl(int fd, int flag)
* value must be terminated by whitespace, ',' or '\0'. Return -1 on
* error.
*/
int64_t
strtosz_suffix
(
const
char
*
nptr
,
char
**
end
,
const
char
default_suffix
)
int64_t
strtosz_suffix_unit
(
const
char
*
nptr
,
char
**
end
,
const
char
default_suffix
,
int64_t
unit
)
{
int64_t
retval
=
-
1
;
char
*
endptr
;
...
...
@@ -362,20 +363,20 @@ int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix)
}
break
;
case
STRTOSZ_DEFSUFFIX_KB
:
mul
=
1
<<
10
;
mul
=
unit
;
break
;
case
0
:
if
(
mul_required
)
{
goto
fail
;
}
case
STRTOSZ_DEFSUFFIX_MB
:
mul
=
1ULL
<<
20
;
mul
=
unit
*
unit
;
break
;
case
STRTOSZ_DEFSUFFIX_GB
:
mul
=
1ULL
<<
30
;
mul
=
unit
*
unit
*
unit
;
break
;
case
STRTOSZ_DEFSUFFIX_TB
:
mul
=
1ULL
<<
40
;
mul
=
unit
*
unit
*
unit
*
unit
;
break
;
default:
goto
fail
;
...
...
@@ -405,6 +406,11 @@ fail:
return
retval
;
}
int64_t
strtosz_suffix
(
const
char
*
nptr
,
char
**
end
,
const
char
default_suffix
)
{
return
strtosz_suffix_unit
(
nptr
,
end
,
default_suffix
,
1024
);
}
int64_t
strtosz
(
const
char
*
nptr
,
char
**
end
)
{
return
strtosz_suffix
(
nptr
,
end
,
STRTOSZ_DEFSUFFIX_MB
);
...
...
hw/kvmclock.c
浏览文件 @
986563b1
...
...
@@ -101,11 +101,8 @@ static SysBusDeviceInfo kvmclock_info = {
void
kvmclock_create
(
void
)
{
if
(
kvm_enabled
()
&&
first_cpu
->
cpuid_kvm_features
&
((
1ULL
<<
KVM_FEATURE_CLOCKSOURCE
)
#ifdef KVM_FEATURE_CLOCKSOURCE2
||
(
1ULL
<<
KVM_FEATURE_CLOCKSOURCE2
)
#endif
))
{
first_cpu
->
cpuid_kvm_features
&
((
1ULL
<<
KVM_FEATURE_CLOCKSOURCE
)
|
(
1ULL
<<
KVM_FEATURE_CLOCKSOURCE2
)))
{
sysbus_create_simple
(
"kvmclock"
,
-
1
,
NULL
);
}
}
...
...
kvm-all.c
浏览文件 @
986563b1
...
...
@@ -1328,7 +1328,6 @@ int kvm_set_signal_mask(CPUState *env, const sigset_t *sigset)
int
kvm_set_ioeventfd_mmio_long
(
int
fd
,
uint32_t
addr
,
uint32_t
val
,
bool
assign
)
{
#ifdef KVM_IOEVENTFD
int
ret
;
struct
kvm_ioeventfd
iofd
;
...
...
@@ -1353,14 +1352,10 @@ int kvm_set_ioeventfd_mmio_long(int fd, uint32_t addr, uint32_t val, bool assign
}
return
0
;
#else
return
-
ENOSYS
;
#endif
}
int
kvm_set_ioeventfd_pio_word
(
int
fd
,
uint16_t
addr
,
uint16_t
val
,
bool
assign
)
{
#ifdef KVM_IOEVENTFD
struct
kvm_ioeventfd
kick
=
{
.
datamatch
=
val
,
.
addr
=
addr
,
...
...
@@ -1380,9 +1375,6 @@ int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign)
return
r
;
}
return
0
;
#else
return
-
ENOSYS
;
#endif
}
int
kvm_on_sigbus_vcpu
(
CPUState
*
env
,
int
code
,
void
*
addr
)
...
...
qemu-common.h
浏览文件 @
986563b1
...
...
@@ -157,6 +157,8 @@ int fcntl_setfl(int fd, int flag);
#define STRTOSZ_DEFSUFFIX_B 'B'
int64_t
strtosz
(
const
char
*
nptr
,
char
**
end
);
int64_t
strtosz_suffix
(
const
char
*
nptr
,
char
**
end
,
const
char
default_suffix
);
int64_t
strtosz_suffix_unit
(
const
char
*
nptr
,
char
**
end
,
const
char
default_suffix
,
int64_t
unit
);
/* path.c */
void
init_paths
(
const
char
*
prefix
);
...
...
target-i386/cpu.h
浏览文件 @
986563b1
...
...
@@ -743,6 +743,7 @@ typedef struct CPUX86State {
uint32_t
cpuid_kvm_features
;
uint32_t
cpuid_svm_features
;
bool
tsc_valid
;
int
tsc_khz
;
/* in order to simplify APIC support, we leave this pointer to the
user */
...
...
target-i386/cpuid.c
浏览文件 @
986563b1
...
...
@@ -224,6 +224,7 @@ typedef struct x86_def_t {
int
family
;
int
model
;
int
stepping
;
int
tsc_khz
;
uint32_t
features
,
ext_features
,
ext2_features
,
ext3_features
;
uint32_t
kvm_features
,
svm_features
;
uint32_t
xlevel
;
...
...
@@ -704,6 +705,17 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model)
}
else
if
(
!
strcmp
(
featurestr
,
"model_id"
))
{
pstrcpy
(
x86_cpu_def
->
model_id
,
sizeof
(
x86_cpu_def
->
model_id
),
val
);
}
else
if
(
!
strcmp
(
featurestr
,
"tsc_freq"
))
{
int64_t
tsc_freq
;
char
*
err
;
tsc_freq
=
strtosz_suffix_unit
(
val
,
&
err
,
STRTOSZ_DEFSUFFIX_B
,
1000
);
if
(
!*
val
||
*
err
)
{
fprintf
(
stderr
,
"bad numerical value %s
\n
"
,
val
);
goto
error
;
}
x86_cpu_def
->
tsc_khz
=
tsc_freq
/
1000
;
}
else
{
fprintf
(
stderr
,
"unrecognized feature %s
\n
"
,
featurestr
);
goto
error
;
...
...
@@ -872,6 +884,7 @@ int cpu_x86_register (CPUX86State *env, const char *cpu_model)
env
->
cpuid_svm_features
=
def
->
svm_features
;
env
->
cpuid_ext4_features
=
def
->
ext4_features
;
env
->
cpuid_xlevel2
=
def
->
xlevel2
;
env
->
tsc_khz
=
def
->
tsc_khz
;
if
(
!
kvm_enabled
())
{
env
->
cpuid_features
&=
TCG_FEATURES
;
env
->
cpuid_ext_features
&=
TCG_EXT_FEATURES
;
...
...
target-i386/kvm.c
浏览文件 @
986563b1
...
...
@@ -354,6 +354,7 @@ int kvm_arch_init_vcpu(CPUState *env)
uint32_t
unused
;
struct
kvm_cpuid_entry2
*
c
;
uint32_t
signature
[
3
];
int
r
;
env
->
cpuid_features
&=
kvm_arch_get_supported_cpuid
(
s
,
1
,
0
,
R_EDX
);
...
...
@@ -499,7 +500,20 @@ int kvm_arch_init_vcpu(CPUState *env)
qemu_add_vm_change_state_handler
(
cpu_update_state
,
env
);
return
kvm_vcpu_ioctl
(
env
,
KVM_SET_CPUID2
,
&
cpuid_data
);
r
=
kvm_vcpu_ioctl
(
env
,
KVM_SET_CPUID2
,
&
cpuid_data
);
if
(
r
)
return
r
;
r
=
kvm_check_extension
(
env
->
kvm_state
,
KVM_CAP_TSC_CONTROL
);
if
(
r
&&
env
->
tsc_khz
)
{
r
=
kvm_vcpu_ioctl
(
env
,
KVM_SET_TSC_KHZ
,
env
->
tsc_khz
);
if
(
r
<
0
)
{
fprintf
(
stderr
,
"KVM_SET_TSC_KHZ failed
\n
"
);
return
r
;
}
}
return
0
;
}
void
kvm_arch_reset_vcpu
(
CPUState
*
env
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录