Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-24 Thread Chao Li
六) 收件人: 李超 , "devel@edk2.groups.io" , "af...@apple.com" 抄送: "pedro.falc...@gmail.com" , "Gao, Liming" , "Feng, Bob C" , "Chen, Christine" , "Kinney, Michael D" 主题: Re: [edk2-devel] About EDK2 supports Self Modifying Code Have y

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-18 Thread Michael D Kinney
t;, "pedro.falc...@gmail.com<mailto:pedro.falc...@gmail.com>" mailto:pedro.falc...@gmail.com>>, "Gao, Liming" mailto:gaolim...@byosoft.com.cn>>, "Feng, Bob C" mailto:bob.c.f...@intel.com>>, "Chen, Christine" mailto:yuwei.c..

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-18 Thread Chao Li
devel@edk2.groups.io, "Mike Kinney" 抄送: "lic...@loongson.cn" , "pedro.falc...@gmail.com" , "Gao, Liming" , "Feng, Bob C" , "Chen, Christine" 主题: Re: [edk2-devel] About EDK2 supports Self Modifying Code On Aug 17, 2023, at 12:53 PM, Mi

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-17 Thread Andrew Fish via groups.io
Feng, Bob C > mailto:bob.c.f...@intel.com>>; Chen, Christine > mailto:yuwei.c...@intel.com>> > Subject: Re: [edk2-devel] About EDK2 supports Self Modifying Code > > Hi Pedro, > > Sorry for the late reply, I was a bit busy yesterday. > > I think the bette

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-17 Thread Michael D Kinney
@edk2.groups.io; pedro.falc...@gmail.com Cc: Andrew (EFI) Fish ; Gao, Liming ; Feng, Bob C ; Chen, Christine Subject: Re: [edk2-devel] About EDK2 supports Self Modifying Code Hi Pedro, Sorry for the late reply, I was a bit busy yesterday. I think the better way is to use inline asm, because

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-16 Thread Chao Li
Loop Mike. Hi Mike and Liming, Please refer to history emails. The Self-Modifying-Code(SMC) method has security risks and no one approve it. Ard and Pedro suggest using inline ASM in MdePkg. For this problem, it can only dealt with in the preprocessing stage, because the CSR instructions

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-16 Thread Chao Li
Hi Pedro, Sorry for the late reply, I was a bit busy yesterday. I think the better way is to use inline asm, because this issue must has to be dealt with in preprocessing stage, because in other stages, it has no chance to get immediate value except using SMC. But then we should ask to the

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Andrew Fish via groups.io
> On Aug 15, 2023, at 11:48 AM, Ard Biesheuvel wrote: > > On Tue, 15 Aug 2023 at 18:31, Andrew Fish via groups.io > mailto:afish=apple@groups.io>> wrote: >> >> >> >>> On Aug 15, 2023, at 8:39 AM, Pedro Falcato wrote: >>> >>> On Tue, Aug 15, 2023 at 4:05 PM Andrew

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Ard Biesheuvel
On Tue, 15 Aug 2023 at 18:31, Andrew Fish via groups.io wrote: > > > > > On Aug 15, 2023, at 8:39 AM, Pedro Falcato wrote: > > > > On Tue, Aug 15, 2023 at 4:05 PM Andrew Fish via groups.io > > wrote: > >> > >> Chao, > >> > >> From a quick google it looks like CSR* is used to access banks of >

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Andrew Fish via groups.io
> On Aug 15, 2023, at 8:39 AM, Pedro Falcato wrote: > > On Tue, Aug 15, 2023 at 4:05 PM Andrew Fish via groups.io > wrote: >> >> Chao, >> >> From a quick google it looks like CSR* is used to access banks of registers >> that relate to things like performance counters and debug

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Pedro Falcato
On Tue, Aug 15, 2023 at 4:05 PM Andrew Fish via groups.io wrote: > > Chao, > > From a quick google it looks like CSR* is used to access banks of registers > that relate to things like performance counters and debug infrastructure and > the number of banks of these register sets is likely

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Pedro Falcato
On Tue, Aug 15, 2023 at 9:20 AM Chao Li wrote: > > Hi Andrew, > > Yes, you are right, I also think that SMC is a bit flawed in terms of > security, but can we use some security mechanism to protect the SMC, like > encryption and decryption? Sorry, I'm not consider mature enough about SMC >

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Andrew Fish via groups.io
Chao, >From a quick google it looks like CSR* is used to access banks of registers >that relate to things like performance counters and debug infrastructure and >the number of banks of these register sets is likely implementation defined. >Seems like we could introduce some Fixed At Build PCD

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Chao Li
Hi Ard, Ok, I see, thanks for you suggestion. Thanks, Chao 在 2023/8/15 16:28, Ard Biesheuvel 写道: On Tue, 15 Aug 2023 at 10:20, Chao Li wrote: Hi Andrew, Yes, you are right, I also think that SMC is a bit flawed in terms of security, but can we use some security mechanism to protect the

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Ard Biesheuvel
On Tue, 15 Aug 2023 at 10:20, Chao Li wrote: > > Hi Andrew, > > Yes, you are right, I also think that SMC is a bit flawed in terms of > security, but can we use some security mechanism to protect the SMC, like > encryption and decryption? Sorry, I'm not consider mature enough about SMC >

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-15 Thread Chao Li
Hi Andrew, Yes, you are right, I also think that SMC is a bit flawed in terms of security, but can we use some security mechanism to protect the SMC, like encryption and decryption? Sorry, I'm not consider mature enough about SMC security. I can tell you real problem, there are some CSR

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-14 Thread Andrew Fish via groups.io
We also support Xcode clang so that means we also support Mach-O executables that get converted to PE/COFF. The is a tool called mtoc (mach-o to coff) in a crufty old open source project that does the conversion. The reason you are having issues is due to security hardening as the self

[edk2-devel] About EDK2 supports Self Modifying Code

2023-08-14 Thread Chao Li
Hi Liming, Bob and Yuwei There is a need that some code wants to supports Self-Modification, because some program behavior may not be determined during compilation, and I think this demand may be very popular. The permise of Self-Modification is that the section has executable and writable