Re: How do I add my tcg tests to check-tcg?

2020-06-04 Thread Bastian Koppelmann
Hi Alex,

On Wed, Jun 03, 2020 at 11:25:36AM +0100, Alex Bennée wrote:
> 
> Bastian Koppelmann  writes:
> 
> > Hi Alex,
> >
> > I have some time again to integrate my tcg tests patch for TriCore [1]. 
> > However,
> > I'm struggeling a bit to get through the details of the Makefiles. I'm 
> > assuming
> > the right rule to run is 'make check-tcg'. I tried running that for
> > xtensa-softmmu, arm-softmmu, and aarch64-softmmu, but they are always 
> > skipped.
> > Digging into the Makefiles I found that there is some way to use the 
> > dockerfiles
> > to run the test. Can someone elighten me on how to properly use this?
> 
> The configure script in tests/tcg/configure.sh will probe for available
> cross compilers (or take a passed in one). Failing that you can fall
> back to a docker image which has the compilers included.
> 
> The result should end up in:
>   $(BUILD_DIR)/tests/tcg/config-$(PROBE_TARGET).mak

that file did not get generated, as I didn't add TriCore to
tests/tcg/configure.sh

Thanks for the quick help. I have sent the TriCore tcg-tests series to the list.

Cheers,
Bastian



Re: How do I add my tcg tests to check-tcg?

2020-06-03 Thread Alex Bennée


Bastian Koppelmann  writes:

> Hi Alex,
>
> I have some time again to integrate my tcg tests patch for TriCore [1]. 
> However,
> I'm struggeling a bit to get through the details of the Makefiles. I'm 
> assuming
> the right rule to run is 'make check-tcg'. I tried running that for
> xtensa-softmmu, arm-softmmu, and aarch64-softmmu, but they are always skipped.
> Digging into the Makefiles I found that there is some way to use the 
> dockerfiles
> to run the test. Can someone elighten me on how to properly use this?

The configure script in tests/tcg/configure.sh will probe for available
cross compilers (or take a passed in one). Failing that you can fall
back to a docker image which has the compilers included.

The result should end up in:
  $(BUILD_DIR)/tests/tcg/config-$(PROBE_TARGET).mak

Assuming you have a CROSS_CC_GUEST or DOCKER_IMAGE and
DOCKER_CROSS_CC_GUEST defined there the makefiles should allow building
of the tests.

For linux-user we include the tests/tcg/multiarch/Makefile.target as
well as the target specific one. The CC variable should already be setup
to build either via docker or using the installed setup.

We don't have a linker or assembler in the tooling so everything is
invoked via the compiler with the appropriate flags to call the
sub-tools if required. Most rules are single file compile and link.

For softmmu tests things are a bit more bespoke. The tooling will make
sure things are setup and then include
tests/tcg/multiarch/system/Makefile.softmmu-target and 
tests/tcg/$ARCH/Makefile.softmmu-target. The main purpose of the arch
specific Makefile is to provide the appropriate build instructions to
build a system image for the multiarch tests and any target specific
tests.

To support the multiarch tests you need a boot.S and a kernel.ld that
defines a simple boot and a __sys_outc helper function. There is a
minilib which provides for a basic printf like output. The boot should
call main and then return the int code via some mechanism to signal the
pass/fail of the test. For aarch64 this is done with semihosting.

Please let me know if you have any more questions.

>
> Thanks and cheers,
> Bastian
>
> [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-05/msg00074.html


-- 
Alex Bennée



How do I add my tcg tests to check-tcg?

2020-06-03 Thread Bastian Koppelmann
Hi Alex,

I have some time again to integrate my tcg tests patch for TriCore [1]. However,
I'm struggeling a bit to get through the details of the Makefiles. I'm assuming
the right rule to run is 'make check-tcg'. I tried running that for
xtensa-softmmu, arm-softmmu, and aarch64-softmmu, but they are always skipped.
Digging into the Makefiles I found that there is some way to use the dockerfiles
to run the test. Can someone elighten me on how to properly use this?

Thanks and cheers,
Bastian

[1] https://lists.nongnu.org/archive/html/qemu-devel/2018-05/msg00074.html