Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1269387

Re: [PATCH] xen/x86: Adjust stack pointer in xen_sysexit

From Boris Ostrovsky <boris.ostrovsky@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] xen/x86: Adjust stack pointer in xen_sysexit
Date 2015-11-14 02:30 +0100
Message-ID <quxPb-5G2-1@gated-at.bofh.it> (permalink)
References <quvNn-4oX-5@gated-at.bofh.it> <quvX3-4s4-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 11/13/2015 06:26 PM, Andy Lutomirski wrote:
> On Fri, Nov 13, 2015 at 3:18 PM, Boris Ostrovsky
> <boris.ostrovsky@oracle.com> wrote:
>> After 32-bit syscall rewrite, and specifically after commit 5f310f739b4c
>> ("x86/entry/32: Re-implement SYSENTER using the new C path"), the stack
>> frame that is passed to xen_sysexit is no longer a "standard" one (i.e.
>> it's not pt_regs).
>>
>> We need to adjust it so that subsequent xen_iret can use it.
> I'm wondering if this should be more straightforward:
>
>          movq    %rsp, %rdi
>          call    do_fast_syscall_32
>          testl   %eax, %eax
>          jz      .Lsyscall_32_done
>
>          /* Opportunistic SYSRET */
> sysret32_from_system_call:
>          XEN_DO_SYSRET32
>
> where XEN_DO_SYSRET32 is a simple pv op that, on Xen, jumps to a
> variant of Xen's iret path that knows that the fast path is okay.


This patch is for 32-bit kernel. I actually haven't looked at compat 
code (probably because our tests don't try that), I need to do that too.

As for XEN_DO_SYSRET32 --- we'd presumably need to have a nop for 
baremetal otherwise current paravirt op will use native_usergs_sysret32 
(for compat code). Which means a new pv_op, I think.

-boris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] xen/x86: Adjust stack pointer in xen_sysexit Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2015-11-14 00:20 +0100
  Re: [PATCH] xen/x86: Adjust stack pointer in xen_sysexit Andy Lutomirski <luto@amacapital.net> - 2015-11-14 00:30 +0100
    Re: [PATCH] xen/x86: Adjust stack pointer in xen_sysexit Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2015-11-14 02:30 +0100
      Re: [PATCH] xen/x86: Adjust stack pointer in xen_sysexit Andy Lutomirski <luto@amacapital.net> - 2015-11-15 19:10 +0100

csiph-web