* [PATCH] x86/PVH: replace bogus assertion with conditional
@ 2014-10-31 10:44 Jan Beulich
2014-10-31 10:45 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2014-10-31 10:44 UTC (permalink / raw)
To: xen-devel; +Cc: Keir Fraser
[-- Attachment #1: Type: text/plain, Size: 948 bytes --]
While PVH guests currently have to start in 64-bit mode, nothing keeps
them from entering compatibility mode via a suitable ring-0 code
selector and making a hypercall from there. Fail such attempts rather
than asserting they won't happen.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4876,10 +4876,10 @@ int hvm_do_hypercall(struct cpu_user_reg
regs->r8, regs->r9);
curr->arch.hvm_vcpu.hcall_64bit = 0;
}
+ else if ( unlikely(is_pvh_vcpu(curr)) )
+ regs->_eax = -ENOSYS; /* PVH 32bitfixme. */
else
{
- ASSERT(!is_pvh_vcpu(curr)); /* PVH 32bitfixme. */
-
HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, %x, %x)", eax,
(uint32_t)regs->ebx, (uint32_t)regs->ecx,
(uint32_t)regs->edx, (uint32_t)regs->esi,
[-- Attachment #2: x86-HVM-32bit-hypercall-PVH.patch --]
[-- Type: text/plain, Size: 995 bytes --]
x86/PVH: replace bogus assertion with conditional
While PVH guests currently have to start in 64-bit mode, nothing keeps
them from entering compatibility mode via a suitable ring-0 code
selector and making a hypercall from there. Fail such attempts rather
than asserting they won't happen.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4876,10 +4876,10 @@ int hvm_do_hypercall(struct cpu_user_reg
regs->r8, regs->r9);
curr->arch.hvm_vcpu.hcall_64bit = 0;
}
+ else if ( unlikely(is_pvh_vcpu(curr)) )
+ regs->_eax = -ENOSYS; /* PVH 32bitfixme. */
else
{
- ASSERT(!is_pvh_vcpu(curr)); /* PVH 32bitfixme. */
-
HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, %x, %x)", eax,
(uint32_t)regs->ebx, (uint32_t)regs->ecx,
(uint32_t)regs->edx, (uint32_t)regs->esi,
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/PVH: replace bogus assertion with conditional
2014-10-31 10:44 [PATCH] x86/PVH: replace bogus assertion with conditional Jan Beulich
@ 2014-10-31 10:45 ` Andrew Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2014-10-31 10:45 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Keir Fraser
[-- Attachment #1.1: Type: text/plain, Size: 1202 bytes --]
On 31/10/14 10:44, Jan Beulich wrote:
> While PVH guests currently have to start in 64-bit mode, nothing keeps
> them from entering compatibility mode via a suitable ring-0 code
> selector and making a hypercall from there. Fail such attempts rather
> than asserting they won't happen.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -4876,10 +4876,10 @@ int hvm_do_hypercall(struct cpu_user_reg
> regs->r8, regs->r9);
> curr->arch.hvm_vcpu.hcall_64bit = 0;
> }
> + else if ( unlikely(is_pvh_vcpu(curr)) )
> + regs->_eax = -ENOSYS; /* PVH 32bitfixme. */
> else
> {
> - ASSERT(!is_pvh_vcpu(curr)); /* PVH 32bitfixme. */
> -
> HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, %x, %x)", eax,
> (uint32_t)regs->ebx, (uint32_t)regs->ecx,
> (uint32_t)regs->edx, (uint32_t)regs->esi,
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 2106 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-31 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-31 10:44 [PATCH] x86/PVH: replace bogus assertion with conditional Jan Beulich
2014-10-31 10:45 ` Andrew Cooper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.