Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
d27d4aca
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d27d4aca
编写于
2月 19, 2007
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
KVM: Cosmetics
Signed-off-by:
N
Avi Kivity
<
avi@qumranet.com
>
上级
43934a38
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
23 deletion
+15
-23
drivers/kvm/kvm_main.c
drivers/kvm/kvm_main.c
+8
-13
drivers/kvm/paging_tmpl.h
drivers/kvm/paging_tmpl.h
+1
-2
drivers/kvm/svm.c
drivers/kvm/svm.c
+5
-5
drivers/kvm/vmx.c
drivers/kvm/vmx.c
+1
-3
未找到文件。
drivers/kvm/kvm_main.c
浏览文件 @
d27d4aca
...
...
@@ -126,10 +126,8 @@ static inline int valid_vcpu(int n)
return
likely
(
n
>=
0
&&
n
<
KVM_MAX_VCPUS
);
}
int
kvm_read_guest
(
struct
kvm_vcpu
*
vcpu
,
gva_t
addr
,
unsigned
long
size
,
void
*
dest
)
int
kvm_read_guest
(
struct
kvm_vcpu
*
vcpu
,
gva_t
addr
,
unsigned
long
size
,
void
*
dest
)
{
unsigned
char
*
host_buf
=
dest
;
unsigned
long
req_size
=
size
;
...
...
@@ -161,10 +159,8 @@ int kvm_read_guest(struct kvm_vcpu *vcpu,
}
EXPORT_SYMBOL_GPL
(
kvm_read_guest
);
int
kvm_write_guest
(
struct
kvm_vcpu
*
vcpu
,
gva_t
addr
,
unsigned
long
size
,
void
*
data
)
int
kvm_write_guest
(
struct
kvm_vcpu
*
vcpu
,
gva_t
addr
,
unsigned
long
size
,
void
*
data
)
{
unsigned
char
*
host_buf
=
data
;
unsigned
long
req_size
=
size
;
...
...
@@ -457,7 +453,7 @@ EXPORT_SYMBOL_GPL(set_cr4);
void
set_cr3
(
struct
kvm_vcpu
*
vcpu
,
unsigned
long
cr3
)
{
if
(
is_long_mode
(
vcpu
))
{
if
(
cr3
&
CR3_L_MODE_RESEVED_BITS
)
{
if
(
cr3
&
CR3_L_MODE_RESEVED_BITS
)
{
printk
(
KERN_DEBUG
"set_cr3: #GP, reserved bits
\n
"
);
inject_gp
(
vcpu
);
return
;
...
...
@@ -774,7 +770,6 @@ static int kvm_dev_ioctl_get_dirty_log(struct kvm *kvm,
if
(
copy_to_user
(
log
->
dirty_bitmap
,
memslot
->
dirty_bitmap
,
n
))
goto
out
;
if
(
any
)
{
cleared
=
0
;
for
(
i
=
0
;
i
<
KVM_MAX_VCPUS
;
++
i
)
{
...
...
@@ -903,8 +898,9 @@ static int emulator_read_emulated(unsigned long addr,
return
X86EMUL_CONTINUE
;
else
{
gpa_t
gpa
=
vcpu
->
mmu
.
gva_to_gpa
(
vcpu
,
addr
);
if
(
gpa
==
UNMAPPED_GVA
)
return
vcpu_printf
(
vcpu
,
"not present
\n
"
),
X86EMUL_PROPAGATE_FAULT
;
return
X86EMUL_PROPAGATE_FAULT
;
vcpu
->
mmio_needed
=
1
;
vcpu
->
mmio_phys_addr
=
gpa
;
vcpu
->
mmio_size
=
bytes
;
...
...
@@ -1801,12 +1797,11 @@ static long kvm_dev_ioctl(struct file *filp,
case
KVM_GET_API_VERSION
:
r
=
KVM_API_VERSION
;
break
;
case
KVM_CREATE_VCPU
:
{
case
KVM_CREATE_VCPU
:
r
=
kvm_dev_ioctl_create_vcpu
(
kvm
,
arg
);
if
(
r
)
goto
out
;
break
;
}
case
KVM_RUN
:
{
struct
kvm_run
kvm_run
;
...
...
drivers/kvm/paging_tmpl.h
浏览文件 @
d27d4aca
...
...
@@ -441,9 +441,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
/*
* mmio: emulate if accessible, otherwise its a guest fault.
*/
if
(
is_io_pte
(
*
shadow_pte
))
{
if
(
is_io_pte
(
*
shadow_pte
))
return
1
;
}
++
kvm_stat
.
pf_fixed
;
kvm_mmu_audit
(
vcpu
,
"post page fault (fixed)"
);
...
...
drivers/kvm/svm.c
浏览文件 @
d27d4aca
...
...
@@ -1042,22 +1042,22 @@ static int io_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
addr_mask
=
io_adress
(
vcpu
,
_in
,
&
kvm_run
->
io
.
address
);
if
(
!
addr_mask
)
{
printk
(
KERN_DEBUG
"%s: get io address failed
\n
"
,
__FUNCTION__
);
printk
(
KERN_DEBUG
"%s: get io address failed
\n
"
,
__FUNCTION__
);
return
1
;
}
if
(
kvm_run
->
io
.
rep
)
{
kvm_run
->
io
.
count
=
vcpu
->
regs
[
VCPU_REGS_RCX
]
&
addr_mask
;
kvm_run
->
io
.
count
=
vcpu
->
regs
[
VCPU_REGS_RCX
]
&
addr_mask
;
kvm_run
->
io
.
string_down
=
(
vcpu
->
svm
->
vmcb
->
save
.
rflags
&
X86_EFLAGS_DF
)
!=
0
;
}
}
else
{
}
else
kvm_run
->
io
.
value
=
vcpu
->
svm
->
vmcb
->
save
.
rax
;
}
return
0
;
}
static
int
nop_on_interception
(
struct
kvm_vcpu
*
vcpu
,
struct
kvm_run
*
kvm_run
)
{
return
1
;
...
...
drivers/kvm/vmx.c
浏览文件 @
d27d4aca
...
...
@@ -27,7 +27,6 @@
#include "segment_descriptor.h"
MODULE_AUTHOR
(
"Qumranet"
);
MODULE_LICENSE
(
"GPL"
);
...
...
@@ -418,10 +417,9 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
case
MSR_IA32_SYSENTER_ESP
:
vmcs_write32
(
GUEST_SYSENTER_ESP
,
data
);
break
;
case
MSR_IA32_TIME_STAMP_COUNTER
:
{
case
MSR_IA32_TIME_STAMP_COUNTER
:
guest_write_tsc
(
data
);
break
;
}
default:
msr
=
find_msr_entry
(
vcpu
,
msr_index
);
if
(
msr
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录