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 765C4C433F5 for ; Thu, 12 May 2022 17:00:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFFAA6B0074; Thu, 12 May 2022 13:00:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAF1C6B0075; Thu, 12 May 2022 13:00:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C50096B0078; Thu, 12 May 2022 13:00:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B292D6B0074 for ; Thu, 12 May 2022 13:00:30 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 68E8E20F78 for ; Thu, 12 May 2022 17:00:30 +0000 (UTC) X-FDA: 79457704620.09.2FCA298 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf28.hostedemail.com (Postfix) with ESMTP id 0D500C00AF for ; Thu, 12 May 2022 17:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652374829; x=1683910829; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=apo30zA37N3jdlCWH2sDbDBKNYM+43W8+OjQdalfpgs=; b=WU9Q3AWb+AEeDLeE3sn/8E/PFxPrPO4fI2yd/6YI1ZDScZj2d/j8HY62 lSZLDwW27HwqJwVYjqrMEbrOwbNb9zXvsSzDeN4pk4Ei6HrDbWZP6j9UO Zq32FWRh7we6S6ngDa+lHI4jZSyLt8zV6Tn/wlKmTmWJW+tGdJpup0CL4 zffEHkolc48TpfRRa3NcOnaSNORhP3y/oRQ9jg7xa0sh+9QuWXesFqAga erH5EOA/RmZFGxPl955i5DiYUAy0XQiGGzxzq3ht59nofOuykGWot/LAB +FsrCV91bst85L7KmYr8htMuCi+fL+v0qCZ1og1rpMo22KWdJ1N9BsDc+ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="295316207" X-IronPort-AV: E=Sophos;i="5.91,220,1647327600"; d="scan'208";a="295316207" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2022 09:56:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,220,1647327600"; d="scan'208";a="895869323" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 12 May 2022 09:56:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 54ED0CE; Thu, 12 May 2022 19:56:12 +0300 (EEST) Date: Thu, 12 May 2022 19:56:12 +0300 From: "Kirill A. Shutemov" To: Thomas Gleixner , Dmitry Vyukov Cc: Peter Zijlstra , Dave Hansen , Andy Lutomirski , x86@kernel.org, Andrey Ryabinin , Alexander Potapenko , "H . J . Lu" , Andi Kleen , Rick Edgecombe , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFCv2 00/10] Linear Address Masking enabling Message-ID: <20220512165612.gizedzgtpzbi7jbl@black.fi.intel.com> References: <20220511022751.65540-1-kirill.shutemov@linux.intel.com> <20220511064943.GR76023@worktop.programming.kicks-ass.net> <87pmkivjst.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pmkivjst.ffs@tglx> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 0D500C00AF X-Stat-Signature: 6tykx77yabbt49xotcmxjpytshdu4eq9 X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=WU9Q3AWb; spf=none (imf28.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com X-HE-Tag: 1652374807-500454 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, May 12, 2022 at 05:42:58PM +0200, Thomas Gleixner wrote: > On Wed, May 11 2022 at 08:49, Peter Zijlstra wrote: > > On Wed, May 11, 2022 at 05:27:40AM +0300, Kirill A. Shutemov wrote: > >> Hi all. Here's long overdue update on LAM enabling. > >> > >> # Description # > >> > >> Linear Address Masking[1] (LAM) modifies the checking that is applied to > >> 64-bit linear addresses, allowing software to use of the untranslated > >> address bits for metadata. > >> > >> The patchset brings support for LAM for userspace addresses. > >> > >> The most sensitive part of enabling is change in tlb.c, where CR3 flags > >> get set. Please take a look that what I'm doing makes sense. > >> > >> The feature competes for bits with 5-level paging: LAM_U48 makes it > >> impossible to map anything about 47-bits. The patchset made these > >> capability mutually exclusive: whatever used first wins. LAM_U57 can be > >> combined with mappings above 47-bits. > > > > So aren't we creating a problem with LAM_U48 where programs relying on > > it are of limited sustainability? > > > > Any such program simply *cannot* run on 5 level pagetables. Why do we > > want to do this? > > More bits are better :) > > Seriously, I agree that restricting it to LAM57, which gives us 6 bits, > makes a lot of sense _and_ makes the whole thing way simpler. > > So supporting both needs a truly good justification and a real world use > case. I asked the question before[1]. Basically, more bits more better: For HWASAN #bits == detection probability. For MarkUS #bits == exponential cost reduction I would really like to have only LAM_U57, but IIUC 6 bits is not always enough. Dmitry, could you elaborate? [1] https://mobile.twitter.com/dvyukov/status/1342019823400837120 -- Kirill A. Shutemov