iommu/amd: Fix interrupt remapping when disable guest_mode
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Mon, 26 Jun 2017 09:28:04 +0000 (04:28 -0500)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:07:09 +0000 (03:07 +0000)
commit736c56dbe25e6dd59da41016f2ca368f9cce68c3
treec4ca671d4b73540060e0f6a5152cf4a4136c914c
parent43bd6abe31fb8f2fb8252ed7542bfaf6c3c81d0a
iommu/amd: Fix interrupt remapping when disable guest_mode

commit 84a21dbdef0b96d773599c33c2afbb002198d303 upstream.

Pass-through devices to VM guest can get updated IRQ affinity
information via irq_set_affinity() when not running in guest mode.
Currently, AMD IOMMU driver in GA mode ignores the updated information
if the pass-through device is setup to use vAPIC regardless of guest_mode.
This could cause invalid interrupt remapping.

Also, the guest_mode bit should be set and cleared only when
SVM updates posted-interrupt interrupt remapping information.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Joerg Roedel <jroedel@suse.de>
Fixes: d98de49a53e48 ('iommu/amd: Enable vAPIC interrupt remapping mode by default')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/amd_iommu.c