xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH for-4.7] x86/pv: Correctly fold vIOPL back into vcpu_guest_context
Date: Mon, 11 Apr 2016 10:08:58 -0400	[thread overview]
Message-ID: <570BAFFA.5010406@oracle.com> (raw)
In-Reply-To: <1460365435-12325-1-git-send-email-andrew.cooper3@citrix.com>

On 04/11/2016 05:03 AM, Andrew Cooper wrote:
> c/s f71ecb6 "x86: introduce a new VMASSIST for architectural behaviour of
> iopl" shifted the vcpu iopl field by 12, but didn't update the logic which
> reconstructs the guests eflags for migration.
>
> Existing guest kernels set a vIOPL of 1, to prevent them from faulting when
> accessing IO ports.  This bug manifests as a crash after migrate, as the vIOPL
> reverts back to the default of 0, and the guest suffers an unexpected #GP
> fault.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

(save/restore was part of brokenness as well, obviously)

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> ---
>   xen/arch/x86/domctl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
> index cba1e37..6e709cb 100644
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -1512,7 +1512,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
>   
>           /* IOPL privileges are virtualised: merge back into returned eflags. */
>           BUG_ON((c(user_regs.eflags) & X86_EFLAGS_IOPL) != 0);
> -        c(user_regs.eflags |= v->arch.pv_vcpu.iopl << 12);
> +        c(user_regs.eflags |= v->arch.pv_vcpu.iopl);
>   
>           if ( !compat )
>           {


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-04-11 14:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11  9:03 [PATCH for-4.7] x86/pv: Correctly fold vIOPL back into vcpu_guest_context Andrew Cooper
2016-04-11  9:45 ` Wei Liu
2016-04-11 14:08 ` Boris Ostrovsky [this message]
2016-04-11 14:22   ` Konrad Rzeszutek Wilk

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=570BAFFA.5010406@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@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).