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
da928521
Commit
da928521
authored
Nov 21, 2007
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: MMU: Move pse36 handling to the guest walker
Signed-off-by:
Avi Kivity
<
avi@qumranet.com
>
parent
5fb07ddb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
drivers/kvm/mmu.c
drivers/kvm/mmu.c
+7
-0
drivers/kvm/paging_tmpl.h
drivers/kvm/paging_tmpl.h
+2
-3
No files found.
drivers/kvm/mmu.c
View file @
da928521
...
@@ -218,6 +218,13 @@ static int is_rmap_pte(u64 pte)
...
@@ -218,6 +218,13 @@ static int is_rmap_pte(u64 pte)
&&
pte
!=
shadow_notrap_nonpresent_pte
;
&&
pte
!=
shadow_notrap_nonpresent_pte
;
}
}
static
gfn_t
pse36_gfn_delta
(
u32
gpte
)
{
int
shift
=
32
-
PT32_DIR_PSE36_SHIFT
-
PAGE_SHIFT
;
return
(
gpte
&
PT32_DIR_PSE36_MASK
)
<<
shift
;
}
static
void
set_shadow_pte
(
u64
*
sptep
,
u64
spte
)
static
void
set_shadow_pte
(
u64
*
sptep
,
u64
spte
)
{
{
#ifdef CONFIG_X86_64
#ifdef CONFIG_X86_64
...
...
drivers/kvm/paging_tmpl.h
View file @
da928521
...
@@ -149,6 +149,8 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
...
@@ -149,6 +149,8 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
&&
(
PTTYPE
==
64
||
is_pse
(
vcpu
)))
{
&&
(
PTTYPE
==
64
||
is_pse
(
vcpu
)))
{
walker
->
gfn
=
gpte_to_gfn_pde
(
pte
);
walker
->
gfn
=
gpte_to_gfn_pde
(
pte
);
walker
->
gfn
+=
PT_INDEX
(
addr
,
PT_PAGE_TABLE_LEVEL
);
walker
->
gfn
+=
PT_INDEX
(
addr
,
PT_PAGE_TABLE_LEVEL
);
if
(
PTTYPE
==
32
&&
is_cpuid_PSE36
())
walker
->
gfn
+=
pse36_gfn_delta
(
pte
);
break
;
break
;
}
}
...
@@ -320,9 +322,6 @@ static void FNAME(set_pde)(struct kvm_vcpu *vcpu, pt_element_t gpde,
...
@@ -320,9 +322,6 @@ static void FNAME(set_pde)(struct kvm_vcpu *vcpu, pt_element_t gpde,
access_bits
&=
gpde
;
access_bits
&=
gpde
;
gaddr
=
(
gpa_t
)
gfn
<<
PAGE_SHIFT
;
gaddr
=
(
gpa_t
)
gfn
<<
PAGE_SHIFT
;
if
(
PTTYPE
==
32
&&
is_cpuid_PSE36
())
gaddr
|=
(
gpde
&
PT32_DIR_PSE36_MASK
)
<<
(
32
-
PT32_DIR_PSE36_SHIFT
);
FNAME
(
set_pte_common
)(
vcpu
,
shadow_pte
,
gaddr
,
FNAME
(
set_pte_common
)(
vcpu
,
shadow_pte
,
gaddr
,
gpde
,
access_bits
,
user_fault
,
write_fault
,
gpde
,
access_bits
,
user_fault
,
write_fault
,
ptwrite
,
walker
,
gfn
);
ptwrite
,
walker
,
gfn
);
...
...
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