From nobody Wed Jan 03 13:52:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T4rlY0M9qz55w0t; Wed, 3 Jan 2024 13:53:13 +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 4T4rlX2b0sz4MVD; Wed, 3 Jan 2024 13:53:12 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Authentication-Results: mx1.freebsd.org; none Received: from corp (corp.infotel.ru [195.170.219.3]) by corp.infotel.ru (Postfix) with ESMTP id C12BF482BA3; Wed, 3 Jan 2024 16:53:04 +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 Jyf2hSLkGXeR; Wed, 3 Jan 2024 16:53:03 +0300 (MSK) Received: from mail.cicgroup.ru (unknown [195.170.219.74]) by corp.infotel.ru (Postfix) with ESMTP id C3462482BA2; Wed, 3 Jan 2024 16:53:03 +0300 (MSK) Received: from mail.cicgroup.ru (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTP id ED91B42211F; Wed, 3 Jan 2024 16:53:01 +0300 (MSK) 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 YKZDxuYlLw7L; Wed, 3 Jan 2024 16:52:55 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTPA id D23AB42211C; Wed, 3 Jan 2024 16:52:54 +0300 (MSK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Date: Wed, 03 Jan 2024 16:52:54 +0300 From: Vladimir Kondratyev To: John Baldwin Cc: Vladimir Kondratyev , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, owner-src-committers@freebsd.org Subject: Re: git: b4efc6277634 - main - LinuxKPI: Do not use explicit context in FPU sections on powerpc64 In-Reply-To: <886e1a57-2e2e-4869-ae8d-0427ef771d41@FreeBSD.org> References: <202312241320.3BODK2DA076069@gitrepo.freebsd.org> <886e1a57-2e2e-4869-ae8d-0427ef771d41@FreeBSD.org> Message-ID: X-Sender: vladimir@kondratyev.su User-Agent: Roundcube Webmail/1.3.5 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4T4rlX2b0sz4MVD X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8299, ipnet:195.170.192.0/19, country:RU] On 2024-01-02 22:17, John Baldwin wrote: > On 12/30/23 7:14 PM, Vladimir Kondratyev wrote: >> On 27.12.2023 20:05, John Baldwin wrote: >>> On 12/24/23 5:20 AM, Vladimir Kondratyev wrote: >>>> The branch main has been updated by wulf: >>>>=20 >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=3Db4efc62776344a9aaada5a0866= e453e528a0e977 >>>>=20 >>>> commit b4efc62776344a9aaada5a0866e453e528a0e977 >>>> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Vladimir Kondratyev >>>> AuthorDate: 2023-12-24 12:48:06 +0000 >>>> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Vladimir Kondratyev >>>> CommitDate: 2023-12-24 12:48:06 +0000 >>>>=20 >>>> =C2=A0=C2=A0=C2=A0=C2=A0 LinuxKPI: Do not use explicit context in F= PU sections on >>>> powerpc64 >>>> =C2=A0=C2=A0=C2=A0=C2=A0 It is not supported yet. >>>> =C2=A0=C2=A0=C2=A0=C2=A0 Sponsored by:=C2=A0=C2=A0 Serenity Cyber S= ecurity, LLC >>>> =C2=A0=C2=A0=C2=A0=C2=A0 Fixes:=C2=A0 5a3bd281672b ("LinuxKPI: Add = explicit software context=20 >>>> to >>>> FPU sections") >>>> =C2=A0=C2=A0=C2=A0=C2=A0 MFC after:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1= week >>>> --- >>>> =C2=A0 sys/compat/linuxkpi/common/include/linux/compat.h | 5 ----- >>>> =C2=A0 sys/compat/linuxkpi/common/src/linux_current.c=C2=A0=C2=A0=C2= =A0 | 9 ++++++--- >>>> =C2=A0 sys/compat/linuxkpi/common/src/linux_fpu.c=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 | 3 ++- >>>> =C2=A0 3 files changed, 8 insertions(+), 9 deletions(-) >>>=20 >>> Do you need explicit contexts at all? >>=20 >> Original version of https://reviews.freebsd.org/D42822 did not use >> explicit contexts. >>=20 >> =C2=A0 That is, can you not just >>> use FPU_KERN_NOCTX all the time?=C2=A0 Most code in the tree now uses >>> FPU_KERN_NOCTX now (all the crypto drivers for example), and I've >>> been thinking about removing support for the !FPU_KERN_NOCTX case. >>> Is there a reason drm-kmod can't use FPU_KERN_NOCTX?=C2=A0 Do you rea= lly >>> need to save FPU registers in one block of code wrapped by fpu_kern_* >>> and then use those register values in a future section wrapped by >>> fpu_kern_*? >>>=20 >>=20 >> I can revert current code end use previous version. Just give me some >> time. >> I will be AFK till the end of january. >=20 > Hmm, well the review for that answers my question which is that > there is GPU driver code that calls malloc() while in an FPU > section. So the answer to my original question is, no, you can't > just use FPU_KERN_NOCTX. Or if you did you would need to patch > the driver code instead to narrow the FPU context usage so it > wasn't enabled when malloc() is called. I don't know how feasible > it would be to fix the drivers to narrow the FPU sections, but I > think you would have to do that if you wanted to go back to always > using FPU_KERN_NOCTX. FPU_KERN_NOCTX is what LKPI uses for years for FPU sections. Original version of revision changes LKPI kmalloc() to automatically=20 detect and than temporarily exit from FPU section for FreeBSD malloc()=20 execution. --=20 WBR Vladimir Kondratyev