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
a77ab5ea
Commit
a77ab5ea
authored
Jan 05, 2009
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: x86 emulator: implement 'ret far' instruction (opcode 0xcb)
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
8b3079a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
arch/x86/kvm/x86_emulate.c
arch/x86/kvm/x86_emulate.c
+25
-1
No files found.
arch/x86/kvm/x86_emulate.c
View file @
a77ab5ea
...
...
@@ -178,7 +178,7 @@ static u32 opcode_table[256] = {
0
,
ImplicitOps
|
Stack
,
0
,
0
,
ByteOp
|
DstMem
|
SrcImm
|
ModRM
|
Mov
,
DstMem
|
SrcImm
|
ModRM
|
Mov
,
/* 0xC8 - 0xCF */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
ImplicitOps
|
Stack
,
0
,
0
,
0
,
0
,
/* 0xD0 - 0xD7 */
ByteOp
|
DstMem
|
SrcImplicit
|
ModRM
,
DstMem
|
SrcImplicit
|
ModRM
,
ByteOp
|
DstMem
|
SrcImplicit
|
ModRM
,
DstMem
|
SrcImplicit
|
ModRM
,
...
...
@@ -1278,6 +1278,25 @@ static inline int emulate_grp9(struct x86_emulate_ctxt *ctxt,
return
0
;
}
static
int
emulate_ret_far
(
struct
x86_emulate_ctxt
*
ctxt
,
struct
x86_emulate_ops
*
ops
)
{
struct
decode_cache
*
c
=
&
ctxt
->
decode
;
int
rc
;
unsigned
long
cs
;
rc
=
emulate_pop
(
ctxt
,
ops
,
&
c
->
eip
,
c
->
op_bytes
);
if
(
rc
)
return
rc
;
if
(
c
->
op_bytes
==
4
)
c
->
eip
=
(
u32
)
c
->
eip
;
rc
=
emulate_pop
(
ctxt
,
ops
,
&
cs
,
c
->
op_bytes
);
if
(
rc
)
return
rc
;
rc
=
kvm_load_segment_descriptor
(
ctxt
->
vcpu
,
(
u16
)
cs
,
1
,
VCPU_SREG_CS
);
return
rc
;
}
static
inline
int
writeback
(
struct
x86_emulate_ctxt
*
ctxt
,
struct
x86_emulate_ops
*
ops
)
{
...
...
@@ -1735,6 +1754,11 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
mov:
c
->
dst
.
val
=
c
->
src
.
val
;
break
;
case
0xcb
:
/* ret far */
rc
=
emulate_ret_far
(
ctxt
,
ops
);
if
(
rc
)
goto
done
;
break
;
case
0xd0
...
0xd1
:
/* Grp2 */
c
->
src
.
val
=
1
;
emulate_grp2
(
ctxt
);
...
...
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