Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5657364rwb; Wed, 21 Sep 2022 10:31:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60Xa5GCLLqExyBO4B/TtEMZygMEdItA7SxDUQPCORsl5rC6tzgoeyKZQOAot502U6EyUGj X-Received: by 2002:a17:907:724e:b0:780:45d1:969b with SMTP id ds14-20020a170907724e00b0078045d1969bmr22526495ejc.26.1663781486098; Wed, 21 Sep 2022 10:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663781486; cv=none; d=google.com; s=arc-20160816; b=pdH9lowtiYHo0MBfsB0zDYofF6hPoLDR4c8Qbb1lHgTe/uon8Iiz/m/mUH4+SXrVyR m5g6MKwzwhtE6QQgQOoAgOMymQSRSu9OwWIZ4HDyfCkiyAr7H/KxYZYffcu7G1VtruIa iSuHG+XOHhib9TPfFxCC5BhvuX122LJ37+IGp2u6uAkNKYXaIItyoJXQwUWQxvQs9enp KJAc7953i3SC8L4dELGsS0dVNw4+mLdGXfTj4TUWQ1M7UWWiU1cymxlLPlPfDZs38Pqj ud1RDXSjA4imPWlZhPf7gLjo9/h+s8fUFmvqrVxsbKij0Z19sF3AzuyrzSyqo9kqORwt 7CLw== 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=wtNI2O6AEp61Y9QSjvF5kNuOpZDHyAZw7efBnc860A8=; b=fNig10XU2EJw6kePp+o+mSoQd43TXUyzr9QuTpQqU04BNWBE2+XRvhszvAXGAGwK/E wLKnGliSQF292QvF0d60OepCw045mEvx9oCXhEfbSxE73pxMZImT4LX+gdyW5hYNnwWh ZnU9VQ7N4RTtyhqOkTqLcTM+4sMcyCx8ClsPOaZD0HITZCTS+FHWDXOUTGO97cmu0JGX 7MDxLpylcAxJunNj/o0VjwuNSFnrrjcHJ5LhFWtczId4zzfCwkl8Yf8vmsuCUqzb01TI a4DWY8oJ1u46CP3K/zHFQo4pyJaR3bMplLSi0oEnj3PSyPswbdmf5J/H8i13IuBGIy7S NjLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=n5lKGhyE; 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 j12-20020a05640211cc00b00454b9403108si3015831edw.219.2022.09.21.10.30.59; Wed, 21 Sep 2022 10:31:26 -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=n5lKGhyE; 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 S230100AbiIURLw (ORCPT + 99 others); Wed, 21 Sep 2022 13:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbiIURLv (ORCPT ); Wed, 21 Sep 2022 13:11:51 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 023879AFFA for ; Wed, 21 Sep 2022 10:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663780310; x=1695316310; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=DiEGsbtLgITtlM9yaoGvIKChT6L0JZ2Jt6gnaU2GdQM=; b=n5lKGhyEqp/GGuvlIn75qht5n/pE1FSe5a7XqbgLxm2QjbtkuA02CIKI D9kilLxpi89UdkI0e5LELpM8qnpehYsM0AnW7V8fkiXl/rdWwl+NFR86i HHIhWTFrK1fLeZzTDbat7ttgziRE2G3iNUjfUN6KF7tDs2qpJSyGsoqa7 gxwvvYhlQDcWb+XryHWL0qOx5qh3wyx+7edQC0mr4rFiZYA4j7CAt6XA8 eCo06doMt/L/OWcKLXMPFuNi8uBWzKLoXfacAro8ggqiKep3iOUOVs6Ke CgY3+4aj6C6mU6/+jxksWeYyhuhmsWKv7kqlJFlIy4683TeAuVFf/D1Hb w==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="283114628" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="283114628" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 10:11:50 -0700 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="948240024" Received: from nchaplot-mobl1.amr.corp.intel.com (HELO [10.209.89.231]) ([10.209.89.231]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 10:11:47 -0700 Message-ID: Date: Wed, 21 Sep 2022 10:11:46 -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: Ashok Raj Cc: "Kirill A. Shutemov" , Jacob Pan , "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, Jason Gunthorpe , Joerg Roedel References: <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> <562dec4d-a39f-b517-58a3-45f691a2d10a@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE 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/21/22 10:08, Ashok Raj wrote: > On Wed, Sep 21, 2022 at 09:57:47AM -0700, Dave Hansen wrote: >> On 9/15/22 10:28, Kirill A. Shutemov wrote:> + /* Serialize against >> address tagging enabling * >>> + if (mmap_write_lock_killable(mm)) >>> + return -EINTR; >>> + >>> + if (!arch_can_alloc_pasid(mm)) { >>> + mmap_write_unlock(mm); >>> + return -EBUSY; >>> + } >> Shouldn't this actually be some kind of *device* check? > The device will enable svm only when its capable of it, and performs all > the normal capability checks like PASID, ATS etc before enabling it. > This is the final step before the mm is hooked up with the IOMMU. What does that mean, though? Are you saying that any device compatibility with an mm is solely determined by the IOMMU in play, so the IOMMU code should host the mm compatibility checks?