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 966D1C6FA82 for ; Mon, 12 Sep 2022 22:51:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED71E6B0072; Mon, 12 Sep 2022 18:51:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5F5D6B0073; Mon, 12 Sep 2022 18:51:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD88B8D0001; Mon, 12 Sep 2022 18:51:42 -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 B96606B0072 for ; Mon, 12 Sep 2022 18:51:42 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 889C81A02E0 for ; Mon, 12 Sep 2022 22:51:42 +0000 (UTC) X-FDA: 79904932044.27.22080C5 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by imf11.hostedemail.com (Postfix) with ESMTP id EDDE840088 for ; Mon, 12 Sep 2022 22:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663023101; x=1694559101; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y5aFaUUfrEqzjVBCB+0ZmxzBuRHaP2jCVI3JIfFSraI=; b=f/S0MouitwkjrBAMjryCoSYdhfbaUCTBFSLhYG3VStvEUEPv1eHI9YM4 u87toYFdG99AOB5Rg5ws0ozgP+FA6B2x0Y7ksfNUfz3en/GI62w2pkUyx c34SlWqOSPSL7S0dOvi365VcFjcxtwtZC6RYaT0ajBdFwI7+NMwhWv3RT dgXsGvtgODldX/ZCJFX2vARQPOooCc0OtajjCqPiGrRaLo5A5Ure39sAy XjBWlriElJcXtOUYi5+eCrigqi3lA/Vh/hVRWjKkKFz2sBkAVYSzsd2eq FTT+yfY575N3IJxTCR4AXJ7N+rD8lfjlPfaXBNNX3aVt5aAlSg5caxXim g==; X-IronPort-AV: E=McAfee;i="6500,9779,10468"; a="359714171" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="359714171" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 15:51:39 -0700 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="611928407" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.198.157]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 15:51:39 -0700 Date: Mon, 12 Sep 2022 15:55:02 -0700 From: Jacob Pan To: Dave Hansen Cc: Ashok Raj , "Kirill A. Shutemov" , "Kirill A. Shutemov" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , , Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , "Alexander Potapenko" , Taras Madan , "Dmitry Vyukov" , "H . J . Lu" , Andi Kleen , Rick Edgecombe , , , Ashok Raj , jacob.jun.pan@intel.com Subject: Re: [PATCHv8 00/11] Linear Address Masking enabling Message-ID: <20220912155502.0087a993@jacob-builder> In-Reply-To: <356d4ad1-f7d8-b8ff-3b63-819a64bf5b9f@intel.com> References: <20220830010104.1282-1-kirill.shutemov@linux.intel.com> <20220904003952.fheisiloilxh3mpo@box.shutemov.name> <20220912133935.3bb3e247@jacob-builder> <356d4ad1-f7d8-b8ff-3b63-819a64bf5b9f@intel.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663023101; 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=UKV9FqEfwh8RUY4XrYmuTJIOBLmI4bB2tEOKUSJCJBs=; b=wbYUQS+o+Mqubj194E4XDvVgYzorEu1nfRS6qBE16a8k7KG0gfgFVojUmzb3Gi0UyjGxIZ GIr2Ur2LzVsY1fR+XrGVFY2J1C1eJQzK6OdQu/aLP3KDEerlMNxkh9+9tqidaFBP9oW8rk lu7D7QdV1PJxFSsX/d6bcbF6ibrKR+c= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b="f/S0Moui"; spf=pass (imf11.hostedemail.com: domain of jacob.jun.pan@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=jacob.jun.pan@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663023101; a=rsa-sha256; cv=none; b=7EtLQc5Dwu/buAMwWcJ92S7HcIR5QfK67wZGvJrsIvAu18l3Ew3axImO7b6S1Tp3LuYD7Y wX+jQWBfMVcEYmyul8ka5WKiRRwMcPpv6k19i4Bw2hfdA71j42znTwfdwIpZfrseEY+wKQ vo9GdpV6x1D/ip1VLfySqBpj+FFUukU= X-Stat-Signature: tiaan6m5qayzejhbrwyujsp8bxxzoatf X-Rspamd-Queue-Id: EDDE840088 Authentication-Results: imf11.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b="f/S0Moui"; spf=pass (imf11.hostedemail.com: domain of jacob.jun.pan@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=jacob.jun.pan@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1663023100-71153 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: Hi Dave, On Mon, 12 Sep 2022 14:41:56 -0700, Dave Hansen wrote: > On 9/12/22 13:39, Jacob Pan wrote: > >>> + if (pasid_valid(mm->pasid) && !forced) { > > I don't think this works since we have lazy pasid free. for example, > > after all the devices did sva_unbind, mm->pasid we'll remain valid > > until mmdrop(). LAM should be supported in this case. > > Nah, it works fine. > It just means that the rules are "you can't do LAM if your process > *EVER* got a PASID" instead of "you can't do LAM if you are actively > using your PASID". Sure it works if you change the rules, but this case need to documented. > > We knew that PASID use would be a one-way trip for a process when we > moved to the simplified implementation. This is just more fallout from > that. It's fine. > Is LAM also a one-way trip? > > Perhaps, we could introduce another prctl flag for SVA, PR_GET_SVA? > > Both iommu driver and LAM can set/query the flag. LAM applications may > > not be the only ones want to know if share virtual addressing is on. > > I don't think it's a good idea to add yet more UABI around this issue. > Won't the IOMMU folks eventually get their hardware in line with LAM? > Isn't this situation temporary? Thanks, Jacob