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 B329EC43334 for ; Wed, 29 Jun 2022 00:53:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3B118E0001; Tue, 28 Jun 2022 20:53:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EEAC06B0072; Tue, 28 Jun 2022 20:53:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB1EF8E0001; Tue, 28 Jun 2022 20:53:42 -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 CC0096B0071 for ; Tue, 28 Jun 2022 20:53:42 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9924820AF1 for ; Wed, 29 Jun 2022 00:53:42 +0000 (UTC) X-FDA: 79629450684.18.71A8A81 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf31.hostedemail.com (Postfix) with ESMTP id B67B52000A for ; Wed, 29 Jun 2022 00:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656464021; x=1688000021; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3vkw3zESbKa0B1riqVX7U9aJn8b2eWkzoJatn5u26Kw=; b=h6lYSxtqFzOEGfPCO97DBsGH0kyRTRHab2dFvVt/Vi4HCD62nSMUt8xq tKsTeCC3rjIBybw6uB9tje45ORhNBX5aGZ0X+W6a1HtjRnCkg6oQAge5f HHQ0ZyNmlENyAy+2cP9y2ArjWd+z23w6vf+KiiVc1ay8A7RSmVJpaLmW7 qqxFMSnXV/pDkuzzvbmnUuAA/4UgWt44dK2R6sMgFPY0ns+//Jhte0MCq 6eIwcptimTSWi9CnYLc6jUau1e81mLIFmNRaFnqSVvqg1byB6AIOhe6E2 S89QGuQdf0HVPShkJJ7pbNpvHmsGJGZ2LqUz+tqdEZz45lUqd9qzHujFu A==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="345880932" X-IronPort-AV: E=Sophos;i="5.92,230,1650956400"; d="scan'208";a="345880932" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 17:53:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,230,1650956400"; d="scan'208";a="590501711" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 28 Jun 2022 17:53:36 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id A9E8FCE; Wed, 29 Jun 2022 03:53:42 +0300 (EEST) Date: Wed, 29 Jun 2022 03:53:42 +0300 From: "Kirill A. Shutemov" To: Andy Lutomirski Cc: Dave Hansen , Peter Zijlstra , 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 6/8] x86/mm: Provide ARCH_GET_UNTAG_MASK and ARCH_ENABLE_TAGGED_ADDR Message-ID: <20220629005342.3thjt26e6p6znyrh@black.fi.intel.com> References: <20220610143527.22974-1-kirill.shutemov@linux.intel.com> <20220610143527.22974-7-kirill.shutemov@linux.intel.com> <6cb17661-9436-afbf-38eb-58565bba1a56@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6cb17661-9436-afbf-38eb-58565bba1a56@kernel.org> ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=h6lYSxtq; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf31.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 134.134.136.100) smtp.mailfrom=kirill.shutemov@linux.intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656464022; 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=mR47HKzMCgYHHnf5jO9jtXhOKvH/cL6z2+1YBvpsw4g=; b=SEyd2T9qDoBkIevMwXwIu+KHXnfrGEyOvASpMHSz8RoAt6eYd5ItUR/KjsU2cZ4yBOBt8v ojctKSC1wFRhwLMK8Mds3nTj+a70SnCAeLISXdIsIjyILa5UyolTw6/r7TMsFsnDihPuL4 B3y/At9Stjl98X2y7rT1X7308uj6hvU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656464022; a=rsa-sha256; cv=none; b=KjmYpSElAs6JkjJ9kMV7p+IJBcDq9nE2D7WZYrT9PQLiq9i5l2TKUt2MY0cxNIvmH+snPi LeFSLsHWrhNZHl4TkyvvZ1UTiNagks/xnTa/eceNaRrqUrXJ5mo7x2yX+dbBiVfOkLxuA4 un3EOyjgTW6SMiHdtQ9mgV3I/7vGZ4Q= X-Stat-Signature: i63xp56e51hq8uzoq5p84sbsffx8znui X-Rspamd-Queue-Id: B67B52000A Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=h6lYSxtq; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf31.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 134.134.136.100) smtp.mailfrom=kirill.shutemov@linux.intel.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1656464021-2681 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 Tue, Jun 28, 2022 at 04:42:40PM -0700, Andy Lutomirski wrote: > On 6/10/22 07:35, Kirill A. Shutemov wrote: > > > + /* Update CR3 to get LAM active */ > > + switch_mm(current->mm, current->mm, current); > > Can you at least justify this oddity? When changing an LDT, we use a > dedicated mechanism. Is there a significant benefit to abusing switch_mm > for this? I'm not sure I follow. LAM mode is set in CR3. switch_mm() has to handle it anyway to context switch. Why do you consider it abuse? > > Also, why can't we enable LAM on a multithreaded process? We can change an > LDT, and the code isn't even particularly complicated. I reworked this in v4[1] and it allows multithreaded processes. Have you got that version? Intel had issue with mail server, but I assumed it didn't affect my patchset since I see it in the archive. [1] https://lore.kernel.org/all/20220622162230.83474-1-kirill.shutemov@linux.intel.com/ -- Kirill A. Shutemov