From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F0C441A575; Sat, 12 Sep 2026 12:11:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789215106; cv=none; b=W9K6v6NlJ+eCVSrJbSlPO5/N1TtWDDXR15q9k7l+HBFzsNZSQUAMsyIXASAK7CXK0IcwqmJ6XXVnT+q53RW6tyJ+LKCMuWbpsvsrE0VRvyXCqITD5j45ac57cv8/9h4dPZtwVFtNAMGZWyekD4oOKAxjLcYASyMfyThgBt5Ln5E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789215106; c=relaxed/simple; bh=Mj8BpgiTRhjht87pxMqBnKSwjU9R7P5N9GuHCyTlvTk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FDAr1tOBmlb8u31eeV/SXtVfNQ7kv4GoAjtNKtX/Rq4NUWpgnazXQvzCjwYXWnvTLK1h5EaynOEC3ZcudtspPtB4S9gymAsJ6iORBnIpL6hCvOxaGnb8IBmI/nJ2u598RBVkQX6udW5EUJdjaZHBeCmdn5K96sXN1jBoO3MSkxA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Tt9Zh82S; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Tt9Zh82S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBE271F000FF; Sat, 12 Sep 2026 12:11:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789215104; bh=Rq32x4o682KHuqQSDLj8kRVYT1KNYdLlLCVy8eXE23g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Tt9Zh82Sxof2TNOQS3SVnjx7bCbsdFSYSsuA3s4cqTkV9nrE2jPDYa1RUUMMs2tBw yqQC4XAwY9Mz77alTV+iiTuyZKJlnrOAKUDYdkCc8HlEsbhlQHqPLPxTopZA3hrU2R UwtYBzvT0+9XHMbOXFpNOmbTAA14/l7Fyl67ovPQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wei Wang , Yongwei Xu , Vasant Hegde , Joerg Roedel , Sasha Levin Subject: [PATCH 6.12 0461/1376] iommu/amd: Prevent SB IOAPIC from overriding IVRS validation errors Date: Sat, 12 Sep 2026 08:48:07 +0200 Message-ID: <20260912065617.804646631@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wei Wang [ Upstream commit 854056480f9217568e3ab5edd81a9347a173ea79 ] The check_ioapic_information() function validates IOAPICs against the IVRS table to safely disable Interrupt Remapping (IR) if the BIOS provides a broken topology. Currently, the validation loop contains a bug: If an unmapped secondary IOAPIC is encountered, 'ret' is set to false. But if the Southbridge (SB) IOAPIC is enumerated after it in the MADT, the loop overwrites 'ret' to true. This bypasses the validation failure and leaves IR enabled. When devices attached to the unmapped secondary IOAPIC fire interrupts, the IOMMU drops them due to the missing Requestor ID, leading to localized device hangs. Fix this by initializing 'ret' to true and only toggling it to false upon encountering a validation error, ensuring failures are never erased. Fixes: c2ff5cf5294b ("iommu/amd: Work around wrong IOAPIC device-id in IVRS table") Signed-off-by: Wei Wang Tested-by: Yongwei Xu Reviewed-by: Vasant Hegde Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/amd/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 54f3c17520d51..66f30e3883d57 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -2973,7 +2973,7 @@ static bool __init check_ioapic_information(void) int idx; has_sb_ioapic = false; - ret = false; + ret = true; /* * If we have map overrides on the kernel command line the @@ -2993,7 +2993,6 @@ static bool __init check_ioapic_information(void) ret = false; } else if (devid == IOAPIC_SB_DEVID) { has_sb_ioapic = true; - ret = true; } } @@ -3007,6 +3006,7 @@ static bool __init check_ioapic_information(void) * device id for the IOAPIC in the system. */ pr_err("%s: No southbridge IOAPIC found\n", fw_bug); + ret = false; } if (!ret) -- 2.53.0