Re: [edk2] [PATCH 0/4] MdeModulePkg: add support for dispatching foreign arch PE/COFF images

2018-09-12 Thread Shi, Steven
Hi Ard, Just my curious, are you supporting the below idea of QEMU in UEFI? QEMU in UEFI - Alexander Graf https://www.youtube.com/watch?v=uxvAH1Q4Mx0 http://events17.linuxfoundation.org/sites/events/files/slides/QEMU%20in%20UEFI.pdf Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522

Re: [edk2] [PATCH] MdeModulePkg/EhciDxe: fix host controller reset condition in BindingStart

2018-09-05 Thread Shi, Steven
> Steven, can you confirm the patch fixes the issue you saw? Yes. The patch fixes my issue in https://bugzilla.tianocore.org/show_bug.cgi?id=1129 . Thanks Steven Shi ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listi

Re: [edk2] [PATCH v2] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw

2018-07-02 Thread Shi, Steven
Hi Zenith, I like your patch. Sorry for the late response. I see your patch has no impact to current supported relocation types, and I also hope we can add more relocation types in our GenFw tool. Below are some code style issues in your patch: > +STATIC > +VOID > +FindElfGOTSectionFromGOTEn

Re: [edk2] [RFC PATCH 00/11] GCC/X64: use hidden visibility for LTO PIE code

2018-06-12 Thread Shi, Steven
ent: Tuesday, June 12, 2018 11:23 PM > To: edk2-devel@lists.01.org > Cc: Ard Biesheuvel ; Kinney, Michael D > ; Gao, Liming ; Ni, > Ruiyu ; Wu, Hao A ; Leif > Lindholm ; Justen, Jordan L > ; Andrew Fish ; Zeng, Star > ; Dong, Eric ; Laszlo Ersek > ; Zenith432 ; Shi, > St

Re: [edk2] [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw

2018-06-07 Thread Shi, Steven
: 821-6522 > -Original Message- > From: Zenith432 [mailto:zenith...@users.sourceforge.net] > Sent: Thursday, June 7, 2018 2:09 PM > To: Shi, Steven > Cc: Gao, Liming ; edk2-devel@lists.01.org > Subject: RE: [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to > GenFw

Re: [edk2] [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw

2018-06-06 Thread Shi, Steven
\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Shi, Steven > Sent: Thursday, June 7, 2018 10:18 AM > To: Shi, Steven ; Gao, Liming > ; Zenith432 ; > edk2-devel@lists.01.org > Subject: RE: [PATCH] BaseTools/GenFw: Add X6

Re: [edk2] [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw

2018-06-06 Thread Shi, Steven
Please see more details in https://bugzilla.tianocore.org/show_bug.cgi?id=970 Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Shi, > Steven > Sent: Th

Re: [edk2] [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw

2018-06-06 Thread Shi, Steven
EFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Gao, Liming > Sent: Thursday, June 7, 2018 9:32 AM > To: Zenith432 ; edk2-devel@lists.01.org > Cc: Shi, Steven ; Zhu, Yonghong > > Subject: RE: [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Su

Re: [edk2] [PATCH v2 0/8] RFC: ovmf: preliminary TPM2 support

2018-03-11 Thread Shi, Steven
, March 9, 2018 9:54 PM > To: Shi, Steven ; Marc-André Lureau > > Cc: edk2-devel@lists.01.org; ler...@redhat.com; pjo...@redhat.com; Yao, > Jiewen ; qemu-de...@nongnu.org; > javi...@redhat.com > Subject: Re: [edk2] [PATCH v2 0/8] RFC: ovmf: preliminary TPM2 support > > On 03/08

Re: [edk2] [PATCH v2 0/8] RFC: ovmf: preliminary TPM2 support

2018-03-08 Thread Shi, Steven
Hi Marcandre, Thanks for your command steps and I tried them, but my qemu failed to connect the socket tpmemu.sock. When I added the control channel to the TPM, the swtpm socket command stuck there and never exit. Not sure whether it was successful. Below are the command steps running output in

Re: [edk2] [PATCH v2 0/8] RFC: ovmf: preliminary TPM2 support

2018-03-08 Thread Shi, Steven
Hi Marcandre, > I test with qemu & swtpm/libtpms (tpm2 branches, swtpm_setup.sh --tpm2 > --tpm-state tpmstatedir) > $ swtpm socket --tpmstate tpmstatedir --ctrl type=unixio,path=tpmsock --tpm2 > & Where is the swtpm_setup.sh? And could you tell how to build & install the swtpm? Thanks Steven

Re: [edk2] [PATCH] MdeModulePkg/SmmCore: Fix hang due to already-freed memory deference

2018-02-01 Thread Shi, Steven
Hi Laszlo, Check the DispatchHandle valid in internal handle set before using it to reference its Signature data is majorly to avoid use-after-free problem here, it also can defense if an input handle is invalid but has a valid signature occasionally or deliberately. > Generally, if client cod

Re: [edk2] [PATCH v2 2/3] BaseTools/tools_def CLANG38: add -Wno-unused-const-variable

2017-12-07 Thread Shi, Steven
Thank you! Reviewed-by: Shi Steven Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Thursday, December 7, 2017 5:29 PM > To: edk2-devel@lists.01.org >

Re: [edk2] [PATCH] BaseTools/tools_def: add CLANG38 LTO versions for AARCH64 and ARM

2017-12-06 Thread Shi, Steven
teven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Wednesday, December 6, 2017 7:39 PM > To: edk2-devel@lists.01.org > Cc: leif.lindh...@linaro.org; Gao, Liming ;

Re: [edk2] [PATCH] PcAtChipsetPkg/IsaAcpiDxe: Restore PCI attributes correctly

2017-11-07 Thread Shi, Steven
patch can fix your "reconnect -r" hang? > > Thanks/Ray > > > -Original Message- > > From: Laszlo Ersek [mailto:ler...@redhat.com] > > Sent: Tuesday, November 7, 2017 7:23 AM > > To: Ni, Ruiyu ; edk2-devel@lists.01.org > > Cc: Zeng, Star ;

Re: [edk2] [PATCH] Maintainers.txt: add Laszlo Ersek as UefiCpuPkg reviewer

2017-10-24 Thread Shi, Steven
Hi Laszlo, I happen hope to know how to well test the IOMMU/VT-D feature on OVMF. Can you give me some hints? Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Lasz

Re: [edk2] [PATCH] UefiCpuPkg/MtrrLib: Fix MtrrDebugPrintAllMtrrsWorker to avoid hang

2017-10-16 Thread Shi, Steven
Reviewed-by: Steven Shi Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ni, Ruiyu > Sent: Tuesday, October 17, 2017 9:47 AM > To: edk2-devel@lists.01.org > Cc: Shi, Steven ; Laszlo Ersek > Subject: [PATCH]

Re: [edk2] [PATCH] BaseTools/Conf: Support LLVM39 and LLVM40 in CLANG38 toolchain

2017-09-25 Thread Shi, Steven
8 toolchain > > >>> > > >>> Hey, > > >>> > > >>> I just noticed this patch as it recently has been pushed. I found > > >>> this has > > >been a > > >>> reaction to https://bugzilla.tianocore.org/sh

Re: [edk2] [PATCH 0/5] MdeModulePkg: UDF fixes and cleanups

2017-09-11 Thread Shi, Steven
] > Sent: Monday, September 11, 2017 9:52 PM > To: Shi, Steven ; Laszlo Ersek ; > edk2-devel-01 > Cc: Ni, Ruiyu ; Dong, Eric ; Zeng, > Star ; Ard Biesheuvel > Subject: Re: [edk2] [PATCH 0/5] MdeModulePkg: UDF fixes and cleanups > > Hi Steven, > > On 11/09/2017 10:07, S

Re: [edk2] [PATCH 0/5] MdeModulePkg: UDF fixes and cleanups

2017-09-11 Thread Shi, Steven
et: 821-6522 > -Original Message- > From: Paulo Alcantara [mailto:pca...@zytor.com] > Sent: Sunday, September 10, 2017 11:52 PM > To: Shi, Steven ; Laszlo Ersek ; > edk2-devel-01 > Cc: Ni, Ruiyu ; Dong, Eric ; Zeng, > Star ; Ard Biesheuvel > Subject: Re: [edk2] [PAT

Re: [edk2] [PATCH 0/5] MdeModulePkg: UDF fixes and cleanups

2017-09-10 Thread Shi, Steven
2 PM > To: Shi, Steven ; edk2-devel-01 de...@lists.01.org> > Cc: Ni, Ruiyu ; Dong, Eric ; Zeng, > Star ; Ard Biesheuvel > Subject: Re: [edk2] [PATCH 0/5] MdeModulePkg: UDF fixes and cleanups > > Hi Steven, > > On 09/10/17 10:38, Laszlo Ersek wrote: > > On 09/10/1

Re: [edk2] [PATCH 0/5] MdeModulePkg: UDF fixes and cleanups

2017-09-09 Thread Shi, Steven
Hi Laszlo, How could we configure the Qemu and test the UDF driver on OVMF? BTW, how could we configure the Qemu to create a full feature scope machine to include all possible devices in it, e.g. USB, ISA, SD/MMC, network etc. Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet

Re: [edk2] "practical" memory allocation limit?

2017-08-28 Thread Shi, Steven
Ersek [mailto:ler...@redhat.com] > Sent: Monday, August 28, 2017 10:40 PM > To: Shi, Steven ; edk2-devel-01 de...@lists.01.org> > Cc: Kinney, Michael D ; Gao, Liming > ; Ard Biesheuvel > Subject: Re: [edk2] "practical" memory allocation limit? > > On 08/28/17

Re: [edk2] "practical" memory allocation limit?

2017-08-28 Thread Shi, Steven
Hi Laszlo, I happen to have a question about how to correctly get the system memory size on Qemu. In the QemuInitializeRam() of OvmfPkg\PlatformPei\MemDetect.c, I add debug info as below to trace the GetSystemMemorySizeBelow4gb() and GetSystemMemorySizeAbove4gb() output. But the output results

[edk2] [PATCH] BaseTools/Conf: Support LLVM39 and LLVM40 in CLANG38 toolchain

2017-08-23 Thread Shi Steven
From: "Shi, Steven" Add LLVM39 and LLVM40 support in CLANG38 toolchain Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi --- BaseTools/Conf/tools_def.template | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Base

Re: [edk2] [PATCH 1/1] BaseTools/tools_def.template: revert to large code model for X64/GCC5/LTO

2017-08-22 Thread Shi, Steven
(GCC48_ARM_ASM_FLAGS) Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Tuesday, August 15, 2017 11:46 PM > To: Shi, Steven > Cc: edk2-devel-01 ; Alex Will

Re: [edk2] [PATCH 1/1] BaseTools/tools_def.template: revert to large code model for X64/GCC5/LTO

2017-08-11 Thread Shi, Steven
ntUnitsWrapper; // // Get the BSP's data of GDT and IDT Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Friday, August 11, 2017 7:18 PM > To: Shi, Steven ; edk2-dev

Re: [edk2] [PATCH 1/1] BaseTools/tools_def.template: revert to large code model for X64/GCC5/LTO

2017-08-10 Thread Shi, Steven
Hi Laszlo, I'm trying to reproduce your boot failure with OVMF in my Ubuntu system, but not succeed. My GCC was built from GCC main trunk code in 20170601, and my ld linker is version 2.28. Could you try the ld 2.28 with your gcc-7.1 and check whether it works in your side? Or, do you know wh

Re: [edk2] [PATCH] ShellPkg: Avoid buffer out-of-bound access

2017-07-28 Thread Shi, Steven
Reviewed-by: Steven Shi Thanks Steven Shi > -Original Message- > From: Ni, Ruiyu > Sent: Wednesday, July 26, 2017 4:22 PM > To: edk2-devel@lists.01.org > Cc: Shi, Steven > Subject: [PATCH] ShellPkg: Avoid buffer out-of-bound access > > PathSize is the number o

Re: [edk2] [PATCH] MdeModulePkg: Fix use-after-free error in InstallConfigurationTable()

2017-06-19 Thread Shi, Steven
Reviewed-by: Steven Shi Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Zeng, Star > Sent: Monday, June 19, 2017 6:24 PM > To: edk2-devel@lists.01.org > Cc: Shi, Steven ; Yao, Jiewen ; > Gao, Liming ; Zen

Re: [edk2] Testing SMM with QEMU, KVM and libvirt

2017-02-22 Thread Shi, Steven
to:ler...@redhat.com] > Sent: Tuesday, February 21, 2017 6:18 PM > To: Shi, Steven ; edk2-devel-01 de...@ml01.01.org> > Cc: Tian, Feng ; Justen, Jordan L > ; Yao, Jiewen ; Kinney, > Michael D ; Fan, Jeff ; Zeng, > Star > Subject: Re: [edk2] Testing SMM with QEMU, KVM and libvi

Re: [edk2] Testing SMM with QEMU, KVM and libvirt

2017-02-21 Thread Shi, Steven
Hi Laszlo, I wonder if you could offer a Ubuntu version wiki for the Testing-SMM-with-QEMU,-KVM-and-libvirt? I'm trying to port your steps to my Ubuntu 16.04, but meet lots of troubles. The Ubuntu apt-get virsh version is too old to support smm feature in your ovmf.fedora.q35.template, and I ha

Re: [edk2] OVMF not booting when built with GCC5 toolset?

2016-08-28 Thread Shi, Steven
/show_bug.cgi?id=70955 Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 From: Shi, Steven Sent: Tuesday, August 23, 2016 4:10 PM To: 'Bruce Cran' mailto:br...@cran.org.uk>>; 'Michael Zimmermann' mailto:sigmaepsilo...@gmail.com>> Cc: '

Re: [edk2] OVMF not booting when built with GCC5 toolset?

2016-08-23 Thread Shi, Steven
It's confirmed it is a GCC6 regression bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70955 Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 From: Shi, Steven Sent: Tuesday, August 23, 2016 4:10 PM To: 'Bruce Cran' ; 'Michael Zimmermann&#

Re: [edk2] OVMF not booting when built with GCC5 toolset?

2016-08-23 Thread Shi, Steven
Hi Cran, This issue might be a GCC6 LTO regression bug, and I've filed a bug to GCC community as below. Please don't use the GCC6 with edk2 GCC5 toolchain for now, the GCC5 (gcc-5) should works. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77341 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=5

Re: [edk2] [PATCH] BaseTools/GenFw: ignore dynamic RELA sections

2016-08-22 Thread Shi, Steven
PM > To: edk2-devel@lists.01.org; Gao, Liming ; Shi, > Steven ; Zhu, Yonghong > Cc: Ard Biesheuvel > Subject: [PATCH] BaseTools/GenFw: ignore dynamic RELA sections > > When building PIE (ET_DYN) executables, an additional RELA section is > emitted (in addition to the per-sec

Re: [edk2] [PATCH] BaseTools/GccBase.lds: don't copy RELA section to PE/COFF

2016-08-22 Thread Shi, Steven
to copy it into the PE/COFF binary, regardless > > of whether we inspect its contents or not. > > > > -- > > Ard. > > > > > > > > Thanks > > > Liming > > >> -Original Message- > > >> From: Ard Biesheuvel [mailto:ard.bie

Re: [edk2] OVMF not booting when built with GCC5 toolset?

2016-08-21 Thread Shi, Steven
August 19, 2016 10:47 PM > To: Shi, Steven ; Michael Zimmermann > > Cc: edk2-devel-01 > Subject: Re: [edk2] OVMF not booting when built with GCC5 toolset? > > On 8/19/2016 8:35 AM, Bruce Cran wrote: > > When I built and ran it using the same commands (with the exception of

[edk2] [PATCH v2] BaseTools-CLANG38: Add -O3 in DLINK2 flag

2016-08-18 Thread Shi, Steven
CLANG38 build fail after CC_FLAG is added in the link rule. This failure is because the CLANG38 enable the LTO through LLVMgold.so linker plugin, but the LLVMgold.so plugin cannot accept the clang -Oz CC flag as build option. After CC_FLAG is added in the link rule, the LLVMgold.so plugin reports l

Re: [edk2] OVMF not booting when built with GCC5 toolset?

2016-08-18 Thread Shi, Steven
Hi Cran, I build OVMF GCC X64 image, can boot Qemu into shell with below commands. I can enter shell, reconnect -r, exit to setup, and the vga display looks good to me. What build command did you use? build -t GCC5 -a X64 -p OvmfPkg/OvmfPkgX64.dsc -n 5 -b DEBUG -DDEBUG_ON_SERIAL_PORT qemu-s

[edk2] [PATCH] BaseTools-CLANG38: Add O3 in Dlink2 flag

2016-08-17 Thread Shi, Steven
CLANG38 build fail after CC_FLAG is added in the link rule. This failure is because the CLANG38 enable the LTO through LLVMgold.so linker plugin, but the LLVMgold.so plugin cannot accept the clang -Oz CC flag as build option. After CC_FLAG is added in the link rule, the LLVMgold.so plugin reports l

Re: [edk2] [PATCH 3/3] BaseTools GCC: add the compiler flags to the linker command line

2016-08-17 Thread Shi, Steven
> > Could you try putting -O2 in the DLINK2_FLAGS for Clang 38? (i.e., so > that the last -O option the linker sees is not -Oz) > Ard, Add -O2 or -O3 in DLINK2_FLAGS works as below, thank your suggestion! "/home/jshi19/clang38/bin/clang" -o /home/jshi19/edk2-fork/Build/OvmfX64/RELEASE_CLAN

Re: [edk2] [PATCH 3/3] BaseTools GCC: add the compiler flags to the linker command line

2016-08-17 Thread Shi, Steven
Hi Ard, CLANG38 has a build failure as below for this patch. This failure is because the CLANG38 enable the LTO through LLVMgold.so linker plugin, but the LLVMgold.so plugin cannot accept the clang -Oz cc flag as build option. After CC_FLAG is added in the link rule, the LLVMgold.so plugin repo

Re: [edk2] [PATCH] BaseTools X64: fold PLT relocations into simple relative references

2016-08-04 Thread Shi, Steven
OK, it is. But it is a bit not very clear. Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Thursday, August 04, 2016 4:55 PM > To: Shi, Steven

Re: [edk2] [PATCH] BaseTools X64: fold PLT relocations into simple relative references

2016-08-04 Thread Shi, Steven
\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Thursday, August 04, 2016 4:46 PM > To: Shi, Steven ; Zhu, Yonghong > ; Gao, Liming ; Justen, > Jordan L ; edk2-devel@lists.01.org

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-08-03 Thread Shi, Steven
\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Thursday, August 04, 2016 4:55 AM > To: Justen, Jordan L > Cc: Shi, Steven ; Kinney, Michael D > ; edk2-devel-01 ; > af...@a

[edk2] [PATCH v5 1/4] BaseTools-Conf:Remove short dash in ar flag for LLVM

2016-08-03 Thread Shi, Steven
Both binutils ar and LLVM ar support "cr", but LLVM ar doens't support add "-" in the flags, and llvm-ar cannot accept "-cr". So remove the short dash "-" to make llvm archives work. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi Reviewed-by: Ard Biesheuvel ---

[edk2] [PATCH v5 4/4] ShellPkg-UefiShellCommandLib: Add EFIAPI in VA_List library function

2016-08-03 Thread Shi, Steven
Add EFIAPI in CatPrint library function. Every function which uses variable list need explicit use EFIAPI to force use MS ABI. This change is needed to pass CLANG38 build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi --- ShellPkg/Library/UefiShellCommandLib/C

[edk2] [PATCH v5 0/4] Introduce CLANG38 toolchain in edk2

2016-08-03 Thread Shi, Steven
os OVMF.fd -serial file:serial.log -m 4096 -hda fat:. Shi, Steven (4): BaseTools-Conf:Remove short dash in ar flag for LLVM BaseTools-Conf:Introduce CLANG38 new toolchain for x86 ShellPkg-UefiShellTftpCommandLib: Replace compiler builtin ShellPkg-UefiShellCommandLib: Add EFIAPI in VA_Li

[edk2] [PATCH v5 3/4] ShellPkg-UefiShellTftpCommandLib: Replace compiler builtin

2016-08-03 Thread Shi, Steven
Use explicit CopyMem to replace compiler builtin to do the structure values assignment. This change is needed to pass CLANG38 build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi Reviewed-by: Jaben Carsey --- ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c |

[edk2] [PATCH v5 2/4] BaseTools-Conf:Introduce CLANG38 new toolchain for x86

2016-08-03 Thread Shi, Steven
This adds support for LLVM 3.8.x in LTO mode for IA32 and X64. CLANG38 enable LLVM Link Time Optimization (LTO) and code size optimization flag (-Oz) by default for aggressive code size improvement. CLANG38 X64 code is small code model + PIE. CLANG LTO needs PIE in link flags to generate PIE code

Re: [edk2] [PATCH 2/4] BaseTools-Conf:Introduce CLANG38 new toolchain for x86

2016-08-03 Thread Shi, Steven
Hello Ard, > > Hello Steven, > > On 3 August 2016 at 08:48, Shi, Steven wrote: > > This adds support for LLVM 3.8.x in LTO mode for IA32 and X64. > > CLANG38 enable LLVM Link Time Optimization (LTO) and code size > > optimization flag (-Oz) by default for aggres

[edk2] [PATCH 2/4] BaseTools-Conf:Introduce CLANG38 new toolchain for x86

2016-08-02 Thread Shi, Steven
This adds support for LLVM 3.8.x in LTO mode for IA32 and X64. CLANG38 enable LLVM Link Time Optimization (LTO) and code size optimization flag (-Oz) by default for aggressive code size improvement. CLANG38 X64 code is small code model + PIE. CLANG LTO needs PIE in link flags to generate PIE code

[edk2] [PATCH 0/4] Introduce CLANG38 toolchain in edk2

2016-08-02 Thread Shi, Steven
$ qemu-system-x86_64.exe -bios OVMF.fd -serial file:serial.log -m 4096 -hda fat:. Shi, Steven (4): BaseTools-Conf:Remove short dash in ar flag for LLVM BaseTools-Conf:Introduce CLANG38 new toolchain for x86 ShellPkg-UefiShellTftpCommandLib: Replace compiler builtin ShellPkg

[edk2] [PATCH 1/4] BaseTools-Conf:Remove short dash in ar flag for LLVM

2016-08-02 Thread Shi, Steven
Both binutils ar and LLVM ar support "cr", but LLVM ar doens't support add "-" in the flags, and llvm-ar cannot accept "-cr". So remove the short dash "-" to make llvm archives work. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi --- BaseTools/Conf/build_rule.t

[edk2] [PATCH 4/4] ShellPkg-UefiShellCommandLib: Add EFIAPI in VA_List library function

2016-08-02 Thread Shi, Steven
Add EFIAPI in CatPrint library function. Every function which uses variable list need explicit use EFIAPI to force use MS ABI. This change is needed to pass CLANG38 build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi --- ShellPkg/Library/UefiShellCommandLib/C

[edk2] [PATCH 3/4] ShellPkg-UefiShellTftpCommandLib: Replace compiler builtin

2016-08-02 Thread Shi, Steven
Use explicit CopyMem to replace compiler builtin to do the structure values assignment. This change is needed to pass CLANG38 build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi Reviewed-by: Jaben Carsey --- ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c |

Re: [edk2] Build traceback with new CLANG35 toolset

2016-08-02 Thread Shi, Steven
Cran, We will send CLANG38 patch to support X86, and the new CLANG38 patch will base on current GCC5 implementation. FYI. Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Beh

Re: [edk2] [PATCH v5 0/8] BaseTools: add support for GCC5 in LTO mode

2016-08-02 Thread Shi, Steven
Ard, Thank you to check in GCC5! Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Tuesday, August 02, 2016 5:03 PM > To: Shi, Steven ; Zhu, Yonghong >

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-08-02 Thread Shi, Steven
> > CoffAddFixup() must be used for absolute symbol references only. These > instructions contain relative symbol references, which are > recalculated in WriteSections64(). > > The only absolute symbol reference is the GOT entry for 'n', and your > code (in WriteRelocations64()) calculates the ad

Re: [edk2] [PATCH v5 0/8] BaseTools: add support for GCC5 in LTO mode

2016-08-01 Thread Shi, Steven
Ard, Where can I check out your v5 patch? Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Monday, August 01, 2016 4:01 PM > To: Shi, Steven ; Zhu, Yonghong >

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-08-01 Thread Shi, Steven
> On 1 August 2016 at 09:54, Shi, Steven wrote: > >> On 1 August 2016 at 09:19, Shi, Steven > mailto:steven@intel.com>> wrote: > >> >> >> > >> >> >> The fact that it works does not make it safe. Having multiple fixups > >&

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-08-01 Thread Shi, Steven
> On 1 August 2016 at 09:19, Shi, Steven > mailto:steven@intel.com>> wrote: > >> >> > >> >> The fact that it works does not make it safe. Having multiple fixups > >> >> for the same symbol in the .reloc section is a problem, an

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-08-01 Thread Shi, Steven
> >> > >> The fact that it works does not make it safe. Having multiple fixups > >> for the same symbol in the .reloc section is a problem, and so is > >> reapplying GOTPCRELX to places where the original instruction has been > >> replaced by the linker. > >> > > [Steven]: I still don't understand

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-07-31 Thread Shi, Steven
> >> > >> I am also concerned about the GOTPCRELX/REX_GOTPCRELX relocations. > >> Reading the x86_64 ABI docs, it appears that these may refer to > >> instructions that have been modified by the linker. In that case, how > >> do we deal with the relocation? Also, according to the doc, mov > >> inst

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-07-31 Thread Shi, Steven
> > > > That was not my point. With your code, how many > > EFI_IMAGE_REL_BASED_DIR64 fixups are added to the .reloc section for > > the GOT entry of 'n'? > > > > int n; > > int f () { return n; } > > int g () { return n; } > > int h () { return n; } [Steven]: If the above global " n " need GOTPCR

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-07-30 Thread Shi, Steven
> OK. Could we do that in a separate patch? [Steven]: Yes. We could separate it in a new patch. > >> Is this necessary? I would expect the GOT entry itself to be already > >> covered by a R_X86_64_64 relocation, so I don't think there is a need > >> to emit a EFI_IMAGE_REL_BASED_DIR64 PE/COFF relo

Re: [edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-07-30 Thread Shi, Steven
> > diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c > b/BaseTools/Source/C/GenFw/Elf64Convert.c > > index 7c838f3..fc241ab 100755 > > --- a/BaseTools/Source/C/GenFw/Elf64Convert.c > > +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c > > @@ -755,6 +755,11 @@ WriteSections64 ( > > // Deter

Re: [edk2] [RFC PATCH] BaseTools GCC: add support for GCC/X64 and GCC/AARCH64 in LTO mode

2016-07-17 Thread Shi, Steven
lto:ard.biesheu...@linaro.org] > Sent: Monday, July 18, 2016 1:26 PM > To: edk2-devel@lists.01.org; ler...@redhat.com; af...@apple.com; Gao, > Liming ; Shi, Steven ; Zhu, > Yonghong ; Kinney, Michael D > ; Justen, Jordan L > Cc: Ard Biesheuvel > Subject: [RFC PATCH] BaseTools

Re: [edk2] [PATCH 4/5] MdePkg X64: force 'hidden' visibility when building with -fpic

2016-07-16 Thread Shi, Steven
iesheu...@linaro.org] > Sent: Saturday, July 16, 2016 10:48 PM > To: Shi, Steven > Cc: Zhu, Yonghong ; Gao, Liming > ; Kinney, Michael D ; > Justen, Jordan L ; ler...@redhat.com; > af...@apple.com; edk2-devel@lists.01.org > Subject: Re: [PATCH 4/5] MdePkg X64: force 'hidden&

Re: [edk2] [PATCH v2 1/7] BaseTools-GenFw:Use EXE flag to check Elf section type

2016-07-16 Thread Shi, Steven
If PIE can generate smaller code than PIC, why not use PIE? Why “We should only enable it if we must” ? Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] Sent: Saturday, July 16, 2016 10:45 PM To: Shi, Steven

Re: [edk2] [PATCH 4/5] MdePkg X64: force 'hidden' visibility when building with -fpic

2016-07-16 Thread Shi, Steven
G/PeiCore.dll' failed Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Thursday, July 14, 2016 9:16 PM > To: Shi, Steven ; Zhu, Yonghong > ; Gao,

Re: [edk2] [PATCH v2 1/7] BaseTools-GenFw:Use EXE flag to check Elf section type

2016-07-16 Thread Shi, Steven
d Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Wednesday, July 13, 2016 11:06 PM > To: Andrew Fish > Cc: Shi, Steven ; edk2-devel-01 de...@lists.01.org>; Gao, Liming ; Justen, Jordan L > ; Kinney, Michael D > > Subject: Re: [PATCH v2 1/7] BaseTools-GenFw:Use EXE

Re: [edk2] [PATCH v2 0/5] MdePkg BaseTools: GCC optimization for X64

2016-07-16 Thread Shi, Steven
line RELEASE_GCC48 (i.e., using -0O and the large > code > model) is > > SECFV [11%Full] 212992 total, 25392 used, 187600 free > FVMAIN_COMPACT [61%Full] 1753088 total, 1076488 used, 676600 free > DXEFV [54%Full] 10485760 total, 5743440 used, 4742320 free > PEIFV [21%Full] 917

Re: [edk2] [PATCH 1/7] BaseTools: Enable three new toolchains

2016-07-11 Thread Shi, Steven
From: Ronny Chevalier [mailto:chevalier.ro...@gmail.com] > Sent: Thursday, July 07, 2016 6:15 PM > To: Shi, Steven > Cc: edk2-devel@lists.01.org; Gao, Liming ; Kinney, > Michael D ; af...@apple.com > Subject: Re: [edk2] [PATCH 1/7] BaseTools: Enable three new toolchains > >

Re: [edk2] [PATCH v2 1/7] BaseTools-GenFw:Use EXE flag to check Elf section type

2016-07-11 Thread Shi, Steven
DEBUG X64 DxeCore.efi 138KB | 273KB| 138KB | 137KB Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] Sent: Monday, July 11, 2016 10:54 PM To: Shi, Steven Cc: af...@apple.com; edk2-dev

Re: [edk2] [PATCH v2 1/7] BaseTools-GenFw:Use EXE flag to check Elf section type

2016-07-11 Thread Shi, Steven
Hi Ard, > > What I am still missing here is an explanation of the > benefit/necessity of using PIE. What does it give us that we don't > already have? How is it different from simply linking a shared ELF > object and running GenFw on that? > [Steven]: Using PIE is necessary, at least for x8

Re: [edk2] [PATCH v2 1/7] BaseTools-GenFw:Use EXE flag to check Elf section type

2016-07-11 Thread Shi, Steven
*(.got .got.*) /* Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Friday, July 08, 2016 9:52 PM > To: Shi, Steven > Cc: edk2-devel-01 ; Gao, Liming >

Re: [edk2] [PATCH v2 1/7] BaseTools-GenFw:Use EXE flag to check Elf section type

2016-07-08 Thread Shi, Steven
-Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Friday, July 08, 2016 5:19 PM > To: Shi, Steven > Cc: edk2-devel-01 ; Gao, Liming > ; af...@apple.com; Justen, Jordan L > ; Kinney, Michael D > > Subject: Re: [PATCH v2 1/7] Bas

[edk2] [PATCH v2 3/7] MdePkg: Enable new MS VA intrinsics for GNUC x86 64bits build

2016-07-08 Thread Shi, Steven
Both GCC and LLVM 3.8 64bits support new variable argument (VA) intrinsics for Microsoft ABI, enable these new VA intrinsics for GNUC family 64bits code build. These VA intrinsics are only permitted use in 64bits code, so not use them in 32bits code build. The original 32bits GNU VA intrinsics has

[edk2] [PATCH v2 0/7] Introduce three new toolchains in edk2

2016-07-08 Thread Shi, Steven
. Seperate three toolchains to three different patches. 3. Seperate GenFw update general part from x86 specific part and enhance the PIE/PIC commit log. 4. Not set -D EFI32, but use MDE_CPU_IA32 instead. Shi, Steven (7): BaseTools-GenFw:Use EXE flag to check Elf section type BaseTools-GenFw:Add new

[edk2] [PATCH v2 7/7] ShellPkg-UefiShellTftpCommandLib: Replace compiler builtin

2016-07-08 Thread Shi, Steven
Use explicit CopyMem to replace compiler builtin to do the structure values assignment. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi Reviewed-by: Jaben Carsey --- ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c | 2 +- 1 file changed, 1 insertion(+), 1 dele

[edk2] [PATCH v2 4/7] BaseTools-Conf:Introduce GCC5 new toolchain for x86

2016-07-08 Thread Shi, Steven
GCC5 enable GCC Link Time Optimization (LTO) and code size optimization (–Os) for aggressive code size improvement. GCC5 X64 code is small code model + position independent code (PIE). Test pass platforms: OVMF (OvmfPkgIa32.dsc, OvmfPkgX64.dsc) and Quark (Quark.dsc). Test compiler and linker versi

[edk2] [PATCH v2 2/7] BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code

2016-07-08 Thread Shi, Steven
Add support to convert new Elf relocation types (R_X86_64_PLT32, R_X86_64_GOTPCREL, R_X86_64_GOTPCRELX, R_X86_64_REX_GOTPCRELX) to PeCoff, which are required by position independent code (PIC) built Elf image. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi ---

[edk2] [PATCH v2 6/7] BaseTools-Conf:Introduce CLANGSCAN38 new toolchain for x86

2016-07-08 Thread Shi, Steven
CLANGSCAN38 is based on CLANG38 to seamlessly integrate Clang scan-build analyzer infrastructure into edk2 build infrastructure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi --- BaseTools/Conf/build_rule.template | 7 ++- BaseTools/Conf/tools_def.template |

[edk2] [PATCH v2 1/7] BaseTools-GenFw:Use EXE flag to check Elf section type

2016-07-08 Thread Shi, Steven
Add SHF_EXECINSTR attribute flag in logic to check Elf Text and Data section type. Also fix some typo in the code comments and Debug strings. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi --- BaseTools/Source/C/GenFw/Elf64Convert.c | 10 +- 1 file chan

[edk2] [PATCH v2 5/7] BaseTools-Conf:Introduce CLANG38 new toolchain for x86

2016-07-08 Thread Shi, Steven
LANG38 uses Clang3.8.0, enable LLVM Link Time Optimization (LTO) and code size optimization flag (-Oz) by default for aggressive code size improvement. CLANG38 X64 code is small code model + PIE. Test pass platforms: OVMF (OvmfPkgIa32.dsc, OvmfPkgX64.dsc). Test compiler and linker version: LLVM 3.

Re: [edk2] [PATCH V2 0/7] Introduce three new toolchains in edk2

2016-07-07 Thread Shi, Steven
Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Shi, > Steven > Sent: Friday, July 08, 2016 10:32 AM > To: edk2-devel@lists.01.org; ard.biesheu...@linaro.org > Cc: Kinney, Michael D ;

[edk2] [PATCH V2 0/7] Introduce three new toolchains in edk2

2016-07-07 Thread Shi, Steven
. Seperate three toolchains to three different patches. 3. Seperate GenFw update general part from x86 specific part and enhance the PIE/PIC commit log. 4. Not set -D EFI32, but use MDE_CPU_IA32 instead. Shi, Steven (7): BaseTools-GenFw:Use EXE flag to check Elf section type BaseTools-GenFw:Add new

Re: [edk2] [PATCH 1/7] BaseTools: Enable three new toolchains

2016-07-07 Thread Shi, Steven
Hi Jordan, I've separated this patch to 3 commits and post a public branch for them: https://github.com/shijunjing/edk2/commits/review6 . Please take a look. Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Shi, St

[edk2] [PATCH 0/7] Introduce three new toolchains in edk2

2016-07-07 Thread Shi, Steven
. Seperate GenFw update general part from x86 specific part and enhance the PIE/PIC commit log. 4. Not set -D EFI32, but use MDE_CPU_IA32 instead. Shi, Steven (7): BaseTools-GenFw:Use EXE flag to check Elf section type BaseTools-GenFw:Add new x86_64 Elf relocation types for PIC/PIE code MdePkg

Re: [edk2] [PATCH 1/7] BaseTools: Enable three new toolchains

2016-07-04 Thread Shi, Steven
OK. I will separate this patch to 3 commits and post a public branch for them. Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Justen, Jordan L > Sent: Thursday, June 30, 2016 4:55 AM > To: Shi, Steven ; edk2-devel@

Re: [edk2] [PATCH 4/7] QuarkPlatformPkg-AcpiPlatform: Downgrade the optimization to O1

2016-07-04 Thread Shi, Steven
6 4:56 AM > To: af...@apple.com; Shi, Steven ; Kinney, Michael D > > Cc: edk2-devel ; Gao, Liming > ; Zimmer, Vincent ; > Doran, Mark ; Mudusuru, Giri P > > Subject: RE: [edk2] [PATCH 4/7] QuarkPlatformPkg-AcpiPlatform: > Downgrade the optimization to O1 > > Andrew,

Re: [edk2] [PATCH 5/7] QuarkSocPkg-MemoryInitPei: Enable compiler builtin and disable CLANG LTO

2016-07-04 Thread Shi, Steven
I will separate the Quark platform code cleanup work from this serial patches. Thanks. Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Kinney, Michael D > Sent: Thursday, June 30, 2016 2:10 AM > To: af...@apple.com;

Re: [edk2] [PATCH 3/7] MdePkg: Enable new MS VA intrinsics for GNUC 64bits build

2016-07-04 Thread Shi, Steven
fix them on GCC44 as well in a separate patch later. Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Justen, Jordan L > Sent: Thursday, June 30, 2016 5:47 AM > To: Andrew Fish > Cc: Shi, Steven ; edk2-devel@li

Re: [edk2] [PATCH 2/7] BaseTools: Add missing Elf relocation type for LTO build

2016-06-29 Thread Shi, Steven
, June 29, 2016 10:42 PM > To: Shi, Steven > Cc: edk2-devel-01 ; Gao, Liming > ; Kinney, Michael D ; > af...@apple.com > Subject: Re: [edk2] [PATCH 2/7] BaseTools: Add missing Elf relocation type > for LTO build > > On 29 June 2016 at 15:59, Shi, Steven wrote: > > Ok

Re: [edk2] [PATCH 2/7] BaseTools: Add missing Elf relocation type for LTO build

2016-06-29 Thread Shi, Steven
Ok, will separate it. Thank you to let me know it. Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Wednesday, June 29, 2016 9:30 PM > To: Shi, Steven > Cc

Re: [edk2] [PATCH 0/7] Introduce three new toolchains in edk2

2016-06-28 Thread Shi, Steven
af...@apple.com [mailto:af...@apple.com] > Sent: Wednesday, June 29, 2016 10:22 AM > To: Gao, Liming > Cc: Bruce Cran ; Shi, Steven ; > edk2-devel@lists.01.org; Kinney, Michael D > Subject: Re: [edk2] [PATCH 0/7] Introduce three new toolchains in edk2 > > > &g

Re: [edk2] Segfault in GenFw when building driver with new CLANG38 toolchain

2016-06-28 Thread Shi, Steven
Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Bruce Cran [mailto:br...@cran.org.uk] > Sent: Wednesday, June 29, 2016 12:35 PM > To: Shi, Steven ; edk2-devel@lists.01.org > Subject: Re: [edk2] Segfault in GenFw when building

Re: [edk2] Segfault in GenFw when building driver with new CLANG38 toolchain

2016-06-28 Thread Shi, Steven
OK. How about GCC53? Can GCC53 build your driver? Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -Original Message- > From: Bruce Cran [mailto:br...@cran.org.uk] > Sent: Wednesday, June 29, 2016 12:12 PM > To: Shi, Steven ; edk2-devel@

  1   2   >