Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5815035rwn; Mon, 12 Sep 2022 15:02:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR6NG8Mo3UgLetBT8z3nLnidVHVz1/Nl4tmZNEuJID5e8jhPM9boc5MAplITv0JLONHdj6x7 X-Received: by 2002:a17:903:22c2:b0:178:3c7c:18af with SMTP id y2-20020a17090322c200b001783c7c18afmr3812828plg.134.1663020131060; Mon, 12 Sep 2022 15:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663020131; cv=none; d=google.com; s=arc-20160816; b=oNTSOWGWeZ45SVnAbJH3k68KryzGHEUSnjlg474SGPxGEQfLz/9QFbVTk0w9Ujdri/ stvT+ZV2eS+WY351X9onZQuJox/fpD/JrtD+Za9WGaGLLXjsncky3nUvx2WnFFGRJLZu BflQLWALoT/I4IKQmWoD9Mo9c6wqCNu6i4Gp5UGiWb+/T5FnwHpyHOQjrLRhndkFEq4s Odz0t2fQtkNHYAE/10ofWqMn9S4jA0PZX9QHY9nyZUncPGdacbJzG88oVcVjUuje8LpL PjfIU7N2/CxLNYl38jTMcKUQ7bpTWJYagwAgUxJXe+1W11dCkZs6SLCJ3ngckFDKzaOu 1Kxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=WFq+9xupQgyWNdHZMQ1/OzWkTLfRMgITvKfbOiWVWgU=; b=eddGNCe/DJ29kp1uUzWkCCB9OjZwXrksSKr+ZpzVRZERxrKLMCMQP6VwCasHJ2azRS 9LUuJ7TTxwsY+1XlWukIIXJ7JQNEEEyI+cJLrSeqmBFGuwZwLhLeXGxIgFkcbpBevKam HiV8W9QhvYFUiacwOQZZSVQ5DxeZFjYCjPH1qwoszT4zAjjuXmTGwl1dLxoHXA+n+KfX yIQQemKWxzAiz5zhuoV7GxYH3SP7WJC0a0YWezbzwd2nPac9VDgMDM73j2OdaIQisfBQ 5Vnq51KtFCgfZHEu2Hb9dMpNVMyFS4R5mRebeEb91nAPd5ngeuTDG4nlcBKnPhyMydOB Jw1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m5R6mxcq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a189-20020a6366c6000000b00434a6cb73eesi10234336pgc.70.2022.09.12.15.01.58; Mon, 12 Sep 2022 15:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m5R6mxcq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbiILVl4 (ORCPT + 99 others); Mon, 12 Sep 2022 17:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbiILVly (ORCPT ); Mon, 12 Sep 2022 17:41:54 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA7A4C61F for ; Mon, 12 Sep 2022 14:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663018913; x=1694554913; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=qFnIjffMALUQQUIAOVDoq6z2zOO7NBVKHgBfILKSm68=; b=m5R6mxcqh9cDwTuB5X4Qk5dvUcEU5bGf7xyyCL8SLaOH8H/szIqKlZ0d jylS4abmc2z6q5k0CD6HBgLShtqpscasuHzju1st7Pm1/Q6R7uMTm83OY wZHWj2/6VbD3M6RpUXRgUwJnMYWy81QpFwdQN74Wrj5ojTUQyYqF8EBqL je9eOeJC9j2tEd1jbadjgQwKgwGXuZcOPgCe1AGhT7VI7tjVP0PpzmOny M72Ec2PPqrEXif9JH+P+h82yoM2dtFpsD2kUbLaW0MR0oB9avZ8s0pY2u XTwrvExDBmqqDYf5NJeqCE0gsnPULWIm/Bv+8eY5kbnFoqP5Fo5C94uZs A==; X-IronPort-AV: E=McAfee;i="6500,9779,10468"; a="298775514" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="298775514" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 14:41:53 -0700 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="646645164" Received: from gjmurphy-mobl.ger.corp.intel.com (HELO [10.213.203.202]) ([10.213.203.202]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 14:41:48 -0700 Message-ID: <356d4ad1-f7d8-b8ff-3b63-819a64bf5b9f@intel.com> Date: Mon, 12 Sep 2022 14:41:56 -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: Jacob Pan , Ashok Raj Cc: "Kirill A. Shutemov" , "Kirill A. Shutemov" , 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, Ashok Raj References: <20220830010104.1282-1-kirill.shutemov@linux.intel.com> <20220904003952.fheisiloilxh3mpo@box.shutemov.name> <20220912133935.3bb3e247@jacob-builder> From: Dave Hansen In-Reply-To: <20220912133935.3bb3e247@jacob-builder> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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". 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. > 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?