Re: [edk2-devel] How to guard CAR's stack overflow

2022-09-22 Thread Tiger Liu(BJ-RD)
Hi, Johnson: Thanks a lot. Usually stack locates on top of heap area, After swapping stack and heap’s location, your method seems ok. Thanks 发件人: Brian J. Johnson 发送时间: 2022年9月23日 5:07 收件人: Tiger Liu(BJ-RD) ; devel@edk2.groups.io; Ni, Ray 主题: Re: [edk2-devel] How to guard CAR's stack ove

Re: [edk2-devel] How to guard CAR's stack overflow

2022-09-22 Thread Brian J. Johnson
I've never tried protecting the stack like this, so I'm not sure exactly what you're running in to. The documentation says the base address is specified a bit differently for expand-down descriptors.  It needs to point to the page below the stack (lower addresses.)  The descriptors for the othe

Re: [edk2-devel] How to guard CAR's stack overflow

2022-09-21 Thread Tiger Liu(BJ-RD)
: Brian J. Johnson mailto:brian.john...@hpe.com>> 发送时间: 2022年9月20日 7:10 收件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; ray...@intel.com<mailto:ray...@intel.com>; Tiger Liu(BJ-RD) mailto:tiger...@zhaoxin.com>> 抄送: Fan, Jeff mailto:fanjianf...@byosoft.com.cn>&g

Re: [edk2-devel] How to guard CAR's stack overflow

2022-09-19 Thread Brian J. Johnson
You could also try modifying the Ia32 segment descriptors to mark the stack segment as an "expand down" type with a limit set just below the low end of the stack area.  That should generate a stack-fault exception if the stack overflows, and wouldn't require building page tables.  See sections

Re: [edk2-devel] How to guard CAR's stack overflow

2022-09-14 Thread Ni, Ray
It’s doable. You need to enable paging and mark the very low 4K area of the stack as not-present. You could use the UefiCpuPkg/Library/CpuPageTableLib to help you create the 1:1 page table with the specific 4K area as not-present (if you are using x86 processors). Thanks, Ray From: devel@edk2.g