This is a note to let you know that I've just added the patch titled iommu/amd: Fix ivrs_acpihid cmdline parsing code to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: iommu-amd-fix-ivrs_acpihid-cmdline-parsing-code.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 5f18e9f8868c6d4eae71678e7ebd4977b7d8c8cf Mon Sep 17 00:00:00 2001 From: Kim Phillips <kim.phillips@xxxxxxx> Date: Mon, 19 Sep 2022 10:56:37 -0500 Subject: iommu/amd: Fix ivrs_acpihid cmdline parsing code From: Kim Phillips <kim.phillips@xxxxxxx> commit 5f18e9f8868c6d4eae71678e7ebd4977b7d8c8cf upstream. The second (UID) strcmp in acpi_dev_hid_uid_match considers "0" and "00" different, which can prevent device registration. Have the AMD IOMMU driver's ivrs_acpihid parsing code remove any leading zeroes to make the UID strcmp succeed. Now users can safely specify "AMDxxxxx:00" or "AMDxxxxx:0" and expect the same behaviour. Fixes: ca3bf5d47cec ("iommu/amd: Introduces ivrs_acpihid kernel parameter") Signed-off-by: Kim Phillips <kim.phillips@xxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@xxxxxxx> Cc: Joerg Roedel <jroedel@xxxxxxx> Link: https://lore.kernel.org/r/20220919155638.391481-1-kim.phillips@xxxxxxx Signed-off-by: Joerg Roedel <jroedel@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/iommu/amd/init.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -3471,6 +3471,13 @@ static int __init parse_ivrs_acpihid(cha return 1; } + /* + * Ignore leading zeroes after ':', so e.g., AMDI0095:00 + * will match AMDI0095:0 in the second strcmp in acpi_dev_hid_uid_match + */ + while (*uid == '0' && *(uid + 1)) + uid++; + i = early_acpihid_map_size++; memcpy(early_acpihid_map[i].hid, hid, strlen(hid)); memcpy(early_acpihid_map[i].uid, uid, strlen(uid)); Patches currently in stable-queue which might be from kim.phillips@xxxxxxx are queue-6.0/iommu-amd-fix-ivrs_acpihid-cmdline-parsing-code.patch queue-6.0/iommu-amd-fix-ill-formed-ivrs_ioapic-ivrs_hpet-and-ivrs_acpihid-options.patch