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
Kirill Smelkov
linux
Commits
7ee5d940
Commit
7ee5d940
authored
Nov 25, 2007
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: Use generalized exception queue for injecting #UD
Signed-off-by:
Avi Kivity
<
avi@qumranet.com
>
parent
c1a5d4f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
20 deletions
+3
-20
drivers/kvm/svm.c
drivers/kvm/svm.c
+2
-10
drivers/kvm/vmx.c
drivers/kvm/vmx.c
+1
-10
No files found.
drivers/kvm/svm.c
View file @
7ee5d940
...
...
@@ -207,13 +207,6 @@ static bool svm_exception_injected(struct kvm_vcpu *vcpu)
return
!
(
svm
->
vmcb
->
control
.
exit_int_info
&
SVM_EXITINTINFO_VALID
);
}
static
void
inject_ud
(
struct
kvm_vcpu
*
vcpu
)
{
to_svm
(
vcpu
)
->
vmcb
->
control
.
event_inj
=
SVM_EVTINJ_VALID
|
SVM_EVTINJ_TYPE_EXEPT
|
UD_VECTOR
;
}
static
int
is_external_interrupt
(
u32
info
)
{
info
&=
SVM_EVTINJ_TYPE_MASK
|
SVM_EVTINJ_VALID
;
...
...
@@ -948,8 +941,7 @@ static int ud_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
er
=
emulate_instruction
(
&
svm
->
vcpu
,
kvm_run
,
0
,
0
,
0
);
if
(
er
!=
EMULATE_DONE
)
inject_ud
(
&
svm
->
vcpu
);
kvm_queue_exception
(
&
svm
->
vcpu
,
UD_VECTOR
);
return
1
;
}
...
...
@@ -1027,7 +1019,7 @@ static int vmmcall_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
static
int
invalid_op_interception
(
struct
vcpu_svm
*
svm
,
struct
kvm_run
*
kvm_run
)
{
inject_ud
(
&
svm
->
vcpu
);
kvm_queue_exception
(
&
svm
->
vcpu
,
UD_VECTOR
);
return
1
;
}
...
...
drivers/kvm/vmx.c
View file @
7ee5d940
...
...
@@ -613,14 +613,6 @@ static bool vmx_exception_injected(struct kvm_vcpu *vcpu)
return
!
(
vmx
->
idt_vectoring_info
&
VECTORING_INFO_VALID_MASK
);
}
static
void
vmx_inject_ud
(
struct
kvm_vcpu
*
vcpu
)
{
vmcs_write32
(
VM_ENTRY_INTR_INFO_FIELD
,
UD_VECTOR
|
INTR_TYPE_EXCEPTION
|
INTR_INFO_VALID_MASK
);
}
/*
* Swap MSR entry in host/guest MSR entry array.
*/
...
...
@@ -1866,8 +1858,7 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
if
(
is_invalid_opcode
(
intr_info
))
{
er
=
emulate_instruction
(
vcpu
,
kvm_run
,
0
,
0
,
0
);
if
(
er
!=
EMULATE_DONE
)
vmx_inject_ud
(
vcpu
);
kvm_queue_exception
(
vcpu
,
UD_VECTOR
);
return
1
;
}
...
...
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