[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC] x86/traps: Make the main trap handlers safe for use early during Xen boot



>>> On 13.05.14 at 18:13, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 13/05/14 16:26, Jan Beulich wrote:
>>>>> On 13.05.14 at 16:51, <andrew.cooper3@xxxxxxxxxx> 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


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.