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 EC2D6C54EE9 for ; Tue, 20 Sep 2022 16:06:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 270D7940008; Tue, 20 Sep 2022 12:06:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 220C5940007; Tue, 20 Sep 2022 12:06:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C215940008; Tue, 20 Sep 2022 12:06:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0016A940007 for ; Tue, 20 Sep 2022 12:06:36 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C1824A076F for ; Tue, 20 Sep 2022 16:06:36 +0000 (UTC) X-FDA: 79932941592.06.DE27648 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf19.hostedemail.com (Postfix) with ESMTP id ED0621A004F for ; Tue, 20 Sep 2022 16:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663689996; x=1695225996; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=/IbS34qABdYU+pzJELnjyiOd+1PbjbFNJt+H4c8Kcrk=; b=PccVUshuguHEaD/dL11qE3p27MOl0RME7z8DznG8Ud+3PhR0SenrJOfz qbW54qCM7JDFCD+6s0aRASi0rjDjr8wu0e6GkvEnvI0HeuMg69DGAb/+k bf+shb7xF8nyIpDMCOq07HYFpVzhojqaO23kOg70CtU3HAZq5m7iXMaHC ZXcnRrcCE/hWLj80QJhME8WEsC+vwEcT+2KC50c2ImfDXVaam0/oSpmBZ uBYWC9COItcR5ouhUlvH0vDqQ0SXI5KpwYEAZKH/fzx88x6Nv3k+CKFx9 GR9zNHR2N+aA8AhnRwlB4tnhnoQWBbhijpTpfHdVEfb5cSlsShD1tAQUe A==; X-IronPort-AV: E=McAfee;i="6500,9779,10476"; a="298462473" X-IronPort-AV: E=Sophos;i="5.93,331,1654585200"; d="scan'208";a="298462473" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 09:06:34 -0700 X-IronPort-AV: E=Sophos;i="5.93,331,1654585200"; d="scan'208";a="687470775" Received: from smidatha-mobl.amr.corp.intel.com (HELO [10.212.180.25]) ([10.212.180.25]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 09:06:33 -0700 Message-ID: <15741fdf-68b6-bd32-b0c2-63fde3bb0db2@intel.com> Date: Tue, 20 Sep 2022 09:06:32 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCHv8 00/11] Linear Address Masking enabling Content-Language: en-US To: Jason Gunthorpe , "Kirill A. Shutemov" Cc: Jacob Pan , Ashok Raj , "Kirill A. Shutemov" , Ashok Raj , Dave Hansen , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Taras Madan , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joerg Roedel References: <20220904003952.fheisiloilxh3mpo@box.shutemov.name> <20220912224930.ukakmmwumchyacqc@box.shutemov.name> <20220914144518.46rhhyh7zmxieozs@box.shutemov.name> <20220914151818.uupzpyd333qnnmlt@box.shutemov.name> <20220914154532.mmxfsr7eadgnxt3s@box.shutemov.name> <20220914165116.24f82d74@jacob-builder> <20220915090135.fpeokbokkdljv7rw@box.shutemov.name> <20220915172858.pl62a5w3m5binxrk@box.shutemov.name> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663689996; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=P2PISFPTm8TjfDy9vNnuFpZLmCliMl2ANU4ij3IJ5OU=; b=PZFAnQuw5dwWmf0GIHZKMhdhoOKTJOMPcOSSIIWL2FKN0yFQLFwORcq/TpeXJbdfxsDJo0 MSyOdPuxli20Z0QOIIK6EKGa5/RhX/3i0Jpd2/Ms6Tz80MBmMI9AiHkqfydVaGHPxVNSII VfFRjqLLHwGBrfLM0p/DpQgmscicqCU= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=PccVUshu; spf=pass (imf19.hostedemail.com: domain of dave.hansen@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dave.hansen@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663689996; a=rsa-sha256; cv=none; b=afR9QLQ18BWIwHHA5grmzpqJpMpsfIZWbzODy5IcaZsv0EMZ+CYc8nF96nF5/MfRDldZMQ fRBhfX5iNd1ZOs+3PkvI2/ZgMFtz8AbqFfehBRSoaJuycRHE4wv6s+TpsaPai4Jt/Wfs2G U+aROFxbwp6RnF9ho/lngqrbJiR3ZTE= X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=PccVUshu; spf=pass (imf19.hostedemail.com: domain of dave.hansen@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dave.hansen@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspamd-Server: rspam04 X-Stat-Signature: 6qmbsqm8s34q8eh461bpkebyg6titsco X-Rspamd-Queue-Id: ED0621A004F X-HE-Tag: 1663689995-69998 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 9/20/22 06:14, Jason Gunthorpe wrote: > For this I would rather have a function that queries the format of the > page table under the mm_struct and we have enum values like > INTEL_NORMAL and INTEL_LAM as possible values. > > The iommu driver will block incompatible page table formats, and when > it starts up it should assert something that blocks changing the > format. That doesn't sound too bad. Except, please don't call it a "page table format". The format of the page tables does not change with LAM. It's entirely how the CPU interprets addresses that changes. I guess someone could make an argument that, with LAM, there is a "hole" that can't be filled in and _that_ constitutes a format change, but that'd be a stretch. The thing that matters when LAM is on is that some CPU might be stashing addresses somewhere that only have meaning when you interpret them with LAM rules. That's really a property of the mm, not of the page tables. Oh, and please don't call things "INTEL_WHATEVER". It looks silly and confuses the heck out of people when a second CPU vendor needs to use the same code.