aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Campbell <Ian.Campbell@citrix.com>2012-08-03 09:54:17 +0100
committerIan Campbell <Ian.Campbell@citrix.com>2012-08-03 09:54:17 +0100
commit815b55b7942ae77d7002f45f268e1081b37e5d00 (patch)
tree408e541bf3cc0d4c364fe39c5511c74771e186ca
parent662d2991eb798c73f29b89f00aede66602254264 (diff)
downloadxen-815b55b7942ae77d7002f45f268e1081b37e5d00.tar.gz
xen-815b55b7942ae77d7002f45f268e1081b37e5d00.tar.bz2
xen-815b55b7942ae77d7002f45f268e1081b37e5d00.zip
nestedhvm: fix nested page fault build error on 32-bit
cc1: warnings being treated as errors hvm.c: In function ‘hvm_hap_nested_page_fault’: hvm.c:1282: error: passing argument 2 of ‘nestedhvm_hap_nested_page_fault’ from incompatible pointer type /local/scratch/ianc/devel/xen-unstable.hg/xen/include/asm/hvm/nestedhvm.h:55: note: expected ‘paddr_t *’ but argument is of type ‘long unsigned int *’ hvm_hap_nested_page_fault takes an unsigned long gpa and passes &gpa to nestedhvm_hap_nested_page_fault which takes a paddr_t *. Since both of the callers of hvm_hap_nested_page_fault (svm_do_nested_pgfault and ept_handle_violation) actually have the gpa which they pass to hvm_hap_nested_page_fault as a paddr_t I think it makes sense to change the argument to hvm_hap_nested_page_fault. The other user of gpa in hvm_hap_nested_page_fault is a call to p2m_mem_access_check, which currently also takes a paddr_t gpa but I think a paddr_t is appropriate there too. Jan points out that this is also an issue for >4GB guests on the 32 bit hypervisor. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r--xen/arch/x86/hvm/hvm.c2
-rw-r--r--xen/arch/x86/mm/p2m.c2
-rw-r--r--xen/include/asm-x86/hvm/hvm.h2
-rw-r--r--xen/include/asm-x86/p2m.h4
4 files changed, 5 insertions, 5 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 87c08a9b5d..7f8a025c8e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1242,7 +1242,7 @@ void hvm_inject_page_fault(int errcode, unsigned long cr2)
hvm_inject_trap(&trap);
}
-int hvm_hap_nested_page_fault(unsigned long gpa,
+int hvm_hap_nested_page_fault(paddr_t gpa,
bool_t gla_valid,
unsigned long gla,
bool_t access_r,
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 75926558fd..344fb9928d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1233,7 +1233,7 @@ void p2m_mem_paging_resume(struct domain *d)
}
}
-bool_t p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long gla,
+bool_t p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, unsigned long gla,
bool_t access_r, bool_t access_w, bool_t access_x,
mem_event_request_t **req_ptr)
{
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index ee1677be07..7243c4eb25 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -433,7 +433,7 @@ static inline void hvm_set_info_guest(struct vcpu *v)
int hvm_debug_op(struct vcpu *v, int32_t op);
-int hvm_hap_nested_page_fault(unsigned long gpa,
+int hvm_hap_nested_page_fault(paddr_t gpa,
bool_t gla_valid, unsigned long gla,
bool_t access_r,
bool_t access_w,
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 8f01fee37c..fd49b28220 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -589,7 +589,7 @@ static inline void p2m_mem_paging_populate(struct domain *d, unsigned long gfn)
* been promoted with no underlying vcpu pause. If the req_ptr has been populated,
* then the caller must put the event in the ring (once having released get_gfn*
* locks -- caller must also xfree the request. */
-bool_t p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long gla,
+bool_t p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, unsigned long gla,
bool_t access_r, bool_t access_w, bool_t access_x,
mem_event_request_t **req_ptr);
/* Resumes the running of the VCPU, restarting the last instruction */
@@ -606,7 +606,7 @@ int p2m_get_mem_access(struct domain *d, unsigned long pfn,
hvmmem_access_t *access);
#else
-static inline bool_t p2m_mem_access_check(unsigned long gpa, bool_t gla_valid,
+static inline bool_t p2m_mem_access_check(paddr_t gpa, bool_t gla_valid,
unsigned long gla, bool_t access_r,
bool_t access_w, bool_t access_x,
mem_event_request_t **req_ptr)