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
c21415e8
Commit
c21415e8
authored
Feb 19, 2007
by
Ingo Molnar
Committed by
Avi Kivity
Mar 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: Add host hypercall support for vmx
Signed-off-by:
Avi Kivity
<
avi@qumranet.com
>
parent
102d8325
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
drivers/kvm/vmx.c
drivers/kvm/vmx.c
+15
-0
include/linux/kvm_para.h
include/linux/kvm_para.h
+18
-0
No files found.
drivers/kvm/vmx.c
View file @
c21415e8
...
...
@@ -1657,6 +1657,20 @@ static int handle_halt(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
return
0
;
}
static
int
handle_vmcall
(
struct
kvm_vcpu
*
vcpu
,
struct
kvm_run
*
kvm_run
)
{
kvm_run
->
exit_reason
=
KVM_EXIT_DEBUG
;
printk
(
KERN_DEBUG
"got vmcall at RIP %08lx
\n
"
,
vmcs_readl
(
GUEST_RIP
));
printk
(
KERN_DEBUG
"vmcall params: %08lx, %08lx, %08lx, %08lx
\n
"
,
vcpu
->
regs
[
VCPU_REGS_RAX
],
vcpu
->
regs
[
VCPU_REGS_RCX
],
vcpu
->
regs
[
VCPU_REGS_RDX
],
vcpu
->
regs
[
VCPU_REGS_RBP
]);
vcpu
->
regs
[
VCPU_REGS_RAX
]
=
0
;
vmcs_writel
(
GUEST_RIP
,
vmcs_readl
(
GUEST_RIP
)
+
3
);
return
1
;
}
/*
* The exit handlers return 1 if the exit was handled fully and guest execution
* may resume. Otherwise they set the kvm_run parameter to indicate what needs
...
...
@@ -1675,6 +1689,7 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu,
[
EXIT_REASON_MSR_WRITE
]
=
handle_wrmsr
,
[
EXIT_REASON_PENDING_INTERRUPT
]
=
handle_interrupt_window
,
[
EXIT_REASON_HLT
]
=
handle_halt
,
[
EXIT_REASON_VMCALL
]
=
handle_vmcall
,
};
static
const
int
kvm_vmx_max_exit_handlers
=
...
...
include/linux/kvm_para.h
View file @
c21415e8
...
...
@@ -52,4 +52,22 @@ struct kvm_vcpu_para_state {
#define KVM_EINVAL 1
/*
* Hypercall calling convention:
*
* Each hypercall may have 0-6 parameters.
*
* 64-bit hypercall index is in RAX, goes from 0 to __NR_hypercalls-1
*
* 64-bit parameters 1-6 are in the standard gcc x86_64 calling convention
* order: RDI, RSI, RDX, RCX, R8, R9.
*
* 32-bit index is EBX, parameters are: EAX, ECX, EDX, ESI, EDI, EBP.
* (the first 3 are according to the gcc regparm calling convention)
*
* No registers are clobbered by the hypercall, except that the
* return value is in RAX.
*/
#define __NR_hypercalls 0
#endif
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