Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp158566rwr; Tue, 2 May 2023 17:56:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67aTC617pJWu55nyajzTl4OToXlFTjmUMnhUpxXyCCzQFNlQSgSm5j6HeSbJ68ex+ojnry X-Received: by 2002:a05:6a20:e185:b0:f2:895c:ccc9 with SMTP id ks5-20020a056a20e18500b000f2895cccc9mr20934278pzb.45.1683075399026; Tue, 02 May 2023 17:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683075399; cv=none; d=google.com; s=arc-20160816; b=lby7xkNoCjvtCWuH0XgNI866oeNMy53Cg8+pdEQ9dnFd2uNBtFzMt9j9KabQVoXRzb iP+s1UngTjdsv1FHRWIo3s5BIvJTVKjVQGfNf69IITcg+DAJYp/ybdqteJ3ZZNKBIanH +bGglNGrHbU24oHCoAXiWvEJPI4EQvZ9UYvW/i7Aa/jEa/+x5G9fsnFjxDfTh+damUHe 9TF+mLPtImF30GWXcCTMAJaikAFOeNJzbn29JyBe1m4xqg/Y3/J+x5LjIliixMqcyiYd AtnWao0K3zUfl1kSjVD6zPcPnPgRCqcVFHHNrOvZI0qiP1Z02AuDwG7A14Tef3gZCiwj QmfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=hASCykaNhD59N0rqWpRinCzRCEwt3/Cs2lP3+LzWZSY=; b=0V8J9l1HeZO3FCrrwVZUhJxBpad93ACjT9vDiZhrGWI9uHhY5NzrdXHOr0vz7BU8r6 ARA/cGlstljjT61Ndgzl5i6vTP06JceADU221SWe/LdvHBisaGOvn3N/U3cUHJ2lypWo zbSloJbsjjSq3073fEaW8+IsNq6/wLCeUGoVyOVtpQyrtB8n8tMicADiq53XDmonfKcr JFHI8g7rIsqhwmXMVMangUFLKfAcvfo3RZ469bXNoFaB7JHGTJmoirTRZgpbeu5OoQKm 2K4aCs0XQqz5fvCMqHkqrLD3OQfdcMN8+vTMGXyQAqHH7ab2Ec0CwTHH7oO944OoPOZ1 VtIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lVzLzLqz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k19-20020a63ff13000000b004fb98290dbdsi31623114pgi.50.2023.05.02.17.56.24; Tue, 02 May 2023 17:56:39 -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=@intel.com header.s=Intel header.b=lVzLzLqz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229461AbjECAxj (ORCPT + 99 others); Tue, 2 May 2023 20:53:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjECAxh (ORCPT ); Tue, 2 May 2023 20:53:37 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F0E82D4B for ; Tue, 2 May 2023 17:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683075216; x=1714611216; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ay/Mwg8qOsS0W2dMW2Uq032t5x+wCyoCdaWP7b6QFO4=; b=lVzLzLqz02bF3V84xtpGdJ+7dOO/29sInnUWOj2PY4D6u8L3n52dHE7d ulkT3XHJrGVY2SJ7ZIA3LSKCHaf/z0LqikWozcR1f/O1mG+3OtItP8abF rjUlOiicDHSQ+9AzKY2kRrOggtDOBZrZyGsPmPBcdG6W1RY6cgcAgAdZH LZb4v3pkPr+tYAJ/ZDwV3ibcyDPPIoLVLXrDaetXoZ7t+a/8bgZlChucJ 6BNwkRZERuiWuAQ8M0D0Vh3bmAAZuycgAkXakhiGliASCxRD+M3W13xmb GdsNgiznm1oS+vGcwKKKOQvxowABBGbkHCMzkzU2nGkRLQ+SsrixnbbWE g==; X-IronPort-AV: E=McAfee;i="6600,9927,10698"; a="350611725" X-IronPort-AV: E=Sophos;i="5.99,245,1677571200"; d="scan'208";a="350611725" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2023 17:53:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10698"; a="726967190" X-IronPort-AV: E=Sophos;i="5.99,245,1677571200"; d="scan'208";a="726967190" Received: from vsanka-mobl.amr.corp.intel.com (HELO [10.212.168.155]) ([10.212.168.155]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2023 17:53:33 -0700 Message-ID: Date: Tue, 2 May 2023 17:53:33 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [GIT PULL] x86/mm for 6.4 Content-Language: en-US To: Linus Torvalds Cc: "Kirill A. Shutemov" , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, kirill.shutemov@linux.intel.com, Peter Zijlstra References: <20230427225647.1101172-1-dave.hansen@linux.intel.com> <20230429003822.n3mglslg666j3npp@box.shutemov.name> <641a9348-a052-6bb5-e6c7-64acb6405328@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 5/2/23 13:14, Linus Torvalds wrote: > No, the problem is that probably *because* "access_ok()" has that > warning, not all users use "access_ok()" at all. We have places that > use "__access_ok()" instead. Like copy_from_nmi(). > > So now copy_from_nmi() doesn't do the untagging, so if you were to use > tagged pointers for the stack, you'd not get stack traces. > > End result: I think that > > (a) that WARN_ON_IN_IRQ() is actively detrimental and causes problems > > (b) the current "use untagged_addr() in access_ok()" model is also broken Ugh, yes. The fallout seems limited to (probably) perf and tracing poking at user stack frames. But, yes, it definitely looks broken there. While I bet we could shoehorn the existing tlbstate checks into the __access_ok() sites, I also vastly prefer the high bit checks in access_ok() instead. The less state we have to consult, the better. Once the WARN_ON_IN_IRQ() is gone, it seems like it's just a matter of collapsing __access_ok() into access_ok() and converting the (~3) callers.