Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp754284pxb; Thu, 25 Feb 2021 14:24:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuaO260gxqniN+o3oe1nZgmfcZtcvoqWfvZrTb0xqKSS1g0wSMWzxeuCKDUlOZg27SYonI X-Received: by 2002:aa7:c80a:: with SMTP id a10mr147414edt.380.1614291864670; Thu, 25 Feb 2021 14:24:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614291864; cv=none; d=google.com; s=arc-20160816; b=m5F2+87IfEksCvt59R6fTBxOcvCXgr/mZeSZOny9r9U2BBlLFW17yWKll7+XFuKvR2 KR4m6Rzmm59cTAsDlXhWqUjhOxImbsPrBEoZ9Q85mIhPEyAlTnUXq3CUJiET/VaXUlW3 RWOhDoh9ku/ZJ+MjwOSJ7bYjsoskA/wmzvQGDdPc0E9IQtJ6DdXDigVSU45Nr1Y7x0UE Jf1qZD6H7BkSvAVxip1vpRhcqbqs+2JYVuYl4+k0HCoWUe9A3bYaJh4Ww9j76soprDfh SpBBtFyiN6Mqjdfwy+Z3jehBPW0qHtUHswks1XpSaqWt+59IvxllKw+EyK/Qkpe7hBdh H3pA== 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:ironport-sdr :ironport-sdr; bh=Ax5k1AmSMdtY4HsXlhCkc9BIRTXyEDJ4N34woZy2dQw=; b=NxF0rr101LDtH9J+wgg0EY8v1Fq4EFqnBkyszqqV/qFtbExq9u4TW2q+1kAIGu8yV4 P+O1GT+2uchyF6VJh4KtlbWgDEdJEuY05y+roRl+o/DxLmc03h6IO/6vyE0xxkO7gu91 BPgYOcV3Og5QAqrPSHoQ3KDMVNQJtVvE40kwBlVdEXAsYBsolPgs6qQliPe5cU9qJ1oS p5kOHkDYckmc2BdZ5o3G49Qg6XscFWj2zObLP35N/tARTxxEOpvHJMCpIvc8pK0TEUds O0h6q1/VV8kiZvgy5y0dSaCE9kxyk7rjQFtEokCmkqKj+tu8NBTJ6kBQnz+Y3zAJFKnU yPQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si4107632eje.586.2021.02.25.14.24.02; Thu, 25 Feb 2021 14:24:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233443AbhBYWXb (ORCPT + 99 others); Thu, 25 Feb 2021 17:23:31 -0500 Received: from mga03.intel.com ([134.134.136.65]:3567 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233455AbhBYWSE (ORCPT ); Thu, 25 Feb 2021 17:18:04 -0500 IronPort-SDR: edwX2uxP8Nqr+3PbHjpS/LjIi/TUOZ5uMxRuNhDF/OAb0wQvPXL+fIsqWvlraCzmw20gIIgHy7 fL1IMyMWQe6w== X-IronPort-AV: E=McAfee;i="6000,8403,9906"; a="185749632" X-IronPort-AV: E=Sophos;i="5.81,207,1610438400"; d="scan'208";a="185749632" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2021 14:17:18 -0800 IronPort-SDR: HBKSHiLe0MtfvnRN4zT3jI0f0Rqf5KuNeB1ORFZDVA8T397xDurDMDhDQchjk4a8veYMxlqzmu CNop4lCWAW1w== X-IronPort-AV: E=Sophos;i="5.81,207,1610438400"; d="scan'208";a="404589780" Received: from otcwcpicx3.sc.intel.com ([172.25.55.73]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2021 14:17:18 -0800 Date: Thu, 25 Feb 2021 22:17:11 +0000 From: Fenghua Yu To: Jean-Philippe Brucker Cc: Joerg Roedel , Lu Baolu , Ashok Raj , Jacob Jun Pan , linux-kernel , iommu@lists.linux-foundation.org, zhangfei.gao@foxmail.com, linux-mm@kvack.org Subject: Re: [PATCH v6 08/12] fork: Clear PASID for new mm Message-ID: References: <1594684087-61184-1-git-send-email-fenghua.yu@intel.com> <1594684087-61184-9-git-send-email-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jean, On Wed, Feb 24, 2021 at 11:19:27AM +0100, Jean-Philippe Brucker wrote: > Hi Fenghua, > > [Trimmed the Cc list] > > On Mon, Jul 13, 2020 at 04:48:03PM -0700, Fenghua Yu wrote: > > When a new mm is created, its PASID should be cleared, i.e. the PASID is > > initialized to its init state 0 on both ARM and X86. > > I just noticed this patch was dropped in v7, and am wondering whether we > could still upstream it. Does x86 need a child with a new address space > (!CLONE_VM) to inherit the PASID of the parent? That doesn't make much > sense with regard to IOMMU structures - same PASID indexing multiple PGDs? You are right: x86 should clear mm->pasid when a new mm is created. This patch somehow is losted:( > > Currently iommu_sva_alloc_pasid() assumes mm->pasid is always initialized > to 0 and fails on forked tasks. I'm trying to figure out how to fix this. > Could we clear the pasid on fork or does it break the x86 model? x86 calls ioasid_alloc() instead of iommu_sva_alloc_pasid(). So functionality is not a problem without this patch on x86. But I think we do need to have this patch in the kernel because PASID is per addr space and two addr spaces shouldn't have the same PASID. Who will accept this patch? Thanks. -Fenghua