Skip to contentSkip to conversation

iommu/amd: Don't use dev_data in irte_ga_set_affinity()

PATCH Applied Scott Wood 2 participants 2 messages Jan 28, 2018 – Feb 13, 2018 1 message not in the archive IOMMU

lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH 1/1 iommu/amd: Don't use dev_data in irte_ga_set_affinity()

search_dev_data() acquires a non-raw lock, which can't be done from atomic context on PREEMPT_RT. There is no need to look at dev_data because guest_mode should never be set if use_vapic is not set.

---
This is a followup to the patches below:

https://patchwork.codeaurora.org/patch/433611/
https://patchwork.codeaurora.org/patch/433613/

 drivers/iommu/amd_iommu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iommu/amd_iommu.c +1 -3
index 84e99097dfe3..a933c26df652 100644
@@ -3861,10 +3861,8 @@ static void irte_ga_set_affinity(void *entry, u16 devid, u16 index,
 				 u8 vector, u32 dest_apicid)
 {
 	struct irte_ga *irte = (struct irte_ga *) entry;
-	struct iommu_dev_data *dev_data = search_dev_data(devid);
 
-	if (!dev_data || !dev_data->use_vapic ||
-	    !irte->lo.fields_remap.guest_mode) {
+	if (!irte->lo.fields_remap.guest_mode) {
 		irte->hi.fields.vector = vector;
 		irte->lo.fields_remap.destination = dest_apicid;
 		modify_irte_ga(devid, index, irte, NULL);
Signature · 1 line
1.8.3.1

A message that is not in the archive (sent off-list or not yet received): 20180128202219.27005-1-swood-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

Applied
#2 lore raw
Quoted 6 lines · Scott Wood

search_dev_data() acquires a non-raw lock, which can't be done from atomic context on PREEMPT_RT. There is no need to look at dev_data because guest_mode should never be set if use_vapic is not set.

Quoted 8 lines

---
This is a followup to the patches below:

https://patchwork.codeaurora.org/patch/433611/
https://patchwork.codeaurora.org/patch/433613/

 drivers/iommu/amd_iommu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Applied, thanks.