Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Aug 2018 16:31:43 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        Gleb Popov <arrowd@freebsd.org>
Cc:        Lars Schotte <lars@gustik.eu>, FreeBSD Ports <freebsd-ports@freebsd.org>,  FreeBSD current <freebsd-current@freebsd.org>
Subject:   Re: OpenVPN produces garbage on TAP on -current
Message-ID:  <7121076.54.1533565903355@localhost>
In-Reply-To: <CALH631n5q97RCB2p%2B1qV=RRoyW3aBQ_P3Pi6nJcxbPJuBwsyEQ@mail.gmail.com>
References:  <20180805225157.7165668d@romy.j20.helspy.pw> <CALH631n5q97RCB2p%2B1qV=RRoyW3aBQ_P3Pi6nJcxbPJuBwsyEQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I'm running a very recent 12-current too and latest openvpn from pkgs. No problems.
I did not change anything in the defaults for the SSL-library it uses.

Ronald.
 
Van: Gleb Popov <arrowd@freebsd.org>
Datum: maandag, 6 augustus 2018 10:30
Aan: Lars Schotte <lars@gustik.eu>
CC: FreeBSD Ports <freebsd-ports@freebsd.org>, FreeBSD current <freebsd-current@freebsd.org>
Onderwerp: Re: OpenVPN produces garbage on TAP on -current
> 
> On Sun, Aug 5, 2018 at 11:51 PM, Lars Schotte <lars@gustik.eu> wrote:
> 
> > Here a bit of paste:
> > https://paste.fedoraproject.org/paste/Hn4M2JqZ~5xccLWOVD1xUw/raw
> > just to illustrate how it does not work.
> >
> > TAP device works good inside OS (FreeBSD current) however, everything
> > that comes over OpenVPN is just garbage.
> >
> 
> I'm using CURRENT from June 10 and tap device works fine for me with
> OpenVPN 2.4.6_1
> 
> 
> > --
> >  Lars Schotte
> >  Mudro?ova 13
> > 92101 Pie??any
> > _______________________________________________
> > freebsd-ports@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-ports
> > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"
> >
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
> 
> 
> 
From owner-freebsd-current@freebsd.org  Mon Aug  6 15:27:42 2018
Return-Path: <owner-freebsd-current@freebsd.org>
Delivered-To: freebsd-current@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD756105C20D
 for <freebsd-current@mailman.ysv.freebsd.org>;
 Mon,  6 Aug 2018 15:27:42 +0000 (UTC)
 (envelope-from vladimir@kondratyev.su)
Received: from corp.infotel.ru (corp.infotel.ru [195.170.219.3])
 by mx1.freebsd.org (Postfix) with ESMTP id 14CD77C437
 for <freebsd-current@freebsd.org>; Mon,  6 Aug 2018 15:27:41 +0000 (UTC)
 (envelope-from vladimir@kondratyev.su)
Received: from corp (corp.infotel.ru [195.170.219.3])
 by corp.infotel.ru (Postfix) with ESMTP id D90A910A98;
 Mon,  6 Aug 2018 18:27:38 +0300 (MSK)
X-Virus-Scanned: amavisd-new at corp.infotel.ru
Received: from corp.infotel.ru ([195.170.219.3])
 by corp (corp.infotel.ru [195.170.219.3]) (amavisd-new, port 10024)
 with ESMTP id b-9EpCnhVEPL; Mon,  6 Aug 2018 18:27:35 +0300 (MSK)
Received: from mail.cicgroup.ru (unknown [195.170.219.74])
 by corp.infotel.ru (Postfix) with ESMTP id F2CD710A91;
 Mon,  6 Aug 2018 18:27:34 +0300 (MSK)
Received: from mail.cicgroup.ru (localhost [127.0.0.1])
 by mail.cicgroup.ru (Postfix) with ESMTP id 9D8C1422123;
 Mon,  6 Aug 2018 18:27:33 +0300 (MSK)
X-Virus-Scanned: amavisd-new at cicgroup.ru
Received: from mail.cicgroup.ru ([127.0.0.1])
 by mail.cicgroup.ru (mail.cicgroup.ru [127.0.0.1]) (amavisd-new, port 10024)
 with SMTP id O1b3URaHx1do; Mon,  6 Aug 2018 18:27:25 +0300 (MSK)
Received: from [192.168.0.30] (gateway [10.0.2.2])
 by mail.cicgroup.ru (Postfix) with ESMTPA id CD28B422122;
 Mon,  6 Aug 2018 18:27:25 +0300 (MSK)
From: Vladimir Kondratyev <vladimir@kondratyev.su>
Subject: Linux process causes kernel panic
To: Konstantin Belousov <kostikbel@gmail.com>
Cc: Johannes Lundberg <johalun0@gmail.com>,
 freebsd-current <freebsd-current@freebsd.org>
References: <CAECmPwvAaSTimVyV1n+9PNKd_0JP6kLXnXyihoWEB3FHRHqa9w@mail.gmail.com>
 <20180803204250.GE6049@kib.kiev.ua>
 <CAECmPwt0kifzPFpgyYWJj7UvnUn2CGjUfQz2tuS5G0BYttTkZQ@mail.gmail.com>
 <20180804142235.GM6049@kib.kiev.ua>
 <CAECmPwu9eqH2UJo0LMNDj7nPXu7S1+9OWnd1swAabZLXcxo1Dg@mail.gmail.com>
Openpgp: preference=signencrypt
Autocrypt: addr=vladimir@kondratyev.su; prefer-encrypt=mutual; keydata=
 xsBNBFkI9Y8BCAC44UZYE8ZswFr/LHNHutuCmrbfP0j6jYl6zkW9VeM3cXVDjDsL3h9JhEFH
 zF9Or0muwHjspNuVdP2ot9vH8FCGAGEYS/GrzEEKxj4yoxAZxWnGUwzFiaf8fCtlrq5D9vOd
 /HSm6tb5YbcC/t/46hSwyPZ4i07rtsxmeozrKNx9H2gkcY0/AfmZ+UxY90/cj/F3aNk4wYLH
 gC95N99jaZvwPFX8wW5k++YaThXo8TNGQaxmC28cFFPdc1qICYdzYxS7kbTlGKp37lWmV9Z6
 FursbfIkJZ7Rzw7NjGGijj4XjKif91ZwQNz/BfO58xrookQCibVCJ3JKcZo4NZ7rWTWlABEB
 AAHNLFZsYWRpbWlyIEtvbmRyYXR5ZXYgPHZsYWRpbWlyQGtvbmRyYXR5ZXYuc3U+wsCUBBMB
 CgA+FiEEkwnJqomIwH/siVElg2u+IHApX3UFAlkJEuQCGwMFCQWjmoAFCwkIBwMFFQoJCAsF
 FgMC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l2i5nl0iaWNNMkuh6is+jLJZ9W5CfEPcp+W2Vekd
 UTm4zN0+uaR7br3Lr3GbBJPlLHrH1haK6nJmyfVzf1MbK8wqIHiH1wWmIxC96QHKCEzRDjdf
 IVYGqb/YykLjBw==
Message-ID: <5856e8a6-84a4-6fb4-c2d4-ecd56c5c5a94@kondratyev.su>
Date: Mon, 6 Aug 2018 18:24:43 +0300
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
 Thunderbird/52.8.0
MIME-Version: 1.0
In-Reply-To: <CAECmPwu9eqH2UJo0LMNDj7nPXu7S1+9OWnd1swAabZLXcxo1Dg@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current/>;
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Aug 2018 15:27:43 -0000

I've got similar panic right after skype start

Disabling of SMAP via loader tunable workarounded the panic for me.

Applying of the patch make skype eating 100%CPU in unkillable state.

tail of ktrace dump

=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 CALL=C2=A0 linux_gettid
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 RET=C2=A0=C2=A0 linux_gettid 101123/0=
x18b03
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 CALL=C2=A0
linux_sys_futex(0x3301edc,0x84,0x1,0x7fffffff,0x3301ec0,0x2)
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 RET=C2=A0=C2=A0 linux_sys_futex 0
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 CALL=C2=A0 linux_sys_futex(0x33b0fac,=
0x80,0x1,0,0x33b0f90,0x1)
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 CALL=C2=A0 linux_sys_futex(0x3301edc,=
0x80,0x1,0,0x3301ec0,0x1)
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 RET=C2=A0=C2=A0 linux_sys_futex -1 er=
rno -11 Resource temporarily
unavailable
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 CALL=C2=A0
linux_sys_futex(0x3301ec0,0x81,0x1,0x3301ec0,0x33b02c8,0xffffc168)
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 RET=C2=A0=C2=A0 linux_sys_futex 0
=C2=A0 1238 skype=C2=A0=C2=A0=C2=A0 CALL=C2=A0
linux_sys_futex(0x33b0fac,0x85,0x1,0x1,0x33b0fa8,0x4000001)
-- here it stops --


ddb also shows that process is looping somewhere inside linux_sys_futex()

KDB: enter: manual escape to
debugger=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C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2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0

int0x80_syscall_common() at int0x80_syscall_common+0x9c/frame 0x4000001



On 06.08.2018 15:03, Johannes Lundberg wrote:
> On Sat, Aug 4, 2018 at 3:22 PM Konstantin Belousov <kostikbel@gmail.com=
>
> wrote:
>
>> On Sat, Aug 04, 2018 at 01:12:17PM +0100, Johannes Lundberg wrote:
>>> No panic over night with that tunable so it seems you're on the right
>>> track.
>> Please try this, on top of r337316.
>>
> Been running boinc client now with 4 linux processes at 100% cpu load w=
ith
> this patch for a while. So far so good.
>
>
>> diff --git a/sys/amd64/linux/linux_machdep.c
>> b/sys/amd64/linux/linux_machdep.c
>> index 6c5b014853f..434ea0eac07 100644
>> --- a/sys/amd64/linux/linux_machdep.c
>> +++ b/sys/amd64/linux/linux_machdep.c
>> @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$");
>>  #include <vm/vm_kern.h>
>>  #include <vm/vm_map.h>
>>
>> +#include <x86/ifunc.h>
>> +#include <x86/sysarch.h>
>> +
>>  #include <amd64/linux/linux.h>
>>  #include <amd64/linux/linux_proto.h>
>>  #include <compat/linux/linux_emul.h>
>> @@ -88,8 +91,6 @@ __FBSDID("$FreeBSD$");
>>  #include <compat/linux/linux_signal.h>
>>  #include <compat/linux/linux_util.h>
>>
>> -#include <x86/include/sysarch.h>
>> -
>>  int
>>  linux_execve(struct thread *td, struct linux_execve_args *args)
>>  {
>> @@ -276,3 +277,48 @@ linux_set_cloned_tls(struct thread *td, void *des=
c)
>>
>>         return (0);
>>  }
>> +
>> +int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_xchgl_smap : futex_xchgl_nosmap);
>> +}
>> +
>> +int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_addl_smap : futex_addl_nosmap);
>> +}
>> +
>> +int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_orl_smap : futex_orl_nosmap);
>> +}
>> +
>> +int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_andl_smap : futex_andl_nosmap);
>> +}
>> +
>> +int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_xorl_smap : futex_xorl_nosmap);
>> +}
>> diff --git a/sys/amd64/linux/linux_support.s
>> b/sys/amd64/linux/linux_support.s
>> index a9f02160be2..391f76414f2 100644
>> --- a/sys/amd64/linux/linux_support.s
>> +++ b/sys/amd64/linux/linux_support.s
>> @@ -38,7 +38,7 @@ futex_fault:
>>         movl    $-EFAULT,%eax
>>         ret
>>
>> -ENTRY(futex_xchgl)
>> +ENTRY(futex_xchgl_nosmap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>> @@ -49,25 +49,58 @@ ENTRY(futex_xchgl)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_xchgl)
>> +END(futex_xchgl_nosmap)
>>
>> -ENTRY(futex_addl)
>> +ENTRY(futex_xchgl_smap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>>         cmpq    %rax,%rsi
>>         ja      futex_fault
>> +       stac
>> +       xchgl   %edi,(%rsi)
>> +       clac
>> +       movl    %edi,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_xchgl_smap)
>> +
>> +ENTRY(futex_addl_nosmap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +#ifdef SMP
>> +       lock
>> +#endif
>> +       xaddl   %edi,(%rsi)
>> +       movl    %edi,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_addl_nosmap)
>> +
>> +ENTRY(futex_addl_smap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +       stac
>>  #ifdef SMP
>>         lock
>>  #endif
>>         xaddl   %edi,(%rsi)
>> +       clac
>>         movl    %edi,(%rdx)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_addl)
>> +END(futex_addl_smap)
>>
>> -ENTRY(futex_orl)
>> +ENTRY(futex_orl_nosmap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>> @@ -85,9 +118,31 @@ ENTRY(futex_orl)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_orl)
>> +END(futex_orl_nosmap)
>>
>> -ENTRY(futex_andl)
>> +ENTRY(futex_orl_smap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +       movl    (%rsi),%eax
>> +1:     movl    %eax,%ecx
>> +       orl     %edi,%ecx
>> +       stac
>> +#ifdef SMP
>> +       lock
>> +#endif
>> +       cmpxchgl %ecx,(%rsi)
>> +       clac
>> +       jnz     1b
>> +       movl    %eax,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_orl_smap)
>> +
>> +ENTRY(futex_andl_nosmap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>> @@ -105,9 +160,51 @@ ENTRY(futex_andl)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_andl)
>> +END(futex_andl_nosmap)
>> +
>> +ENTRY(futex_andl_smap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +       movl    (%rsi),%eax
>> +1:     movl    %eax,%ecx
>> +       andl    %edi,%ecx
>> +       stac
>> +#ifdef SMP
>> +       lock
>> +#endif
>> +       cmpxchgl %ecx,(%rsi)
>> +       clac
>> +       jnz     1b
>> +       movl    %eax,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_andl_smap)
>> +
>> +ENTRY(futex_xorl_nosmap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +       movl    (%rsi),%eax
>> +1:     movl    %eax,%ecx
>> +       xorl    %edi,%ecx
>> +#ifdef SMP
>> +       lock
>> +#endif
>> +       cmpxchgl %ecx,(%rsi)
>> +       jnz     1b
>> +       movl    %eax,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_xorl_nosmap)
>>
>> -ENTRY(futex_xorl)
>> +ENTRY(futex_xorl_smap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>> @@ -116,13 +213,15 @@ ENTRY(futex_xorl)
>>         movl    (%rsi),%eax
>>  1:     movl    %eax,%ecx
>>         xorl    %edi,%ecx
>> +       stac
>>  #ifdef SMP
>>         lock
>>  #endif
>>         cmpxchgl %ecx,(%rsi)
>> +       clac
>>         jnz     1b
>>         movl    %eax,(%rdx)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_xorl)
>> +END(futex_xorl_smap)
>> diff --git a/sys/amd64/linux32/linux32_machdep.c
>> b/sys/amd64/linux32/linux32_machdep.c
>> index ce06be57e9f..61ecc87dc77 100644
>> --- a/sys/amd64/linux32/linux32_machdep.c
>> +++ b/sys/amd64/linux32/linux32_machdep.c
>> @@ -58,10 +58,12 @@ __FBSDID("$FreeBSD$");
>>  #include <sys/wait.h>
>>
>>  #include <machine/frame.h>
>> +#include <machine/md_var.h>
>>  #include <machine/pcb.h>
>>  #include <machine/psl.h>
>>  #include <machine/segments.h>
>>  #include <machine/specialreg.h>
>> +#include <x86/ifunc.h>
>>
>>  #include <vm/pmap.h>
>>  #include <vm/vm.h>
>> @@ -822,3 +824,48 @@ linux_set_thread_area(struct thread *td,
>>
>>         return (0);
>>  }
>> +
>> +int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_xchgl_smap : futex_xchgl_nosmap);
>> +}
>> +
>> +int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_addl_smap : futex_addl_nosmap);
>> +}
>> +
>> +int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_orl_smap : futex_orl_nosmap);
>> +}
>> +
>> +int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_andl_smap : futex_andl_nosmap);
>> +}
>> +
>> +int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
>> +int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval);
>> +DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static)
>> +{
>> +
>> +       return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) !=3D 0 ?
>> +           futex_xorl_smap : futex_xorl_nosmap);
>> +}
>> diff --git a/sys/amd64/linux32/linux32_support.s
>> b/sys/amd64/linux32/linux32_support.s
>> index bba0d8d5e71..981bba9f582 100644
>> --- a/sys/amd64/linux32/linux32_support.s
>> +++ b/sys/amd64/linux32/linux32_support.s
>> @@ -38,7 +38,7 @@ futex_fault:
>>         movl    $-EFAULT,%eax
>>         ret
>>
>> -ENTRY(futex_xchgl)
>> +ENTRY(futex_xchgl_nosmap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>> @@ -49,25 +49,58 @@ ENTRY(futex_xchgl)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_xchgl)
>> +END(futex_xchgl_nosmap)
>>
>> -ENTRY(futex_addl)
>> +ENTRY(futex_xchgl_smap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>>         cmpq    %rax,%rsi
>>         ja      futex_fault
>> +       stac
>> +       xchgl   %edi,(%rsi)
>> +       clac
>> +       movl    %edi,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_xchgl_smap)
>> +
>> +ENTRY(futex_addl_nosmap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +#ifdef SMP
>> +       lock
>> +#endif
>> +       xaddl   %edi,(%rsi)
>> +       movl    %edi,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_addl_nosmap)
>> +
>> +ENTRY(futex_addl_smap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +       stac
>>  #ifdef SMP
>>         lock
>>  #endif
>>         xaddl   %edi,(%rsi)
>> +       clac
>>         movl    %edi,(%rdx)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_addl)
>> +END(futex_addl_smap)
>>
>> -ENTRY(futex_orl)
>> +ENTRY(futex_orl_nosmap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>> @@ -85,9 +118,31 @@ ENTRY(futex_orl)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_orl)
>> +END(futex_orl_nosmap)
>>
>> -ENTRY(futex_andl)
>> +ENTRY(futex_orl_smap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +       movl    (%rsi),%eax
>> +1:     movl    %eax,%ecx
>> +       orl     %edi,%ecx
>> +       stac
>> +#ifdef SMP
>> +       lock
>> +#endif
>> +       cmpxchgl %ecx,(%rsi)
>> +       clac
>> +       jnz     1b
>> +       movl    %eax,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_orl_smap)
>> +
>> +ENTRY(futex_andl_nosmap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>> @@ -105,9 +160,51 @@ ENTRY(futex_andl)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_andl)
>> +END(futex_andl_nosmap)
>> +
>> +ENTRY(futex_andl_smap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +       movl    (%rsi),%eax
>> +1:     movl    %eax,%ecx
>> +       andl    %edi,%ecx
>> +       stac
>> +#ifdef SMP
>> +       lock
>> +#endif
>> +       cmpxchgl %ecx,(%rsi)
>> +       clac
>> +       jnz     1b
>> +       movl    %eax,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_andl_smap)
>> +
>> +ENTRY(futex_xorl_nosmap)
>> +       movq    PCPU(CURPCB),%r8
>> +       movq    $futex_fault,PCB_ONFAULT(%r8)
>> +       movq    $VM_MAXUSER_ADDRESS-4,%rax
>> +       cmpq    %rax,%rsi
>> +       ja      futex_fault
>> +       movl    (%rsi),%eax
>> +1:     movl    %eax,%ecx
>> +       xorl    %edi,%ecx
>> +#ifdef SMP
>> +       lock
>> +#endif
>> +       cmpxchgl %ecx,(%rsi)
>> +       jnz     1b
>> +       movl    %eax,(%rdx)
>> +       xorl    %eax,%eax
>> +       movq    %rax,PCB_ONFAULT(%r8)
>> +       ret
>> +END(futex_xorl_nosmap)
>>
>> -ENTRY(futex_xorl)
>> +ENTRY(futex_xorl_smap)
>>         movq    PCPU(CURPCB),%r8
>>         movq    $futex_fault,PCB_ONFAULT(%r8)
>>         movq    $VM_MAXUSER_ADDRESS-4,%rax
>> @@ -116,13 +213,15 @@ ENTRY(futex_xorl)
>>         movl    (%rsi),%eax
>>  1:     movl    %eax,%ecx
>>         xorl    %edi,%ecx
>> +       stac
>>  #ifdef SMP
>>         lock
>>  #endif
>>         cmpxchgl %ecx,(%rsi)
>> +       clac
>>         jnz     1b
>>         movl    %eax,(%rdx)
>>         xorl    %eax,%eax
>>         movq    %rax,PCB_ONFAULT(%r8)
>>         ret
>> -END(futex_xorl)
>> +END(futex_xorl_smap)
>>
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.o=
rg"





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7121076.54.1533565903355>