diff options
author | Avi Kivity <avi@qumranet.com> | 2007-03-30 07:02:32 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-05-03 03:52:28 -0400 |
commit | 954bbbc236afe23b368abdf4942f313a5f6e1d50 (patch) | |
tree | 4c990bff08f7a9a13980deb68a85e091065bb1ec /drivers/kvm/vmx.c | |
parent | e0fa826f969c262c23908953bf85add487cc2e6c (diff) |
KVM: Simply gfn_to_page()
Mapping a guest page to a host page is a common operation. Currently,
one has first to find the memory slot where the page belongs (gfn_to_memslot),
then locate the page itself (gfn_to_page()).
This is clumsy, and also won't work well with memory aliases. So simplify
gfn_to_page() not to require memory slot translation first, and instead do it
internally.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index b64b7b792e8..61a611691e5 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -926,9 +926,9 @@ static int init_rmode_tss(struct kvm* kvm) | |||
926 | gfn_t fn = rmode_tss_base(kvm) >> PAGE_SHIFT; | 926 | gfn_t fn = rmode_tss_base(kvm) >> PAGE_SHIFT; |
927 | char *page; | 927 | char *page; |
928 | 928 | ||
929 | p1 = _gfn_to_page(kvm, fn++); | 929 | p1 = gfn_to_page(kvm, fn++); |
930 | p2 = _gfn_to_page(kvm, fn++); | 930 | p2 = gfn_to_page(kvm, fn++); |
931 | p3 = _gfn_to_page(kvm, fn); | 931 | p3 = gfn_to_page(kvm, fn); |
932 | 932 | ||
933 | if (!p1 || !p2 || !p3) { | 933 | if (!p1 || !p2 || !p3) { |
934 | kvm_printf(kvm,"%s: gfn_to_page failed\n", __FUNCTION__); | 934 | kvm_printf(kvm,"%s: gfn_to_page failed\n", __FUNCTION__); |