From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: xen-devel@lists.xen.org
Cc: elena.ufimtseva@oracle.com, wei.liu2@citrix.com,
ian.campbell@citrix.com, andrew.cooper3@citrix.com,
stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com,
jbeulich@suse.com, boris.ostrovsky@oracle.com,
roger.pau@citrix.com
Subject: [PATCH v5 4/5] x86/pvh: Handle hypercalls for 32b PVH guests
Date: Fri, 4 Sep 2015 13:05:13 -0400 [thread overview]
Message-ID: <1441386314-5694-5-git-send-email-boris.ostrovsky@oracle.com> (raw)
In-Reply-To: <1441386314-5694-1-git-send-email-boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
xen/arch/x86/hvm/hvm.c | 36 ++++++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6f6cadc..ff94a9c 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5113,7 +5113,6 @@ static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
[ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
};
-/* PVH 32bitfixme. */
static hvm_hypercall_t *const pvh_hypercall64_table[NR_hypercalls] = {
HYPERCALL(platform_op),
HYPERCALL(memory_op),
@@ -5133,6 +5132,30 @@ static hvm_hypercall_t *const pvh_hypercall64_table[NR_hypercalls] = {
[ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
};
+extern int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(void) cmp_uops,
+ unsigned int count,
+ XEN_GUEST_HANDLE_PARAM(uint) pdone,
+ unsigned int foreigndom);
+static hvm_hypercall_t *const pvh_hypercall32_table[NR_hypercalls] = {
+ HYPERCALL(platform_op),
+ COMPAT_CALL(memory_op),
+ HYPERCALL(xen_version),
+ HYPERCALL(console_io),
+ [ __HYPERVISOR_grant_table_op ] =
+ (hvm_hypercall_t *)hvm_grant_table_op_compat32,
+ COMPAT_CALL(vcpu_op),
+ COMPAT_CALL(mmuext_op),
+ HYPERCALL(xsm_op),
+ COMPAT_CALL(sched_op),
+ HYPERCALL(event_channel_op),
+ [ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op_compat32,
+ HYPERCALL(hvm_op),
+ HYPERCALL(sysctl),
+ HYPERCALL(domctl),
+ HYPERCALL(xenpmu_op),
+ [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
+};
+
extern const uint8_t hypercall_args_table[], compat_hypercall_args_table[];
int hvm_do_hypercall(struct cpu_user_regs *regs)
@@ -5163,8 +5186,8 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
return viridian_hypercall(regs);
if ( (eax >= NR_hypercalls) ||
- (is_pvh_domain(currd) ? !pvh_hypercall64_table[eax]
- : !hvm_hypercall32_table[eax]) )
+ !(is_pvh_domain(currd) ? pvh_hypercall32_table[eax]
+ : hvm_hypercall32_table[eax]) )
{
regs->eax = -ENOSYS;
return HVM_HCALL_completed;
@@ -5219,8 +5242,6 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
}
#endif
}
- else if ( unlikely(is_pvh_domain(currd)) )
- regs->_eax = -ENOSYS; /* PVH 32bitfixme. */
else
{
unsigned int ebx = regs->_ebx;
@@ -5246,7 +5267,10 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
}
#endif
- regs->_eax = hvm_hypercall32_table[eax](ebx, ecx, edx, esi, edi, ebp);
+ regs->_eax = (is_pvh_vcpu(curr)
+ ? pvh_hypercall32_table
+ : hvm_hypercall32_table)[eax](ebx, ecx, edx,
+ esi, edi, ebp);
#ifndef NDEBUG
if ( !curr->arch.hvm_vcpu.hcall_preempted )
--
1.8.1.4
next prev parent reply other threads:[~2015-09-04 17:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 17:05 [PATCH v5 0/5] 32-bit domU PVH support Boris Ostrovsky
2015-09-04 17:05 ` [PATCH v5 1/5] x86/pvh: Set 32b PVH guest mode in XEN_DOMCTL_set_address_size Boris Ostrovsky
2015-09-04 17:05 ` [PATCH v5 2/5] x86/pvh: Do not allow 32-bit PVH guests to clear CR4's PAE bit Boris Ostrovsky
2015-09-04 17:05 ` [PATCH v5 3/5] x86/compat: Test both PV and PVH guests for compat mode Boris Ostrovsky
2015-09-04 17:05 ` Boris Ostrovsky [this message]
2015-09-04 17:05 ` [PATCH v5 5/5] libxc/x86/pvh: Allow creation of 32b PVH guests Boris Ostrovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441386314-5694-5-git-send-email-boris.ostrovsky@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=elena.ufimtseva@oracle.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).