[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.1-testing] nestedhvm: fix nested page fault build error on 32-bit


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
  • Date: Tue, 07 Aug 2012 15:01:24 +0000
  • Delivery-date: Tue, 07 Aug 2012 15:01:36 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1343987004 -3600
# Node ID f8f8912b3de00ba4451894c29419ca95e13af38e
# Parent  5a65d6a1aab79b80e4b4cd7bf2621707e507a546
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@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Tim Deegan <tim@xxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
xen-unstable changeset:   25724:612898732e66
xen-unstable date:        Fri Aug 03 09:54:17 2012 +0100
Backported-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 5a65d6a1aab7 -r f8f8912b3de0 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri Aug 03 10:39:13 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri Aug 03 10:43:24 2012 +0100
@@ -1109,7 +1109,7 @@ void hvm_triple_fault(void)
     domain_shutdown(v->domain, SHUTDOWN_reboot);
 }
 
-bool_t hvm_hap_nested_page_fault(unsigned long gpa,
+bool_t hvm_hap_nested_page_fault(paddr_t gpa,
                                  bool_t gla_valid,
                                  unsigned long gla,
                                  bool_t access_valid,
diff -r 5a65d6a1aab7 -r f8f8912b3de0 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Fri Aug 03 10:39:13 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c     Fri Aug 03 10:43:24 2012 +0100
@@ -3032,7 +3032,7 @@ void p2m_mem_paging_resume(struct p2m_do
     mem_event_unpause_vcpus(d);
 }
 
-void p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long 
gla, 
+void 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)
 {
     struct vcpu *v = current;
diff -r 5a65d6a1aab7 -r f8f8912b3de0 xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h     Fri Aug 03 10:39:13 2012 +0100
+++ b/xen/include/asm-x86/hvm/hvm.h     Fri Aug 03 10:43:24 2012 +0100
@@ -368,7 +368,7 @@ static inline void hvm_set_info_guest(st
 
 int hvm_debug_op(struct vcpu *v, int32_t op);
 
-bool_t hvm_hap_nested_page_fault(unsigned long gpa,
+bool_t hvm_hap_nested_page_fault(paddr_t gpa,
                                  bool_t gla_valid, unsigned long gla,
                                  bool_t access_valid, 
                                  bool_t access_r,
diff -r 5a65d6a1aab7 -r f8f8912b3de0 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h Fri Aug 03 10:39:13 2012 +0100
+++ b/xen/include/asm-x86/p2m.h Fri Aug 03 10:43:24 2012 +0100
@@ -539,12 +539,12 @@ static inline void p2m_mem_paging_popula
 #ifdef __x86_64__
 /* Send mem event based on the access (gla is -1ull if not available).  Handles
  * the rw2rx conversion */
-void p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long 
gla, 
+void 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);
 /* Resumes the running of the VCPU, restarting the last instruction */
 void p2m_mem_access_resume(struct p2m_domain *p2m);
 #else
-static inline void p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, 
+static inline void 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)
 { }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.