[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_
|
From: |
Peter Maydell |
|
Subject: |
Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit |
|
Date: |
Tue, 30 May 2023 16:18:24 +0100 |
On Tue, 30 May 2023 at 16:09, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 5/30/23 07:48, Peter Maydell wrote:
> > On Tue, 30 May 2023 at 15:29, Richard Henderson
> > <richard.henderson@linaro.org> wrote:
> >>
> >> On 5/30/23 07:06, Peter Maydell wrote:
> >>>> This is about falling through to the cmpxchg below: if !PAGE_WRITE_ORG,
> >>>> then the page is
> >>>> really not writable, we will SIGSEGV, and handle_sigsegv_accerr_write
> >>>> will kill the process.
> >>>
> >>> Right, but if !PAGE_WRITE_ORG then that implies also !PAGE_WRITE,
> >>> so we do that even without this change ?
> >>
> >> But !PAGE_WRITE does not imply !PAGE_WRITE_ORG.
> >
> > Hmm. In what situation do we mark a page writeable when the
> > guest didn't ask for it to be writeable ?
>
> I don't know -- it seems backward, I know.
>
> I *think* it's a race condition, where PAGE_WRITE changes.
> That's what the test case is trying to provoke, anyway.
That sounds like the theory I had earlier, that we
don't have the mmap lock, so the other thread can
get in and turn the RO-only-because-of-the-JIT page
back to RW, so we don't want to do the non-atomic
access for the "RO-only-because-of-JIT" cases.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH v4 00/16] tcg: Improvements to atomic128, Richard Henderson, 2023/05/25
- [PATCH v4 01/16] tcg: Fix register move type in tcg_out_ld_helper_ret, Richard Henderson, 2023/05/25
- [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit, Richard Henderson, 2023/05/25
- Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit, Peter Maydell, 2023/05/30
- Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit, Richard Henderson, 2023/05/30
- Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit, Peter Maydell, 2023/05/30
- Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit, Richard Henderson, 2023/05/30
- Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit, Peter Maydell, 2023/05/30
- Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit, Richard Henderson, 2023/05/30
- Re: [PATCH v4 02/16] accel/tcg: Fix check for page writeability in load_atomic16_or_exit,
Peter Maydell <=
[PATCH v4 03/16] meson: Split test for __int128_t type from __int128_t arithmetic, Richard Henderson, 2023/05/25
[PATCH v4 04/16] qemu/atomic128: Add x86_64 atomic128-ldst.h, Richard Henderson, 2023/05/25
[PATCH v4 06/16] tcg/aarch64: Rename temporaries, Richard Henderson, 2023/05/25
[PATCH v4 09/16] tcg/aarch64: Support 128-bit load/store, Richard Henderson, 2023/05/25
[PATCH v4 05/16] tcg/i386: Support 128-bit load/store, Richard Henderson, 2023/05/25
[PATCH v4 07/16] tcg/aarch64: Reserve TCG_REG_TMP1, TCG_REG_TMP2, Richard Henderson, 2023/05/25
[PATCH v4 08/16] tcg/aarch64: Simplify constraints on qemu_ld/st, Richard Henderson, 2023/05/25