From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D74DAC433E2 for ; Thu, 17 Sep 2020 14:40:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5C7762223C for ; Thu, 17 Sep 2020 14:40:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nWLsOgjo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C7762223C 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 D5D9A6B0003; Thu, 17 Sep 2020 10:40:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D34C86B0037; Thu, 17 Sep 2020 10:40:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4A616B0055; Thu, 17 Sep 2020 10:40:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id AD4ED6B0003 for ; Thu, 17 Sep 2020 10:40:12 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5BCBE3635 for ; Thu, 17 Sep 2020 14:40:12 +0000 (UTC) X-FDA: 77272813464.14.sand20_0f157a827123 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 2EB6018229835 for ; Thu, 17 Sep 2020 14:40:12 +0000 (UTC) X-HE-Tag: sand20_0f157a827123 X-Filterd-Recvd-Size: 4936 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 14:40:11 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id w2so2225275wmi.1 for ; Thu, 17 Sep 2020 07:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AFLyIaK95Pcs3v3wg/rAuVTRxjhXIS5PXfpZ3zAaOv4=; b=nWLsOgjoU61ywvQ9ZZ82TsQRhow3wqYpSRb7J3wrgivoxq+dHXdSETF3r8wIxY00Am BIU5UH87TtUtB+HdqoiumsJLElQEnKYOVcBNrkycJGKU0aE2ZBcUW/HDU+JzXELttajy aWIjt7wufdqdBtB43FS6vYywByed9MFwtiI9wQrB9sICqofHKioVFZPGrsRqjfUHxjBO 7uXR6+UQZrebS7j3o8Wr8jbOOphKwcs1eYzv/854R7WIliBwwohybQEvJJWKN1z2/yQA 1v2Dea/oMLcs0y3iFzEMK9ef9WkXjT3mhbRMX/lDcTK1MXCvgAh+oCC6Thl4YvyWSTPu WvxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AFLyIaK95Pcs3v3wg/rAuVTRxjhXIS5PXfpZ3zAaOv4=; b=IyS0tA4u1WqjT/EV5PavWyWJiQmoa1oZKuyOlxdxSbl+IMAYN7OJoKpJJyiAatsFmK NdcSLpOVhbsDidcBXww/WChmcVnUcwTXpaNpDoqrH7JgchS4G2BSOOR9t4Z4aUsrYyxD VcUS7bEEqJ7kXUEy1wBt5Rh23cigMmSFkM8R6Abc0vbrkHNBb30Er+NHhnrfNB6RtRLx Xs/XOvw4wUuWlYqWTXXpAVLwkO4LqCd3uYVt2iCPPpODnHcZrjQNeDnTln5PiX8ntBXX bnewJJ++AQUAPdhETJfHF1aYxJjlaZtpPZDWkLGUx44wfu8mQs0eQmpGJtkdkoJmv3if MQXQ== X-Gm-Message-State: AOAM531VOHYXOqYgBvYTo6Sew4o9A/Ch63B0LC9/O8fNN3txXzmcLo9a TRnbWUtXCl8XCR88G6gpa8VGsw== X-Google-Smtp-Source: ABdhPJxSUUGTyJ6hnRF8W/ZFmbozBT4cLiO00TWm8X3HAAtPbdXGCiYd8wCQULGNjrxSn5FlEfb6QQ== X-Received: by 2002:a05:600c:2155:: with SMTP id v21mr10911853wml.118.1600353610755; Thu, 17 Sep 2020 07:40:10 -0700 (PDT) Received: from myrica ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id f16sm9869987wrp.47.2020.09.17.07.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 07:40:10 -0700 (PDT) Date: Thu, 17 Sep 2020 16:39:51 +0200 From: Jean-Philippe Brucker To: Auger Eric Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, fenghua.yu@intel.com, catalin.marinas@arm.com, Suzuki K Poulose , robin.murphy@arm.com, zhangfei.gao@linaro.org, will@kernel.org Subject: Re: [PATCH RESEND v9 10/13] iommu/arm-smmu-v3: Check for SVA features Message-ID: <20200917143951.GE134903@myrica> References: <20200817171558.325917-1-jean-philippe@linaro.org> <20200817171558.325917-11-jean-philippe@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 2EB6018229835 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: On Tue, Sep 08, 2020 at 11:38:31AM +0200, Auger Eric wrote: > Hi Jean, > On 8/17/20 7:15 PM, Jean-Philippe Brucker wrote: > > Aggregate all sanity-checks for sharing CPU page tables with the SMMU > > under a single ARM_SMMU_FEAT_SVA bit. For PCIe SVA, users also need to > > check FEAT_ATS and FEAT_PRI. For platform SVA, they will have to check > > FEAT_STALLS. > > > > Introduce ARM_SMMU_FEAT_BTM (Broadcast TLB Maintenance), but don't > > enable it at the moment. Since the entire VMID space is shared with the > > CPU, enabling DVM (by clearing SMMU_CR2.PTM) could result in > > over-invalidation and affect performance of stage-2 mappings. > In which series do you plan to enable it? In the third part, after the PRI+stall series. I still haven't had time to look at solving the stage-2 DVM problem (pinning VMIDs through KVM), so it might be a while. [...] > > + /* > > + * See max_pinned_asids in arch/arm64/mm/context.c. The following is > > + * generally the maximum number of bindable processes. > > + */ > > + if (IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0)) > Out of curiosity, What is the rationale behind using > arm64_kernel_unmapped_at_el0() versus > IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0)? > CPU caps being finalized? I'm not sure. The caps are finalized at this point. I'll change it. > Is that why you say "generally" here? I said "generally" because having less PASIDs than ASIDs is in theory possible, but hardware will normally support 20-bit PASIDs. > > + asid_bits--; > > + dev_dbg(smmu->dev, "%d shared contexts\n", (1 << asid_bits) -> + num_possible_cpus() - 2); > nit: s/shared/bindable? I find "shared" clearer, with regard to contexts Thanks, Jean