[Top][All Lists]

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

Re: Question about TCG backend correctness

From: Alex Bennée
Subject: Re: Question about TCG backend correctness
Date: Mon, 17 Oct 2022 11:30:51 +0100
User-agent: mu4e 1.9.1; emacs 28.2.50

LIU Zhiwei <zhiwei_liu@linux.alibaba.com> writes:

> Hi folks,
>     For TCG front end, we can test it with tools, such as RISU. But I
> don't know if  there are some tools that can help
> to verify the correctness of a TCG backend.
>     Can someone share the tools or the experience to debug RISC-V
> backend?  Thanks very much.

It's mostly down to inspection or debugging failures. Sometimes you can
attempt to shake out bugs by running a stacked QEMU. e.g.

   qemu-system-aarch64 on x86 host
   qemu-system-aarch64 on qemu-system-riscv64 on x86 host

and see if the two aarch64 guests run the same. This of course gets very
tricky running full OS kernels because as soon as time and async
interrupts get involved you will get divergence anyway. This would work
best with simple straight line test cases (e.g. check-tcg test cases).

I've long wanted to have the ability to have TCG unit tests where a
virtual processor could be defined for the purpose of directly
exercising TCG. This would be mainly to check tcg_optimize() works
correctly but no doubt could be extended to verify the eventual backend
output. The problem with implementing such an approach has been the
amount of boilerplate needed to define a simple frontend. Maybe this
will get simpler as we slowly move to a single binary build but there is
still quite of lot of things TCG needs to know about the guest it is

If you would like to attempt improve the testing situation for TCG and its
backend I'm fully supportive.

Alex Bennée

reply via email to

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