From: Lu Baolu <baolu.lu@linux.intel.com> To: FelixCui-oc <FelixCui-oc@zhaoxin.com>, Joerg Roedel <joro@8bytes.org>, "iommu@lists.linux-foundation.org" <iommu@lists.linux-foundation.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, David Woodhouse <dwmw2@infradead.org> Cc: baolu.lu@linux.intel.com, RaymondPang-oc <RaymondPang-oc@zhaoxin.com>, CobeChen-oc <CobeChen-oc@zhaoxin.com> Subject: Re: 答复: 答复: 答复: 答复: 答复: 答复: 答复: [PATCH] iommu/vt-d:Add support for ACPI device in RMRR Date: Fri, 7 Aug 2020 16:08:08 +0800 [thread overview] Message-ID: <f631a3b2-5bd4-f48a-5ec5-0fc6118e1c95@linux.intel.com> (raw) In-Reply-To: <f25e4fdf592a455594d0e88fced8fb62@zhaoxin.com> Hi, On 2020/8/7 11:29, FelixCui-oc wrote: > Hi baolu, > I understand what you mean is that you want to put the following processing code in the acpi_device_create_direct_mappings() into the probe_acpi_namespace_devices() ,right? > If you mean it , I think it's OK. Yes. If the acpi device has companion physical devices, then probe the companion devices; otherwise, probe the acpi device instead. Also, let's put detecting and probing acpi devices in different patches so that they could be easier for reviewing. Best regards, baolu > > if (pn_dev == NULL) { > acpi_device->bus->iommu_ops = &intel_iommu_ops; > ret = iommu_probe_device(acpi_device); > if (ret) { > pr_err("acpi_device probe fail! ret:%d\n", ret); > return ret; > } > return 0; > } > > Best regards > Felix cui-oc > > > > > > -----邮件原件----- > 发件人: Lu Baolu <baolu.lu@linux.intel.com> > 发送时间: 2020年8月7日 9:08 > 收件人: FelixCui-oc <FelixCui-oc@zhaoxin.com>; Joerg Roedel <joro@8bytes.org>; iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org; David Woodhouse <dwmw2@infradead.org> > 抄送: baolu.lu@linux.intel.com; RaymondPang-oc <RaymondPang-oc@zhaoxin.com>; CobeChen-oc <CobeChen-oc@zhaoxin.com> > 主题: Re: 答复: 答复: 答复: 答复: 答复: 答复: [PATCH] iommu/vt-d:Add support for ACPI device in RMRR > > Hi Felix, > > On 2020/8/6 14:51, FelixCui-oc wrote: >> Hi baolu, >> >Sure. Before that, let me sync my understanding with you. You have an acpi namespace device in ANDD table, it also shows up in the device scope of a RMRR. >> >Current code doesn't enumerate that device for the RMRR, hence iommu_create_device_direct_mappings() doesn't work for this device. >> >> >At the same time, probe_acpi_namespace_devices() doesn't work for this device, hence you want to add a home-made >> >acpi_device_create_direct_mappings() helper. >> >> Your understanding is right. >> But there is a problem that even if the namespace device in rmrr is enumerated in the code, probe_acpi_namespace_devices() also doesn't work for this device. >> This is because the dev parameter of the iommu_create_device_direct_mappings() is not the namespace device in RMRR. >> The actual parameter passed in is the namespace device's physical node device. >> In iommu_create_device_direct_mappings(), the physical node device passed in cannot match the namespace device in rmrr->device[],right? >> We need acpi_device_create_direct_mappings() helper ? >> >> In addition, adev->physical_node_list is related to the __HID of namespace device reported by the bios. >> For example, if the __HID reported by the bios belongs to acpi_pnp_device_ids[], adev->physical_node_list has no devices. >> So in acpi_device_create_direct_mappings(), I added the case that adev->physical_node_list is empty. > > Got you. Thanks! > > Have you ever tried to have probe_acpi_namespace_devices() handle the case of empty adev->physical_node_list at the same time? > > Best regards, > baolu > >> >> >> Best regards >> Felix cui >> >> >> >> >> -----邮件原件----- >> 发件人: Lu Baolu <baolu.lu@linux.intel.com> >> 发送时间: 2020年8月6日 10:36 >> 收件人: FelixCui-oc <FelixCui-oc@zhaoxin.com>; Joerg Roedel >> <joro@8bytes.org>; iommu@lists.linux-foundation.org; >> linux-kernel@vger.kernel.org; David Woodhouse <dwmw2@infradead.org> >> 抄送: baolu.lu@linux.intel.com; RaymondPang-oc >> <RaymondPang-oc@zhaoxin.com>; CobeChen-oc <CobeChen-oc@zhaoxin.com> >> 主题: Re: 答复: 答复: 答复: 答复: 答复: [PATCH] iommu/vt-d:Add support for ACPI >> device in RMRR >> >> Hi Felix, >> >> On 8/5/20 3:37 PM, FelixCui-oc wrote: >>> Hi baolu, >>> Let me talk about why acpi_device_create_direct_mappings() is needed and please tell me if there is an error. >> >> Sure. Before that, let me sync my understanding with you. You have an acpi namespace device in ANDD table, it also shows up in the device scope of a RMRR. Current code doesn't enumerate that device for the RMRR, hence iommu_create_device_direct_mappings() doesn't work for this device. >> >> At the same time, probe_acpi_namespace_devices() doesn't work for this >> device, hence you want to add a home-made >> acpi_device_create_direct_mappings() helper. >> >> Did I get it right? >> >>> In the probe_acpi_namespace_devices() function, only the device in the addev->physical_node_list is probed, >>> but we need to establish identity mapping for the namespace device in RMRR. These are two different devices. >> >> The namespace device has been probed and put in one drhd's device list. >> Hence, it should be processed by probe_acpi_namespace_devices(). So the question is why there are no devices in addev->physical_node_list? >> >>> Therefore, the namespace device in RMRR is not mapped in probe_acpi_namespace_devices(). >>> acpi_device_create_direct_mappings() is to create direct mappings for namespace devices in RMRR. >> >> Best regards, >> baolu >>
WARNING: multiple messages have this Message-ID (diff)
From: Lu Baolu <baolu.lu@linux.intel.com> To: FelixCui-oc <FelixCui-oc@zhaoxin.com>, Joerg Roedel <joro@8bytes.org>, "iommu@lists.linux-foundation.org" <iommu@lists.linux-foundation.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, David Woodhouse <dwmw2@infradead.org> Cc: CobeChen-oc <CobeChen-oc@zhaoxin.com> Subject: Re: 答复: 答复: 答复: 答复: 答复: 答复: 答复: [PATCH] iommu/vt-d:Add support for ACPI device in RMRR Date: Fri, 7 Aug 2020 16:08:08 +0800 [thread overview] Message-ID: <f631a3b2-5bd4-f48a-5ec5-0fc6118e1c95@linux.intel.com> (raw) In-Reply-To: <f25e4fdf592a455594d0e88fced8fb62@zhaoxin.com> Hi, On 2020/8/7 11:29, FelixCui-oc wrote: > Hi baolu, > I understand what you mean is that you want to put the following processing code in the acpi_device_create_direct_mappings() into the probe_acpi_namespace_devices() ,right? > If you mean it , I think it's OK. Yes. If the acpi device has companion physical devices, then probe the companion devices; otherwise, probe the acpi device instead. Also, let's put detecting and probing acpi devices in different patches so that they could be easier for reviewing. Best regards, baolu > > if (pn_dev == NULL) { > acpi_device->bus->iommu_ops = &intel_iommu_ops; > ret = iommu_probe_device(acpi_device); > if (ret) { > pr_err("acpi_device probe fail! ret:%d\n", ret); > return ret; > } > return 0; > } > > Best regards > Felix cui-oc > > > > > > -----邮件原件----- > 发件人: Lu Baolu <baolu.lu@linux.intel.com> > 发送时间: 2020年8月7日 9:08 > 收件人: FelixCui-oc <FelixCui-oc@zhaoxin.com>; Joerg Roedel <joro@8bytes.org>; iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org; David Woodhouse <dwmw2@infradead.org> > 抄送: baolu.lu@linux.intel.com; RaymondPang-oc <RaymondPang-oc@zhaoxin.com>; CobeChen-oc <CobeChen-oc@zhaoxin.com> > 主题: Re: 答复: 答复: 答复: 答复: 答复: 答复: [PATCH] iommu/vt-d:Add support for ACPI device in RMRR > > Hi Felix, > > On 2020/8/6 14:51, FelixCui-oc wrote: >> Hi baolu, >> >Sure. Before that, let me sync my understanding with you. You have an acpi namespace device in ANDD table, it also shows up in the device scope of a RMRR. >> >Current code doesn't enumerate that device for the RMRR, hence iommu_create_device_direct_mappings() doesn't work for this device. >> >> >At the same time, probe_acpi_namespace_devices() doesn't work for this device, hence you want to add a home-made >> >acpi_device_create_direct_mappings() helper. >> >> Your understanding is right. >> But there is a problem that even if the namespace device in rmrr is enumerated in the code, probe_acpi_namespace_devices() also doesn't work for this device. >> This is because the dev parameter of the iommu_create_device_direct_mappings() is not the namespace device in RMRR. >> The actual parameter passed in is the namespace device's physical node device. >> In iommu_create_device_direct_mappings(), the physical node device passed in cannot match the namespace device in rmrr->device[],right? >> We need acpi_device_create_direct_mappings() helper ? >> >> In addition, adev->physical_node_list is related to the __HID of namespace device reported by the bios. >> For example, if the __HID reported by the bios belongs to acpi_pnp_device_ids[], adev->physical_node_list has no devices. >> So in acpi_device_create_direct_mappings(), I added the case that adev->physical_node_list is empty. > > Got you. Thanks! > > Have you ever tried to have probe_acpi_namespace_devices() handle the case of empty adev->physical_node_list at the same time? > > Best regards, > baolu > >> >> >> Best regards >> Felix cui >> >> >> >> >> -----邮件原件----- >> 发件人: Lu Baolu <baolu.lu@linux.intel.com> >> 发送时间: 2020年8月6日 10:36 >> 收件人: FelixCui-oc <FelixCui-oc@zhaoxin.com>; Joerg Roedel >> <joro@8bytes.org>; iommu@lists.linux-foundation.org; >> linux-kernel@vger.kernel.org; David Woodhouse <dwmw2@infradead.org> >> 抄送: baolu.lu@linux.intel.com; RaymondPang-oc >> <RaymondPang-oc@zhaoxin.com>; CobeChen-oc <CobeChen-oc@zhaoxin.com> >> 主题: Re: 答复: 答复: 答复: 答复: 答复: [PATCH] iommu/vt-d:Add support for ACPI >> device in RMRR >> >> Hi Felix, >> >> On 8/5/20 3:37 PM, FelixCui-oc wrote: >>> Hi baolu, >>> Let me talk about why acpi_device_create_direct_mappings() is needed and please tell me if there is an error. >> >> Sure. Before that, let me sync my understanding with you. You have an acpi namespace device in ANDD table, it also shows up in the device scope of a RMRR. Current code doesn't enumerate that device for the RMRR, hence iommu_create_device_direct_mappings() doesn't work for this device. >> >> At the same time, probe_acpi_namespace_devices() doesn't work for this >> device, hence you want to add a home-made >> acpi_device_create_direct_mappings() helper. >> >> Did I get it right? >> >>> In the probe_acpi_namespace_devices() function, only the device in the addev->physical_node_list is probed, >>> but we need to establish identity mapping for the namespace device in RMRR. These are two different devices. >> >> The namespace device has been probed and put in one drhd's device list. >> Hence, it should be processed by probe_acpi_namespace_devices(). So the question is why there are no devices in addev->physical_node_list? >> >>> Therefore, the namespace device in RMRR is not mapped in probe_acpi_namespace_devices(). >>> acpi_device_create_direct_mappings() is to create direct mappings for namespace devices in RMRR. >> >> Best regards, >> baolu >> _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2020-08-07 8:08 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-02 10:07 [PATCH] iommu/vt-d:Add support for ACPI device in RMRR FelixCuioc 2020-08-02 10:07 ` FelixCuioc 2020-08-03 2:31 ` Lu Baolu 2020-08-03 2:31 ` Lu Baolu 2020-08-03 4:40 ` 答复: " FelixCui-oc 2020-08-03 4:40 ` FelixCui-oc 2020-08-03 6:18 ` Lu Baolu 2020-08-03 6:18 ` Lu Baolu 2020-08-03 6:52 ` 答复: " FelixCui-oc 2020-08-03 6:52 ` FelixCui-oc 2020-08-03 8:25 ` Lu Baolu 2020-08-03 8:25 ` Lu Baolu 2020-08-03 9:01 ` 答复: " FelixCui-oc 2020-08-03 9:01 ` FelixCui-oc 2020-08-03 9:41 ` FelixCui-oc 2020-08-03 9:41 ` FelixCui-oc 2020-08-04 1:11 ` Lu Baolu 2020-08-04 1:11 ` Lu Baolu 2020-08-04 3:11 ` 答复: " FelixCui-oc 2020-08-04 3:11 ` FelixCui-oc 2020-08-05 2:56 ` Lu Baolu 2020-08-05 2:56 ` Lu Baolu 2020-08-05 7:37 ` 答复: " FelixCui-oc 2020-08-05 7:37 ` FelixCui-oc 2020-08-06 2:36 ` Lu Baolu 2020-08-06 2:36 ` Lu Baolu 2020-08-06 6:51 ` 答复: " FelixCui-oc 2020-08-06 6:51 ` FelixCui-oc 2020-08-07 1:07 ` Lu Baolu 2020-08-07 1:07 ` Lu Baolu 2020-08-07 3:29 ` 答复: " FelixCui-oc 2020-08-07 3:29 ` FelixCui-oc 2020-08-07 8:08 ` Lu Baolu [this message] 2020-08-07 8:08 ` Lu Baolu 2020-08-08 7:14 ` 答复: " FelixCui-oc 2020-08-08 7:14 ` FelixCui-oc
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=f631a3b2-5bd4-f48a-5ec5-0fc6118e1c95@linux.intel.com \ --to=baolu.lu@linux.intel.com \ --cc=CobeChen-oc@zhaoxin.com \ --cc=FelixCui-oc@zhaoxin.com \ --cc=RaymondPang-oc@zhaoxin.com \ --cc=dwmw2@infradead.org \ --cc=iommu@lists.linux-foundation.org \ --cc=joro@8bytes.org \ --cc=linux-kernel@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.