lkml.org 
[lkml]   [2015]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86/entry/64: Remove duplicate syscall table for fast path
On Wed, Dec 9, 2015 at 9:42 PM, Brian Gerst <brgerst@gmail.com> wrote:
> On Wed, Dec 9, 2015 at 6:50 PM, Andy Lutomirski <luto@amacapital.net> wrote:
>> On Wed, Dec 9, 2015 at 1:15 PM, Andy Lutomirski <luto@amacapital.net> wrote:
>>> On Wed, Dec 9, 2015 at 1:08 PM, Brian Gerst <brgerst@gmail.com> wrote:
>>>> Simplified version:
>>>> ENTRY(stub_ptregs_64)
>>>> cmpl $fast_path_return, (%rsp)
>>>
>>> Does that instruction actually work the way you want it to? (Does it
>>> link?) I think you might need to use leaq the way I did in my patch.
>
> It should have been cmpq. leaq isn't necessary, since immediates are
> sign-extended to 64-bit.

Right, I always forget that they're sign-extended and not zero-extended.

I folded that bit in to my queue.

>
>>>> jne 1f
>>>> SAVE_EXTRA_REGS offset=8
>>>> call *%rax
>>>> RESTORE_EXTRA_REGS offset=8
>>>> ret
>>>> 1:
>>>> jmp *%rax
>>>> END(stub_ptregs_64)
>>>
>>> This'll work, I think, but I still think I prefer keeping as much
>>> complexity as possible in the slow path. I could be convinced
>>> otherwise, though -- this variant is reasonably clean.
>>
>> On further reflection, there's at least one functional difference.
>> With my variant, modifying pt_regs from sys_foo/ptregs is safe. In
>> your variant, it's unsafe unless force_iret() is called. I don't know
>> whether we care.
>
> I can go either way at this point. My main concern was getting rid of
> the duplicate table.

Agreed. I'll sleep on it, and maybe someone else has some reason to
prefer one approach over the other.

--Andy



--
Andy Lutomirski
AMA Capital Management, LLC


\
 
 \ /
  Last update: 2015-12-10 07:41    [W:0.054 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site