|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH resend 03/13] acpi: arm: Code to generate Hardware Domains IORT
On 03/23/2018 06:58 AM, Julien Grall wrote: I think the name is quite appropriate. Also in this patch I have added description of the flow so this should be fairly intuitive. Could you please let me know the specific point you dont understand, I can explain that.Hi Manish, On 03/13/2018 03:20 PM, mjaggi@xxxxxxxxxxxxxxxxxx wrote:From: Manish Jaggi <mjaggi@xxxxxxxxxxxxxxxxxx> Structure of Hardware domain's (hwdom) IORT hwdom's IORT will only have PCIRC nodes and ITS group nodes in the following order. SMMU nodes as they are hidden from hardware domain. [IORT Header] [ITS Group 1 ] ... [ITS Group n ] [PCIRC Node 1] [PCIRC IDMAP entry 1] ... [PCIRC IDMAP entry m] ... [PCIRC Node p] [PCIRC IDMAP entry 1] ... [PCIRC IDMAP entry q] ... *n,m,p are variable. requesterid-deviceid mapping list (rid_devid_list) populated by parsing IORT is used to generate hwdom IORT. As the rid_devid_list is populated from firmware IORT, IDMAP entry would have output references offsets based on firmware's IORT. It is required to fixup node offset of ITS Group Nodes in the PCIRC idmap (output_reference) First write all the ITS group nodes in the hwdom's IORT. For this write_hwits_nodes is called, which parses the rid_devid_list and for each unique its_node in firmware IORT create a its_node in hwdom's IORT and also creates and entry in fwits_hwits_map. fwits_hwits_map is a mapping between firmware IORT's its node and the node offset of the corresponding its_node stored in the hwdom's IORT. This map can later be used to set output reference value in hwdom's pcirc node's idmap entries. Signed-off-by: Manish Jaggi <manish.jaggi@xxxxxxxxxx> ---xen/arch/arm/acpi/gen-iort.c | 299 ++++++++++++++++++++++++++++++++++++xen/arch/arm/domain_build.c | 35 +++++ xen/include/asm-arm/acpi.h | 1 + xen/include/asm-arm/acpi/gen-iort.h | 11 ++ 4 files changed, 346 insertions(+) diff --git a/xen/arch/arm/acpi/gen-iort.c b/xen/arch/arm/acpi/gen-iort.c index 687c4f18ee..251a9771e3 100644 --- a/xen/arch/arm/acpi/gen-iort.c +++ b/xen/arch/arm/acpi/gen-iort.c @@ -19,6 +19,305 @@ #include <asm/acpi/ridmap.h> #include <xen/acpi.h> +#include <acpi/actables.h> + +/* + * Structure of Hardware domain's (hwdom) IORT + * ----------------------------------- + * + * hwdom's IORT will only have PCIRC nodes and ITS group nodes + * in the following order. + * + * [IORT Header] + * [ITS Group 1 ] + * ... + * [ITS Group N ] + * [PCIRC Node 1] + * [PCIRC IDMAP entry 1] + * ... + * [PCIRC IDMAP entry N] + * ... + * [PCIRC Node N] + *+ * requesterid-deviceid mapping list (rid_devid_list) populated by parsing IORT+ * is used to generate hwdom IORT. + * + * One of the challanges is to fixup node offset of ITS Group Nodess/challanges/challenges/+ * in the PCIRC idmap (output_reference) + * + * In rid_devid_map firmware IORT's ITS group node pointer in stored. + * + * We first write all the ITS group nodes in the hwdom's IORT. For this + * write_hwits_nodes is called, which parses the rid_devid_list and for+ * each unique its_node in firmware IORT create a its_node in hwdom's IORT But you likely want to rename the function to add_fwits_node(...) or something similar. I think name is quite appropriate. Since this list can be used multiple times even after creation of IORT for dom0, say thinking ahead for domUs. + if ( !map ) + return -ENOMEM; + + map->fwits_node = fwits_node; + map->hwitsnode_offset = offset; + list_add_tail(&map->entry, &fwits_hwits_list); + + return 1; +} + +/* + * Returns the offset of corresponding its node to fwits_node + * written in hwdom's IORT. + * + * This function would be used when write hwdoms pcirc nodes' idmap + * entries. + */ +static+unsigned int hwitsnode_offset_from_map(struct acpi_iort_node *fwits_node) Yes See a bug_on when it is used. +} + +static void write_hwits_nodes(u8 *iort, unsigned int *offset,Please avoid using u* and use uint_* instead. I expect that you fix all of for the next version.Here, I think you want to use void *. I will change it to off, will not break anything.
ok.
Not sure if I follow your comment here. Xen gets host IORT from firmware, how will it get updated? Then you would end up to have the wrong revision number here.+ node->reserved = 0; + node->mapping_count = 0; + node->mapping_offset= 0; ++ fw_grp = (struct acpi_iort_its_group *)(&rmap->its_node->node_data);++ /* Copy its_count and identifiers from firmware iort's its_node */+ grp->its_count = fw_grp->its_count; + grp->identifiers[0] = fw_grp->identifiers[0];Hmmm, here you will only copy the first identifier. What if you have multiple one?It would also be good that somewhere (maybe at the top of the file) that you rely on the number of ITS and identifiers for the hwdom is the same as the host. ok Could you please have a look at other patches and if there is functionality related change that I need to make, i can add that in my next rev. Cheers, _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |