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>
This commit is contained in:
Ian Campbell committed 2012-08-03 10:43:24 +01:00
1 parent 7680b3d481
commit d88e5d451b
4 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -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,
+1 -1
View File
@@ -3032,7 +3032,7 @@ void p2m_mem_paging_resume(struct p2m_domain *p2m)
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;
+1 -1
View File
@@ -368,7 +368,7 @@ static inline void hvm_set_info_guest(struct vcpu *v)
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,
+2 -2
View File
@@ -539,12 +539,12 @@ static inline void p2m_mem_paging_populate(struct p2m_domain *p2m, unsigned long
#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)
{ }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.