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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52406ECAAD8 for ; Wed, 21 Sep 2022 17:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229496AbiIURLx (ORCPT ); Wed, 21 Sep 2022 13:11:53 -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 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?