Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: x86 assembly questions



Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:

> Then %ecx should contains the size in sizeof(long). I understand it 
> should copy from 0x100000 to 0x100000 + (4 * 0x4ef400), which is 
> 0x14bd000, but when I break after rep movsl instruction, the code 
> at 0x40780b3 has been clobered. 

After  digging a bit further, the code clobbering actually happens a bit
more far away, in the range  0x40780e1 - 0x407816f. It occurs in the
middle of  rep mosvl, which mannaged to copy 0x100000  - 0x119eb4. 

By setting  a watchpoint, on the modified code, I discovered it happens
in an exception handler. I use OVMF on Qemu, and I was able to find the
offending code source, it is in ErrorCodeAndVectorOnStack from
efiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.S

Hence the code clobbering is not caused by rep mosvl itself, but I still
wonder why the exception. Any hint on what can happen here?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index