Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8137243rwn; Wed, 14 Sep 2022 09:27:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR7UnKJwof9fzQM5MzcYP1yf/2qhm3Fs7n2MyB1wvwc6mIZArwsZOwU0s3lNNQyHdXpVMT9t X-Received: by 2002:a05:6402:2694:b0:450:d537:f6d6 with SMTP id w20-20020a056402269400b00450d537f6d6mr26154663edd.344.1663172841541; Wed, 14 Sep 2022 09:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663172841; cv=none; d=google.com; s=arc-20160816; b=guWYdgenx4m/FBY/gRGs5/hiZ0r1kVp62449fyrKSPSR4Wtxokez4skKo4V+RYz9mU N0+xJU/5vHCMWmULC9K9kDGQGfo8KG7w1xzsctkWJmvi8mX45/6wKnS+wr73w2IFZKA5 GAL7R/nxOZbyt7uuql0dF9ZlEPqseJffUsH9nBMNmiO3O1fMnDuz5Maqi4PTZKWu5qj8 0so8U83tnVx3LK2f/AalqBB670ddK+A9AsTxWRZt5CckcbTTeb88+5F3q6m34vZHfaRy OF4SAE8bPmG5eFDECwMmun2hVQ4oN/dhHuiyKR5oS+/MzabM/sGG3t4HLsiyBApCkJHK HSuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CNs4MglVCK0cnwhher8oXP04wfcxQX8w6twg5ud85JM=; b=XDW6CEaAZiXLJ+6UIwaZYrQMG6yC95PsujGGi7ra81Imxg2JSiO7mfiR6yZfVqV5lv sDKF0oVIUf3km/k10RbgyuyiFGOVjttTbYnNtDlBO3GPFh9k/C5l8U4thJBiuu4mOb6K kST3y4lGu+jrKXx4a29K8OZOeWRnSbLHPAhjuZlOVWta3mdx+OOivv7ZUPsc9jeEP8on sJ9VE/0FEhTcWqsGiuLjDCcqf2qBCI8GaJHX6R3kpYEibw5paQtxwyjMs2iVVgFin+ha 7no9DiCloUvm4LCxmhiXfPnKIYUp0CNphHP3Y6sPlnE0bp9iRlPtHrFThMy9Pm38ipZx 2b6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jfW7T2ZB; 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 e16-20020a056402191000b0044f2bdfc098si14326990edz.532.2022.09.14.09.26.36; Wed, 14 Sep 2022 09:27:21 -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=jfW7T2ZB; 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 S230002AbiINPpo (ORCPT + 99 others); Wed, 14 Sep 2022 11:45:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiINPpk (ORCPT ); Wed, 14 Sep 2022 11:45:40 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB0D761710 for ; Wed, 14 Sep 2022 08:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663170339; x=1694706339; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=2J58XWUXP07cyxLDmZJLpFnGymq3h5HGsgmtzg9SqzE=; b=jfW7T2ZB3a8l4GG9WJkmgciL+pvL/WvJwB+ioibTsWDrx2ikfKs3kYkq 8fI8FW131jjaB6xpSebVe2ZxzhndBvdy5dBulKMETbdk8+OLH5Gz/TmaM Detu7Y+BeLmIyRjvuVofFaXwYx4gs5YMgeDc+OdIzZbGDJVVS3ITsbqhA iowvrv5IpxLuWCt8mlfO+02vFr6652buFo9YyS1jEd3tYo0r24rAG1SKj lgX/3Bqko1Oq50mtxKFxmrzdI/G7/Nun2qDRd1++AOGz5RYirUvO/vv8c K8kHsH8zUnx+GYN/TqRd/eYSmBf1dGBQK1+JdNaDpSOb3eIfYiLcRJiiU g==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="362424197" X-IronPort-AV: E=Sophos;i="5.93,315,1654585200"; d="scan'208";a="362424197" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2022 08:45:39 -0700 X-IronPort-AV: E=Sophos;i="5.93,315,1654585200"; d="scan'208";a="650119021" Received: from gcapodan-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.251.209.179]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2022 08:45:34 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 0B5AA10466D; Wed, 14 Sep 2022 18:45:32 +0300 (+03) Date: Wed, 14 Sep 2022 18:45:32 +0300 From: "Kirill A. Shutemov" To: Ashok Raj Cc: "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, Jacon Jun Pan , Jason Gunthorpe , Joerg Roedel Subject: Re: [PATCHv8 00/11] Linear Address Masking enabling Message-ID: <20220914154532.mmxfsr7eadgnxt3s@box.shutemov.name> References: <20220830010104.1282-1-kirill.shutemov@linux.intel.com> <20220904003952.fheisiloilxh3mpo@box.shutemov.name> <20220912224930.ukakmmwumchyacqc@box.shutemov.name> <20220914144518.46rhhyh7zmxieozs@box.shutemov.name> <20220914151818.uupzpyd333qnnmlt@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Wed, Sep 14, 2022 at 08:31:56AM -0700, Ashok Raj wrote: > On Wed, Sep 14, 2022 at 06:18:18PM +0300, Kirill A. Shutemov wrote: > > > > > > > > > > > > The patch below implements something like this. It is PoC, build-tested only. > > > > > > > > > > > > To be honest, I hate it. It is clearly a layering violation. It feels > > > > > > dirty. But I don't see any better way as we tie orthogonal features > > > > > > together. > > > > > > > > > > > > Also I have no idea how to make forced PASID allocation if LAM enabled. > > > > > > What the API has to look like? > > > > > > > > > > Jacob, Ashok, any comment on this part? > > > > > > > > > > I expect in many cases LAM will be enabled very early (like before malloc > > > > > is functinal) in process start and it makes PASID allocation always fail. > > > > > > > > > > Any way out? > > > > > > > > We need closure on this to proceed. Any clue? > > > > > > Failing PASID allocation seems like the right thing to do here. If the > > > application is explicitly allocating PASID's it can opt-out using the > > > similar mechanism you have for LAM enabling. So user takes > > > responsibility for sanitizing pointers. > > > > > > If some library is using an accelerator without application knowledge, > > > that would use the failure as a mechanism to use an alternate path if > > > one exists. > > > > > > I don't know if both LAM and SVM need a separate forced opt-in (or i > > > don't have an opinion rather). Is this what you were asking? > > > > > > + Joerg, JasonG in case they have an opinion. > > > > My point is that the patch provides a way to override LAM vs. PASID mutual > > exclusion, but only if PASID allocated first. If we enabled LAM before > > PASID is allcoated there's no way to forcefully allocate PASID, bypassing > > LAM check. I think there should be one, no? > > Yes, we should have one for force enabling SVM too if the application > asks for forgiveness. What is the right API here? -- Kiryl Shutsemau / Kirill A. Shutemov