public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sheng Wei" <w.sheng@intel.com>
To: devel@edk2.groups.io
Cc: Ray Ni <ray.ni@intel.com>,
	Rangasai V Chaganty <rangasai.v.chaganty@intel.com>,
	Jenny Huang <jenny.huang@intel.com>,
	Robert Kowalewski <robert.kowalewski@intel.com>
Subject: [PATCH] IntelSiliconPkg/VTd: Use Legacy Mode Address Translation
Date: Tue,  8 Feb 2022 10:03:11 +0800	[thread overview]
Message-ID: <20220208020311.8276-1-w.sheng@intel.com> (raw)

Only if ECAP_REG.SMTS == 0 and ECAP_REG.bit 24 == 1, use
 extended mode address translation.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3826

Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Jenny Huang <jenny.huang@intel.com>
Cc: Robert Kowalewski <robert.kowalewski@intel.com>
Signed-off-by: Sheng Wei <w.sheng@intel.com>
---
 .../Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c    | 2 +-
 .../IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c      | 2 +-
 .../Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c
index b30c44dc..180981eb 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c
@@ -626,7 +626,7 @@ EnableVTdTranslationProtection (
 
     if (VtdUnitInfo->ExtRootEntryTable != 0) {
       DEBUG ((DEBUG_INFO, "EnableVtdDmar (%d) ExtRootEntryTable 0x%x\n", Index, VtdUnitInfo->ExtRootEntryTable));
-      Status = EnableDmar (VtdUnitInfo, VtdUnitInfo->ExtRootEntryTable);
+      Status = EnableDmar (VtdUnitInfo, VtdUnitInfo->ExtRootEntryTable | BIT11);
     } else {
       DEBUG ((DEBUG_INFO, "EnableVtdDmar (%d) RootEntryTable 0x%x\n", Index, VtdUnitInfo->RootEntryTable));
       Status = EnableDmar (VtdUnitInfo, VtdUnitInfo->RootEntryTable);
diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
index c94f4a85..b3e9519f 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
@@ -902,7 +902,7 @@ SetupTranslationTable (
         ASSERT(FALSE);
         Status = EFI_UNSUPPORTED;
       } else {
-        Status = CreateExtContextEntry (VtdUnitInfo);
+        Status = CreateContextEntry (VtdUnitInfo);
       }
     } else {
       if (VtdUnitInfo->ECapReg.Bits.DEP_24) {
diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
index 48e38d56..3e8cf9dd 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
@@ -389,7 +389,7 @@ SetupTranslationTable (
         ASSERT(FALSE);
         Status = EFI_UNSUPPORTED;
       } else {
-        Status = CreateExtContextEntry (Index);
+        Status = CreateContextEntry (Index);
       }
     } else {
       if (mVtdUnitInformation[Index].ECapReg.Bits.DEP_24) {
-- 
2.16.2.windows.1


             reply	other threads:[~2022-02-08  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08  2:03 Sheng Wei [this message]
2022-02-09  3:03 ` [PATCH] IntelSiliconPkg/VTd: Use Legacy Mode Address Translation Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220208020311.8276-1-w.sheng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox