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 CA88DC43334 for ; Thu, 16 Jun 2022 10:01:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58A7A6B0074; Thu, 16 Jun 2022 06:01:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 539FB6B0075; Thu, 16 Jun 2022 06:01:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 401B46B0078; Thu, 16 Jun 2022 06:01:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 305706B0074 for ; Thu, 16 Jun 2022 06:01:17 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F24F42167E for ; Thu, 16 Jun 2022 10:01:16 +0000 (UTC) X-FDA: 79583656152.04.FCD4EED Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id 50B7212008C for ; Thu, 16 Jun 2022 10:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=CgVWCHgWJJT3XNAbwXXT31wUhHpLBydJuqr4cEkRcRg=; b=svndT7e0vHjSg2FVR5ABLL492R IBtvGgXVEG5zhGj5aNFh88vSwSzeRBdB1MBdUnYvsy9jCMe2cA+Wt0G4hjDRsv7wJbDrxi6i7BIDU 7R1xPG91BSSXR6pN3fWYbtYx8ONsk5qrJgZBqZUqfCP1UHoZ2miHsNV1Gac7VMH747b5J1vn/1ijN VyRNaMy9QDV+NANfFtZ+IfN5dRQ+wvP3CezJog+UrECePy2EoNzEmF68hlLHwODy9dd5ylyEQF9pY 2y98Qiax+HEcswDRZS2wlgcugb3gUJ3VVKg+ORcJKrjVJWkGX9gSOmvCVWRkOvyHlcaH++RCuqJsc 4W4FsX0A==; Received: from dhcp-077-249-017-003.chello.nl ([77.249.17.3] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1mJ9-001r0b-S3; Thu, 16 Jun 2022 10:00:59 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1BE763006C2; Thu, 16 Jun 2022 12:00:58 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F2E97201A4015; Thu, 16 Jun 2022 12:00:57 +0200 (CEST) Date: Thu, 16 Jun 2022 12:00:57 +0200 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: Dave Hansen , Andy Lutomirski , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv3 OPTIONAL 8/8] x86/mm: Extend LAM to support to LAM_U48 Message-ID: References: <20220610143527.22974-1-kirill.shutemov@linux.intel.com> <20220610143527.22974-9-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220610143527.22974-9-kirill.shutemov@linux.intel.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655373676; 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=CgVWCHgWJJT3XNAbwXXT31wUhHpLBydJuqr4cEkRcRg=; b=f7hZrhXYIHBGW5XWnZ1nDIMvPXY6ocbKv6d/chWOsPZELs2mBgC+D7HfyyQ/HwhAYeYiD0 frZ2S18/OPfXYmCIjeGP39Wes8HvQerrsFTbVRkcHUL3e+NiqvDHgqjine2BJF3sC572BA IX2dLa7LonxylVhxIobglZjsyXT0d9U= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=svndT7e0; spf=none (imf29.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655373676; a=rsa-sha256; cv=none; b=FfNHlkeOlFPsh2YvJLOczusP3uAQ45aAj6CmYZvWDRAlvxFT0fO3K5pzcqXeqnAhEuIrRt wfXK2K2txD7Y8ZpapA5//iMhhQICJvuYes1QXLocnXeU1KpnJYt2I/iRs1JXbzXyLUX4Uo TLV7ZRavixCYI6ABNF3x0GT3Jxdtux8= X-Stat-Signature: azotdwbxe6zeh1e7xxdqhqnbdi64z35y X-Rspamd-Queue-Id: 50B7212008C X-Rspamd-Server: rspam11 X-Rspam-User: Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=svndT7e0; spf=none (imf29.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none X-HE-Tag: 1655373676-881976 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 Fri, Jun 10, 2022 at 05:35:27PM +0300, Kirill A. Shutemov wrote: > LAM_U48 allows to encode 15 bits of tags into address. > > LAM_U48 steals bits above 47-bit for tags and makes it impossible for > userspace to use full address space on 5-level paging machine. > > Make these features mutually exclusive: whichever gets enabled first > blocks the other one. This patch is broken in that it doesn't fix untag_pointer() *If* you really want to continue down this road; you'll need something like: #define untagged_addr(mm, addr) ({ \ u64 __addr = (__force u64)(addr); \ s64 sign = (s64)__addr >> 63; \ __addr ^= sign; \ __addr &= (mm)->context.untag_mask[sign & 1]; \ __addr ^= sign; \ (__force __typeof__(addr))__addr; \ }) Which uses a different mask for kernel and user pointers. Anyway, without this U48 patch on, the mask could be a constant, no need to keep this variable, we can unconditionally unmask U57. Let me go reply to that other mail too.