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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47251C6FD1F for ; Wed, 22 Mar 2023 17:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References: Cc:To:Subject:MIME-Version:Date:Message-ID:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I0cA0IHxuksXc9a5pq5Hu6t9QxbWZ80D2QKT8iaC8lY=; b=NNrvrg93mE68XL lD167ebFjRBpgdRGSOl0W8hi0CimZpbHZ3dKAeZGW/uRotqKc66iwuiPCU3sEr5UzIXBwTKQaI0cz 8b9k/nn9/TEjeSUwkrt+VrjXo0lhwpo103zL+pRfZSQ02pNMr87Pe1xNxulIk1GorlSnPuH9LQ75Y jtfeC/MISJ6Ep36UAjoqdb9N7vDFx2SfcA9DdaMimD6yD6fffvstKs++kISkNxTCcIyf+TvlVac6E ZQAH60LCr+AJokc4Cua3V+SeDb8TJ4/2FvnDNbq1hvwE4sMGmIk7h7xcy1AeEx2ZBnJ7WBmd6MKZT aJEQYuvpy0ns231caMBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pf2TB-00GtKP-04; Wed, 22 Mar 2023 17:41:53 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pf2T7-00GtIz-2m for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2023 17:41:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679506908; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R6GCfilh0cZKB8DQRhLDL4RZochnv+xVhcOUE0oDoD0=; b=GKv5EXWhx1InC+JqVlzvIySHolPNgmvgmEIWvdXbF+NQFneG5SZ57z0gGfnfa3ncYH/Pfd FtVnn1lK3ZmSgAzhrWPRQSV/bOauX0y2UDsHu3uz19SW8sDu2aHOG5Yhi6hLtpzDFZP3/u JtNXiYnU7wuJRwHr93RzULa2jCDFGwo= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517-5XtZ95FRNbWHNLgrTkD6Gg-1; Wed, 22 Mar 2023 13:41:47 -0400 X-MC-Unique: 5XtZ95FRNbWHNLgrTkD6Gg-1 Received: by mail-qk1-f197.google.com with SMTP id 198-20020a370bcf000000b007468cffa4e2so4449010qkl.10 for ; Wed, 22 Mar 2023 10:41:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679506907; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:reply-to:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R6GCfilh0cZKB8DQRhLDL4RZochnv+xVhcOUE0oDoD0=; b=ShGNwkhuY8NnVb3PTD3xAKtc8cSSL3ODqJ9MGOSkAwYynU0L6DdV//6cHkslUr5qAm xOHqqOQLBIMkk0hnjs7ZIi5TqnxkP3oTjRErQ86RzXWweyzcNxHLdUqKg8wJRmkM2fRi gtBBTT8+hTXP5r8lhSlxGlcn5kmllGl+B8n090DxqlS1rwXo9cwSI8ZG2XtStJIx3O5G 0SliEmz1eHSFlturhurxMLb4forlnIivGOllyJzvO5c08xsn8vVHLZAyFYvUmUJ2ww0s AJYiSjWWdS9KNszC8wbFg2EkQU/C97MkRtb4sYpQUVmpNWPtA5QbS/1oHw//XdTivDlQ XX2Q== X-Gm-Message-State: AO0yUKXT5DV7+x/Uj2uibptPsST9hVRCYGom/ifEtj/BAzjH6a3tMjpT 2eIZ+22ubvV6a+vZt81zkhBR7s6oZt5x1d2DUoEn72hf6KuHd/fZA7fkCMryOMWk+Zqzec+Vg3Z kyA0Xr2wQn4jSGl3JtU8sArWImofe+kliS6s= X-Received: by 2002:a05:6214:d07:b0:5cc:e059:efa3 with SMTP id 7-20020a0562140d0700b005cce059efa3mr7054148qvh.23.1679506906943; Wed, 22 Mar 2023 10:41:46 -0700 (PDT) X-Google-Smtp-Source: AK7set++hcwOGZwKk/07mSyw88ezcgv4USpopnCaUqdkAzomtduECxyPJGmLRRVrQqNYnB5Xmc40DQ== X-Received: by 2002:a05:6214:d07:b0:5cc:e059:efa3 with SMTP id 7-20020a0562140d0700b005cce059efa3mr7054121qvh.23.1679506906665; Wed, 22 Mar 2023 10:41:46 -0700 (PDT) Received: from ?IPV6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id p17-20020a374211000000b007428e743508sm11708821qka.70.2023.03.22.10.41.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Mar 2023 10:41:46 -0700 (PDT) Message-ID: Date: Wed, 22 Mar 2023 18:41:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v1 01/14] iommu: Add iommu_get_unmanaged_domain helper To: Jason Gunthorpe Cc: Shameerali Kolothum Thodi , Nicolin Chen , "robin.murphy@arm.com" , "will@kernel.org" , "kevin.tian@intel.com" , "baolu.lu@linux.intel.com" , "joro@8bytes.org" , "jean-philippe@linaro.org" , "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" References: <9b1077601cace998533129327f5e7ad946752d29.1678348754.git.nicolinc@nvidia.com> From: Eric Auger In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230322_104150_018619_45634080 X-CRM114-Status: GOOD ( 28.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: eric.auger@redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jason, On 3/22/23 18:02, Jason Gunthorpe wrote: > On Wed, Mar 22, 2023 at 05:07:39PM +0100, Eric Auger wrote: > >>> It seems like Eric's issue is overly broad if we just want to block >>> RID reassignment that doesn't impact MMIO layout. >> IORT spec says >> >> " >> If reserved memory regions are present, the OS must preserve PCIe >> configuration performed by the boot >> firmware. This preservation is required to ensure functional continuity >> of the endpoints that are using the reserved >> memory regions. Therefore, RMR nodes must be supported by the inclusion >> of the PCI Firmware defined _DSM >> for ignoring PCI boot configuration, Function 5, in the ACPI device >> object of the PCIe host bridge in ACPI >> namespace. The _DSM method should return a value of 0 to indicate that >> the OS must honour the PCI >> configuration that the firmware has done at boot time. See [PCIFW] for >> more details on this _DSM method. >> " > I would say this spec language is overly broad. If the FW knows the > reserved memory regions it creates are not sensitive to PCI layout > then it should not be forced to set this flag. But do we have any guarantee the bus numbers can't change. I thought the guest was allowed to re-number at will? While further thinking at it, all RID ID mappings should be affected by this concern, I mean not only RID 2 RMRs? What do I miss? > >>> But, still, why do we care about this? >>> >>> The vIOMMU should virtualize the vSIDs right? So why does qemu give a >>> vSID list to the guest anyhow? Shouldn't the guest use an algorithmic >>> calculation from the vRID so that qemu can reverse it to the correct >>> vPCI device and thus the correct vfio_device and then dev id in the >>> iommu_domain? >> I don't understand how this changes the above picture? > We are forced to use RMR because of the hacky GIC ITS stuff. well we are not obliged to use RMRs. My first revisions did not use it and created a non direct S1 mapping. This is just a commodity that simplifies the integration and was nicely suggested by jean. > > ITS placement is not sensitive to PCI layout. > > ITS is not sensitive to bus numbers/etc. > > vSID to dev_id should also be taken care of by QEMU even if bus > numbers change and doesn't need to be fixed. agreed, hence the above question. > > So let's have a reason why we need to do all this weird stuff beyond > the spec says so. > > If there is no actual functional issue we should not restrict the > guest and provide RMR without the DSM method. Someone should go and > update the spec if this offends them :) > > Jason > Thanks Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel