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
0ef753b8
Commit
0ef753b8
authored
Aug 18, 2010
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: x86 emulator: implement CALL FAR (FF /3)
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
7af04fc0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
arch/x86/kvm/emulate.c
arch/x86/kvm/emulate.c
+36
-1
No files found.
arch/x86/kvm/emulate.c
View file @
0ef753b8
...
@@ -2214,6 +2214,40 @@ static int em_das(struct x86_emulate_ctxt *ctxt)
...
@@ -2214,6 +2214,40 @@ static int em_das(struct x86_emulate_ctxt *ctxt)
return
X86EMUL_CONTINUE
;
return
X86EMUL_CONTINUE
;
}
}
static
int
em_call_far
(
struct
x86_emulate_ctxt
*
ctxt
)
{
struct
decode_cache
*
c
=
&
ctxt
->
decode
;
u16
sel
,
old_cs
;
ulong
old_eip
;
int
rc
;
old_cs
=
ctxt
->
ops
->
get_segment_selector
(
VCPU_SREG_CS
,
ctxt
->
vcpu
);
old_eip
=
c
->
eip
;
memcpy
(
&
sel
,
c
->
src
.
valptr
+
c
->
op_bytes
,
2
);
if
(
load_segment_descriptor
(
ctxt
,
ctxt
->
ops
,
sel
,
VCPU_SREG_CS
))
return
X86EMUL_CONTINUE
;
c
->
eip
=
0
;
memcpy
(
&
c
->
eip
,
c
->
src
.
valptr
,
c
->
op_bytes
);
c
->
src
.
val
=
old_cs
;
emulate_push
(
ctxt
,
ctxt
->
ops
);
rc
=
writeback
(
ctxt
,
ctxt
->
ops
);
if
(
rc
!=
X86EMUL_CONTINUE
)
return
rc
;
c
->
src
.
val
=
old_eip
;
emulate_push
(
ctxt
,
ctxt
->
ops
);
rc
=
writeback
(
ctxt
,
ctxt
->
ops
);
if
(
rc
!=
X86EMUL_CONTINUE
)
return
rc
;
c
->
dst
.
type
=
OP_NONE
;
return
X86EMUL_CONTINUE
;
}
#define D(_y) { .flags = (_y) }
#define D(_y) { .flags = (_y) }
#define N D(0)
#define N D(0)
#define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) }
#define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) }
...
@@ -2241,7 +2275,8 @@ static struct opcode group4[] = {
...
@@ -2241,7 +2275,8 @@ static struct opcode group4[] = {
static
struct
opcode
group5
[]
=
{
static
struct
opcode
group5
[]
=
{
D
(
DstMem
|
SrcNone
|
ModRM
|
Lock
),
D
(
DstMem
|
SrcNone
|
ModRM
|
Lock
),
D
(
DstMem
|
SrcNone
|
ModRM
|
Lock
),
D
(
DstMem
|
SrcNone
|
ModRM
|
Lock
),
D
(
SrcMem
|
ModRM
|
Stack
),
N
,
D
(
SrcMem
|
ModRM
|
Stack
),
I
(
SrcMemFAddr
|
ModRM
|
ImplicitOps
|
Stack
,
em_call_far
),
D
(
SrcMem
|
ModRM
|
Stack
),
D
(
SrcMemFAddr
|
ModRM
|
ImplicitOps
),
D
(
SrcMem
|
ModRM
|
Stack
),
D
(
SrcMemFAddr
|
ModRM
|
ImplicitOps
),
D
(
SrcMem
|
ModRM
|
Stack
),
N
,
D
(
SrcMem
|
ModRM
|
Stack
),
N
,
};
};
...
...
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