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
bedbe4ee
Commit
bedbe4ee
authored
Dec 09, 2007
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: MMU: Move pte access calculation into a helper function
Signed-off-by:
Avi Kivity
<
avi@qumranet.com
>
parent
8d87a03a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
drivers/kvm/paging_tmpl.h
drivers/kvm/paging_tmpl.h
+13
-7
No files found.
drivers/kvm/paging_tmpl.h
View file @
bedbe4ee
...
...
@@ -102,6 +102,18 @@ static bool FNAME(cmpxchg_gpte)(struct kvm *kvm,
return
(
ret
!=
orig_pte
);
}
static
unsigned
FNAME
(
gpte_access
)(
struct
kvm_vcpu
*
vcpu
,
pt_element_t
gpte
)
{
unsigned
access
;
access
=
(
gpte
&
(
PT_WRITABLE_MASK
|
PT_USER_MASK
))
|
ACC_EXEC_MASK
;
#if PTTYPE == 64
if
(
is_nx
(
vcpu
))
access
&=
~
(
gpte
>>
PT64_NX_SHIFT
);
#endif
return
access
;
}
/*
* Fetch a guest pte for a guest virtual address
*/
...
...
@@ -166,13 +178,7 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
pte
|=
PT_ACCESSED_MASK
;
}
pte_access
=
pte
&
(
PT_WRITABLE_MASK
|
PT_USER_MASK
);
pte_access
|=
ACC_EXEC_MASK
;
#if PTTYPE == 64
if
(
is_nx
(
vcpu
))
pte_access
&=
~
(
pte
>>
PT64_NX_SHIFT
);
#endif
pte_access
&=
pt_access
;
pte_access
=
pt_access
&
FNAME
(
gpte_access
)(
vcpu
,
pte
);
if
(
walker
->
level
==
PT_PAGE_TABLE_LEVEL
)
{
walker
->
gfn
=
gpte_to_gfn
(
pte
);
...
...
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