From owner-dev-commits-src-all@freebsd.org Wed Mar 10 17:38:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9CB1571EC4; Wed, 10 Mar 2021 17:38:04 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DwfRw1xnQz3tLq; Wed, 10 Mar 2021 17:38:03 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ed1-f54.google.com with SMTP id t1so29323963eds.7; Wed, 10 Mar 2021 09:38:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CnpwdviPwppKQIfOgzncJKqkxdD2LWVsoLJ/gwSTBcE=; b=GNlKDDCPtybC1WyTDK2GEJ/sCkz2FKaI7pYcXae8llAdH+WfgwG2IWzxKSVb6SzHeP UduYWvH52TGJKD/9ab+FZQu4jXqY+XgIikmWRqsPDu5IpYehF0etLXaD1uaQphsmDBSX WXCm8o80gXypS09pgDKUC/nZz95nD92fVYXdUxur3y29QgbhVTehWY8cW4LsA3rq7QpZ +Sp2A97mtgpPJl23AJMk5hpdp2ztq+cG3G0LqBWD6H09+phiLnS46oIWbC6160Alh1pN vCipvgHrOTyBBg5ZaJbdqOkjocsi82+1XpuZweJN6s5YPHgLa3YyNtWql7CqTz4E9A5s ZLSA== X-Gm-Message-State: AOAM533y4kQ9UWe4jIivM5DTey6XOe3zO8QwiSm9c83JSWrUBbKRgZMx JVqlduvER6ypb90l/lURwn2iMh1VutfHRA== X-Google-Smtp-Source: ABdhPJxSdrevv8c1wCdmx7FBYvNkS7jbkL9xUk8BgJ+cXPuDMC2XtO+Rxzc5quGjaCuwg1/9LKYDwg== X-Received: by 2002:a50:c00b:: with SMTP id r11mr4591354edb.35.1615397882141; Wed, 10 Mar 2021 09:38:02 -0800 (PST) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com. [209.85.221.47]) by smtp.gmail.com with ESMTPSA id y11sm61211ejd.72.2021.03.10.09.38.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Mar 2021 09:38:02 -0800 (PST) Received: by mail-wr1-f47.google.com with SMTP id w11so24271185wrr.10; Wed, 10 Mar 2021 09:38:01 -0800 (PST) X-Received: by 2002:a05:6000:118c:: with SMTP id g12mr4676388wrx.353.1615397881613; Wed, 10 Mar 2021 09:38:01 -0800 (PST) MIME-Version: 1.0 References: <202103101245.12ACjLn7064810@gitrepo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Wed, 10 Mar 2021 17:37:50 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 953a7d7c61f3 - main - Arch64: Clear VFP state on execve() To: John Baldwin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DwfRw1xnQz3tLq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2021 17:38:04 -0000 On Wed, 10 Mar 2021 at 17:29, John Baldwin wrote: > > On 3/10/21 4:45 AM, Alex Richardson wrote: > > The branch main has been updated by arichardson: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=953a7d7c61f3b2f5351dfe668510ec782ae282e8 > > > > commit 953a7d7c61f3b2f5351dfe668510ec782ae282e8 > > Author: Alex Richardson > > AuthorDate: 2021-03-09 19:11:40 +0000 > > Commit: Alex Richardson > > CommitDate: 2021-03-10 12:44:42 +0000 > > > > Arch64: Clear VFP state on execve() > > > > I noticed that many of the math-related tests were failing on AArch64. > > After a lot of debugging, I noticed that the floating point exception flags > > were not being reset when starting a new process. This change resets the > > VFP inside exec_setregs() to ensure no VFP register state is leaked from > > parent processes to children. > > > > This commit also moves the clearing of fpcr that was added in 65618fdda0f27 > > from fork() to execve() since that makes more sense: fork() can retain > > current register values, but execve() should result in a well-defined > > clean state. > > > > Reviewed By: andrew > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D29060 > > FYI, cpu_thread_copy() should copy the creating thread's state to the new thread, > not reset it. POSIX actually says that new threads inherit the "floating point > environment" from the creating thread for pthread_create(). I have a patch I'm > testing to fix thix for x86. > I believe sv_setregs is only called for execve() not for new threads? cpu_copy_thread() is not affected by this patch and I see it does a bcopy(td0->td_pcb, td->td_pcb, sizeof(struct pcb)); so should be fine? Alex