xcp-1.6-updates/xen-4.1.hg

changeset 23331:f8f8912b3de0

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>
xen-unstable changeset: 25724:612898732e66
xen-unstable date: Fri Aug 03 09:54:17 2012 +0100
Backported-by: Keir Fraser <keir@xen.org>
author Ian Campbell <ian.campbell@citrix.com>
date Fri Aug 03 10:43:24 2012 +0100 (2012-08-03)
parents 5a65d6a1aab7
children 859205b36fe9
files xen/arch/x86/hvm/hvm.c xen/arch/x86/mm/p2m.c xen/include/asm-x86/hvm/hvm.h xen/include/asm-x86/p2m.h
line diff
     1.1 --- a/xen/arch/x86/hvm/hvm.c	Fri Aug 03 10:39:13 2012 +0100
     1.2 +++ b/xen/arch/x86/hvm/hvm.c	Fri Aug 03 10:43:24 2012 +0100
     1.3 @@ -1109,7 +1109,7 @@ void hvm_triple_fault(void)
     1.4      domain_shutdown(v->domain, SHUTDOWN_reboot);
     1.5  }
     1.6  
     1.7 -bool_t hvm_hap_nested_page_fault(unsigned long gpa,
     1.8 +bool_t hvm_hap_nested_page_fault(paddr_t gpa,
     1.9                                   bool_t gla_valid,
    1.10                                   unsigned long gla,
    1.11                                   bool_t access_valid,
     2.1 --- a/xen/arch/x86/mm/p2m.c	Fri Aug 03 10:39:13 2012 +0100
     2.2 +++ b/xen/arch/x86/mm/p2m.c	Fri Aug 03 10:43:24 2012 +0100
     2.3 @@ -3032,7 +3032,7 @@ void p2m_mem_paging_resume(struct p2m_do
     2.4      mem_event_unpause_vcpus(d);
     2.5  }
     2.6  
     2.7 -void p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long gla, 
     2.8 +void p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, unsigned long gla, 
     2.9                            bool_t access_r, bool_t access_w, bool_t access_x)
    2.10  {
    2.11      struct vcpu *v = current;
     3.1 --- a/xen/include/asm-x86/hvm/hvm.h	Fri Aug 03 10:39:13 2012 +0100
     3.2 +++ b/xen/include/asm-x86/hvm/hvm.h	Fri Aug 03 10:43:24 2012 +0100
     3.3 @@ -368,7 +368,7 @@ static inline void hvm_set_info_guest(st
     3.4  
     3.5  int hvm_debug_op(struct vcpu *v, int32_t op);
     3.6  
     3.7 -bool_t hvm_hap_nested_page_fault(unsigned long gpa,
     3.8 +bool_t hvm_hap_nested_page_fault(paddr_t gpa,
     3.9                                   bool_t gla_valid, unsigned long gla,
    3.10                                   bool_t access_valid, 
    3.11                                   bool_t access_r,
     4.1 --- a/xen/include/asm-x86/p2m.h	Fri Aug 03 10:39:13 2012 +0100
     4.2 +++ b/xen/include/asm-x86/p2m.h	Fri Aug 03 10:43:24 2012 +0100
     4.3 @@ -539,12 +539,12 @@ static inline void p2m_mem_paging_popula
     4.4  #ifdef __x86_64__
     4.5  /* Send mem event based on the access (gla is -1ull if not available).  Handles
     4.6   * the rw2rx conversion */
     4.7 -void p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long gla, 
     4.8 +void p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, unsigned long gla, 
     4.9                            bool_t access_r, bool_t access_w, bool_t access_x);
    4.10  /* Resumes the running of the VCPU, restarting the last instruction */
    4.11  void p2m_mem_access_resume(struct p2m_domain *p2m);
    4.12  #else
    4.13 -static inline void p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, 
    4.14 +static inline void p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, 
    4.15                                          unsigned long gla, bool_t access_r, 
    4.16                                          bool_t access_w, bool_t access_x)
    4.17  { }