Skip to contentSkip to conversation

iommu/vt-d: Fix status code for Allocate/Free PASID command

PATCH In review Zenghui Yu 3 participants 3 messages Feb 27, 2021 – Mar 4, 2021

Subsystems (2)
lore
Share & tools
lore

Zenghui Yu

author
#0 lore raw

PATCH 1/1 iommu/vt-d: Fix status code for Allocate/Free PASID command

As per Intel vt-d spec, Rev 3.0 (section 10.4.45 "Virtual Command Response Register"), the status code of "No PASID available" error in response to the Allocate PASID command is 2, not 1. The same for "Invalid PASID" error in response to the Free PASID command.

We will otherwise see confusing kernel log under the command failure from guest side. Fix it.

Fixes 24f27d32ab6b ("iommu/vt-d: Enlightened PASID allocation")
---
 drivers/iommu/intel/pasid.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/intel/pasid.h +2 -2
index 97dfcffbf495..444c0bec221a 100644
@@ -30,8 +30,8 @@
 #define VCMD_VRSP_IP			0x1
 #define VCMD_VRSP_SC(e)			(((e) >> 1) & 0x3)
 #define VCMD_VRSP_SC_SUCCESS		0
-#define VCMD_VRSP_SC_NO_PASID_AVAIL	1
-#define VCMD_VRSP_SC_INVALID_PASID	1
+#define VCMD_VRSP_SC_NO_PASID_AVAIL	2
+#define VCMD_VRSP_SC_INVALID_PASID	2
 #define VCMD_VRSP_RESULT_PASID(e)	(((e) >> 8) & 0xfffff)
 #define VCMD_CMD_OPERAND(e)		((e) << 8)
 /*
Signature · 6 lines
2.19.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 20 lines · Zenghui Yu

As per Intel vt-d spec, Rev 3.0 (section 10.4.45 "Virtual Command Response Register"), the status code of "No PASID available" error in response to the Allocate PASID command is 2, not 1. The same for "Invalid PASID" error in response to the Free PASID command.

We will otherwise see confusing kernel log under the command failure from guest side. Fix it.

Fixes 24f27d32ab6b ("iommu/vt-d: Enlightened PASID allocation")
---
  drivers/iommu/intel/pasid.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/intel/pasid.h +0 -0
index 97dfcffbf495..444c0bec221a 100644

drivers/iommu/intel/pasid.h line 37

Quoted 10 lines
drivers/iommu/intel/pasid.h +2 -2
@@ -30,8 +30,8 @@
  #define VCMD_VRSP_IP			0x1
  #define VCMD_VRSP_SC(e)			(((e) >> 1) & 0x3)
  #define VCMD_VRSP_SC_SUCCESS		0
-#define VCMD_VRSP_SC_NO_PASID_AVAIL	1
-#define VCMD_VRSP_SC_INVALID_PASID	1
+#define VCMD_VRSP_SC_NO_PASID_AVAIL	2
+#define VCMD_VRSP_SC_INVALID_PASID	2
  #define VCMD_VRSP_RESULT_PASID(e)	(((e) >> 8) & 0xfffff)
  #define VCMD_CMD_OPERAND(e)		((e) << 8)
  /*

Thanks a lot for catching this.

Best regards,
baolu
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

maintainer
#2 lore raw
In reply to Zenghui Yu
Quoted 10 lines · Zenghui Yu

As per Intel vt-d spec, Rev 3.0 (section 10.4.45 "Virtual Command Response Register"), the status code of "No PASID available" error in response to the Allocate PASID command is 2, not 1. The same for "Invalid PASID" error in response to the Free PASID command.

We will otherwise see confusing kernel log under the command failure from guest side. Fix it.

Fixes 24f27d32ab6b ("iommu/vt-d: Enlightened PASID allocation")

Applied for v5.12, thanks.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu