[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v14 01/26] target/loongarch: Add README
|
From: |
WANG Xuerui |
|
Subject: |
Re: [PATCH v14 01/26] target/loongarch: Add README |
|
Date: |
Sun, 9 Jan 2022 17:24:57 +0800 |
|
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Thunderbird/97.0a1 |
On 1/6/22 17:41, Song Gao wrote:
This patch gives an introduction to the LoongArch target.
Signed-off-by: Song Gao<gaosong@loongson.cn>
Signed-off-by: Xiaojuan Yang<yangxiaojuan@loongson.cn>
Reviewed-by: Richard Henderson<richard.henderson@linaro.org>
---
MAINTAINERS | 5 +++
target/loongarch/README | 77 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+)
create mode 100644 target/loongarch/README
diff --git a/MAINTAINERS b/MAINTAINERS
index f871d759fd..2df0d4a7c2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -213,6 +213,11 @@ S: Maintained
F: target/hppa/
F: disas/hppa.c
+LoongArch TCG CPUS
"TCG CPUs" -- notice the case for the plural "s".
+M: Song Gao<gaosong@loongson.cn>
+S: Maintained
+F: target/loongarch/
+
M68K TCG CPUs
M: Laurent Vivier<laurent@vivier.eu>
S: Maintained
diff --git a/target/loongarch/README b/target/loongarch/README
new file mode 100644
index 0000000000..d5780c5918
--- /dev/null
+++ b/target/loongarch/README
@@ -0,0 +1,77 @@
+- Introduction
+
+ LoongArch is the general processor architecture of Loongson.
+
+ The following versions of the LoongArch core are supported
+ core: 3A5000
+https://github.com/loongson/LoongArch-Documentation/releases/download/2021.08.17/LoongArch-Vol1-v1.00-EN.pdf
+
+ We can get the latest loongarch documents
athttps://github.com/loongson/LoongArch-Documentation/tags.
+
+
+- Linux-user emulation
+
+ We already support Linux user emulation. We can use LoongArch cross-tools to
build LoongArch executables on X86 machines,
+ and We can also use qemu-loongarch64 to run LoongArch executables.
+
+ 1. Install LoongArch cross-tools on X86 machines.
+
+ Download cross-tools.
+
+
wgethttps://github.com/loongson/build-tools/releases/latest/download/loongarch64-clfs-20211202-cross-tools.tar.xz
+
+ tar -vxf loongarch64-clfs-20211202-cross-tools.tar.xz -C /opt
+
+ Config cross-tools env.
+
+ . setenv.sh
+
+ setenv.sh:
+
+ #!/bin/sh
+ set -x
+ CC_PREFIX=/opt/cross-tools
+
+ export PATH=$CC_PREFIX/bin:$PATH
+ export LD_LIBRARY_PATH=$CC_PREFIX/lib:$LD_LIBRARY_PATH
+ export
LD_LIBRARY_PATH=$CC_PREFIX/loongarch64-unknown-linux-gnu/lib/:$LD_LIBRARY_PATH
+ set +x
+
+ 2. Test tests/tcg/multiarch.
+
+ ./configure --disable-rdma --disable-pvrdma --prefix=/usr \
+ --target-list="loongarch64-linux-user" \
+ --disable-libiscsi --disable-libnfs --disable-libpmem \
+ --disable-glusterfs --enable-libusb --enable-usb-redir \
+ --disable-opengl --disable-xen --enable-spice --disable-werror \
+ --enable-debug --disable-capstone --disable-kvm --enable-profiler
+
+ cd build/
+
+ make && make check-tcg
+
+ 3. Run LoongArch system basic command with loongarch-clfs-system.
+
+ Download clfs-system.
+
+
wgethttps://github.com/loongson/build-tools/releases/latest/download/loongarch64-clfs-system-2021-12-02.tar.bz2
+
+ tar -vxf loongarch64-clfs-system-2021-12-02.tar.bz2 -C /opt/clfs
+ ln -s /opt/clfs/ /opt/clfs/tls
Command with dubious intention -- are you working around some kind of
LIBPATH priority problem? TLS shouldn't be involved at this level, yet I
remotely remember that library search paths similar to "/usr/lib/tls"
were a thing long ago...
+
+ Config env.
+
+ cp /opt/clfs/lib64/ld-linux-loongarch64.so.1 /lib64
+
+ export LD_LIBRARY_PATH="/opt/clfs/lib64"
+
+ Run LoongArch system basic command.
+
+ ./qemu-loongarch64 /opt/clfs/usr/bin/bash
+ ./qemu-loongarch64 /opt/clfs/usr/bin/ls
+ ./qemu-loongarch64 /opt/clfs/usr/bin/pwd
+ ...
+
+
+- Note.
+ We can get the latest LoongArch documents or LoongArch tools
athttps://github.com/loongson/
I'm afraid this README would require some re-writing due to the amount
of Chinglish involved, but that's possibly okay after merging. (I don't
have the time to rewrite this for you currently, so just a mild rant for
now.)
- [PATCH v14 17/26] linux-user: Add LoongArch generic header files, (continued)
- [PATCH v14 17/26] linux-user: Add LoongArch generic header files, Song Gao, 2022/01/06
- [PATCH v14 23/26] default-configs: Add loongarch linux-user support, Song Gao, 2022/01/06
- [PATCH v14 20/26] linux-user: Add LoongArch elf support, Song Gao, 2022/01/06
- [PATCH v14 26/26] scripts: add loongarch64 binfmt config, Song Gao, 2022/01/06
- [PATCH v14 24/26] target/loongarch: Add target build suport, Song Gao, 2022/01/06
- [PATCH v14 01/26] target/loongarch: Add README, Song Gao, 2022/01/06
- Re: [PATCH v14 01/26] target/loongarch: Add README,
WANG Xuerui <=
- [PATCH v14 08/26] target/loongarch: Add fixed point atomic instruction translation, Song Gao, 2022/01/06
- [PATCH v14 07/26] target/loongarch: Add fixed point load/store instruction translation, Song Gao, 2022/01/06
- [PATCH v14 13/26] target/loongarch: Add floating point move instruction translation, Song Gao, 2022/01/06
- [PATCH v14 25/26] target/loongarch: 'make check-tcg' support, Song Gao, 2022/01/06
- Re: [PATCH v14 00/26] Add LoongArch linux-user emulation support, Richard Henderson, 2022/01/07