Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753706AbeAFDJF (ORCPT + 1 other); Fri, 5 Jan 2018 22:09:05 -0500 Received: from mail-it0-f54.google.com ([209.85.214.54]:37321 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753533AbeAFDJD (ORCPT ); Fri, 5 Jan 2018 22:09:03 -0500 X-Google-Smtp-Source: ACJfBoutCmUWCAwR/2QwBlZWGCkZr2PROp3UveG15meGDmXtfmeVjPNn/3J+5LkCJh8trVpOzzOEcTO20NMEIBWVbf4= MIME-Version: 1.0 In-Reply-To: References: <151520099201.32271.4677179499894422956.stgit@dwillia2-desk3.amr.corp.intel.com> <151520102670.32271.8447983009852138826.stgit@dwillia2-desk3.amr.corp.intel.com> From: Linus Torvalds Date: Fri, 5 Jan 2018 19:09:01 -0800 X-Google-Sender-Auth: XKkDCYKl4yFKNZK__TcWbBbJNnQ Message-ID: Subject: Re: [PATCH 06/18] x86, barrier: stop speculation for failed access_ok To: Dan Williams Cc: Linux Kernel Mailing List , linux-arch@vger.kernel.org, Andi Kleen , Arnd Bergmann , Greg Kroah-Hartman , Peter Zijlstra , Network Development , "the arch/x86 maintainers" , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Alan Cox Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, Jan 5, 2018 at 6:52 PM, Linus Torvalds wrote: > > The fact is, we have to stop speculating when access_ok() does *not* > fail - because that's when we'll actually do the access. And it's that > access that needs to be non-speculative. I also suspect we should probably do this entirely differently. Maybe the whole lfence can be part of uaccess_begin() instead (ie currently 'stac()'). That would fit the existing structure better, I think. And it would avoid any confusion about the whole "when to stop speculation". Linus