Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2859670ybk; Tue, 12 May 2020 09:49:01 -0700 (PDT) X-Google-Smtp-Source: APiQypKuHJWcp8qlrM70hQ6BtDjVLniZumCB+3VApTO77cdnyX4rQ5TZFhXi0+H0g3A/kol31tO4 X-Received: by 2002:a50:e806:: with SMTP id e6mr19319961edn.153.1589302141229; Tue, 12 May 2020 09:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589302141; cv=none; d=google.com; s=arc-20160816; b=Cz6RETkbdsQmRWE0HlHCqQPpXR1ldrZNmUk+2Bi6rIkJCig2j7J6daJ77OVZSQltd8 /JbZtiD9xivBdQx4AaYKq5WiMAt6Ir2JoobKV9C7aZE0IWNRw3xGxHrCw3CT+O3MWu02 wJflBvJUr0LG6UF8Wkfxe8dopTYNYxR2RVDzQGWFbL7WAO7z7bZvrV5NiTbM2as5sq0T Glbsq/wRtURlQlGmbe0ip6xbZTEwufwRgxO91h1rvw9giKUkMP8rpfORXA7LkJAGUiXO YJyxfH4VgvD3cDGP3P1lKMvQobOAGUWfLqqWpRee9g87FiAfL6o2FBXEMFJrjMtQSAWg OjXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jyNo/FD8DQaK2ucnwvUAdPJG4owWhdE2wKYx5rVGxYI=; b=VMH7TQkE+ML8sB3c2raPReQTRUXGWSuC1BLS1iWb64R9oRCSfgdzEdL8mBF2wtVdOS HpcVnIPmMt07TqlDYLB93BrVmX87AatTEorObWaRuf3m4MAmt8CCmY543YBMObN6Bnul K+QB2SrJmaVsGc+Np/gHnuiGfRkX1mMvD1ob1HG7r6IKNZbyUfOaOp5MOmFSTIFkOLQ8 dxyInqT+MPlQZibUqb68HTkPzlApJckfHOr7GonGCd6ZOY1tPhfYDt2KrCG2PzCnYRrv iCU5+V3ui2TC5sDHs6AxFBgX1zIxF6LczLV1M181lEj7h2RHlSOb4wmDFBejszCTCmz3 UB6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=clatA++v; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc2si5385373edb.598.2020.05.12.09.48.34; Tue, 12 May 2020 09:49:01 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=clatA++v; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726367AbgELQrQ (ORCPT + 99 others); Tue, 12 May 2020 12:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbgELQrQ (ORCPT ); Tue, 12 May 2020 12:47:16 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5F80C061A0C for ; Tue, 12 May 2020 09:47:15 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id g12so24215446wmh.3 for ; Tue, 12 May 2020 09:47:15 -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=jyNo/FD8DQaK2ucnwvUAdPJG4owWhdE2wKYx5rVGxYI=; b=clatA++vihr5sTI7dUupzacVS/N7lCVLYB3yV/N5dBG1B2tTi3SyMIL+AT9rTNF4RM whaaPPqLKdjztbhQ6G88AUdB+KZ6RgutaBFsYMakAU5CewEq5W5Z2IKQNcDNtMNOdJia S+Wi+0vcoouQSemfz+P2d3pyqaWJGMB1Teackt4osIMCTle/Q/wCH0Ojbm5v82RWocy0 gxsD8/lNkUdxZjnAAheAO7kqpIMxV9U2axJMnC1aeKnEubwnt8djZJ4/U1FMtzNtqjSj 9bb/GI48q0BZqY/mg0V1iXr6dJRTXCAScM395uW6IHfakeiexg7rOaqobfoR4E0ezkNz gIMw== 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=jyNo/FD8DQaK2ucnwvUAdPJG4owWhdE2wKYx5rVGxYI=; b=SjZUSTUCDBj2k1pcUQNp93GPmeKLdIBa5LnBzj0O932lCcJ4AvS0URiRmT+EH15zDo C38cV+isqMdg21amQ2FUxlIK48Z5BTuS62Lxk/laR6Q0AC3T0l49/RbbMBLGk042QA68 BsWErn5tZU3RvpzJSBdnH9dxFnHC7dw+qJTqYU80N38ZZ8D3zFuVVwIEYLYcsl8JIggQ sVEe9dPppakEnRyamc/kMwArSvh1ZfzPwUr+Sq5FvOB4vUa7e7R4Ae2i9jsAzNZIrLBF b8PkDGadqz1seLPM1pN0i0MYWypwzgAauwQayzhrDLgRJ76Rxv6AplZysDfjXU97PP7F bJUg== X-Gm-Message-State: AGi0PuZ9dXKsAVXynKwrjikJuTYlnLlVMz42q6jUAyx+ada4VuOfuwJs DmVBpv/YUeT0GPcUV9ipeBlnIQ== X-Received: by 2002:a1c:e903:: with SMTP id q3mr36930985wmc.76.1589302033401; Tue, 12 May 2020 09:47:13 -0700 (PDT) Received: from myrica ([2001:171b:226e:c200:c43b:ef78:d083:b355]) by smtp.gmail.com with ESMTPSA id a8sm23851429wrg.85.2020.05.12.09.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 09:47:12 -0700 (PDT) Date: Tue, 12 May 2020 18:47:03 +0200 From: Jean-Philippe Brucker To: "Michael S. Tsirkin" Cc: Bharat Bhushan , joro@8bytes.org, jasowang@redhat.com, virtualization@lists.linux-foundation.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, eric.auger.pro@gmail.com, eric.auger@redhat.com Subject: Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint Message-ID: <20200512164703.GA1902@myrica> References: <20200505093004.1935-1-bbhushan2@marvell.com> <20200512105149-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200512105149-mutt-send-email-mst@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2020 at 10:53:39AM -0400, Michael S. Tsirkin wrote: > > static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > > struct virtio_iommu_probe_resv_mem *mem, > > size_t len) > > @@ -499,6 +513,9 @@ static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev) > > case VIRTIO_IOMMU_PROBE_T_RESV_MEM: > > ret = viommu_add_resv_mem(vdev, (void *)prop, len); > > break; > > + case VIRTIO_IOMMU_PROBE_T_PAGE_SIZE_MASK: > > + ret = viommu_set_pgsize_bitmap(vdev, (void *)prop, len); > > + break; > > default: > > dev_err(dev, "unknown viommu prop 0x%x\n", type); > > } > > So given this is necessary early in boot, how about we > add this in the config space? And maybe ACPI too ... A page_size_mask field is already in the config space and applies to all endpoints. Here we add a property to override the global value for individual endpoints. It can be necessary when mixing physical (pass- through) and virtual endpoints under the same virtio-iommu device. Thanks, Jean