[PATCH v2 0/3] linux-user: Allow gdbstub to ignore page protection

Ilya Leoshkevich posted 3 patches 8 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240109230808.583012-1-iii@linux.ibm.com
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>
There is a newer version of this series
cpu-target.c                                  | 76 +++++++++++++++----
tests/guest-debug/run-test.py                 |  7 +-
tests/guest-debug/test_gdbstub.py             | 56 ++++++++++++++
tests/tcg/aarch64/gdbstub/test-sve-ioctl.py   | 34 +--------
tests/tcg/aarch64/gdbstub/test-sve.py         | 33 +-------
tests/tcg/multiarch/Makefile.target           |  9 ++-
tests/tcg/multiarch/gdbstub/interrupt.py      | 47 ++----------
tests/tcg/multiarch/gdbstub/memory.py         | 41 +---------
tests/tcg/multiarch/gdbstub/prot-none.py      | 22 ++++++
tests/tcg/multiarch/gdbstub/registers.py      | 41 ++--------
tests/tcg/multiarch/gdbstub/sha1.py           | 40 ++--------
.../multiarch/gdbstub/test-proc-mappings.py   | 39 +---------
.../multiarch/gdbstub/test-qxfer-auxv-read.py | 37 +--------
.../gdbstub/test-thread-breakpoint.py         | 37 +--------
tests/tcg/multiarch/prot-none.c               | 40 ++++++++++
tests/tcg/s390x/gdbstub/test-signals-s390x.py | 42 +---------
tests/tcg/s390x/gdbstub/test-svc.py           | 39 +---------
17 files changed, 227 insertions(+), 413 deletions(-)
create mode 100644 tests/guest-debug/test_gdbstub.py
create mode 100644 tests/tcg/multiarch/gdbstub/prot-none.py
create mode 100644 tests/tcg/multiarch/prot-none.c
[PATCH v2 0/3] linux-user: Allow gdbstub to ignore page protection
Posted by Ilya Leoshkevich 8 months, 2 weeks ago
v1 -> v2: Use /proc/self/mem as a fallback. Handle TB invalidation
          (Richard).
          Test cross-page accesses.

RFC: https://lists.gnu.org/archive/html/qemu-devel/2023-12/msg02044.html
RFC -> v1: Use /proc/self/mem and accept that this will not work
           without /proc.
           Factor out a couple functions for gdbstub testing.
           Add a test.

Hi,

I've noticed that gdbstub behaves differently from gdbserver in that it
doesn't allow reading non-readable pages. This series improves the
situation by using the same mechanism as gdbserver: /proc/self/mem.

Best regards,
Ilya

Ilya Leoshkevich (3):
  linux-user: Allow gdbstub to ignore page protection
  tests/tcg: Factor out gdbstub test functions
  tests/tcg: Add the PROT_NONE gdbstub test

 cpu-target.c                                  | 76 +++++++++++++++----
 tests/guest-debug/run-test.py                 |  7 +-
 tests/guest-debug/test_gdbstub.py             | 56 ++++++++++++++
 tests/tcg/aarch64/gdbstub/test-sve-ioctl.py   | 34 +--------
 tests/tcg/aarch64/gdbstub/test-sve.py         | 33 +-------
 tests/tcg/multiarch/Makefile.target           |  9 ++-
 tests/tcg/multiarch/gdbstub/interrupt.py      | 47 ++----------
 tests/tcg/multiarch/gdbstub/memory.py         | 41 +---------
 tests/tcg/multiarch/gdbstub/prot-none.py      | 22 ++++++
 tests/tcg/multiarch/gdbstub/registers.py      | 41 ++--------
 tests/tcg/multiarch/gdbstub/sha1.py           | 40 ++--------
 .../multiarch/gdbstub/test-proc-mappings.py   | 39 +---------
 .../multiarch/gdbstub/test-qxfer-auxv-read.py | 37 +--------
 .../gdbstub/test-thread-breakpoint.py         | 37 +--------
 tests/tcg/multiarch/prot-none.c               | 40 ++++++++++
 tests/tcg/s390x/gdbstub/test-signals-s390x.py | 42 +---------
 tests/tcg/s390x/gdbstub/test-svc.py           | 39 +---------
 17 files changed, 227 insertions(+), 413 deletions(-)
 create mode 100644 tests/guest-debug/test_gdbstub.py
 create mode 100644 tests/tcg/multiarch/gdbstub/prot-none.py
 create mode 100644 tests/tcg/multiarch/prot-none.c

-- 
2.43.0
Re: [PATCH v2 0/3] linux-user: Allow gdbstub to ignore page protection
Posted by Richard Henderson 7 months, 3 weeks ago
On 1/10/24 09:05, Ilya Leoshkevich wrote:
> v1 -> v2: Use /proc/self/mem as a fallback. Handle TB invalidation
>            (Richard).
>            Test cross-page accesses.
> 
> RFC: https://lists.gnu.org/archive/html/qemu-devel/2023-12/msg02044.html
> RFC -> v1: Use /proc/self/mem and accept that this will not work
>             without /proc.
>             Factor out a couple functions for gdbstub testing.
>             Add a test.
> 
> Hi,
> 
> I've noticed that gdbstub behaves differently from gdbserver in that it
> doesn't allow reading non-readable pages. This series improves the
> situation by using the same mechanism as gdbserver: /proc/self/mem.
> 
> Best regards,
> Ilya
> 
> Ilya Leoshkevich (3):
>    linux-user: Allow gdbstub to ignore page protection
>    tests/tcg: Factor out gdbstub test functions
>    tests/tcg: Add the PROT_NONE gdbstub test

Queued, thanks.


r~