All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel List <xen-devel@lists.xen.org>,
	David Vrabel <david.vrabel@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [RFC] Linux save_fl PVOP for Xen
Date: Fri, 17 Apr 2015 11:26:24 +0100	[thread overview]
Message-ID: <5530DFD0.2080604@citrix.com> (raw)
In-Reply-To: <5530021C.4070905@citrix.com>

On 16/04/15 19:40, Andrew Cooper wrote:
> Having recently got some Broadwell hardware, our automatic test system
> discovered that 32bit PV guests would reliably blow up while attempting
> to boot.
> 
> It turns out that the save_fl PVOP is at fault.  The comment is false,
> as setup_smap() uses it to check that the Alignment Check flag is clear.
> 
> As the Xen PVOP leaves everything other than %ah worth of eflags
> uninitialised, the BUG_ON(eflags & X86_EFLAGS_AC) in setup_smap() is
> unconditional undefined behaviour on all versions of Linux since SMAP
> support was introduced.

I'm somewhat surprised this ever worked...

> I had developed a patch (see below) and was writing up the commit
> message, but it would appear that this PVOP is also used by PVHVM
> domains, which invalidates an assumption underlying the fix (insofar
> that 'pushf' would unconditionally have IF set).

PVHVM uses native save/restore flags.

> 2) Change setup_smap() to use something like native_safe_fl().  Unlikely
> to get traction upstream, and fragile to similar changes in the future.

This one liner seems preferred to me.  Can you try it and see if the x86
maintainers agree?

David

      reply	other threads:[~2015-04-17 10:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16 18:40 [RFC] Linux save_fl PVOP for Xen Andrew Cooper
2015-04-17 10:26 ` David Vrabel [this message]

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=5530DFD0.2080604@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=konrad.wilk@oracle.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 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.