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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3D80C43334 for ; Fri, 17 Jun 2022 11:37:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381810AbiFQLhE (ORCPT ); Fri, 17 Jun 2022 07:37:04 -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> 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.