* [PATCH v1 1/2] docs/system/loongarch: update loongson3.rst and rename it to virt.rst
@ 2023-02-08 9:41 Song Gao
2023-02-08 9:41 ` [PATCH v1 2/2] loongarch: Add smbios command line option Song Gao
0 siblings, 1 reply; 4+ messages in thread
From: Song Gao @ 2023-02-08 9:41 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, peter.maydell, philmd, armbru, thuth, mst,
maobibo, yangxiaojuan
Since the EDK2 had already support LoongArch, update build bios,
and update cpu type, cross-tools.
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
.../loongarch/{loongson3.rst => virt.rst} | 97 ++++++++-----------
1 file changed, 38 insertions(+), 59 deletions(-)
rename docs/system/loongarch/{loongson3.rst => virt.rst} (51%)
diff --git a/docs/system/loongarch/loongson3.rst b/docs/system/loongarch/virt.rst
similarity index 51%
rename from docs/system/loongarch/loongson3.rst
rename to docs/system/loongarch/virt.rst
index 489ea20f8f..b268f4715f 100644
--- a/docs/system/loongarch/loongson3.rst
+++ b/docs/system/loongarch/virt.rst
@@ -19,14 +19,14 @@ The ``virt`` machine supports:
- Fw_cfg device
- PCI/PCIe devices
- Memory device
-- CPU device. Type: la464-loongarch-cpu.
+- CPU device. Type: la464.
CPU and machine Type
--------------------
The ``qemu-system-loongarch64`` provides emulation for virt
machine. You can specify the machine type ``virt`` and
-cpu type ``la464-loongarch-cpu``.
+cpu type ``la464``.
Boot options
------------
@@ -35,95 +35,74 @@ 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:
+(1) Build qemu-system-loongarch64:
.. code-block:: bash
- $ 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 console=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 \
+ ./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
+ make -j8
-(4) uefi bios source code and compile method:
+(2) Set cross tools:
.. 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`
+ wget https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-6.3-cross-tools-gcc-glibc.tar.xz
- export PACKAGES_PATH=$WORKSPACE/edk2-LoongarchVirt
+ tar -vxf loongarch64-clfs-6.3-cross-tools-gcc-glibc.tar.xz -C /opt
- export GCC5_LOONGARCH64_PREFIX=loongarch64-unknown-linux-gnu-
+ export PATH=/opt/cross-tools/bin:$PATH
+ export LD_LIBRARY_PATH=/opt/cross-tools/lib:$LD_LIBRARY_PATH
+ export LD_LIBRARY_PATH=/opt/cross-tools/loongarch64-unknown-linux-gnu/lib/:$LD_LIBRARY_PATH
- edk2-LoongarchVirt/edksetup.sh
+Note: You need get the latest cross-tools at https://github.com/loongson/build-tools
- make -C edk2-LoongarchVirt/BaseTools
+(3) Build BIOS:
- build --buildtarget=DEBUG --tagname=GCC5 --arch=LOONGARCH64 --platform=OvmfPkg/LoongArchQemu/Loongson.dsc
+ See: https://github.com/tianocore/edk2-platforms/tree/master/Platform/Loongson/LoongArchQemuPkg#readme
- build --buildtarget=RELEASE --tagname=GCC5 --arch=LOONGARCH64 --platform=OvmfPkg/LoongArchQemu/Loongson.dsc
+Note: build release bios need set --buildtarget=RELEASE,
+ the bios file path: Build/LoongArchQemu/RELEASE_GCC5/FV/QEMU_EFI.fd
-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:
+(4) Build kernel:
.. 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
+ cd linux
- export LD_LIBRARY_PATH=$YOUR_COMPILER_PATH/loongarch64-unknown-linux-gnu/lib/:$LD_LIBRARY_PATH
+ git checkout loongarch-next
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
+ make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- j32
Note: The branch of linux source code is loongarch-next.
+ the kernel file: arch/loongarch/boot/vmlinuz.efi
-(6) initrd file:
+(5) Get initrd:
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
+
+.. code-block:: bash
+
+ git clone https://github.com/yangxiaojuan-loongson/qemu-binary
+
+Note: the initrd file is ramdisk
+
+(6) Booting LoongArch:
+
+.. code-block:: bash
+
+ $ ./build/qemu-system-loongarch64 -machine virt -m 4G -cpu la464 \
+ -smp 1 -bios QEMU_EFI.fd -kernel vmlinuz.efi -initrd ramdisk \
+ -serial stdio -monitor telnet:localhost:4495,server,nowait \
+ -append "root=/dev/ram rdinit=/sbin/init console=ttyS0,115200" \
+ --nographic
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v1 2/2] loongarch: Add smbios command line option.
2023-02-08 9:41 [PATCH v1 1/2] docs/system/loongarch: update loongson3.rst and rename it to virt.rst Song Gao
@ 2023-02-08 9:41 ` Song Gao
2023-02-08 9:51 ` Michael S. Tsirkin
2023-02-08 10:26 ` Markus Armbruster
0 siblings, 2 replies; 4+ messages in thread
From: Song Gao @ 2023-02-08 9:41 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, peter.maydell, philmd, armbru, thuth, mst,
maobibo, yangxiaojuan
LoongArch has enabled CONFIG_SMBIOS, but didn't enable CLI '-smbios'.
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
qemu-options.hx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 88e93c6103..2aa6709466 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2592,7 +2592,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
" specify SMBIOS type 17 fields\n"
"-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n"
" specify SMBIOS type 41 fields\n",
- QEMU_ARCH_I386 | QEMU_ARCH_ARM)
+ QEMU_ARCH_I386 | QEMU_ARCH_ARM | QEMU_ARCH_LOONGARCH)
SRST
``-smbios file=binary``
Load SMBIOS entry from binary file.
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1 2/2] loongarch: Add smbios command line option.
2023-02-08 9:41 ` [PATCH v1 2/2] loongarch: Add smbios command line option Song Gao
@ 2023-02-08 9:51 ` Michael S. Tsirkin
2023-02-08 10:26 ` Markus Armbruster
1 sibling, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2023-02-08 9:51 UTC (permalink / raw)
To: Song Gao
Cc: qemu-devel, richard.henderson, peter.maydell, philmd, armbru,
thuth, maobibo, yangxiaojuan
On Wed, Feb 08, 2023 at 05:41:33PM +0800, Song Gao wrote:
> LoongArch has enabled CONFIG_SMBIOS, but didn't enable CLI '-smbios'.
>
> Signed-off-by: Song Gao <gaosong@loongson.cn>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> qemu-options.hx | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 88e93c6103..2aa6709466 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -2592,7 +2592,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
> " specify SMBIOS type 17 fields\n"
> "-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n"
> " specify SMBIOS type 41 fields\n",
> - QEMU_ARCH_I386 | QEMU_ARCH_ARM)
> + QEMU_ARCH_I386 | QEMU_ARCH_ARM | QEMU_ARCH_LOONGARCH)
> SRST
> ``-smbios file=binary``
> Load SMBIOS entry from binary file.
> --
> 2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 2/2] loongarch: Add smbios command line option.
2023-02-08 9:41 ` [PATCH v1 2/2] loongarch: Add smbios command line option Song Gao
2023-02-08 9:51 ` Michael S. Tsirkin
@ 2023-02-08 10:26 ` Markus Armbruster
1 sibling, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2023-02-08 10:26 UTC (permalink / raw)
To: Song Gao
Cc: qemu-devel, richard.henderson, peter.maydell, philmd, thuth, mst,
maobibo, yangxiaojuan
Song Gao <gaosong@loongson.cn> writes:
> LoongArch has enabled CONFIG_SMBIOS, but didn't enable CLI '-smbios'.
>
Suggest
Fixes: 3efa6fa1e629 ("hw/loongarch: Add smbios support")
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
> qemu-options.hx | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 88e93c6103..2aa6709466 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -2592,7 +2592,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
> " specify SMBIOS type 17 fields\n"
> "-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n"
> " specify SMBIOS type 41 fields\n",
> - QEMU_ARCH_I386 | QEMU_ARCH_ARM)
> + QEMU_ARCH_I386 | QEMU_ARCH_ARM | QEMU_ARCH_LOONGARCH)
> SRST
> ``-smbios file=binary``
> Load SMBIOS entry from binary file.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-08 10:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 9:41 [PATCH v1 1/2] docs/system/loongarch: update loongson3.rst and rename it to virt.rst Song Gao
2023-02-08 9:41 ` [PATCH v1 2/2] loongarch: Add smbios command line option Song Gao
2023-02-08 9:51 ` Michael S. Tsirkin
2023-02-08 10:26 ` Markus Armbruster
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.