mbox series

[0/2] accel/tcg: fix page invalidation in tb_invalidate_phys_range()

Message ID 20230629082522.606219-1-mark.cave-ayland@ilande.co.uk
Headers show
Series accel/tcg: fix page invalidation in tb_invalidate_phys_range() | expand

Message

Mark Cave-Ayland June 29, 2023, 8:25 a.m. UTC
This series contains 2 patches: the first is a fix for page invalidation in
tb_invalidate_phys_range() which resolves the crash reported by Howard and
Cédric when booting MacOS 9 under qemu-system-ppc -M mac99,via=pmu.

The second patch adds an assert() to tb_invalidate_phys_page_range__locked()
which is enabled by --enable-debug-tcg to ensure that both the start and last
addresses are within the same target page.

I've confirmed that this assert() is first triggered by the commit that
initially introduced the bug e506ad6a05 ("accel/tcg: Pass last not end to
tb_invalidate_phys_range") when building QEMU with --enable-debug and
doesn't trigger after the series is applied.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (2):
  accel/tcg: fix start page passed to
    tb_invalidate_phys_page_range__locked()
  accel/tcg: add assert() check in
    tb_invalidate_phys_page_range__locked()

 accel/tcg/tb-maint.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Richard Henderson June 30, 2023, 1:34 p.m. UTC | #1
On 6/29/23 10:25, Mark Cave-Ayland wrote:
> This series contains 2 patches: the first is a fix for page invalidation in
> tb_invalidate_phys_range() which resolves the crash reported by Howard and
> Cédric when booting MacOS 9 under qemu-system-ppc -M mac99,via=pmu.
> 
> The second patch adds an assert() to tb_invalidate_phys_page_range__locked()
> which is enabled by --enable-debug-tcg to ensure that both the start and last
> addresses are within the same target page.
> 
> I've confirmed that this assert() is first triggered by the commit that
> initially introduced the bug e506ad6a05 ("accel/tcg: Pass last not end to
> tb_invalidate_phys_range") when building QEMU with --enable-debug and
> doesn't trigger after the series is applied.
> 
> Signed-off-by: Mark Cave-Ayland<mark.cave-ayland@ilande.co.uk>
> 
> 
> Mark Cave-Ayland (2):
>    accel/tcg: fix start page passed to
>      tb_invalidate_phys_page_range__locked()
>    accel/tcg: add assert() check in
>      tb_invalidate_phys_page_range__locked()

Queued to tcg-next, with some wording changes.
And to use tcg_debug_assert instead of the ifdef.


r~