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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06F23C433EF for ; Fri, 17 Jun 2022 11:36:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 903C46B0075; Fri, 17 Jun 2022 07:36:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8DA7C6B0078; Fri, 17 Jun 2022 07:36:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A2736B007B; Fri, 17 Jun 2022 07:36:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 698156B0075 for ; Fri, 17 Jun 2022 07:36:47 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3903D35310 for ; Fri, 17 Jun 2022 11:36:47 +0000 (UTC) X-FDA: 79587525654.16.291FD53 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf08.hostedemail.com (Postfix) with ESMTP id 57F8A160091 for ; Fri, 17 Jun 2022 11:36:46 +0000 (UTC) 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> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655465806; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cR4LnuVZtAt+9tGMI7j6kcQ3OFS9N17ZPUsUFSJS2hY=; b=hXQA2CY9ugn1EXdAv1BfUE0Y02tccqBfqJZo/Nu5+3DVBLevJpAuNARoDXShJ+5OoB6Cg3 vmrCCWbEStpdiAQX5nT0sDRKPp1QrG3SsazD+HJoXx/AeJFWaaXXQG254NEFRzra7ncK9h SCACzvv5aOJj1tO5XKEEroXn/+uLinI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655465806; a=rsa-sha256; cv=none; b=yDDCnZodg/npfprMaQ82F43Py2tOeblkehlecp3uB+9D/Zwxyd3oG/g8iEeWSHG6yWPUJN zvFbcew3YokROjt0lp13Y/WwRip5Gu4NPA2Jc3P1j9IE0gC5wCkt8Nl8RaTB/SrXUBhD3T 4skVchD1KsDytmtCH6Zwwo89BSOYNnc= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=FWg5hYeg; dmarc=none; spf=none (imf08.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Stat-Signature: 17q1j1c1atnpss3u4zqxa7wyt53zm9bd X-Rspamd-Queue-Id: 57F8A160091 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=FWg5hYeg; dmarc=none; spf=none (imf08.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Rspamd-Server: rspam01 X-Rspam-User: X-HE-Tag: 1655465806-340666 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.