Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6326841rwl; Wed, 22 Mar 2023 09:10:58 -0700 (PDT) X-Google-Smtp-Source: AK7set/eBeL9rX1Bnu7EOExiuZazu/p8aOgIcrr8U7PndEw38iZAVCtC6jdp7UWOPXquMf1kwMSh X-Received: by 2002:a05:6402:3c1:b0:4fe:9374:30cb with SMTP id t1-20020a05640203c100b004fe937430cbmr6216232edw.37.1679501458400; Wed, 22 Mar 2023 09:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679501458; cv=none; d=google.com; s=arc-20160816; b=W4MStkPakwmYFDz2BEZtCs4CTPGLS6tqgFGz9zViGiGruhurkyfK+2O5JsZw81HBwz 1Zt0xRNS6aMfYB9w34iJfavGNtCx/U+JfqXdMdBaXplWb1uIda6uYue/0htG5sS8GZCY QKaCaucVVO/Xr8rp6Jh5N5twJaWKRTF32tFBzTmUAbGOB29sMdvScIy1QeoQn5vZhGlK RqVOGufdiVSr45J3SXVQF/k/coW7r8alrlnJ51nVmhodnvwHKWYbhgr6Ab9IlVkl7/Xz H+lRhCXo1LxrG/Gms7Sv6438phM13oOy7+b4nLmTVIedJyMg7ONjL06/HSPFysdwSS5w VUjQ== 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:reply-to:user-agent :mime-version:date:message-id:dkim-signature; bh=E9Rnif2QXbiaghLODlyfTFhBazkHFsocz625fhcIzRQ=; b=F1I/Tn4U6i3j4qSWsu6dgZ5Z+qqhG21M7Nk8MsGigyq9Zb3LhpoGOH/BN063GHDebG gmXioVNGton8jOEIRItb8c0NUp/lTssRcDKDpv3ZXUKGG43P+a6RQbWqp/qNFSfrTo4w SyPsLFzaMRysdQ7JJD+WGP9LAEOqYIfKnaDtNUi11dfDRmceUjcd5PLiYBrBOuxYF8mI 22d8ll9CcQc72KX5iVkigW/43pKCzYysHXNrUMzrB9FtmLy+nXY0ZIgyAvkxb6i/lMHI s52In3xElj2tOXzJ6jq664efqAqFqIkKll/D4RfnZYXaOh0/CSldjlZiDMAeMNHPBhSH EEjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Pt9gkxgG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d10-20020aa7ce0a000000b004fd3ad97e48si15702807edv.55.2023.03.22.09.10.34; Wed, 22 Mar 2023 09:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Pt9gkxgG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbjCVQIm (ORCPT + 99 others); Wed, 22 Mar 2023 12:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230460AbjCVQIf (ORCPT ); Wed, 22 Mar 2023 12:08:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70D7265464 for ; Wed, 22 Mar 2023 09:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679501265; 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=E9Rnif2QXbiaghLODlyfTFhBazkHFsocz625fhcIzRQ=; b=Pt9gkxgGtcXSX4MyfcCrAMi5ljMhISVFWaY+ZRhf43HVBikaA1xfmXVq62piEeQILPYaDw V8OWCaugz4WB1/frRQx837/y6p5ykR8jZfRqFldDWomkVhdRdE9g0TcXi211C4EN3nKEeP /GmTxHCQEd8Rxs7L/MfCBdByj5lcsJs= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-gx-GBKmRM-Ws66Kz8FmeWg-1; Wed, 22 Mar 2023 12:07:44 -0400 X-MC-Unique: gx-GBKmRM-Ws66Kz8FmeWg-1 Received: by mail-qk1-f198.google.com with SMTP id 203-20020a370ad4000000b00746981f8f4bso3622207qkk.13 for ; Wed, 22 Mar 2023 09:07:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679501263; 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=E9Rnif2QXbiaghLODlyfTFhBazkHFsocz625fhcIzRQ=; b=49vQ7YJ6lPmJ3oJ1fdpFhNyFhaaLJr7yLr99cOUPXLCHJTFEIiFZ8mJBgG+t6oxcsR ib77Lr5B9KvS3kwVEBd6zcjLoDSofazXr+Esrl7use7Q2SUL0fsq6EesiOatn5li4D7b Za/gbGj0ZdU9Hn1nPCQHEe8Oqu59ooo6nEf3DGEIU89IpBsag7VQi6+eU4SQIHeOGAUl 1iB0cmw7JOJce/zdUpJqV5tFyengXv6Z9pfuomeo2jWsWG1rhNgHl52hVcEX4ZWBip1n kp/ivQIJlwnH8tSJTfy6SFYW8QqcBrxGbvgXii7w3fAtTxA4Ux4KX1AqDmP7TD/cJT5B SAcg== X-Gm-Message-State: AO0yUKWWM/mN5yoT6fbC+ru4QGFvZNERsyM10GlOf521bXVy+e/W2/eM KnoOqnPXlL0ygvBwUg8DD1nLCQAnBbRJdEIHXVbQ6a5aKmRGmhF3K9hmjFR12+0gzPaH1KoBfNM squt2FhQhjnEVNQaXzzfgHeky X-Received: by 2002:a05:622a:1310:b0:3bf:b614:bcaf with SMTP id v16-20020a05622a131000b003bfb614bcafmr6250301qtk.67.1679501263468; Wed, 22 Mar 2023 09:07:43 -0700 (PDT) X-Received: by 2002:a05:622a:1310:b0:3bf:b614:bcaf with SMTP id v16-20020a05622a131000b003bfb614bcafmr6250269qtk.67.1679501263144; Wed, 22 Mar 2023 09:07:43 -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 f16-20020ac86ed0000000b003e390b48958sm24348qtv.55.2023.03.22.09.07.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Mar 2023 09:07:42 -0700 (PDT) Message-ID: Date: Wed, 22 Mar 2023 17:07:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Reply-To: eric.auger@redhat.com Subject: Re: [PATCH v1 01/14] iommu: Add iommu_get_unmanaged_domain helper Content-Language: en-US To: Jason Gunthorpe , Shameerali Kolothum Thodi Cc: 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: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, On 3/10/23 18:03, Jason Gunthorpe wrote: > On Fri, Mar 10, 2023 at 04:30:03PM +0000, Shameerali Kolothum Thodi wrote: >> >>> -----Original Message----- >>> From: Jason Gunthorpe [mailto:jgg@nvidia.com] >>> Sent: 10 March 2023 16:21 >>> To: Shameerali Kolothum Thodi >>> Cc: Eric Auger ; 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 >>> Subject: Re: [PATCH v1 01/14] iommu: Add iommu_get_unmanaged_domain >>> helper >>> >>> On Fri, Mar 10, 2023 at 04:07:38PM +0000, Shameerali Kolothum Thodi >>> wrote: >>> https://lore.kernel.org/linux-arm-kernel/20220420164836.1181-5-shameer >>>>>> ali.kolothum.thodi@huawei.com/ >>>>> So "boot configration" is more like "don't change the RIDs"? Ie don't >>> enable >>>>> SRIOV? >>>> Yes. Don't think it will work with SR-IOV if you can't guarantee the RMR >>> specified >>>> SID. >>> So I think we are probably good them because vSR-IOV is already not >>> supported by qemu, so it impossible for a VM to change the PCI >>> configuration in a way that would alter the RID to SID mapping? >>> >> Provided we fix the issue mentioned by Eric. This was discussed here previously, >> >> https://lore.kernel.org/linux-arm-kernel/bb3688c7-8f42-039e-e22f-6529078da97d@redhat.com/ > Ah, I see so that we don't renumber the buses during PCI discovery.. > > 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. " Enforcing preservation was attempted in the past in QEMU and then reverted due to the aforemented bug. qemu commit: 40c3472a29  Revert "acpi/gpex: Inform os to keep firmware resource map" So if we want to rely on RMRs and re-introduce that change I don't see how we can avoid fixing the kernel issue. > > 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? Thanks Eric > > Jason >