From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 866C3740032 for ; Thu, 18 Jul 2024 15:34:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=51w62qXDsIT05k1zNFxGIM2dA+/F6NpaF70YLXsJ3IA=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1721316862; v=1; b=PTWEd/3KgFqj9E8fQPfJB/RdJpEvPM71+6bCXqmihp2p8ukcOjDZVIJkZkTFQg6bK19lzgl1 BB8WSH/hfZA+9B1Rw6vPm57KJePiJ6FtqWx2e8RXJtA7nSU5UNm2f8gAxd7Zhjslg0FsKw9p6G4 +YptnX0Kvi7EWODCBlbdgR/epNbu9BfHM1KSroB2hdeVxtylQGl1v3GmKMOr6U5Qc2ufNXPyKop Db9ywMj4LHP83VyPJSyXpcSMUu8n2Yu8v88QS6qmIEhbqianq67+IBHbfdxWI6qjyzqxM+ElAg7 9rTerWC1k6AMgpG6v2w4LgNjuEqP593C3sgYpc8aTLUIQ== X-Received: by 127.0.0.2 with SMTP id w5EuYY7687511xvogoRzE9Ky; Thu, 18 Jul 2024 08:34:20 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.18053.1721316855431122625 for ; Thu, 18 Jul 2024 08:34:15 -0700 X-Received: from [10.6.0.181] (unknown [20.39.63.0]) by linux.microsoft.com (Postfix) with ESMTPSA id A432420B7165; Thu, 18 Jul 2024 08:34:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A432420B7165 Message-ID: Date: Thu, 18 Jul 2024 11:34:13 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/2] IntelSiliconPkg: Compiler and linker fixes To: "Chaganty, Rangasai V" , "devel@edk2.groups.io" Cc: "Ni, Ray" , "S, Ashraf Ali" , "Lautner, Kenneth" References: <20240717175440.229-1-mikuback@linux.microsoft.com> <20240717175440.229-2-mikuback@linux.microsoft.com> From: "Michael Kubacki" In-Reply-To: Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 18 Jul 2024 08:34:15 -0700 Resent-From: mikuback@linux.microsoft.com Reply-To: devel@edk2.groups.io,mikuback@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 952LyR01TuRJ6cn6e4AI5T6ux7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="PTWEd/3K"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linux.microsoft.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Thanks for finding those. Updated them in V2: - https://edk2.groups.io/g/devel/message/119967 - https://github.com/tianocore/edk2-platforms/pull/171 On 7/18/2024 12:15 AM, Chaganty, Rangasai V wrote: > Hi Michael, > Thanks for addressing the GCC compiler issues. Overall looks good. >=20 > In IntelVTdCorePei.c, it seems the following got missed: > Item->Header.LogType =3D (UINT64) (1 << EventType); >=20 > Can you also take care of below and use LShiftU64, instead of compiler in= trinsic operators. >=20 > Thanks, > Sai >=20 > -----Original Message----- > From: mikuback@linux.microsoft.com > Sent: Wednesday, July 17, 2024 10:55 AM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Chaganty, Rangasai V ; S, Ashraf Ali ; Lautner, Kenneth > Subject: [edk2-platforms][PATCH v1 1/2] IntelSiliconPkg: Compiler and lin= ker fixes >=20 > From: Michael Kubacki >=20 > Some code is currently not being built in the package. This fixes GCC com= piler errors and MSVC linker failures in the code so the package can build = with these modules included. >=20 > Cc: Ray Ni > Cc: Rangasai V Chaganty > Cc: Ashraf Ali S >=20 > Co-authored-by: Ken Lautner > Signed-off-by: Michael Kubacki > --- > Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/BmDma.c = | 4 ++-- > Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/VtdLog.c = | 12 ++++++------ > Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCorePei/IntelVTdCoreP= ei.c | 6 +++--- > 3 files changed, 11 insertions(+), 11 deletions(-) >=20 > diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/Bm= Dma.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/BmDma.c > index 41917a004880..47fd3674cd56 100644 > --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/BmDma.c > +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/BmDma.c > @@ -464,7 +464,7 @@ IoMmuAllocateBuffer ( > if (!EFI_ERROR (Status)) { > *HostAddress =3D (VOID *) (UINTN) PhysicalAddress; > =20 > - VTdLogAddEvent (VTDLOG_DXE_IOMMU_ALLOC_BUFFER, (UINT64) Pages, (UINT= 64) (*HostAddress)); > + VTdLogAddEvent (VTDLOG_DXE_IOMMU_ALLOC_BUFFER, (UINT64) Pages, > + (UINT64) (UINTN) (*HostAddress)); > } > =20 > DEBUG ((DEBUG_VERBOSE, "IoMmuAllocateBuffer: 0x%08x <=3D=3D\n", *Host= Address)); @@ -494,7 +494,7 @@ IoMmuFreeBuffer ( { > DEBUG ((DEBUG_VERBOSE, "IoMmuFreeBuffer: 0x%\n", Pages)); > =20 > - VTdLogAddEvent (VTDLOG_DXE_IOMMU_FREE_BUFFER, Pages, (UINT64) HostAddr= ess); > + VTdLogAddEvent (VTDLOG_DXE_IOMMU_FREE_BUFFER, Pages, (UINT64) (UINTN) > + HostAddress); > =20 > return gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress, Pa= ges); } diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCor= eDxe/VtdLog.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/V= tdLog.c > index 91c27e2a1f2c..6a44424395c9 100644 > --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/VtdLog.c > +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCoreDxe/VtdLog.c > @@ -77,7 +77,7 @@ VTdLogAddEvent ( > Item->Data2 =3D Data2; > =20 > Item->Header.DataSize =3D sizeof (VTDLOG_EVENT_2PARAM); > - Item->Header.LogType =3D (UINT64) 1 << EventType; > + Item->Header.LogType =3D LShiftU64 (1, EventType); > Item->Header.Timestamp =3D AsmReadTsc (); > } > } > @@ -117,11 +117,11 @@ VTdLogAddDataEvent ( > CopyMem (Item->Data, Data, DataSize); > =20 > Item->Header.DataSize =3D EventSize; > - Item->Header.LogType =3D (UINT64) 1 << EventType; > + Item->Header.LogType =3D LShiftU64 (1, EventType); > Item->Header.Timestamp =3D AsmReadTsc (); > } > } > - > + > /** > Get Event Items From Pei Pre-Mem Buffer > =20 > @@ -154,10 +154,10 @@ VTdGetEventItemsFromPeiPreMemBuffer ( > Event.Header.DataSize =3D sizeof (VTDLOG_EVENT_2PARAM); > Event.Header.Timestamp =3D 0; > =20 > - Event.Header.LogType =3D ((UINT64) 1) << VTDLOG_PEI_PRE_MEM_DMA_PR= OTECT; > + Event.Header.LogType =3D LShiftU64 (1, > + VTDLOG_PEI_PRE_MEM_DMA_PROTECT); > Event.Data1 =3D InfoBuffer[Index].BarAddress; > Event.Data2 =3D InfoBuffer[Index].Mode; > - Event.Data2 |=3D InfoBuffer[Index].Status<<8; > + Event.Data2 |=3D LShiftU64 (InfoBuffer[Index].Status, 8); > CallbackHandle (Context, &Event.Header); > } > EventCount++; > @@ -231,7 +231,7 @@ VTdGenerateStateEvent ( > Item.Data2 =3D Data2; > =20 > Item.Header.DataSize =3D sizeof (VTDLOG_EVENT_2PARAM); > - Item.Header.LogType =3D (UINT64) 1 << EventType; > + Item.Header.LogType =3D LShiftU64 (1, EventType); > Item.Header.Timestamp =3D 0; > =20 > if (CallbackHandle) { > diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCorePei/In= telVTdCorePei.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCorePei= /IntelVTdCorePei.c > index 0160c3604541..7c72055e73dd 100644 > --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCorePei/IntelVTdC= orePei.c > +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdCorePei/IntelVTd > +++ CorePei.c > @@ -152,7 +152,7 @@ VTdLogAddDataEvent ( > =20 > Item->Header.DataSize =3D EventSize; > Item->Header.LogType =3D (UINT64) (1 << EventType); > - Item->Header.Timestamp =3D AsmReadTsc (); > + Item->Header.Timestamp =3D AsmReadTsc (); > } > } > /** > @@ -372,7 +372,7 @@ PeiIoMmuMap ( > ); > } > =20 > - VTdLogAddEvent (VTDLOG_PEI_PPI_MAP, (UINT64) HostAddress, Length); > + VTdLogAddEvent (VTDLOG_PEI_PPI_MAP, (UINT64) (UINTN) HostAddress, > + Length); > return EFI_SUCCESS; > } > =20 > @@ -498,7 +498,7 @@ PeiIoMmuAllocateBuffer ( > =20 > DEBUG ((DEBUG_INFO, "PeiIoMmuAllocateBuffer - allocate - %x\n", *Host= Address)); > =20 > - VTdLogAddEvent (VTDLOG_PEI_PPI_ALLOC_BUFFER, (UINT64) (*HostAddress), = Length); > + VTdLogAddEvent (VTDLOG_PEI_PPI_ALLOC_BUFFER, (UINT64) (UINTN) > + (*HostAddress), Length); > =20 > return EFI_SUCCESS; > } > -- > 2.45.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119970): https://edk2.groups.io/g/devel/message/119970 Mute This Topic: https://groups.io/mt/107402756/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-