git: 9d7eb557c157 - stable/13 - AMD-vi: Mixed format IVHD block should replace fixed format IVHD block

0 views
Skip to first unread message

Ka Ho Ng

unread,
Apr 7, 2021, 6:56:27 AM4/7/21
to src-com...@freebsd.org, dev-commi...@freebsd.org, dev-commits-...@freebsd.org
The branch stable/13 has been updated by khng:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d7eb557c1574f879b4bb4adee285cc9f2d5f18e

commit 9d7eb557c1574f879b4bb4adee285cc9f2d5f18e
Author: Ka Ho Ng <kh...@FreeBSD.org>
AuthorDate: 2021-04-01 01:15:19 +0000
Commit: Ka Ho Ng <kh...@FreeBSD.org>
CommitDate: 2021-04-07 10:55:38 +0000

AMD-vi: Mixed format IVHD block should replace fixed format IVHD block

This fixes double IVHD_SETUP_INTR calls on the same IOMMU device.

Sponsored by: The FreeBSD Foundation
MFC with: 74ada297e897
Reported by: Oleg Ginzburg <ole...@olevole.ru>
Reviewed by: grehan
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D29521

(cherry picked from commit 03efa462b2ab3ae8166598363e9e83d4e5cf0398)
---
sys/amd64/vmm/amd/ivrs_drv.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/sys/amd64/vmm/amd/ivrs_drv.c b/sys/amd64/vmm/amd/ivrs_drv.c
index 6291895c212f..1cd76069d0a2 100644
--- a/sys/amd64/vmm/amd/ivrs_drv.c
+++ b/sys/amd64/vmm/amd/ivrs_drv.c
@@ -312,14 +312,22 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc)
static bool
ivhd_is_newer(ACPI_IVRS_HEADER *old, ACPI_IVRS_HEADER *new)
{
- /*
- * Newer IVRS header type take precedence.
- */
- if ((old->DeviceId == new->DeviceId) &&
- (old->Type == IVRS_TYPE_HARDWARE_LEGACY) &&
- ((new->Type == IVRS_TYPE_HARDWARE_EFR) ||
- (new->Type == IVRS_TYPE_HARDWARE_MIXED))) {
- return (true);
+ if (old->DeviceId == new->DeviceId) {
+ /*
+ * Newer IVRS header type take precedence.
+ */
+ if (old->Type == IVRS_TYPE_HARDWARE_LEGACY &&
+ ((new->Type == IVRS_TYPE_HARDWARE_EFR) ||
+ (new->Type == IVRS_TYPE_HARDWARE_MIXED)))
+ return (true);
+
+ /*
+ * Mixed format IVHD header type take precedence
+ * over fixed format IVHD header types.
+ */
+ if (old->Type == IVRS_TYPE_HARDWARE_EFR &&
+ new->Type == IVRS_TYPE_HARDWARE_MIXED)
+ return (true);
}

return (false);
_______________________________________________
dev-commi...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src...@freebsd.org"
Reply all
Reply to author
Forward
0 new messages