Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp467245rwr; Wed, 3 May 2023 01:03:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5hb0AO0qDjkMJhrn3KKl35PK7RGdcA4uEcRADq92zZ20M2p7e2XiYJsDVYSIU6vDlAaNFf X-Received: by 2002:a17:90a:bf93:b0:24e:2248:31c with SMTP id d19-20020a17090abf9300b0024e2248031cmr5423943pjs.22.1683101011409; Wed, 03 May 2023 01:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683101011; cv=none; d=google.com; s=arc-20160816; b=hOII9I7HXTpopV8NXGcSAwKWq+CdKIgH6cHT3bU87W9hVkv1VIRaW0SFGFVNlcBUpi EupYN2BEvE8KkWMeM6Xc8f8F+VrSJGbX16S7k9ysjQXw0RO4Y2WCPZ6A+cDX33LyUSP2 7KQ9JAJyXuIQz8vnGCjzyduALoVygC2qRb701U70Amv5fIk4/sTxFxxIqBtXTsAkiClt 2wQE+dZsocMC2+wPnstOcnDg5ROmKE99Ka/OUypUeQq5Q1qtVCCjZ5PLxILWa3O8iESk TlBKJ6x43ExAWBz48iZ6qVogCpdrLtrmpbk5uqBgRUznvxj8arAbQbK24Zd+z8bmCtk1 rPQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hdEbYtS1iRPX3ufit0+uNAIFJ7lCoR0ZmQxqt1yihgI=; b=vszQpHgXd62JC0m67XObL5kR31y60k9NRFL+4fESdIrZr/O0mFPblWOvjm7xdnzdJV GwmBO6GdvXu3PZpbiqFiiYxL+Qc9KezgUD9gHa6QkVM1YXfvoiOVfrLKoN4nVu2VRXt8 DOdqAz2Kmjm3ME0fPU5eyBO71PirA2xyawppJdhGO7E70azKvinBkxBvGjbMWYZfDBY/ 7WSMz0sFrUY9n/DdqLs4n4ijlVgfq6375/T2JcpqK89vDeBvXvFC8HIumfY9b5zga92R VZk8B0PbQHLLJQDmRL9r3fj7nLSLXvbePWHieZZ+LwiesUSXxFUVzsAeIZatknnOzmjU Zpgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=HS5Y9S3M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 23-20020a17090a199700b0024e54c31c25si144781pji.176.2023.05.03.01.03.18; Wed, 03 May 2023 01:03:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=HS5Y9S3M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbjECIBv (ORCPT + 99 others); Wed, 3 May 2023 04:01:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbjECIBt (ORCPT ); Wed, 3 May 2023 04:01:49 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FF321BEB for ; Wed, 3 May 2023 01:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=hdEbYtS1iRPX3ufit0+uNAIFJ7lCoR0ZmQxqt1yihgI=; b=HS5Y9S3MqENTJyAf/kMk1nj0PD xFOss2GETs9WooaMp2m98KNsESsdNVNRVu4upkIAo2s67kxTJxmgE+3AU6AlpissNEgN3s9ndVOS6 epMjtDOZdhHI/aqmkvosMiTt5DGzNBdsPLYkKDlxKjoMysxEHaPoBRvwfJb26bZpt2aGHwBQg+IdI cEfzb9hGhGkXw3Ju6EBVql6YjiA8utMWhLwLDKeJgfCEjEiMIIQEqcOhkczo5Y1GUJOc1+sN97mA3 E5jHqiVEmmvWt1d+Tr7R4J94KXAfLkUuzi1hfqZLJcR3fNDBWdEJX/EfmkjLz69z2W/EvLf3d3Qpw ELL/OExQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pu7QX-0000vk-14; Wed, 03 May 2023 08:01:29 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 487B630062D; Wed, 3 May 2023 10:01:27 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F235128110D0A; Wed, 3 May 2023 10:01:26 +0200 (CEST) Date: Wed, 3 May 2023 10:01:26 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Dave Hansen , "Kirill A. Shutemov" , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, kirill.shutemov@linux.intel.com Subject: Re: [GIT PULL] x86/mm for 6.4 Message-ID: <20230503080126.GA1676736@hirez.programming.kicks-ass.net> References: <20230427225647.1101172-1-dave.hansen@linux.intel.com> <20230429003822.n3mglslg666j3npp@box.shutemov.name> <641a9348-a052-6bb5-e6c7-64acb6405328@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 02, 2023 at 01:14:33PM -0700, Linus Torvalds wrote: > On Tue, May 2, 2023 at 9:00 AM Linus Torvalds > wrote: > > > > > I guess it also wouldn't matter as much either if we hid it in a helper > > > like the attached patch and I didn't have to read it twice. ;) > > > > Yeah, I think that's a good solution. > > Hmm. And as I was rebasing the patch to fix up my patch, I realized > that the current -git top-of-tree state is actually broken. > > That > > #define access_ok(addr, size) \ > ({ \ > WARN_ON_IN_IRQ(); \ > likely(__access_ok(untagged_addr(addr), size)); \ > }) > > is actually *wrong* in two ways. > > Now, in my original patch, I added a comment about how that > "WARN_ON_IN_IRQ()" is bogus and this shouldn't be x86-specific at all. > > I ended up going back in time to see why it was added, and I think it > was added because we used to access 'current' in access_ok(), due to > it using that user_addr_max() thing: > > likely(!__range_not_ok(addr, size, user_addr_max())); > > but that was all removed by the set_fs() removal by Christoph Hellwig. So I had a poke around, trying to figure out where it came from, and yes. Commit ae31fe51a3cc ("perf/x86: Restore TASK_SIZE check on frame pointer") is the reason that WARN_ON_IN_IRQ() thing got added.