Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp345281iog; Fri, 17 Jun 2022 04:47:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vSM7uYEsr/+OB/kX7pQnBEtnRVF1+DITAU2O7J+In+EqZUBQtpsTlmgqrdxFMz+Ebu+EeT X-Received: by 2002:a17:90a:eb11:b0:1e6:7865:4ecb with SMTP id j17-20020a17090aeb1100b001e678654ecbmr21062159pjz.172.1655466454901; Fri, 17 Jun 2022 04:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655466454; cv=none; d=google.com; s=arc-20160816; b=gdwF6OFJtDS6/omorjxpjEs36OfhhJ+Y74EAnKi5jN9iwCq8qDD4hDEUcMJ/yriR8K GlTdKSPUFdOBKunNoa36ihHD2xhbSYCFGQVoNB4x2DD5PrXAS84+XCDJ+kIiCU6kFDVz AfJezbi4UKzpONNJVJPdSu6DAxQjseJ5HoyIfLYO+EMWuuCuusEgs262ggSn4CInIyCS PWr+eEEhiybV2S3LNmHnzHzAkhg4e/Rmar9MRtHkPIVrlimxOIHIo9I9HBtAvYqjcvBw 743PeR66mN8IX/wWICyX5FgS2OMnBMiJ47gyQMhf09LcPuneSk93eEJdAJoWWn+BfGru b+Jg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cR4LnuVZtAt+9tGMI7j6kcQ3OFS9N17ZPUsUFSJS2hY=; b=PCxdInZGUavwgjmwIgMhR2M++fo0PKryp2M10pNTHvzMED+42bllSF+aBDknt9cRBo hHqsdfWDSfaDSbTIJZ4iFrdjAGNXH8OVnn1ti5t9ISgDU4CXKmqrrjHRPprektQo2M2C I1WYk71uYuL91DsmUZqtw0kYnVcyPQlWfAgYbFisnRuhFa0kUg3ey0LuSfDJqUpWs+o+ MLMJEvlcN/YEajcFUZob82UiZxgA5Var3xJuL6/Dgz7iTnTiHRsTU54Ro1lk7W6VlMhc d8yXmJ4qR2W6vuzYR0/z3Z2QiZjxgC4ddFtiVb2/y80a1tsJcymFS6p7luePxXWmJA8b ZNWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=FWg5hYeg; 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 h25-20020a63f919000000b003fe1c0a9903si5334029pgi.348.2022.06.17.04.47.22; Fri, 17 Jun 2022 04:47:34 -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=FWg5hYeg; 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 S1381741AbiFQLhD (ORCPT + 99 others); Fri, 17 Jun 2022 07:37:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380246AbiFQLhB (ORCPT ); Fri, 17 Jun 2022 07:37:01 -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 6748F6A437 for ; Fri, 17 Jun 2022 04:37:01 -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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cR4LnuVZtAt+9tGMI7j6kcQ3OFS9N17ZPUsUFSJS2hY=; b=FWg5hYegefT0O4qCxoNpGInvL1 3CvZtxDn1NvT3GI7TrBZ889svm/ipuljeM6ZVbmrYVZsp6UrJOHU+RflM9Ph/5f7aGwIN3OXKivEf dISFmOCd1BsnYhFPeiiJnYCyTS27JhFM7u1Gx8b9BsijzL+VLenvdYGh0fBdCs/RJHz0xgg85qplM fAbui5Vc1IWuPGOupTeDaFOzZ7fxitlDI2iRc5GqxZcBBNSw1Kw2hyZ9mA+DVZSRZyUzGnWgXMxZD cLPKpLBMpCIyUNTgNVDtRm0cgUxJVKjGy9t7qASM0AB7uWriZjOJuP0zGQdLX2kQvRPuX/sC7sHFw TvNhmFtg==; Received: from dhcp-077-249-017-003.chello.nl ([77.249.17.3] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AGw-008fkA-Ik; Fri, 17 Jun 2022 11:36:27 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 0041F9816B5; Fri, 17 Jun 2022 13:36:17 +0200 (CEST) Date: Fri, 17 Jun 2022 13:36:17 +0200 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: "Edgecombe, Rick P" , "Lutomirski, Andy" , "dave.hansen@linux.intel.com" , "linux-kernel@vger.kernel.org" , "hjl.tools@gmail.com" , "linux-mm@kvack.org" , "kcc@google.com" , "andreyknvl@gmail.com" , "ak@linux.intel.com" , "dvyukov@google.com" , "x86@kernel.org" , "ryabinin.a.a@gmail.com" , "glider@google.com" Subject: Re: [PATCHv3 5/8] x86/uaccess: Provide untagged_addr() and remove tags before address check Message-ID: References: <20220610143527.22974-1-kirill.shutemov@linux.intel.com> <20220610143527.22974-6-kirill.shutemov@linux.intel.com> <20220616164440.vw7sqnof6grrmnvl@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220616164440.vw7sqnof6grrmnvl@black.fi.intel.com> 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 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 Thu, Jun 16, 2022 at 07:44:40PM +0300, Kirill A. Shutemov wrote: > Any objection against this variant (was posted in the thread): > > #define untagged_addr(mm, addr) ({ \ > u64 __addr = (__force u64)(addr); \ > s64 sign = (s64)__addr >> 63; \ > __addr &= (mm)->context.untag_mask | sign; \ > (__force __typeof__(addr))__addr; \ > }) > > ? Yeah, I suppose that should work fine.