xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: TimDeegan <tim@xen.org>, Keir Fraser <keir@xen.org>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH RFC] x86/traps: Make the main trap handlers safe for use early during Xen boot
Date: Wed, 14 May 2014 08:00:55 +0100	[thread overview]
Message-ID: <537330C70200007800011FEE@mail.emea.novell.com> (raw)
In-Reply-To: <53724492.2090106@citrix.com>

>>> On 13.05.14 at 18:13, <andrew.cooper3@citrix.com> wrote:
> On 13/05/14 16:26, Jan Beulich wrote:
>>>>> On 13.05.14 at 16:51, <andrew.cooper3@citrix.com> wrote:
>>> --- a/xen/arch/x86/traps.c
>>> +++ b/xen/arch/x86/traps.c
>>> @@ -561,7 +561,8 @@ static void do_trap(struct cpu_user_regs *regs, int use_error_code)
>>>      }
>>>  
>>>      if ( ((trapnr == TRAP_copro_error) || (trapnr == TRAP_simd_error)) &&
>>> -         has_hvm_container_vcpu(curr) && curr->arch.hvm_vcpu.fpu_exception_callback )
>>> +         system_state == SYS_STATE_active && has_hvm_container_vcpu(curr) &&
>> This seems too specific a check - I think this ought to be "system_state >=
>> SYS_STATE_active".
> 
> I considered that, but the valid values greater than active are suspend
> and resume, which absolutely shouldn't be running x86_emulate
> codepaths.  I don't think it is safe to assume that any future values
> greater than active will be safe contexts for this.

I can see your point, but my perspective is different: All you really
want to guard against here is de-referencing a non yet properly set
current. And that would be achieved with the range check, not the
equality one.

Jan

      reply	other threads:[~2014-05-14  7:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 14:51 [PATCH RFC] x86/traps: Make the main trap handlers safe for use early during Xen boot Andrew Cooper
2014-05-13 15:26 ` Jan Beulich
2014-05-13 16:13   ` Andrew Cooper
2014-05-14  7:00     ` Jan Beulich [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=537330C70200007800011FEE@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --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).