From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=SPF record not found (domain: zhaoxin.com, ip: 203.148.12.81, mailfrom: jerryzhou@zhaoxin.com) Received: from ZXSHCAS1.zhaoxin.com (ZXSHCAS1.zhaoxin.com [203.148.12.81]) by groups.io with SMTP; Mon, 13 May 2019 04:28:10 -0700 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Mon, 13 May 2019 19:27:59 +0800 Received: from zxbjmbx3.zhaoxin.com (10.29.252.165) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Mon, 13 May 2019 19:27:58 +0800 Received: from zxbjmbx3.zhaoxin.com ([fe80::57b:6f00:3193:d8a6]) by zxbjmbx3.zhaoxin.com ([fe80::57b:6f00:3193:d8a6%8]) with mapi id 15.01.1261.035; Mon, 13 May 2019 19:27:58 +0800 From: "Jerry Zhou(BJ-RD)" To: "Zeng, Star" , "edk2-devel@lists.01.org" , "devel@edk2.groups.io" CC: "Yao, Jiewen" , "Ni, Ray" Subject: =?UTF-8?B?562U5aSNOiBbZWRrMl0gW1BBVENIXSBJbnRlbFNpbGljb25Qa2cgVlRkRHhlOiBhIHF1ZXN0aW9uIGFib3V0IHRoZSBzb3VyY2UgY29kZQ==?= Thread-Topic: [edk2] [PATCH] IntelSiliconPkg VTdDxe: a question about the source code Thread-Index: AdUJNci9WEC63Y3xT7KjRAFsJUkP5QARFuIgAAC+ShA= Date: Mon, 13 May 2019 11:27:58 +0000 Message-ID: <9b07851c347d4810a691ebaa64d1fa5e@zhaoxin.com> References: <0C09AFA07DD0434D9E2A0C6AEB048310402DECF5@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB048310402DECF5@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.29.8.16] MIME-Version: 1.0 Return-Path: JerryZhou@zhaoxin.com Content-Language: zh-CN Content-Type: multipart/alternative; boundary="_000_9b07851c347d4810a691ebaa64d1fa5ezhaoxincom_" --_000_9b07851c347d4810a691ebaa64d1fa5ezhaoxincom_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 R290IGl0ISBUaGFua3MgZm9yIHlvdXIgcmVwbHkuDQpCdXQgeW91IHNob3VsZCBzdGlsbCBwb2xs IHRoZSBCX0dTVFNfUkVHX1RFIGJpdCwgbm90IHRoZSBCX0dTVFNfUkVHX1JUUFMgYml0LCBpbiB0 aGUganVkZ2VtZW50IGNvZGUgb2Ygd2hpbGUoKSBsb29wLg0KQWZ0ZXIgJiBvcGVyYXRpb24gYmV0 d2VlbiBSZWczMiBhbmQgQl9HU1RTX1JFR19SVFBTLCB0aGUgc3RhdHVzIG9mIEJfR1NUU19SRUdf VEUgd2lsbCBiZSBsb3N0Lg0KDQpBIG1vcmUgdGVkaW91cyBidXQgbW9yZSByZWxpYWJsZSBvcGVy YXRpb24gc2VxdWVuY2UgaXMgcmVjb21tZW5kZWQgaW4gVnQtZCBzcGVjaWZpY2F0aW9uIDIuNCBi ZWxvdzoNCg0KdG8gdXBkYXRlIGEgYml0IGZpZWxkIGluIHRoaXMgcmVnaXN0ZXIgYXQgb2Zmc2V0 IFggd2l0aCB2YWx1ZSBvZiBZLCBzb2Z0d2FyZQ0KbXVzdCBmb2xsb3cgYmVsb3cgc3RlcHM6DQox LiBUbXAgPSBSZWFkIEdTVFNfUkVHDQoyLiBTdGF0dXMgPSAoVG1wICYgOTZGRkZGRkZoKSAvLyBS ZXNldCB0aGUgb25lLXNob3QgYml0cw0KMy4gQ29tbWFuZCA9IChTdGF0dXMgfCAoWSA8PCBYKSkN Cj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JQUwgTk9URToNClRoaXMgZW1haWwgY29udGFpbnMgY29uZmlkZW50aWFsIG9y IGxlZ2FsbHkgcHJpdmlsZWdlZCBpbmZvcm1hdGlvbiBhbmQgaXMgZm9yIHRoZSBzb2xlIHVzZSBv ZiBpdHMgaW50ZW5kZWQgcmVjaXBpZW50LiBBbnkgdW5hdXRob3JpemVkIHJldmlldywgdXNlLCBj b3B5aW5nIG9yIGZvcndhcmRpbmcgb2YgdGhpcyBlbWFpbCBvciB0aGUgY29udGVudCBvZiB0aGlz IGVtYWlsIGlzIHN0cmljdGx5IHByb2hpYml0ZWQuDQoNCg0KsaPD3Mn5w/ejug0Ksb7Tyrz+uqzT 0LGjw9y78teo09DQxc+io6y99rmp1ri2qMrVvP7Iy8q508Oho9HPvfu21LG+08q8/rvyxuTE2sjd 1/bIzrrOzrS+rcrayKi1xLLp1MShosq508Ohori01sa78teqt6Khow0KQ09ORklERU5USUFMIE5P VEU6DQpUaGlzIGVtYWlsIGNvbnRhaW5zIGNvbmZpZGVudGlhbCBvciBsZWdhbGx5IHByaXZpbGVn ZWQgaW5mb3JtYXRpb24gYW5kIGlzIGZvciB0aGUgc29sZSB1c2Ugb2YgaXRzIGludGVuZGVkIHJl Y2lwaWVudC4gQW55IHVuYXV0aG9yaXplZCByZXZpZXcsIHVzZSwgY29weWluZyBvciBmb3J3YXJk aW5nIG9mIHRoaXMgZW1haWwgb3IgdGhlIGNvbnRlbnQgb2YgdGhpcyBlbWFpbCBpcyBzdHJpY3Rs eSBwcm9oaWJpdGVkLg0K --_000_9b07851c347d4810a691ebaa64d1fa5ezhaoxincom_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable

Got it!= Thanks for your reply.

But you= should still poll the B_GSTS_REG_TE bit, not the B_GSTS_REG_RTPS bit, in t= he judgement code of while() loop.

After &= amp; operation between Reg32 and B_GSTS_REG_RTPS, the status of B_GSTS_REG_= TE will be lost.

&n= bsp;

A more = tedious but more reliable operation sequence is recommended in Vt-d specifi= cation 2.4 below:

&n= bsp;

to update a bit field in t= his register at offset X with value of Y, software

must follow below steps:

1. Tmp =3D Read GSTS_REG

2. Status =3D (Tmp & 9= 6FFFFFFh) // Reset the one-shot bits

3. Command =3D (Status | (= Y << X))

4. Write Command to GCMD_R= EG

5. Wait until GSTS_REG[X] = indicates command is serviced.

=B7=A2=BC=FE=C8=CB: Zeng, Star [mailto:star.zeng@intel.com]
=B7=A2= =CB=CD=CA=B1=BC=E4: 2019=C4=EA5=D4=C213=C8=D5 18:54
=CA=D5=BC=FE=C8=CB: Jerry Zhou(BJ-RD); edk2-devel@lists.01.org
=B3=AD=CB=CD: Yao, Jiewen; Ni, Ray; Zeng, Star
=D6=F7=CC=E2: RE: [edk2] [PATCH] IntelSiliconPkg VTdDxe: a question about the source co= de

 

Good question, my understanding is setting B_GMCD_REG_SRTP(BIT30)= ONLY also means clearing B_GMCD_REG_TE (BIT31).

 

Thanks,

Star

From: Jerry Zhou(BJ-RD) [mailto:JerryZhou@zhaoxin.c= om]
Sent: Monday, May 13, 2019 10:59 AM
To: Zeng, Star <star.zeng@intel.com>; edk2-devel@lists.01.org<= br> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Ni, Ray <ray.ni@int= el.com>
Subject:
=B4=F0=B8=B4= : [edk2] [PATCH] IntelSiliconPkg VTdDxe: a question about the source code

 

Hi Star,

    &nbs= p;    I'am so interested in DMA protection in UEFI. It's a r= eally good design!

    &nbs= p;    But I have a question about the implemention of DisableDmar() in IntelSiliconPkg\feature\vtd\intelvtddxe\VtdReg.c

    &nbs= p;    Is it a typing error in the code segment below?

 

    //

    // Disabl= e VTd

    //

    MmioWrite= 32 (mVtdUnitInformation[Index].VtdUnitBaseAddress + R_GCMD_REG, B_GMCD_REG_SRTP);=

    do {=

    &nbs= p; Reg32 =3D MmioRead32 (mVtdUnitInformation[Index].VtdUnitBaseAddress += ; R_GSTS_REG);

} while((Reg32 & B_GSTS_REG_RTPS) =3D=3D 0);

 

The software should program the B_GMCD_REG_TE field in global command register and then poll the = B_GSTS_REG_TE field in global status register if the DMAR is expected t= o be disabled or enabled according to Vt-d specification.=

 

Thanks

Jerry Zhou=

Ext:892418=

 

 

 

-----=D3=CA=BC=FE=D4=AD=BC=FE-----
=B7=A2=BC=FE=C8=CB: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] =B4=FA=B1=ED Star Zeng
=B7=A2=CB=CD=CA=B1=BC=E4
: 2018=C4=EA10=D4=C224=C8=D5 11:32
=CA=D5=BC=FE=C8=CB: edk2-devel@lists.01.org
=B3=AD=CB=CD: Jiewen Yao; Star Zeng
=D6=F7=CC=E2: [edk2] [PATCH] IntelSiliconPkg VTdDxe: Option to force no ea= rly access attr request

 

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

 

To have high confidence in u= sage for platform, add option (BIT2 of

PcdVTdPolicyPropertyMask) to= force no IOMMU access attribute request

recording before DMAR table = is installed.

 

Check PcdVTdPolicyPropertyMa= sk BIT2 before RequestAccessAttribute()

and ProcessRequestedAccessAt= tribute(), then RequestAccessAttribute(),

ProcessRequestedAccessAttrib= ute() and mAccessRequestXXX variables

could be optimized by compil= er when PcdVTdPolicyPropertyMask BIT2 =3D 1.

 

Test done:=

1: Created case that has IOM= MU access attribute request before DMAR

   table is instal= led, ASSERT was triggered after setting

   PcdVTdPolicyPro= pertyMask BIT2 to 1.

 

2. Confirmed RequestAccessAt= tribute(), ProcessRequestedAccessAttribute()

   and mAccessRequ= estXXX variables were optimized by compiler after

   setting PcdVTdP= olicyPropertyMask BIT2 to 1.

 

Cc: Jiewen Yao <jiewen.yao@intel.com>

Cc: Rangasai V Chaganty <= rangasai.v.chaganty@intel.= com>

Contributed-under: TianoCore= Contribution Agreement 1.1

Signed-off-by: Star Zeng <= ;star.zeng@intel.com>

---

IntelSiliconPkg/Feature/VTd/= IntelVTdDxe/DmaProtection.c | 8 +++++++-

IntelSiliconPkg/Feature/VTd/= IntelVTdDxe/IntelVTdDxe.c   | 7 ++++++= 3;

IntelSiliconPkg/IntelSilicon= Pkg.dec           &n= bsp;         | 1 +

3 files changed, 15 insertio= ns(+), 1 deletion(-)

 

diff --git a/IntelSiliconPkg= /Feature/VTd/IntelVTdDxe/DmaProtection.c b/IntelSiliconPkg/Feature/VTd/Inte= lVTdDxe/DmaProtection.c

index 86d50eb6f288..77845456= 31b3 100644

--- a/IntelSiliconPkg/Featur= e/VTd/IntelVTdDxe/DmaProtection.c

+++ b/IntelSilic= onPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c

@@ -515,7 +515,13 @@ Set= upVtd (

 

   ParseDmarA= cpiTableRmrr ();

 

-  ProcessRequestedAcce= ssAttribute ();

+  if ((PcdGet8 (Pc= dVTdPolicyPropertyMask) & BIT2) =3D=3D 0) {

+    //

+    // S= upport IOMMU access attribute request recording before DMAR table is instal= led.

+    // H= ere is to process the requests.

+    //

+    Proc= essRequestedAccessAttribute ();

+  }

 

   for (Index= =3D 0; Index < mVtdUnitNumber; Index++) {

     DEB= UG ((DEBUG_INFO,"VTD Unit %d (Segment: %04x)\n", Index, mVtdUnitI= nformation[Index].Segment));

diff --git a/IntelSiliconPkg= /Feature/VTd/IntelVTdDxe/IntelVTdDxe.c b/IntelSiliconPkg/Feature/VTd/IntelV= TdDxe/IntelVTdDxe.c

index 25d7c80af1d4..09948ce5= 0e94 100644

--- a/IntelSiliconPkg/Featur= e/VTd/IntelVTdDxe/IntelVTdDxe.c

+++ b/IntelSilic= onPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.c

@@ -254,6 +254,13 @@ VTd= SetAttribute (

     // = Record the entry to driver global variable.

     // = As such once VTd is activated, the setting can be adopted.

     //<= o:p>

+    if (= (PcdGet8 (PcdVTdPolicyPropertyMask) & BIT2) !=3D 0) {=

+    = ;  //

+    = ;  // Force no IOMMU access attribute request recording before DMAR ta= ble is installed.

+    = ;  //

+    = ;  ASSERT_EFI_ERROR (EFI_NOT_READY);

+    = ;  return EFI_NOT_READY;

+    }

     Sta= tus =3D RequestAccessAttribute (Segment, SourceId, DeviceAddress, Length, I= oMmuAccess);

   } else {

     PER= F_CODE (

diff --git a/IntelSiliconPkg= /IntelSiliconPkg.dec b/IntelSiliconPkg/IntelSiliconPkg.dec

index b9646d773b95..900e8f63= c64d 100644

--- a/IntelSiliconPkg/IntelS= iliconPkg.dec

+++ b/IntelSilic= onPkg/IntelSiliconPkg.dec

@@ -64,6 +64,7 @@ [PcdsF= ixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]<= /span>

   ## The mask is = used to control VTd behavior.<BR><BR>

   #  BIT0: E= nable IOMMU during boot (If DMAR table is installed in DXE. If VTD_INFO_PPI= is installed in PEI.)

   #  BIT1: E= nable IOMMU when transfer control to OS (ExitBootService in normal boot. En= dOfPEI in S3)

+  #  BIT2: Fo= rce no IOMMU access attribute request recording before DMAR table is instal= led.

   # @Prompt The p= olicy for VTd driver behavior.

   gIntelSiliconPk= gTokenSpaceGuid.PcdVTdPolicyPropertyMask|1|UINT8|0x00000002

 

--

2.7.0.windows.1

 

____________________________= ___________________

edk2-devel mailing list=

edk2-devel@lists.01.org

https://lists.01.org/mailman/listinfo/edk2= -devel

 

=B1=A3=C3=DC=C9=F9=C3=F7=A3=BA<= /span>

=B1=BE=D3=CA=BC=FE=BA=AC=D3=D0=B1=A3=C3=DC=BB=F2=D7=A8=D3=D0=D0=C5=CF= =A2=A3=AC=BD=F6=B9=A9=D6=B8=B6=A8=CA=D5=BC=FE=C8=CB=CA=B9=D3=C3=A1=A3=D1=CF= =BD=FB=B6=D4=B1=BE=D3=CA=BC=FE=BB=F2=C6=E4=C4=DA=C8=DD=D7=F6=C8=CE=BA=CE=CE= =B4=BE=AD=CA=DA=C8=A8=B5=C4=B2=E9=D4=C4=A1=A2=CA=B9=D3=C3=A1=A2=B8=B4=D6=C6= =BB=F2=D7=AA=B7=A2=A1=A3

CONFIDENTIAL NOTE: <= /p>

This email contains= confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying = or forwarding of this email or the content of this email is strictly prohib= ited.



=B1=A3=C3=DC=C9=F9=C3=F7=A3=BA
=B1=BE=D3=CA=BC=FE=BA=AC=D3=D0=B1=A3=C3=DC=BB=F2=D7=A8=D3= =D0=D0=C5=CF=A2=A3=AC=BD=F6=B9=A9=D6=B8=B6=A8=CA=D5=BC=FE=C8=CB=CA=B9=D3=C3= =A1=A3=D1=CF=BD=FB=B6=D4=B1=BE=D3=CA=BC=FE=BB=F2=C6=E4=C4=DA=C8=DD=D7=F6=C8= =CE=BA=CE=CE=B4=BE=AD=CA=DA=C8=A8=B5=C4=B2=E9=D4=C4=A1=A2=CA=B9=D3=C3=A1=A2= =B8=B4=D6=C6=BB=F2=D7=AA=B7=A2=A1=A3
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and i= s for the sole use of its intended recipient. Any unauthorized review, use,= copying or forwarding of this email or the content of this email is strict= ly prohibited.
--_000_9b07851c347d4810a691ebaa64d1fa5ezhaoxincom_--