Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9f811285
Commit
9f811285
authored
Mar 02, 2008
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: Provide unlocked version of emulator_write_phys()
Signed-off-by:
Avi Kivity
<
avi@qumranet.com
>
parent
0cf1bfd2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
arch/x86/kvm/x86.c
arch/x86/kvm/x86.c
+14
-7
include/asm-x86/kvm_host.h
include/asm-x86/kvm_host.h
+3
-0
No files found.
arch/x86/kvm/x86.c
View file @
9f811285
...
@@ -1840,22 +1840,29 @@ static int emulator_read_emulated(unsigned long addr,
...
@@ -1840,22 +1840,29 @@ static int emulator_read_emulated(unsigned long addr,
return
X86EMUL_UNHANDLEABLE
;
return
X86EMUL_UNHANDLEABLE
;
}
}
static
int
emulator_write_phys
(
struct
kvm_vcpu
*
vcpu
,
gpa_t
gpa
,
int
__
emulator_write_phys
(
struct
kvm_vcpu
*
vcpu
,
gpa_t
gpa
,
const
void
*
val
,
int
bytes
)
const
void
*
val
,
int
bytes
)
{
{
int
ret
;
int
ret
;
down_read
(
&
vcpu
->
kvm
->
slots_lock
);
ret
=
kvm_write_guest
(
vcpu
->
kvm
,
gpa
,
val
,
bytes
);
ret
=
kvm_write_guest
(
vcpu
->
kvm
,
gpa
,
val
,
bytes
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
up_read
(
&
vcpu
->
kvm
->
slots_lock
);
return
0
;
return
0
;
}
kvm_mmu_pte_write
(
vcpu
,
gpa
,
val
,
bytes
);
kvm_mmu_pte_write
(
vcpu
,
gpa
,
val
,
bytes
);
up_read
(
&
vcpu
->
kvm
->
slots_lock
);
return
1
;
return
1
;
}
}
static
int
emulator_write_phys
(
struct
kvm_vcpu
*
vcpu
,
gpa_t
gpa
,
const
void
*
val
,
int
bytes
)
{
int
ret
;
down_read
(
&
vcpu
->
kvm
->
slots_lock
);
ret
=
__emulator_write_phys
(
vcpu
,
gpa
,
val
,
bytes
);
up_read
(
&
vcpu
->
kvm
->
slots_lock
);
return
ret
;
}
static
int
emulator_write_emulated_onepage
(
unsigned
long
addr
,
static
int
emulator_write_emulated_onepage
(
unsigned
long
addr
,
const
void
*
val
,
const
void
*
val
,
unsigned
int
bytes
,
unsigned
int
bytes
,
...
...
include/asm-x86/kvm_host.h
View file @
9f811285
...
@@ -432,6 +432,9 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages);
...
@@ -432,6 +432,9 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages);
int
load_pdptrs
(
struct
kvm_vcpu
*
vcpu
,
unsigned
long
cr3
);
int
load_pdptrs
(
struct
kvm_vcpu
*
vcpu
,
unsigned
long
cr3
);
int
__emulator_write_phys
(
struct
kvm_vcpu
*
vcpu
,
gpa_t
gpa
,
const
void
*
val
,
int
bytes
);
enum
emulation_result
{
enum
emulation_result
{
EMULATE_DONE
,
/* no further processing */
EMULATE_DONE
,
/* no further processing */
EMULATE_DO_MMIO
,
/* kvm_run filled with mmio request */
EMULATE_DO_MMIO
,
/* kvm_run filled with mmio request */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment