提交 ca15f20f 编写于 作者: J Jeremy Fitzhardinge 提交者: Ingo Molnar

xen: fix 64-bit hypercall variants

64-bit guests can pass 64-bit quantities in a single argument,
so fix up the hypercalls.
Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 7077c33d
...@@ -223,12 +223,12 @@ static inline int ...@@ -223,12 +223,12 @@ static inline int
HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val, HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
unsigned long flags) unsigned long flags)
{ {
unsigned long pte_hi = 0; if (sizeof(new_val) == sizeof(long))
#ifdef CONFIG_X86_PAE return _hypercall3(int, update_va_mapping, va,
pte_hi = new_val.pte_high; new_val.pte, flags);
#endif else
return _hypercall4(int, update_va_mapping, va, return _hypercall4(int, update_va_mapping, va,
new_val.pte_low, pte_hi, flags); new_val.pte, new_val.pte >> 32, flags);
} }
static inline int static inline int
...@@ -281,12 +281,13 @@ static inline int ...@@ -281,12 +281,13 @@ static inline int
HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, pte_t new_val, HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, pte_t new_val,
unsigned long flags, domid_t domid) unsigned long flags, domid_t domid)
{ {
unsigned long pte_hi = 0; if (sizeof(new_val) == sizeof(long))
#ifdef CONFIG_X86_PAE return _hypercall4(int, update_va_mapping_otherdomain, va,
pte_hi = new_val.pte_high; new_val.pte, flags, domid);
#endif else
return _hypercall5(int, update_va_mapping_otherdomain, va, return _hypercall5(int, update_va_mapping_otherdomain, va,
new_val.pte_low, pte_hi, flags, domid); new_val.pte, new_val.pte >> 32,
flags, domid);
} }
static inline int static inline int
...@@ -327,14 +328,14 @@ MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va, ...@@ -327,14 +328,14 @@ MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
{ {
mcl->op = __HYPERVISOR_update_va_mapping; mcl->op = __HYPERVISOR_update_va_mapping;
mcl->args[0] = va; mcl->args[0] = va;
#ifdef CONFIG_X86_PAE if (sizeof(new_val) == sizeof(long)) {
mcl->args[1] = new_val.pte_low; mcl->args[1] = new_val.pte;
mcl->args[2] = new_val.pte_high; mcl->args[2] = flags;
#else } else {
mcl->args[1] = new_val.pte_low; mcl->args[1] = new_val.pte;
mcl->args[2] = 0; mcl->args[2] = new_val.pte >> 32;
#endif mcl->args[3] = flags;
mcl->args[3] = flags; }
} }
static inline void static inline void
...@@ -354,15 +355,16 @@ MULTI_update_va_mapping_otherdomain(struct multicall_entry *mcl, unsigned long v ...@@ -354,15 +355,16 @@ MULTI_update_va_mapping_otherdomain(struct multicall_entry *mcl, unsigned long v
{ {
mcl->op = __HYPERVISOR_update_va_mapping_otherdomain; mcl->op = __HYPERVISOR_update_va_mapping_otherdomain;
mcl->args[0] = va; mcl->args[0] = va;
#ifdef CONFIG_X86_PAE if (sizeof(new_val) == sizeof(long)) {
mcl->args[1] = new_val.pte_low; mcl->args[1] = new_val.pte;
mcl->args[2] = new_val.pte_high; mcl->args[2] = flags;
#else mcl->args[3] = domid;
mcl->args[1] = new_val.pte_low; } else {
mcl->args[2] = 0; mcl->args[1] = new_val.pte;
#endif mcl->args[2] = new_val.pte >> 32;
mcl->args[3] = flags; mcl->args[3] = flags;
mcl->args[4] = domid; mcl->args[4] = domid;
}
} }
static inline void static inline void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册