qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Stefan Weil <sw@weilnetz.de>
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH v4 4/4] meson: Warn when TCI is selected but TCG backend is available
Date: Wed, 27 Jan 2021 19:52:26 +0000	[thread overview]
Message-ID: <87wnvyw3eh.fsf@linaro.org> (raw)
In-Reply-To: <a8aaa601-dcb4-ed87-d7ba-f6362942b596@weilnetz.de>


Stefan Weil <sw@weilnetz.de> writes:

> Am 26.01.21 um 23:39 schrieb Richard Henderson:
>
>> On 1/26/21 9:44 AM, Stefan Weil wrote:
>>> I was not talking about the TODO assertions. When I wrote TCI, I only enabled
>>> and included code which was triggered by my testing - that's why I said the
>>> productive code lines have 100 % test coverage. TODO assertions are not
>>> productive code, but debug code which were made to detect new test cases. They
>>> were successful, too, because they were triggered by some tests in `make
>>> check-tcg`.
>> The TODO assertions are all bugs.
>>
>> Any *real* dead code detection should have been done in
>> tcg/tci/tcg-target.c.inc.  What's interpreted in tcg/tci.c should be exactly
>> what is produced on the other side, and you are producing more than you are
>> consuming.
>
>
> Unless the TCG opcodes in tcg/tci/tcg-target.c.inc are used in real-live 
> scenarios, they are dead code, too.

For example - debian-buster (arm64) running ffmpeg:

  alex.bennee@8cd150a4b35d:~/lsrc/qemu.git/builds/all.tci$ ./qemu-aarch64 /usr/bin/ffmpeg -i theora.mkv theora.webm
  TODO ../../tcg/tci.c:882: tcg_qemu_tb_exec()
  ../../tcg/tci.c:882: tcg fatal error
  qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  Segmentation fault (core dumped)

> Writing a test case which produces them directly (not for some real 
> architecture) is not a real-live scenario.
>
> And the remaining TODO assertions are a good indicator that the current 
> tests are incomplete for native TCG because they obviously don't cover 
> all TCG opcodes.

That's because check-tcg isn't a comprehensive test suite and expecting
it to be misses the point of it. It was added to make it easy to add new
test cases and remove some of the burden off maintainers having their
own zoo of test binaries. It has slowly grown as directed test cases
were written while bug hunting and sometimes when new features where
added. It will never be a comprehensive exercising of the CPU emulation
although some architectures have more coverage than others. For example
MIPs has a bunch of ISA level tests as part of check-tcg but most of the
ARM ISA validation is done externally using the RISU random instruction
testing tool.

Besides you've just argued writing a test case that targets missing
functionality in TCI would somehow be cheating as it's not a "real-live"
scenario.

I don't mind either way - the fact that TCI is useful to people is cool
and more power to them. But lets not pretend it is a fully functional
and maintained backend because it has obviously got some major holes. If
it ends up being a drag on efforts to maintain and improve the TCG then
we have to question why we are keeping it in. Being able to run
emulation on esoteric hardware without a real backend is a party trick
at best. The other use-cases that have been mentioned could be solved
with investing some effort in the rest of the TCG code.

-- 
Alex Bennée


  parent reply	other threads:[~2021-01-27 20:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 14:45 [PATCH v4 0/4] meson: Try to clarify TCG / TCI options for new users Philippe Mathieu-Daudé
2021-01-25 14:45 ` [PATCH v4 1/4] configure: Fix --enable-tcg-interpreter Philippe Mathieu-Daudé
2021-01-25 16:36   ` Paolo Bonzini
2021-01-25 17:10   ` Daniel P. Berrangé
2021-01-26 19:46   ` Stefan Weil
2021-01-25 14:45 ` [PATCH v4 2/4] configure: Improve TCI feature description Philippe Mathieu-Daudé
2021-01-25 16:44   ` Daniel P. Berrangé
2021-01-25 14:45 ` [PATCH v4 3/4] meson: Explicit TCG backend used Philippe Mathieu-Daudé
2021-01-25 16:45   ` Daniel P. Berrangé
2021-01-25 14:45 ` [PATCH v4 4/4] meson: Warn when TCI is selected but TCG backend is available Philippe Mathieu-Daudé
2021-01-25 16:46   ` Daniel P. Berrangé
2021-01-25 16:47   ` Daniel P. Berrangé
2021-01-25 17:05     ` Philippe Mathieu-Daudé
2021-01-25 18:58       ` Stefan Weil
2021-01-25 19:02         ` Richard Henderson
2021-01-25 21:02           ` Stefan Weil
2021-01-25 22:35             ` Richard Henderson
2021-01-26 11:40               ` Stefan Weil
2021-01-26 17:24                 ` Alex Bennée
2021-01-26 19:44                   ` Stefan Weil
2021-01-26 20:07                     ` Paolo Bonzini
2021-01-26 20:10                       ` Stefan Weil
2021-01-26 22:39                     ` Richard Henderson
2021-01-27  6:53                       ` Stefan Weil
2021-01-27 17:19                         ` Richard Henderson
2021-01-27 19:52                         ` Alex Bennée [this message]
2021-01-27 20:49                           ` Stefan Weil
2021-01-27 21:47                             ` Alex Bennée
2021-01-28  2:49                               ` Stefan Weil
2021-01-28  6:51                               ` qemu user mode fails to run programs with large VM / built with address sanitizer (was: Re: [PATCH v4 4/4] meson: Warn when TCI is selected but TCG backend is available) Stefan Weil
2021-01-28  8:29                                 ` Richard Henderson
2021-01-27 10:02                   ` [PATCH v4 4/4] meson: Warn when TCI is selected but TCG backend is available Daniel P. Berrangé
2021-01-27 12:34                     ` Alex Bennée
2021-01-26 10:34           ` Daniel P. Berrangé
2021-01-29  8:06 ` [PATCH v4 0/4] meson: Try to clarify TCG / TCI options for new users Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnvyw3eh.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sw@weilnetz.de \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).