Thomas Huth <th...@redhat.com> writes:
> On 01/07/2021 03.07, maobibo wrote: >> 在 2021年06月30日 17:36, Alex Bennée 写道: >>> >>> maobibo <maob...@loongson.cn> writes: >>> >>>> 在 2021年06月29日 21:42, Peter Maydell 写道: >>>>> On Mon, 28 Jun 2021 at 13:05, Song Gao <gaos...@loongson.cn> wrote: >>>>>> >>>>>> Add files to linux-user/loongarch64 >>>>>> Add file to default-configs >>>>>> Add loongarch to target/meson.build >>>>>> >>>>>> Signed-off-by: Song Gao <gaos...@loongson.cn> >>>>>> --- >>>>>> MAINTAINERS | 1 + >>>>>> default-configs/targets/loongarch64-linux-user.mak | 4 + >>>>>> include/elf.h | 2 + >>>>>> linux-user/elfload.c | 58 ++++ >>>>>> linux-user/loongarch64/cpu_loop.c | 177 ++++++++++++ >>>>>> linux-user/loongarch64/signal.c | 193 +++++++++++++ >>>>>> linux-user/loongarch64/sockbits.h | 1 + >>>>>> linux-user/loongarch64/syscall_nr.h | 307 >>>>>> +++++++++++++++++++++ >>>>>> linux-user/loongarch64/target_cpu.h | 36 +++ >>>>>> linux-user/loongarch64/target_elf.h | 14 + >>>>>> linux-user/loongarch64/target_fcntl.h | 12 + >>>>>> linux-user/loongarch64/target_signal.h | 28 ++ >>>>>> linux-user/loongarch64/target_structs.h | 49 ++++ >>>>>> linux-user/loongarch64/target_syscall.h | 46 +++ >>>>>> linux-user/loongarch64/termbits.h | 229 >>>>>> +++++++++++++++ >>>>>> linux-user/syscall_defs.h | 8 +- >>>>>> meson.build | 2 +- >>>>>> qapi/machine-target.json | 4 +- >>>>>> target/loongarch/meson.build | 19 ++ >>>>>> target/meson.build | 1 + >>>>>> 20 files changed, 1185 insertions(+), 6 deletions(-) >>>>> >>>>> This is a massive patch that would benefit from being split up >>>>> into multiple smaller patches. >>>>> >>>>> I'm told by a kernel developer that loongarch hasn't yet been >>>>> accepted into the Linux kernel mainline. Until it has been, the >>>>> syscall ABI for it is not yet stable, so we won't be able to take >>>>> the linux-user patches for it yet. (We have been burned in the >>>>> past by taking linux-user architecture support patches without >>>>> realizing they weren't for a stable ABI, and then being out of >>>>> sync with the eventual upstream kernel ABI that was accepted.) >>>>> >>>>> We can certainly do code review in the meantime, though. >>>> Thanks for reviewing the big series patches. It is understandable that >>>> there should be linux kernel merged for one new architecture support >>>> firstly, and then there will be linux-user simulator later. >>>> >>>> We are planning to submit patch to linux kernel for LoongArch support, >>>> there is the link: >>>> https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next >>>> >>>> And we will continueto submit softmmu support for LoongArch. And is there >>>> any extra requirements for softmmu simulation for new architecture, >>>> such as gcc/binutils/bios? >>> >>> Ideally if there are some pre-built toolchains either as part of a >>> distro (we've used Debian Sid before for some) or easily to install in a >>> docker container as binary tarballs (like we do for tricore) then we can >>> enable basic check-tcg functionality. >>> >>> Going forward having stable URLs for test images of distros means we can >>> also enable check-acceptance tests. >> Thanks for guidance, it requires that linux kernel/gcc/glibc are submitted >> already. My meaning is that linux-user emulation depends on kernel >> syscall ABI, softmmu emulation does not have such dependency, on the contrast >> system emulation can be used to verify linux kernel. Is there any requirement >> for system emulation of new architecture? > > I think we'd need some way of automatic regression testing for new > targets. If your board has a serial UART that is easy to use, then > please add a test in tests/qtest/boot-serial-test.c. You can also write a very minimal softmmu harness with either semihosting or a debug port - currently we can run the tests for x86/arm/alpha. See tests/tcg/multiarch/system and the various boot.S/kernel.ld in tests/tcg/FOO/system and the Makefile.softmmu-target in the relevant directories. Basically you need enough initialisation to get to a non-stdlib main and a __sys_outc and __exit implementation. This allows for simple smoke tests that don't need a full Linux/kernel to run. > And if there are > any public Linux kernel binaries for (reliable) download anywhere, > please add a test in tests/acceptance/, see for example the various > machine_*.py files or boot_linux_console.py there. > > HTH, > Thomas -- Alex Bennée