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: 11784557 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 A2AAC618 for ; Fri, 18 Sep 2020 10:19:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4C58E208C3 for ; Fri, 18 Sep 2020 10:19:59 +0000 (UTC) Authentication-Results: mail.kernel.org; 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 4C58E208C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 365CC6B005C; Fri, 18 Sep 2020 06:19:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2F0F76B005D; Fri, 18 Sep 2020 06:19:57 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B8956B0062; Fri, 18 Sep 2020 06:19:57 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id 0027F6B005C for ; Fri, 18 Sep 2020 06:19:56 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BD7498249980 for ; Fri, 18 Sep 2020 10:19:56 +0000 (UTC) X-FDA: 77275786392.28.ink81_0b077c42712a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id AA6056C05 for ; Fri, 18 Sep 2020 10:19:56 +0000 (UTC) X-Spam-Summary: 1,0,0,0d52152728cd932f,d41d8cd98f00b204,jean-philippe@linaro.org,,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1540:1711:1714:1730:1747:1777:1792:2393:2525:2559:2563:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3351:3865:3866:3867:3868:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4043:4250:4321:5007:6261:6653:6742:7576:7903:9025:10004:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12895:12986:13069:13311:13357:13845:13894:14096:14181:14384:14394:14721:14777:21080:21433:21444:21451:21627:21740:21749:21819:30054:30064:30070,0,RBL:209.85.208.68:@linaro.org:.lbl8.mailshell.net-62.2.84.100 66.100.201.201;04yf6efryqtkbetzisgzgeux3cpr3ycaqrksaemabid169azmgpec6mex9wxjnh.riwfismmz6hqz3fdmkpiaz3iree3f8zx9jemr5c3arkoidch3w5xgatwx6wbdyj.c-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bul k,SPF:ft X-HE-Tag: ink81_0b077c42712a X-Filterd-Recvd-Size: 4200 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 10:19:56 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id a12so5466159eds.13 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=LrNGjrepLzeZPCy4Nteqs2CFX/WpaHi8QRHqUai8Rx6jIqFbCcGQhJrpwGdE0j864U 6G+5MNgMaL4+M7Ugc1bgtyFAlksKfFiJvMrPOEcE3+RsuQZk1boz5+xi0FpSYOVez73Z bIg6fLbuNtaVUitsp8Zvg1OPiuVsJctLiHtVzhUUf6/8Vm+cmSjxyuMul0LtGYZ3CPpM xTHjRetTwi2KIr76TBpHbZwpIT8qZJOTbpZwSxWXgpnUV5M3RDQ83XrLHhlp/9hV/iZ3 Bteb3owXPBQJgczlZdISU9Y1OBTghGgnYzs+c9jRykRkPRXbvqm9dOG8Xd3L+DK9q6cW t8+Q== X-Gm-Message-State: AOAM533Ji94eL24QMbpSkZRWKGxMeBnkUai0LHuuKcSGR4OENsDEnGqL r3XFLaFXXwkXleMUfdBwEc8Avw== 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 Cc: joro@8bytes.org, catalin.marinas@arm.com, will@kernel.org, robin.murphy@arm.com, baolu.lu@linux.intel.com, Jonathan.Cameron@huawei.com, jacob.jun.pan@linux.intel.com, zhangfei.gao@linaro.org, xuzaibo@huawei.com, fenghua.yu@intel.com, eric.auger@redhat.com, Christoph Hellwig , Tony Luck 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-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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; /*