Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-03-22 Thread Laurent Vivier
Le 22/03/2018 à 12:13, Laurent Vivier a écrit : > Le 22/03/2018 à 12:07, Peter Maydell a écrit : >> On 22 March 2018 at 11:05, Peter Maydell wrote: >>> On 22 March 2018 at 10:36, Laurent Vivier wrote: It goes wrong in this part: + */ +if (is_write && info->si_signo ==

Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-03-22 Thread Laurent Vivier
Le 22/03/2018 à 12:07, Peter Maydell a écrit : > On 22 March 2018 at 11:05, Peter Maydell wrote: >> On 22 March 2018 at 10:36, Laurent Vivier wrote: >>> It goes wrong in this part: >>> >>> + */ >>> +if (is_write && info->si_signo == SIGSEGV && info->si_code == >>> SEGV_ACCERR && >>> +

Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-03-22 Thread Peter Maydell
On 22 March 2018 at 11:07, Laurent Vivier wrote: > Le 22/03/2018 à 12:05, Peter Maydell a écrit : >> On 22 March 2018 at 10:36, Laurent Vivier wrote:re. >>> It goes wrong in this part: >>> >>> + */ >>> +if (is_write && info->si_signo == SIGSEGV && info->si_code == >>> SEGV_ACCERR && >>> +

Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-03-22 Thread Peter Maydell
On 22 March 2018 at 11:05, Peter Maydell wrote: > On 22 March 2018 at 10:36, Laurent Vivier wrote: >> It goes wrong in this part: >> >> + */ >> +if (is_write && info->si_signo == SIGSEGV && info->si_code == >> SEGV_ACCERR && >> +h2g_valid(address)) { >> >> Because, on ppc, si_code

Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-03-22 Thread Laurent Vivier
Le 22/03/2018 à 12:05, Peter Maydell a écrit : > On 22 March 2018 at 10:36, Laurent Vivier wrote: >> Le 22/03/2018 à 02:52, Laurent Vivier a écrit : >>> It seems this patch breaks something in linux-user mode emulation for >>> m68k (32bit BE) on ppc (32bit BE). >>> >>> What I have: >>> >>> ~/chr

Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-03-22 Thread Peter Maydell
On 22 March 2018 at 10:36, Laurent Vivier wrote: > Le 22/03/2018 à 02:52, Laurent Vivier a écrit : >> It seems this patch breaks something in linux-user mode emulation for >> m68k (32bit BE) on ppc (32bit BE). >> >> What I have: >> >> ~/chroot$ sudo QEMU_CPU=m68040 chroot m68k/sid/ >> I have n

Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-03-22 Thread Laurent Vivier
Le 22/03/2018 à 02:52, Laurent Vivier a écrit : > Le 23/01/2018 à 15:48, Laurent Vivier a écrit : >> From: Peter Maydell >> >> If multiple guest threads in user-mode emulation write to a >> page which QEMU has marked read-only because of cached TCG >> translations, the threads can race in page_unp

Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-03-21 Thread Laurent Vivier
Le 23/01/2018 à 15:48, Laurent Vivier a écrit : > From: Peter Maydell > > If multiple guest threads in user-mode emulation write to a > page which QEMU has marked read-only because of cached TCG > translations, the threads can race in page_unprotect: > > * threads A & B both try to do a write t

[Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE

2018-01-23 Thread Laurent Vivier
From: Peter Maydell If multiple guest threads in user-mode emulation write to a page which QEMU has marked read-only because of cached TCG translations, the threads can race in page_unprotect: * threads A & B both try to do a write to a page with code in it at the same time (ie which we've m