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

[Xen-devel] RE: [PATCH] Fixing stack alignment in x86-64 Xen


  • To: "Andi Kleen" <ak@xxxxxx>
  • From: "Nakajima, Jun" <jun.nakajima@xxxxxxxxx>
  • Date: Wed, 18 May 2005 08:57:08 -0700
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 18 May 2005 15:56:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcVbvuvqSGTKRtLMQ2up1gqWjfIFcQAAOAxA
  • Thread-topic: [PATCH] Fixing stack alignment in x86-64 Xen

Andi Kleen wrote:
> "Nakajima, Jun" <jun.nakajima@xxxxxxxxx> writes:
>> 
>> The recent optimization reset_stack_and_jump() code needs to know the
>> exact address of the interrupt stack (because it resets %rsp), and
>> calculates it based on the value that Xen set (i.e. 8-byte boundary).
>> Since the processor forces the rsp0 on a 16-byte boundary (i.e.
>> moves it down by 8 bytes), Xen sees a wrong stack when returning
>> from the interrupt.
> 
> I would rather fix reset_stack_and_jump then to do the necessary
> rounding or better look at the original RSP the processor stored into
> the stack frame. Otherwise the 16 byte alignment will probably bite
> you later again.
> 
> -Andi

I think the right thing is to get rsp0 in TSS on a 16-byte boundary by
getting get_stack_bottom() and get_cpu_user_regs() see the correct
stack. That will fix the reset_stack_and_jump() as well. It's basically
what my patch does. 

Jun

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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