Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2962502pxb; Tue, 13 Apr 2021 14:56:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3XKCqSYgeKbw+VzrqBD3ax/RvoYe60YRT/xC22sTg/V1tf50HIkKAZa4xoLon68yKDg7v X-Received: by 2002:a05:6402:4395:: with SMTP id o21mr36492957edc.22.1618350965336; Tue, 13 Apr 2021 14:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618350965; cv=none; d=google.com; s=arc-20160816; b=XDU6P5GGCQVK/tDAzPcQ6VK8dSCR2ymJH0+K0ETpuy7qg4p6RqSJB9gyqmWsOB+nJi SpHbLTSD61hbIr4cr4iftJWKCuAMKV1C5SqzciZVHhvUBsnyMGpl5tR5u+M9dzaR4U21 eVyWo3Cue/HWAuQo6QHNuCseWqFIYWWZ7glPLbjZ8vAYWgLkSLHSR7eLabrQ8Cur0w7s QNAbh3AR6bc+fVmokyYdPxqU5xiHxnHqFn1K/5ZSR1PwErMunYgd8Os09SaFG5z9n/YU GViIOn9zoCaCG1kMxP7PEzy6j8zBDR4rMdf9oHhRtb9w+l8ehcHRhrygiFu08EsnP8Vs 5UGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OZIb1ppB5Vw0K0ah9GL/sCPeLYwov/sRo9mNSJgD/ts=; b=RT2B9aWSxtEXfvxYNdNGBR2xu0PDFdUfdUsLB52ENj4RXr4HInESsiJ6RskwUuff5d eiimm9UZOedicyjEL7/Lwf+e8jgV5okVl0xHkzAp5FUkFUGxwAJ7NGLf/dq1AK7aQmy0 LURGj8lV7w1XB+GYiP4YiGmrCwvSJLEfsQGZRg+2EctFoqjSpdH8RDrSoEL3yeHg6uV6 E/WQEl+8T2XyanKpmRkBI5oU8SkTGLyAoFzBHIdmcgpJl1Tc8rhR1TOK3H8fcBsRNPQA bq9Mcd3VDcJUR0lspDfLS3gi9tE+ygUGJC//e3oBNuGW55m15uwzaoIDa3p9STPMmXfb ESYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r2rebxpM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si10400751edd.490.2021.04.13.14.55.41; Tue, 13 Apr 2021 14:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r2rebxpM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346975AbhDMQ6l (ORCPT + 99 others); Tue, 13 Apr 2021 12:58:41 -0400 Received: from mail-yb1-f182.google.com ([209.85.219.182]:43545 "EHLO mail-yb1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346974AbhDMQ6k (ORCPT ); Tue, 13 Apr 2021 12:58:40 -0400 Received: by mail-yb1-f182.google.com with SMTP id o10so18870952ybb.10 for ; Tue, 13 Apr 2021 09:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OZIb1ppB5Vw0K0ah9GL/sCPeLYwov/sRo9mNSJgD/ts=; b=r2rebxpMV26LN+easkWpoOosTIX01D42v9Qy88wQexpW7daWyeeyE7RVOn3FCGpjPc IxfwEQdGCQ1xYo9hsBVXCk//NafP1z9EUTJUOzePILV7q5O1U1qd/oVriCCX3qkbCgUH Z3T7JWcXdQUOxaYxQKjfbUDAEiTt4zc5UfbShq1dZZVdkbcdYWG6IZVZiCZka2BlgAuc cUEfGtODzJMuDzYUa2LblWkb4g84TOAGMmStIuI5EsRBX9ETYQ528gmq5ywuPxd7kBYc NyklAgCb5ii1mnG6YySdYNloCGk5eRGP+VC+aC2qarfbeVCNlNqXiTKofUfrbMGTZISt c4JQ== 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=OZIb1ppB5Vw0K0ah9GL/sCPeLYwov/sRo9mNSJgD/ts=; b=feyKCC+HaV35yLbXJPpsYSajLlmK8ErYcbaSp6/O+kgqwCSUtnVUkDaT8zpuYiXPJP 65bvNCX8XpZSaJ4OkKXsNsEMofjjLOs3BFqNovTw4C9PAATwYMIz+ipGvK8PbLDiK8eD d+UKxJcKvnVmKS1fdTNLyGsp8CtjKHtsBwLpg89ySFThHnwqz5+p0MkvhgKm4GCAtZrY KWmfqWutfem0mh4XMhTanjnnq2eJy7DCWTb90Ln5TqvEyVNMs7nCcsayH+B3KRYQ1tl2 MN8Rwtn/TVLi40RUiO3VJkqG3R0ZaSSw0h4UbHifNbxbRCET3FezD5u8eHzN125p6IJ9 EuOA== X-Gm-Message-State: AOAM530kHsfEIrDkPch5Quj59t//sIPzrFpgddYprAy1wmTBErRsXzWw 7m8R01N0+/mk0HiV8RrtKpwCiT02VkB7o8cOHIk+JQ== X-Received: by 2002:a25:7650:: with SMTP id r77mr18961159ybc.446.1618333040102; Tue, 13 Apr 2021 09:57:20 -0700 (PDT) MIME-Version: 1.0 References: <20210413162240.3131033-1-eric.dumazet@gmail.com> <20210413162240.3131033-4-eric.dumazet@gmail.com> <567941475.72456.1618332885342.JavaMail.zimbra@efficios.com> In-Reply-To: <567941475.72456.1618332885342.JavaMail.zimbra@efficios.com> From: Eric Dumazet Date: Tue, 13 Apr 2021 18:57:08 +0200 Message-ID: Subject: Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs() To: Mathieu Desnoyers Cc: Eric Dumazet , David Laight , Ingo Molnar , Peter Zijlstra , paulmck , Boqun Feng , Arjun Roy , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 13, 2021 at 6:54 PM Mathieu Desnoyers wrote: > > ----- On Apr 13, 2021, at 12:22 PM, Eric Dumazet eric.dumazet@gmail.com wrote: > > > From: Eric Dumazet > > > > Commit ec9c82e03a74 ("rseq: uapi: Declare rseq_cs field as union, > > update includes") added regressions for our servers. > > > > Using copy_from_user() and clear_user() for 64bit values > > is suboptimal. > > > > We can use faster put_user() and get_user(). > > > > 32bit arches can be changed to use the ptr32 field, > > since the padding field must always be zero. > > > > v2: added ideas from Peter and Mathieu about making this > > generic, since my initial patch was only dealing with > > 64bit arches. > > Ah, now I remember the reason why reading and clearing the entire 64-bit > is important: it's because we don't want to allow user-space processes to > use this change in behavior to figure out whether they are running on a > 32-bit or in a 32-bit compat mode on a 64-bit kernel. > > So although I'm fine with making 64-bit kernels faster, we'll want to keep > updating the entire 64-bit ptr field on 32-bit kernels as well. > > Thanks, > So... back to V1 then ?