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

Re: [Xen-devel] [PATCH v2 1/2] x86/entry/32: Introduce and use X86_BUG_ESPFIX instead of paravirt_enabled



On Mon, Feb 29, 2016 at 03:50:19PM -0800, Andy Lutomirski wrote:
> x86_64 has very clean espfix handling on paravirt: espfix64 is set
> up in native_iret, so paravirt systems that override iret bypass
> espfix64 automatically.  This is robust and straightforward.

This I think I get as all the ESP hackery is on native_iret():

arch/x86/entry/entry_64.S
ENTRY(native_iret)                                                              
        /*                                                                      
         * Are we returning to a stack segment from the LDT?  Note: in          
         * 64-bit mode SS:RSP on the exception stack is always valid.           
         */                                                                     
#ifdef CONFIG_X86_ESPFIX64                                                      
        testb   $4, (SS-RIP)(%rsp)                                              
        jnz     native_irq_return_ldt                                           
#endif 

native_iret is simply expected to not be used on paravirt systems.

> x86_32 is messier.  espfix is set up before the IRET paravirt patch
> point, so it can't be directly conditionalized on whether we use
> native_iret.

This I don't quite get.

I see on paravirt.h:                                                            
  
                                                                                
#define INTERRUPT_RETURN                                                \       
        PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_iret), CLBR_NONE,       \       
                  jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_iret))  

The rest is unclear, in particular how this would be late.

  Luis

_______________________________________________
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®.