From: Joerg Roedel <joerg.roedel@amd.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 2/2] KVM: Use u64 for frame data types
Date: Thu, 1 Jul 2010 16:00:12 +0200 [thread overview]
Message-ID: <1277992812-31945-3-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1277992812-31945-1-git-send-email-joerg.roedel@amd.com>
For 32bit machines where the physical address width is
larger than the virtual address width the frame number types
in KVM may overflow. Fix this by changing them to u64.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
include/linux/kvm_types.h | 4 ++--
virt/kvm/iommu.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h
index fb46efb..7ac0d4e 100644
--- a/include/linux/kvm_types.h
+++ b/include/linux/kvm_types.h
@@ -32,11 +32,11 @@
typedef unsigned long gva_t;
typedef u64 gpa_t;
-typedef unsigned long gfn_t;
+typedef u64 gfn_t;
typedef unsigned long hva_t;
typedef u64 hpa_t;
-typedef unsigned long hfn_t;
+typedef u64 hfn_t;
typedef hfn_t pfn_t;
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index 673c88a..22fc28b 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -108,7 +108,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
get_order(page_size), flags);
if (r) {
printk(KERN_ERR "kvm_iommu_map_address:"
- "iommu failed to map pfn=%lx\n", pfn);
+ "iommu failed to map pfn=%llx\n", pfn);
goto unmap_pages;
}
--
1.7.0.4
next prev parent reply other threads:[~2010-07-01 14:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-01 14:00 [PATCH 0/2] Use u64 for gfn_t in KVM Joerg Roedel
2010-07-01 14:00 ` [PATCH 1/2] KVM: Remove unnecessary divide operations Joerg Roedel
2010-07-01 14:18 ` Avi Kivity
2010-07-01 14:00 ` Joerg Roedel [this message]
2010-07-01 14:18 ` [PATCH 0/2] Use u64 for gfn_t in KVM Avi Kivity
2010-07-02 17:19 ` Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1277992812-31945-3-git-send-email-joerg.roedel@amd.com \
--to=joerg.roedel@amd.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®