Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp148227pxy; Tue, 4 May 2021 21:33:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUr6vy5utzh/DmmB+UFuUjfe6zaHCtMLkiHCydRF4BlSwncAm5NFGR8SXct+uETdbR2wz/ X-Received: by 2002:a17:906:551:: with SMTP id k17mr4731786eja.69.1620189187155; Tue, 04 May 2021 21:33:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620189187; cv=none; d=google.com; s=arc-20160816; b=PFkuuDMN5eOR5N+LyAL0oDRNQfd+9eR2X2hgH5seX0ZKuoasYjsDKDCuaq6j489KB5 XqLi7XQw62lJA/7Uz2jx7eJA+42VohtuH79avuO1EcVeL1Rqi2E3Sp9GlbDIHln/09L2 DiAyql5rWGqh8Vl5l/rOrjW70cnuPOK1GkqUqGB/1DHGcqHCFqRrirb/3gSVDYmJn61e zBd4CTIbVoYiW+7IlQwwUARB1Ho/StQgJEexydYXOBbzPAHA3IMixwiUM6jqAfpw81xf FtBdoAm0OPV+zUDhGDb/HcBI8bNgyUvXz7dDlDYAKyiLhOSpvHI1oN1QJdoOIhuYuQLL MDVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=dkfLmEwUYBpgZ3VRNqk3l0eUK71c8qK9M3LO8M6K/A4=; b=JDUY1O3DrVrVPQVZqdfhzcBWzud997cxPpHDVd3RkmWLte3Clh5gXbH07MrlLgDkEm 5DmPzI9PT26KzkJFUhd3UQdxjyaCyDKqij7QpbrV4+PzL5SPkYSwqip8hNnRHmDJyX4g WUMt/PFkQr/EoHqbIV9BPOa+1dCnuvBcGYTGRnQWppo4IMA8sWEo/ii2soICi9XTpVuY nYFzgCGht+7CvYAN1sAmkykeYDo32b1MVGvHAVJTnewEeVi/U1GZO8UmFjQ3L4H+RHMq m2d5CRQPovAZ1Hgf5DAspSPhG5lg0W/W9uk9BjWL/p2+BYzPXrqFccXmentarX8GVOeo Nuuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b="j/2/x3IG"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si3636213eje.15.2021.05.04.21.32.20; Tue, 04 May 2021 21:33:07 -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=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b="j/2/x3IG"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231586AbhEEEaD (ORCPT + 99 others); Wed, 5 May 2021 00:30:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbhEEEaC (ORCPT ); Wed, 5 May 2021 00:30:02 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60985C06174A for ; Tue, 4 May 2021 21:29:05 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id b15so1142535pfl.4 for ; Tue, 04 May 2021 21:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs-ru.20150623.gappssmtp.com; s=20150623; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=dkfLmEwUYBpgZ3VRNqk3l0eUK71c8qK9M3LO8M6K/A4=; b=j/2/x3IGENqBt1eM/uTRys9FwUAyOd7d1CPrhgnUeDqkdWgk208eetcKGgAwQm0ClS 807Quye1hCoirriQHZ8jB6fGbUq8JRjgdvApCO7Sk2LBzgsemv98xXqPqhRBtNTYFbQ2 c+pvRacMoE5zUBhZlKz1Zp/I3sP37UVPa/SyFRnF0O9Vv0+UUbY2fjviPRN77nwLubJm WkGzNUwF7P0ucQPk4Bw8kKF/DF8Lt/l4gAxFgApBd4DtEkMPmr//4N1veXHtU6pvce11 I2Ygs6SMbnq3+EW7szo7yKB9Z6UagEOZuXHkUZLToFvlJwesJGEXi2KI7w4v+L0cFgNN jqBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=dkfLmEwUYBpgZ3VRNqk3l0eUK71c8qK9M3LO8M6K/A4=; b=e8/o92G6LIzYhMzliNS5jsJlwhpDKaG3MXPJueCT5GVWjmXk681ODINNnah5D0pcxL +fFPQR9jxKPWR3NaF5D2blUykJVvk1h57/A8/3qv9PtFLJ6l6Zh/JC7rK2nU4KsBHVKJ kuBZiFLnkDqx8AxAWmi+ohroOuIPIlQap65gh5n3JW3q+LJyrKehaAmmQpWjWqXLxcnC QQ2opjJ8yJMyfhIT2HOrBf1Dc47EryMa6ePnfqUcF9VvK5gHdmTLikpDetYkSwQPq+lo euDeT0YQWwsP8jwfYkQk1lvtIZNrDE3KSiwgSFwc3scbyMPoGWHLMuuG8omwauWhgche NGeA== X-Gm-Message-State: AOAM532q/szMvW0X60cJYEAtCJQtjuqmlfkQ27fh92s4ycyGgu8DIx6q KbdXEQBWJaTg0r2g0kKaLW0hSw== X-Received: by 2002:aa7:8051:0:b029:272:7b9c:cde1 with SMTP id y17-20020aa780510000b02902727b9ccde1mr26211062pfm.55.1620188944813; Tue, 04 May 2021 21:29:04 -0700 (PDT) Received: from localhost (ppp121-45-194-51.cbr-trn-nor-bras38.tpg.internode.on.net. [121.45.194.51]) by smtp.gmail.com with UTF8SMTPSA id l6sm5170914pgc.68.2021.05.04.21.28.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 21:29:04 -0700 (PDT) Message-ID: <7e5c2276-ca1c-a8af-c15f-72a7c83c8bfa@ozlabs.ru> Date: Wed, 5 May 2021 14:28:53 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Thunderbird/88.0 Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Content-Language: en-US To: Jason Gunthorpe , David Gibson Cc: Alex Williamson , "Liu, Yi L" , Jacob Pan , Auger Eric , Jean-Philippe Brucker , "Tian, Kevin" , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "cgroups@vger.kernel.org" , Tejun Heo , Li Zefan , Johannes Weiner , Jean-Philippe Brucker , Jonathan Corbet , "Raj, Ashok" , "Wu, Hao" , "Jiang, Dave" References: <20210421133312.15307c44@redhat.com> <20210421230301.GP1370958@nvidia.com> <20210422111337.6ac3624d@redhat.com> <20210427172432.GE1370958@nvidia.com> <20210429002149.GZ1370958@nvidia.com> <20210503160530.GL1370958@nvidia.com> <20210504181537.GC1370958@nvidia.com> From: Alexey Kardashevskiy In-Reply-To: <20210504181537.GC1370958@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/05/2021 04:15, Jason Gunthorpe wrote: > On Tue, May 04, 2021 at 01:54:55PM +1000, David Gibson wrote: >> On Mon, May 03, 2021 at 01:05:30PM -0300, Jason Gunthorpe wrote: >>> On Thu, Apr 29, 2021 at 01:20:22PM +1000, David Gibson wrote: >>>>> There is a certain appeal to having some >>>>> 'PPC_TCE_CREATE_SPECIAL_IOASID' entry point that has a wack of extra >>>>> information like windows that can be optionally called by the viommu >>>>> driver and it remains well defined and described. >>>> >>>> Windows really aren't ppc specific. They're absolutely there on x86 >>>> and everything else as well - it's just that people are used to having >>>> a window at 0.. that you can often get away with >>>> treating it sloppily. >>> >>> My point is this detailed control seems to go on to more than just >>> windows. As you say the vIOMMU is emulating specific HW that needs to >>> have kernel interfaces to match it exactly. >> >> It's really not that bad. The case of emulating the PAPR vIOMMU on >> something else is relatively easy, because all updates to the IO page >> tables go through hypercalls. So, as long as the backend IOMMU can >> map all the IOVAs that the guest IOMMU can, then qemu's implementation >> of those hypercalls just needs to put an equivalent mapping in the >> backend, which it can do with a generic VFIO_DMA_MAP. > > So you also want the PAPR vIOMMU driver to run on, say, an ARM IOMMU? This is a good feature in general when let's say there is a linux supported device which has a proprietary device firmware update tool which only exists as an x86 binary and your hardware is not x86 - running qemu + vfio in full emulation would provide a way to run the tool to update a physical device. -- Alexey