Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1910689pxb; Fri, 5 Mar 2021 02:47:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwD4nylY9w/g3BQK2JgxXtlCJ0jh2zMWhY5Vy73X9O9Rhs0PsvWHor2aTP6UxLux4Ck4fis X-Received: by 2002:a05:6402:549:: with SMTP id i9mr8706987edx.379.1614941270269; Fri, 05 Mar 2021 02:47:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614941270; cv=none; d=google.com; s=arc-20160816; b=V3yaR+SB+mtSKwPIik18nysZYS/agMVw5Z9mm+AUMvs1KMJZqIz1jyD7XkBFSCmyla 8wi/8BrcwVEr8/Gyn/A6TEHM8AhiCSUDIeLywPlOfnWtwE5Gv0N8xjMS5Oh1p4M95sAC 85BUbVFr3VG0gpaJ1/Lwh6w9QeSvjRENUmhMYno5RDRGezoGzXEyjuQqWMo5ZHV1cb9n p1HKJuJ7C9boDeIIalqlZwWi933N8NgcTlwwbfCmHxxYSr8OrcXGzytiISn0dfyy5Ufh 1e2ZUgD/E1q6QqZjbMzAFCMm6X+KG2wHtodr+/2sJ9XzCiRrp58gFU4fnn3JkUBMyQdp YS5g== 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:dkim-signature; bh=QYcloRQYqoQYeneB9TUL5LWRoYdegubdAgTSoIagbwI=; b=vYSERom5uxuUHgmul31ewmG34CA30s+GKzM5P3W/nyLideehSp2mXHwVP5/pGRu0Re oPrTQLQrEjGpc345s+sS0/rJ/JBqTchoL3TJsEvlXBtQFbNHQhhcKQu2A3F7kruGzy9a gM2fXOArg7x5Isxac9l7juoFHiHuoKDXYaMLUkJM43pn7z7MAiao30Ue4uQvruK858O1 eSTykvHnq1ggzKEs+WFqyXMxJeWzPunoqlHytIzvcSFOZQU9y3aMh+KPvOpI734s7l80 C6KuJruqG9NfCFjO6ZwcnXOOwD7KD/BkxEFlEqz7wDYxgTR3I0ReQx4kNvsQRdBhxUdU RtDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l1f+UOwI; 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 d2si1342187edx.95.2021.03.05.02.47.25; Fri, 05 Mar 2021 02:47:50 -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; dkim=pass header.i=@linaro.org header.s=google header.b=l1f+UOwI; 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 S229608AbhCEKq3 (ORCPT + 99 others); Fri, 5 Mar 2021 05:46:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbhCEKqO (ORCPT ); Fri, 5 Mar 2021 05:46:14 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFEB6C061574 for ; Fri, 5 Mar 2021 02:46:13 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id u187so1012663wmg.4 for ; Fri, 05 Mar 2021 02:46:13 -0800 (PST) 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=QYcloRQYqoQYeneB9TUL5LWRoYdegubdAgTSoIagbwI=; b=l1f+UOwIgVlt828ar7VR0vnkFXh4cRc5C417MtipeTaqlFL9hi+QxQf/kRpJECja4M b1VgvXtLOV2KpkBB58JtxLb1r7x39cua/HRZI9XXxtgnnfrWNKNfRFRTEas45fO773zY 7mJT+4G1Sc+QLV2KsJ35V7xN27sbUzT0B7bZHtGhOQSugEZHgtKaZ8IjZJJY8KECnj/e NDxYvkkIxMp0CEG5YQG2rPAaxqFREGuonfLmWbqP9a2as8Ty/JDljoFuQmk5w49uAPkM S2mRfInX6LS/JeefCGRhe0mbClkNBjicwLmnvj5wLTXA7t3Uwhc3PfpgO3P27y1rnfyj Tanw== 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=QYcloRQYqoQYeneB9TUL5LWRoYdegubdAgTSoIagbwI=; b=rQBRRzgx1DUxD0lU+uG8wuEe41YFwRYqkXxh6r8zYx7Ew9yDuwNVV1p+lPjKM+rkZR X0PajiwC3Fqi9Pu7AJdioVeg01svQMI/5yF21VZKiuqETjtQPnLj90iaRTd1SIAXk9f6 WfCK0l0nxE9zMkhQl8Udc7pxDN0UnMyOhNsjJYj7BeLbqQLc7iAoHnAUlA3kqr6GEOeX jP3qKVZejO55FiO+XizGpOYXBCffP6CGewdJATZPZ5rdYRIDCHaWcJklJHXRJCqCMZdb BCZ2FD+WlHB3NkIa9gLeQTopO4FiFJyr/nK2zWkZDlFLd+XJ9gsL5Cek4L7/H4acluQc Wa1w== X-Gm-Message-State: AOAM530gQodbo7z1uki3Zx5OlNSFp0UtWyJJzwhfKCcKlUz8wW0fPyXy 6HEZECuVswoRt2tFMb6vUkA4Xw== X-Received: by 2002:a1c:2049:: with SMTP id g70mr8213376wmg.7.1614941172536; Fri, 05 Mar 2021 02:46:12 -0800 (PST) Received: from myrica ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id o11sm4083278wrq.74.2021.03.05.02.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 02:46:12 -0800 (PST) Date: Fri, 5 Mar 2021 11:45:50 +0100 From: Jean-Philippe Brucker To: Eric Auger Cc: eric.auger.pro@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, will@kernel.org, maz@kernel.org, robin.murphy@arm.com, joro@8bytes.org, alex.williamson@redhat.com, tn@semihalf.com, zhukeqian1@huawei.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, wangxingang5@huawei.com, jiangkunkun@huawei.com, zhangfei.gao@linaro.org, zhangfei.gao@gmail.com, vivek.gautam@arm.com, shameerali.kolothum.thodi@huawei.com, yuzenghui@huawei.com, nicoleotsuka@gmail.com, lushenming@huawei.com, vsethi@nvidia.com Subject: Re: [PATCH v12 03/13] vfio: VFIO_IOMMU_SET_MSI_BINDING Message-ID: References: <20210223210625.604517-1-eric.auger@redhat.com> <20210223210625.604517-4-eric.auger@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210223210625.604517-4-eric.auger@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Feb 23, 2021 at 10:06:15PM +0100, Eric Auger wrote: > This patch adds the VFIO_IOMMU_SET_MSI_BINDING ioctl which aim > to (un)register the guest MSI binding to the host. This latter > then can use those stage 1 bindings to build a nested stage > binding targeting the physical MSIs. Now that RMR is in the IORT spec, could it be used for the nested MSI problem? For virtio-iommu tables I was planning to do it like this: MSI is mapped at stage-2 with an arbitrary IPA->doorbell PA. We report this IPA to userspace through iommu_groups/X/reserved_regions. No change there. Then to the guest we report a reserved identity mapping at IPA (using RMR, an equivalent DT binding, or probed RESV_MEM for virtio-iommu). The guest creates that mapping at stage-1, and that's it. Unless I overlooked something we'd only reuse existing infrastructure and avoid the SET_MSI_BINDING interface. Thanks, Jean