From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52EA7C433E1 for ; Thu, 4 Jun 2020 14:59:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37D0D20823 for ; Thu, 4 Jun 2020 14:59:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729168AbgFDO7c (ORCPT ); Thu, 4 Jun 2020 10:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729082AbgFDO7c (ORCPT ); Thu, 4 Jun 2020 10:59:32 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B61B6C08C5C0; Thu, 4 Jun 2020 07:59:31 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jgrL2-0033fO-LT; Thu, 04 Jun 2020 14:59:24 +0000 Date: Thu, 4 Jun 2020 15:59:24 +0100 From: Al Viro To: Jason Wang Cc: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH RFC] uaccess: user_access_begin_after_access_ok() Message-ID: <20200604145924.GF23230@ZenIV.linux.org.uk> References: <20200602084257.134555-1-mst@redhat.com> <20200603014815.GR23230@ZenIV.linux.org.uk> <20200603011810-mutt-send-email-mst@kernel.org> <20200603165205.GU23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Jun 04, 2020 at 02:10:27PM +0800, Jason Wang wrote: > > > get_user(flags, desc->flags) > > > smp_rmb() > > > if (flags & VALID) > > > copy_from_user(&adesc, desc, sizeof adesc); > > > > > > this would be a good candidate I think. > > Perhaps, once we get stac/clac out of raw_copy_from_user() (coming cycle, > > probably). BTW, how large is the structure and how is it aligned? > > > Each descriptor is 16 bytes, and 16 bytes aligned. Won't it be cheaper to grap the entire thing unconditionally? And what does that rmb order, while we are at it - won't all coherency work in terms of entire cachelines anyway? Confused...