* [PULL 0/1] loongarch patch queue
@ 2022-08-09 2:50 Richard Henderson
2022-08-09 4:41 ` Richard Henderson
0 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2022-08-09 2:50 UTC (permalink / raw)
To: qemu-devel
Hopefully the last such last minute bug for this new target.
r~
The following changes since commit 7b06148df8a22d984e77e796322aeb5901dc653c:
Merge tag 'mips-20220809' of https://github.com/philmd/qemu into staging (2022-08-08 17:59:27 -0700)
are available in the Git repository at:
https://gitlab.com/rth7680/qemu.git tags/pull-la-20220808
for you to fetch changes up to 10dcb08b03863221faa41f4f1aa835cdca441b96:
target/loongarch: Remove cpu_fcsr0 (2022-08-08 19:42:53 -0700)
----------------------------------------------------------------
loongarch: fix emulation of fcsr register
----------------------------------------------------------------
Richard Henderson (1):
target/loongarch: Remove cpu_fcsr0
target/loongarch/helper.h | 2 +-
target/loongarch/fpu_helper.c | 4 ++--
target/loongarch/translate.c | 3 ---
tests/tcg/loongarch64/test_fcsr.c | 15 +++++++++++++
target/loongarch/insn_trans/trans_fmov.c.inc | 33 ++++++++++++++--------------
tests/tcg/loongarch64/Makefile.target | 1 +
6 files changed, 36 insertions(+), 22 deletions(-)
create mode 100644 tests/tcg/loongarch64/test_fcsr.c
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PULL 0/1] loongarch patch queue
2022-08-09 2:50 Richard Henderson
@ 2022-08-09 4:41 ` Richard Henderson
0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2022-08-09 4:41 UTC (permalink / raw)
To: qemu-devel
On 8/8/22 19:50, Richard Henderson wrote:
> Hopefully the last such last minute bug for this new target.
>
>
> r~
>
>
> The following changes since commit 7b06148df8a22d984e77e796322aeb5901dc653c:
>
> Merge tag 'mips-20220809' of https://github.com/philmd/qemu into staging (2022-08-08 17:59:27 -0700)
>
> are available in the Git repository at:
>
> https://gitlab.com/rth7680/qemu.git tags/pull-la-20220808
>
> for you to fetch changes up to 10dcb08b03863221faa41f4f1aa835cdca441b96:
>
> target/loongarch: Remove cpu_fcsr0 (2022-08-08 19:42:53 -0700)
>
> ----------------------------------------------------------------
> loongarch: fix emulation of fcsr register
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.
r~
>
> ----------------------------------------------------------------
> Richard Henderson (1):
> target/loongarch: Remove cpu_fcsr0
>
> target/loongarch/helper.h | 2 +-
> target/loongarch/fpu_helper.c | 4 ++--
> target/loongarch/translate.c | 3 ---
> tests/tcg/loongarch64/test_fcsr.c | 15 +++++++++++++
> target/loongarch/insn_trans/trans_fmov.c.inc | 33 ++++++++++++++--------------
> tests/tcg/loongarch64/Makefile.target | 1 +
> 6 files changed, 36 insertions(+), 22 deletions(-)
> create mode 100644 tests/tcg/loongarch64/test_fcsr.c
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PULL 0/1] loongarch patch queue
@ 2022-08-14 13:47 Richard Henderson
2022-08-14 13:47 ` [PULL 1/1] docs/system/loongarch: Update the LoongArch document Richard Henderson
2022-08-14 20:36 ` [PULL 0/1] loongarch patch queue Richard Henderson
0 siblings, 2 replies; 5+ messages in thread
From: Richard Henderson @ 2022-08-14 13:47 UTC (permalink / raw)
To: qemu-devel
The following changes since commit 93f3dd604825824a7239aaf704baf74730aa3007:
Merge tag 'pull-target-arm-20220812' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2022-08-12 10:46:43 -0700)
are available in the Git repository at:
https://gitlab.com/rth7680/qemu.git tags/pull-la-20220814
for you to fetch changes up to 1f90ce64fc6043470209f825c7763950ec2067a1:
docs/system/loongarch: Update the LoongArch document (2022-08-13 04:45:03 -0700)
----------------------------------------------------------------
Loongarch docs update
----------------------------------------------------------------
Xiaojuan Yang (1):
docs/system/loongarch: Update the LoongArch document
docs/system/loongarch/loongson3.rst | 104 +++++++++++++++++++++++++++++++++---
target/loongarch/README | 49 +----------------
2 files changed, 97 insertions(+), 56 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PULL 1/1] docs/system/loongarch: Update the LoongArch document
2022-08-14 13:47 [PULL 0/1] loongarch patch queue Richard Henderson
@ 2022-08-14 13:47 ` Richard Henderson
2022-08-14 20:36 ` [PULL 0/1] loongarch patch queue Richard Henderson
1 sibling, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2022-08-14 13:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Xiaojuan Yang, Song Gao
From: Xiaojuan Yang <yangxiaojuan@loongson.cn>
1. Add some information about how to boot the LoongArch virt
machine by uefi bios and linux kernel and how to access the
source code or binary file.
2. Move the explanation of LoongArch system emulation in the
target/loongarch/README to docs/system/loongarch/loongson3.rst
Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20220812091957.3338126-1-yangxiaojuan@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
docs/system/loongarch/loongson3.rst | 104 +++++++++++++++++++++++++---
target/loongarch/README | 49 +------------
2 files changed, 97 insertions(+), 56 deletions(-)
diff --git a/docs/system/loongarch/loongson3.rst b/docs/system/loongarch/loongson3.rst
index fa3acd01c0..1bdab44e27 100644
--- a/docs/system/loongarch/loongson3.rst
+++ b/docs/system/loongarch/loongson3.rst
@@ -15,27 +15,115 @@ The ``virt`` machine supports:
- Gpex host bridge
- Ls7a RTC device
- Ls7a IOAPIC device
-- Ls7a ACPI device
+- ACPI GED device
- Fw_cfg device
- PCI/PCIe devices
- Memory device
-- CPU device. Type: Loongson-3A5000.
+- CPU device. Type: la464-loongarch-cpu.
CPU and machine Type
--------------------
The ``qemu-system-loongarch64`` provides emulation for virt
machine. You can specify the machine type ``virt`` and
-cpu type ``Loongson-3A5000``.
+cpu type ``la464-loongarch-cpu``.
Boot options
------------
-Now the ``virt`` machine can run test program in ELF format and the
-method of compiling is in target/loongarch/README.
+We can boot the LoongArch virt machine by specifying the uefi bios,
+initrd, and linux kernel. And those source codes and binary files
+can be accessed by following steps.
+
+(1) booting command:
.. code-block:: bash
- $ qemu-system-loongarch64 -machine virt -m 4G -cpu Loongson-3A5000 \
- -smp 1 -kernel hello -monitor none -display none \
- -chardev file,path=hello.out,id=output -serial chardev:output
+ $ qemu-system-loongarch64 -machine virt -m 4G -cpu la464-loongarch-cpu \
+ -smp 1 -bios QEMU_EFI.fd -kernel vmlinuz.efi -initrd initrd.img \
+ -append "root=/dev/ram rdinit=/sbin/init consol e=ttyS0,115200" \
+ --nographic
+
+Note: The running speed may be a little slow, as the performance of our
+qemu and uefi bios is not perfect, and it is being fixed.
+
+(2) cross compiler tools:
+
+.. code-block:: bash
+
+ wget https://github.com/loongson/build-tools/releases/download/ \
+ 2022.05.29/loongarch64-clfs-5.0-cross-tools-gcc-full.tar.xz
+
+ tar -vxf loongarch64-clfs-5.0-cross-tools-gcc-full.tar.xz
+
+(3) qemu compile configure option:
+
+.. code-block:: bash
+
+ ./configure --disable-rdma --disable-pvrdma --prefix=usr \
+ --target-list="loongarch64-softmmu" \
+ --disable-libiscsi --disable-libnfs --disable-libpmem \
+ --disable-glusterfs --enable-libusb --enable-usb-redir \
+ --disable-opengl --disable-xen --enable-spice \
+ --enable-debug --disable-capstone --disable-kvm \
+ --enable-profiler
+ make
+
+(4) uefi bios source code and compile method:
+
+.. code-block:: bash
+
+ git clone https://github.com/loongson/edk2-LoongarchVirt.git
+
+ cd edk2-LoongarchVirt
+
+ git submodule update --init
+
+ export PATH=$YOUR_COMPILER_PATH/bin:$PATH
+
+ export WORKSPACE=`pwd`
+
+ export PACKAGES_PATH=$WORKSPACE/edk2-LoongarchVirt
+
+ export GCC5_LOONGARCH64_PREFIX=loongarch64-unknown-linux-gnu-
+
+ edk2-LoongarchVirt/edksetup.sh
+
+ make -C edk2-LoongarchVirt/BaseTools
+
+ build --buildtarget=DEBUG --tagname=GCC5 --arch=LOONGARCH64 --platform=OvmfPkg/LoongArchQemu/Loongson.dsc
+
+ build --buildtarget=RELEASE --tagname=GCC5 --arch=LOONGARCH64 --platform=OvmfPkg/LoongArchQemu/Loongson.dsc
+
+The efi binary file path:
+
+ Build/LoongArchQemu/DEBUG_GCC5/FV/QEMU_EFI.fd
+
+ Build/LoongArchQemu/RELEASE_GCC5/FV/QEMU_EFI.fd
+
+(5) linux kernel source code and compile method:
+
+.. code-block:: bash
+
+ git clone https://github.com/loongson/linux.git
+
+ export PATH=$YOUR_COMPILER_PATH/bin:$PATH
+
+ export LD_LIBRARY_PATH=$YOUR_COMPILER_PATH/lib:$LD_LIBRARY_PATH
+
+ export LD_LIBRARY_PATH=$YOUR_COMPILER_PATH/loongarch64-unknown-linux-gnu/lib/:$LD_LIBRARY_PATH
+
+ make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- loongson3_defconfig
+
+ make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu-
+
+ make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- install
+
+ make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- modules_install
+
+Note: The branch of linux source code is loongarch-next.
+
+(6) initrd file:
+
+ You can use busybox tool and the linux modules to make a initrd file. Or you can access the
+ binary files: https://github.com/yangxiaojuan-loongson/qemu-binary
diff --git a/target/loongarch/README b/target/loongarch/README
index 1823375d04..0b9dc0d40a 100644
--- a/target/loongarch/README
+++ b/target/loongarch/README
@@ -11,54 +11,7 @@
- System emulation
- Mainly emulate a virt 3A5000 board and ls7a bridge that is not exactly the same as the host.
- 3A5000 support multiple interrupt cascading while here we just emulate the extioi interrupt
- cascading. LS7A1000 host bridge support multiple devices, such as sata, gmac, uart, rtc
- and so on. But we just realize the rtc. Others use the qemu common devices. It does not affect
- the general use. We also introduced the emulation of devices at docs/system/loongarch/virt.rst.
-
- This version only supports running binary files in ELF format, and does not depend on BIOS and kernel file.
- You can compile the test program with 'make & make check-tcg' and run the test case with the following command:
-
- 1. Install LoongArch cross-tools on X86 machines.
-
- Download cross-tools.
-
- wget https://github.com/loongson/build-tools/releases/download/2022.05.29/loongarch64-clfs-5.0-cross-tools-gcc-full.tar.xz
-
- tar -vxf loongarch64-clfs-5.0-cross-tools-gcc-full.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-softmmu" \
- --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
-
- or
-
- ./build/qemu-system-loongarch64 -machine virt -m 4G -cpu Loongson-3A5000 -smp 1 -kernel build/tests/tcg/loongarch64-softmmu/hello -monitor none -display none -chardev file,path=hello.out,id=output -serial chardev:output
+ You can reference docs/system/loongarch/loongson3.rst to get the information about system emulation of LoongArch.
- Linux-user emulation
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PULL 0/1] loongarch patch queue
2022-08-14 13:47 [PULL 0/1] loongarch patch queue Richard Henderson
2022-08-14 13:47 ` [PULL 1/1] docs/system/loongarch: Update the LoongArch document Richard Henderson
@ 2022-08-14 20:36 ` Richard Henderson
1 sibling, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2022-08-14 20:36 UTC (permalink / raw)
To: qemu-devel
On 8/14/22 08:47, Richard Henderson wrote:
> The following changes since commit 93f3dd604825824a7239aaf704baf74730aa3007:
>
> Merge tag 'pull-target-arm-20220812' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2022-08-12 10:46:43 -0700)
>
> are available in the Git repository at:
>
> https://gitlab.com/rth7680/qemu.git tags/pull-la-20220814
>
> for you to fetch changes up to 1f90ce64fc6043470209f825c7763950ec2067a1:
>
> docs/system/loongarch: Update the LoongArch document (2022-08-13 04:45:03 -0700)
>
> ----------------------------------------------------------------
> Loongarch docs update
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.
r~
>
> ----------------------------------------------------------------
> Xiaojuan Yang (1):
> docs/system/loongarch: Update the LoongArch document
>
> docs/system/loongarch/loongson3.rst | 104 +++++++++++++++++++++++++++++++++---
> target/loongarch/README | 49 +----------------
> 2 files changed, 97 insertions(+), 56 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-08-14 20:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-14 13:47 [PULL 0/1] loongarch patch queue Richard Henderson
2022-08-14 13:47 ` [PULL 1/1] docs/system/loongarch: Update the LoongArch document Richard Henderson
2022-08-14 20:36 ` [PULL 0/1] loongarch patch queue Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
2022-08-09 2:50 Richard Henderson
2022-08-09 4:41 ` Richard Henderson
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).