mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] iommu/vt-d: Set No Execute Enable bit in PASID table entry
@ 2023-01-26  9:54 Lu Baolu
  2023-01-28  7:19 ` Tian, Kevin
  2023-01-31  7:53 ` Baolu Lu
  0 siblings, 2 replies; 4+ messages in thread
From: Lu Baolu @ 2023-01-26  9:54 UTC (permalink / raw)
  To: iommu
  Cc: Joerg Roedel, Will Deacon, Robin Murphy, Kevin Tian, Ashok Raj,
	linux-kernel, Lu Baolu

Setup No Execute Enable bit (Bit 133) of a scalable mode PASID
entry. It is required when XD bit of the first level page table
entry is about to be set.

Fixes: ddf09b6d43ec ("iommu/vt-d: Setup pasid entries for iova over first level")
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/iommu/intel/pasid.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c
index fb3c7020028d..ec964ac7d797 100644
--- a/drivers/iommu/intel/pasid.c
+++ b/drivers/iommu/intel/pasid.c
@@ -364,6 +364,16 @@ static inline void pasid_set_page_snoop(struct pasid_entry *pe, bool value)
 	pasid_set_bits(&pe->val[1], 1 << 23, value << 23);
 }
 
+/*
+ * Setup No Execute Enable bit (Bit 133) of a scalable mode PASID
+ * entry. It is required when XD bit of the first level page table
+ * entry is about to be set.
+ */
+static inline void pasid_set_nxe(struct pasid_entry *pe)
+{
+	pasid_set_bits(&pe->val[2], 1 << 5, 1 << 5);
+}
+
 /*
  * Setup the Page Snoop (PGSNP) field (Bit 88) of a scalable mode
  * PASID entry.
@@ -557,6 +567,7 @@ int intel_pasid_setup_first_level(struct intel_iommu *iommu,
 	pasid_set_domain_id(pte, did);
 	pasid_set_address_width(pte, iommu->agaw);
 	pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
+	pasid_set_nxe(pte);
 
 	/* Setup Present and PASID Granular Transfer Type: */
 	pasid_set_translation_type(pte, PASID_ENTRY_PGTT_FL_ONLY);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] iommu/vt-d: Set No Execute Enable bit in PASID table entry
  2023-01-26  9:54 [PATCH 1/1] iommu/vt-d: Set No Execute Enable bit in PASID table entry Lu Baolu
@ 2023-01-28  7:19 ` Tian, Kevin
  2023-01-28  7:42   ` Baolu Lu
  2023-01-31  7:53 ` Baolu Lu
  1 sibling, 1 reply; 4+ messages in thread
From: Tian, Kevin @ 2023-01-28  7:19 UTC (permalink / raw)
  To: Lu Baolu, iommu
  Cc: Joerg Roedel, Will Deacon, Robin Murphy, Raj, Ashok, linux-kernel

> From: Lu Baolu <baolu.lu@linux.intel.com>
> Sent: Thursday, January 26, 2023 5:55 PM
> 
> Setup No Execute Enable bit (Bit 133) of a scalable mode PASID
> entry. It is required when XD bit of the first level page table
> entry is about to be set.

"is about to set" sounds like the NXE bit is set conditionally when
certain event happens. But the actual definition of NXE bit is to
allow the use of XD bit of the first level page table.

With the comment fixed:

Reviewed-by: Kevin Tian <kevin.tian@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] iommu/vt-d: Set No Execute Enable bit in PASID table entry
  2023-01-28  7:19 ` Tian, Kevin
@ 2023-01-28  7:42   ` Baolu Lu
  0 siblings, 0 replies; 4+ messages in thread
From: Baolu Lu @ 2023-01-28  7:42 UTC (permalink / raw)
  To: Tian, Kevin, iommu
  Cc: baolu.lu, Joerg Roedel, Will Deacon, Robin Murphy, Raj, Ashok,
	linux-kernel

On 2023/1/28 15:19, Tian, Kevin wrote:
>> From: Lu Baolu<baolu.lu@linux.intel.com>
>> Sent: Thursday, January 26, 2023 5:55 PM
>>
>> Setup No Execute Enable bit (Bit 133) of a scalable mode PASID
>> entry. It is required when XD bit of the first level page table
>> entry is about to be set.
> "is about to set" sounds like the NXE bit is set conditionally when
> certain event happens. But the actual definition of NXE bit is to
> allow the use of XD bit of the first level page table.
> 
> With the comment fixed:
> 
> Reviewed-by: Kevin Tian<kevin.tian@intel.com>

Updated. Thank you, Kevin.

Best regards,
baolu


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] iommu/vt-d: Set No Execute Enable bit in PASID table entry
  2023-01-26  9:54 [PATCH 1/1] iommu/vt-d: Set No Execute Enable bit in PASID table entry Lu Baolu
  2023-01-28  7:19 ` Tian, Kevin
@ 2023-01-31  7:53 ` Baolu Lu
  1 sibling, 0 replies; 4+ messages in thread
From: Baolu Lu @ 2023-01-31  7:53 UTC (permalink / raw)
  To: iommu
  Cc: baolu.lu, Joerg Roedel, Will Deacon, Robin Murphy, Kevin Tian,
	Ashok Raj, linux-kernel

On 2023/1/26 17:54, Lu Baolu wrote:
> Setup No Execute Enable bit (Bit 133) of a scalable mode PASID
> entry. It is required when XD bit of the first level page table
> entry is about to be set.
> 
> Fixes: ddf09b6d43ec ("iommu/vt-d: Setup pasid entries for iova over first level")
> Signed-off-by: Ashok Raj<ashok.raj@intel.com>
> Signed-off-by: Lu Baolu<baolu.lu@linux.intel.com>

Patch queued for v6.3.

https://lore.kernel.org/linux-iommu/20230131073740.378984-1-baolu.lu@linux.intel.com/

Best regards,
baolu

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-31  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26  9:54 [PATCH 1/1] iommu/vt-d: Set No Execute Enable bit in PASID table entry Lu Baolu
2023-01-28  7:19 ` Tian, Kevin
2023-01-28  7:42   ` Baolu Lu
2023-01-31  7:53 ` Baolu Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome