From patchwork Fri Sep 18 10:18:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 11784593 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B32F86CA for ; Fri, 18 Sep 2020 10:21:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 817DB208C3 for ; Fri, 18 Sep 2020 10:21:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lzqQYGc7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="An2RGosn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 817DB208C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vN+/oshBr8qsXYUEUh3G1JK6K88j7KE5z7oeg4KaRZg=; b=lzqQYGc7/pNWBtwcYeSngE/VC E/exv+XcuutbVkkY0LXrtlUtEM/pBmrr/mXzHlFAdOmFtJvxdrioYfT9YzU/ZWndSS5eg5Rlsr0+1 6UFJBynBr9Gcsxd9+VPLbdW8JiL74oQnCAlCDB8K8bMlfMxEVF2VMVwX/79zoRQSEpkF6W9Rk7aPj J+I7dJFjr0cvq8Qow656iCb21kzreU4MBv2lCgXjqkCZ2rWaBoM9W6Lxk6ZWugSyYNPZYEMNejHjA mJ5lz3wW3fZ3D8UL/+fcH1c22Q646JK6/xJeGdHia4qHONQ0xnPBJmz4WfjqOwgUaLkMJoGx6ApKf Ivw2JtBKg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJDUq-0005DE-Cs; Fri, 18 Sep 2020 10:20:04 +0000 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJDUi-00059H-Mi for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2020 10:19:57 +0000 Received: by mail-ed1-x543.google.com with SMTP id k14so5597371edo.1 for ; Fri, 18 Sep 2020 03:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2gh2U/OQRDlfxCtYoS0doxF26o80NSyyKwHk1RFsbXk=; b=An2RGosn33WkwrKn91f2hcynPhO0aguQcKdHhB2LUthuXwojJqnDpiGkJsPrYipiDA pBgHZMUkueqCEe2uGK/BQfNvSQljRhhsrTdgUWEHCQflnsC1YN6klyAzU0ViKd5+vM9j XkqhgBI7f1kR26cFqbzkHrCeJaK6C3OilUnnnp5ImWI20wcvVgomBFVP5gGMfa+DzjlS Zisu/ODl7eC3QiRm5h43VRGkMqyahZfMOwNiASorDsh6TdAVQJpCdhjLvRpsORdHhhLq n32un+szGBkhCKxnv6Rs5rFm8usvoAtLjxfXziCFDqbp7uGBXaQlU3CldYPAjvBR3noy T7fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2gh2U/OQRDlfxCtYoS0doxF26o80NSyyKwHk1RFsbXk=; b=mYKDpX/IvomgyUu8ktt8z65beYmUNJXX+R4bGJd+7xPHyv0sEZK1amASh8zFhy3p3U 0XHZjOuOYmAVG/P0/AOlpxQEkO3MOOLu+aAUujoJmH2iPsvKYr7WlbcB0IMsGWqDR3qR BMwYRPib5xKyUDDVIlEKAhu+WCsWyMGJIamED3tMgxAI0fZvih/nteXc+V+2BPSH1tf8 qOUatCx2uOSoHxuBhDWrwU8p5A/HHMzfKirAw/gbaBomXacbMv+V84exmuDOSydP5YcA 8RMsz45n1c2XtupN+9vwArLLaDtJNPuLfbF859NjK4W+zQAv2t+g8pK3XSMN/b+QpU/W Xraw== X-Gm-Message-State: AOAM531s+ZbdCv+KwCiPe1oL7oPpVp15a6Es80dLmI5eAK7dI+20WD+w nvI3r8azcsGv6tFgJzIoDmqAzAZgio0mvdGF X-Google-Smtp-Source: ABdhPJwCf8UyHhQnUAUKzshX9fTYq/59eQXnaDMxaWJg5DmcPX6/b+kkPryQE6Uc4EgCXvl5fGzAuQ== X-Received: by 2002:a05:6402:176c:: with SMTP id da12mr38578214edb.386.1600424395283; Fri, 18 Sep 2020 03:19:55 -0700 (PDT) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id r16sm1940674edc.57.2020.09.18.03.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 03:19:54 -0700 (PDT) From: Jean-Philippe Brucker To: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Subject: [PATCH v10 01/13] mm: Define pasid in mm Date: Fri, 18 Sep 2020 12:18:41 +0200 Message-Id: <20200918101852.582559-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200918101852.582559-1-jean-philippe@linaro.org> References: <20200918101852.582559-1-jean-philippe@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200918_061956_778438_6CCB1B98 X-CRM114-Status: GOOD ( 13.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:543 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fenghua.yu@intel.com, jacob.jun.pan@linux.intel.com, catalin.marinas@arm.com, joro@8bytes.org, robin.murphy@arm.com, Christoph Hellwig , eric.auger@redhat.com, Tony Luck , Jonathan.Cameron@huawei.com, zhangfei.gao@linaro.org, will@kernel.org, xuzaibo@huawei.com, baolu.lu@linux.intel.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Fenghua Yu PASID is shared by all threads in a process. So the logical place to keep track of it is in the "mm". Both ARM and X86 need to use the PASID in the "mm". Suggested-by: Christoph Hellwig Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck Acked-by: Will Deacon --- https://lore.kernel.org/linux-iommu/1600187413-163670-8-git-send-email-fenghua.yu@intel.com/ --- include/linux/mm_types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 496c3ff97cce..1ff0615ef19f 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -542,6 +542,10 @@ struct mm_struct { atomic_long_t hugetlb_usage; #endif struct work_struct async_put_work; + +#ifdef CONFIG_IOMMU_SUPPORT + u32 pasid; +#endif } __randomize_layout; /*