qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Page protection and i386 cmpxchg8b


From: Pierre d'Herbemont
Subject: Re: [Qemu-devel] Page protection and i386 cmpxchg8b
Date: Fri, 23 Feb 2007 23:10:28 +0100

Hi Ilya!

On 23 févr. 07, at 21:32, Ilya Shar wrote:

I'm running i386-darwin-usrer on i386 and some apps
(Safari browser) crash because cmpxchg8b attempts to
wrie to a qemu-allocated page which is readable but
write-protected.  When I comment out mprotect in
exec.c

Are you sure it does Safari does crash because of that call? I have the Apple Bug Reporter which complains about the fact that qemu gets a EXC_BAD_ACCESS, but then I get this error: qemu: Unsupported mach syscall: -61(0xffffffc3) (= semaphore_signal_trap)
or
qemu: Unsupported mach syscall: -33(0xffffffdf) (= syscall_thread_switch)

To fix this we have to implement those syscalls.

//        mprotect(g2h(page_addr),
qemu_host_page_size,
//                 (prot & PAGE_BITS) & ~PAGE_WRITE);

I can proceed further.  I would guess mprotect is
there for a reason so it doesn't seem like a good
solution, besides the runs get substantially slower
without mprotect.  Is there a solution to this problem
or a way to better understand what is going on?

I think the idea behind the mprotect is to make sure that any changes to this pages gets monitored, and that the tb can be invalidated if the code was modified (self modify-ing code).

Pierre.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]