A tricky bug that make no sense for me.
Posted: Sat Feb 08, 2014 8:45 am
In my OS design (64bit), I directly mapped all physical memory to 0xFFFFFF00 00000000, and I mapped memory into process's virtual address area, also.
I met a tricky bug, I let a process run:
and let kernel display the change of value of (%rsp) every time it switches process.
In bochs and VMware, the values for all processes (ticks are equally allocated) are all the same, that is also my expectation.
In QEMU, the values are different, and 1 process' is 10 times than that of another.
Strange thing happened when I memcpy(rsp-PAGE_SIZE, rsp-PAGE_SIZE, PAGE_SIZE), it should not change anything according to my memcpy implement. But now, QEMU display the exactly same value.
I got really confused (and I am going to be crazy) about the phenomenon I saw.
I think maybe there is a bug about vaddr translation or cache in QEMU?
I met a tricky bug, I let a process run:
Code: Select all
sub $4, %rsp;
repeat:
incl (%rsp);
jmp repeat;
In bochs and VMware, the values for all processes (ticks are equally allocated) are all the same, that is also my expectation.
In QEMU, the values are different, and 1 process' is 10 times than that of another.
Strange thing happened when I memcpy(rsp-PAGE_SIZE, rsp-PAGE_SIZE, PAGE_SIZE), it should not change anything according to my memcpy implement. But now, QEMU display the exactly same value.
I got really confused (and I am going to be crazy) about the phenomenon I saw.
I think maybe there is a bug about vaddr translation or cache in QEMU?