Question about the cpu_uid parameter of acpi_evaluate_dsm() in PCI/TPH
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 90 lines · Wei Huang
Quoted 70 lines · fengchengwen
Hi Wei,
Quoted 46 lines · Wei
Quoted 23 lines · fengchengwen
Hi Wei, Eric,
I noticed that you submitted a commit [1] that supports PCI/TPH. We want to evaluate whether this feature is supported on the Kunpeng platform. Currently, we have encountered a problem. Please confirm it. Thank you.
The problem:
1. Inpcie_tph_get_cpu_st()function, the input parametercpu_uidis directly transferred to the dsm method as the ACPI parameter.int pcie_tph_get_cpu_st(struct pci_dev *pdev, enum tph_mem_type mem_type, unsigned int cpu_uid, u16 *tag) { ... if (tph_invoke_dsm(rp_acpi_handle, cpu_uid, &info) != AE_OK) { *tag = 0; return -EINVAL; } ... } static acpi_status tph_invoke_dsm(acpi_handle handle, u32 cpu_uid, union st_info *st_out) {Quoted 8 lines
... /* DWORD: target UID */ arg3[1].integer.type = ACPI_TYPE_INTEGER; arg3[1].integer.value = cpu_uid; ... out_obj = acpi_evaluate_dsm(handle, &pci_acpi_dsm_guid, 7, TPH_ST_DSM_FUNC_INDEX, &in_obj); }Correct. According to
_DSMECN, the input is defined as: "If the target is a processor, then this field represents the ACPI Processor UID of the processor as specified in the MADT. If the target is a processor container, then this field represents the ACPI Processor UID of the processor container as specified in the PPTT"Quoted 4 lines
2. In the Broadcom driver implementation [2],
cpu_uidis obtained based oncpumask_first(irq->cpu_mask), the returned value is the logical ID of a CPU core, which is generated and managed by the Linux kernel. E.g. [0,255] if the system has 256 logical CPU core.Correct.
Quoted 8 lines
Quoted 4 lines
3. In order to obtain ST (steer-tag), we need to get physical core info (e.g. MPIDR in Kunpeng platform), The problem is how does the ACPI know the physical core info corresponding to the logical ID of the CPU core? The ACPI don't know how the logical ID definition.
This was a problem we encountered. "Fortunately" the mapping between logic ID and ACPI
_UIDis similar on AMD platform. We didn't encounter too many issues in this area.Okay, so for AMD platform, the logic ID equal
ACPI_UID, so there is no need to convert the logic ID toACPI_UID(as we see in the code thecpu_uidwas directly passed to dsm).Quoted 8 lines
Quoted 4 lines
4. One of my guess is that ACPI reports the SRAT table and reports the system CPU core information in sequence. Is it based on this sequence to search for the corresponding physical core information in the ACPI when process above DSM method?
So you don't seem to be concerned with
logic_id<=>acpi_uid. Instead, you want to know how does ACPI convert theacpi_uidinto a correspondingphys_idwhen it receives an_DSMcall, right? If this is the case, IQuoted 5 lines
Yes, there are two part:
1) The first is PCI driver convertlogic_idtoacpi_uid. Because thelogic_idmay not equalacpi_uidin Kunpeng platform, This is our biggest puzzle, but it's clear now: we need another patch do the converation if following_DSMECN.Let me know your findings on Kunpeng platform. If there is a need to tweak code for this area, we can do it together.
Quoted 9 lines
2) The ACPI convert
acpi_uidto it's phy_id(e.g. MPIDR)Quoted 3 lines
think system firmware already knows about it. If you look at MADT table, which is also available on ARM platform, the Type
0xBprocessor structure should already have such info.Yes, the MADT table seemed could do that.
Quoted 7 lines
Quoted 5 lines
Thank you for your clarification.
Currently, this feature only support in host kernel, from your slide [1], your team was developing TPH virtualization, do you have any public channels (like slack) that we can participate in?
Yes, a prototype was completed. I have a code base sitting in a private github tree. Give me a bit time to clean up and I will share it with you and the public as soon as possible (ping me if it lags behind).
Kindly ping.
I am not clear about the specific solution. I guess your changes might involve vfio-pci and qemu. Could you please send the modifications to vfio-pci for review first, so that the host userspace (such as DPDK) can also move forward based on this?
Thanks
Quoted 11 lines
Quoted 4 lines
We also want to enable this feature in DPDK, ps: it already has such commit [2] but seemed has no progress.
I was aware of this code, but didn't follow closely. Let me forward it to AMD related team and maybe they can help to test and push it forward.