Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4368852rwb; Tue, 20 Sep 2022 12:54:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7B14Z9rTchr0ulDwcFSNV3/LWuv6bUzObi6Xbt1ssi7MfbTt1Vujrs5Cq7V6p40/20Wbzv X-Received: by 2002:a17:907:25cc:b0:77b:a6c7:6d2b with SMTP id ae12-20020a17090725cc00b0077ba6c76d2bmr18779965ejc.148.1663703680754; Tue, 20 Sep 2022 12:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663703680; cv=none; d=google.com; s=arc-20160816; b=TUKT/MjC9Seux2ob6WkAJoBWgcVoTxEAE4iJCa2fjc47wIBbtrTx6JIvPIpiXkcMMs 9RWEuQiTJCW82oTcGUNyTfjxLJeq7h25ac/YolFrbdR1LlzanmaO7xuDeGv9j3uI3vFP A/7SR78+XQ/7eTmXdGbgyEQbfe3/Nk7Pk5dhjlah+08eYdspF4deUiK10mzJnQLgkKPb wnZXLg0m8H6I/guSAv1/p4dn13/dXkFObFm7L0k5YlmOkkFHScYw+BI/raCrYUQ13NjI E5HtySPoJdIGT3mixIMRB3wpG2S4KB+TX20ld7rbntlmtpp73BMk1uQ+1QSXB+9UZZiX o8Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=2GFWGGrKGBa5F7dNKu2gGRRpNEqVW9ty/j8I0SRCClM=; b=plEKilabFY5YRk7XMHblV+WZxdGFJ8X+TU8gZR3jGlI76y7iwsrmAc0IWS+ePOaYRT c8W5GB+PgOs5zy9xs+DNLMANw1tSjVG2WYwnXe9sT99JwYZYe+CKLp4etRr9hP1tKMae zlKN0t5+baMVjgwjixId/efjA/Bx98D60BYDBH28upu7cjwyJQ3gplHYxxZTnBgrQUXF wS4XHmg5ljNVrpRP32G+3vMiObEyxY1xfFx5JjI3S1O1JPmRAf0j/kjltTQq04pU1MEA 0laHhR15NugKH9ta1Kq444AcjskcwgN5P1u9WGD+qT6WQu81k/VUSsi4zFIPKj+CS7E7 EU+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=agxLF798; 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 dz21-20020a0564021d5500b00454c5d9eae7si4467edb.35.2022.09.20.12.54.15; Tue, 20 Sep 2022 12:54:40 -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=agxLF798; 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 S230178AbiITShk (ORCPT + 99 others); Tue, 20 Sep 2022 14:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230382AbiITShi (ORCPT ); Tue, 20 Sep 2022 14:37:38 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D7047435C for ; Tue, 20 Sep 2022 11:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663699057; x=1695235057; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cwaHxCFQdCA+LHKA01+dBZuk8JhukqOfP2h7q+evcCs=; b=agxLF798DH3RQuBu9iHgAOHXO/Tf0CB2lz5l+SrMs8aWZ1bn43CFz5Cl kUD3115lh3oHfaOaznUjyRx7YNx5afhASuCIJgLj6HbsbCeBp3PjyS/mb 0+abbIU+b7Ig/+bDJEYITEp9IBw2rkOfJiJ8iWw7CqMkEeWuhRzm0ij6E N6WC6c6fpIOjLwk5GngICtnrakTYkn5/6XOmchCHHssAXG/mZ74Wmi34+ kIBefQ05rAxuIO3FcKZNEzn5V0BkPyuXyWQ0G0HIU7nePA9gHOIXI569/ Jn8jr5wZr/yF+G8d3+NIe4Q0VY7GdKuksCONKPFrCZTDRHJHo9jDvu0A6 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10476"; a="299773230" X-IronPort-AV: E=Sophos;i="5.93,331,1654585200"; d="scan'208";a="299773230" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 11:37:36 -0700 X-IronPort-AV: E=Sophos;i="5.93,331,1654585200"; d="scan'208";a="794370245" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.198.157]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 11:37:36 -0700 Date: Tue, 20 Sep 2022 11:41:04 -0700 From: Jacob Pan To: Jason Gunthorpe Cc: Dave Hansen , "Kirill A. Shutemov" , 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 , jacob.jun.pan@linux.intel.com Subject: Re: [PATCHv8 00/11] Linear Address Masking enabling Message-ID: <20220920113742.277ac497@jacob-builder> In-Reply-To: References: <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> <15741fdf-68b6-bd32-b0c2-63fde3bb0db2@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 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 Hi Jason, On Tue, 20 Sep 2022 13:27:27 -0300, Jason Gunthorpe wrote: > On Tue, Sep 20, 2022 at 09:06:32AM -0700, Dave Hansen wrote: > > 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. > > Sure it does. The rules for how the page table is walked change. The > actual bits stored in memory might not be different, but that doesn't > mean the format didn't change. If it didn't change we wouldn't have an > incompatibility with the IOMMU HW walker. There are many CPU-IOMMU compatibility checks before we do for SVA,e.g. we check paging mode in sva_bind. We are delegating these checks in arch/platform code. So why can't we let arch code decide how to convey mm-IOMMU SVA compatibility? let it be a flag ( as in this patch) or some callback. Perhaps a more descriptive name s/arch_can_alloc_pasid(mm)/arch_can_support_sva(mm)/ is all we disagreeing :) Thanks, Jacob