summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/vmx.c
diff options
context:
space:
mode:
authorAvi Kivity2007-03-30 13:02:32 +0200
committerAvi Kivity2007-05-03 09:52:28 +0200
commit954bbbc236afe23b368abdf4942f313a5f6e1d50 (patch)
tree4c990bff08f7a9a13980deb68a85e091065bb1ec /drivers/kvm/vmx.c
parentKVM: Add mmu cache clear function (diff)
downloadkernel-qcow2-linux-954bbbc236afe23b368abdf4942f313a5f6e1d50.tar.gz
kernel-qcow2-linux-954bbbc236afe23b368abdf4942f313a5f6e1d50.tar.xz
kernel-qcow2-linux-954bbbc236afe23b368abdf4942f313a5f6e1d50.zip
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index b64b7b792e84..61a611691e50 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -926,9 +926,9 @@ static int init_rmode_tss(struct kvm* kvm)
gfn_t fn = rmode_tss_base(kvm) >> PAGE_SHIFT;
char *page;
- p1 = _gfn_to_page(kvm, fn++);
- p2 = _gfn_to_page(kvm, fn++);
- p3 = _gfn_to_page(kvm, fn);
+ p1 = gfn_to_page(kvm, fn++);
+ p2 = gfn_to_page(kvm, fn++);
+ p3 = gfn_to_page(kvm, fn);
if (!p1 || !p2 || !p3) {
kvm_printf(kvm,"%s: gfn_to_page failed\n", __FUNCTION__);