From: lixianglai <lixianglai(a)loongson.cn>
Hello, Everyone:
This patch series adds libvirt support for loongarch.Although the bios
path and name has not been officially integrated into qemu and we think
there are still many shortcomings, we try to push a version of patch to
the community according to the opinions of the community, hoping to
listen to everyone's opinions. Anyway we have a version of libvirt that
supports loongarch.
You can also get libvirt's patch from the link below:
https://gitlab.com/lixianglai/libvirt
branch: loongarch
Since the patch associated with loongarch has not yet been submitted to
the virt-manager community, we are providing a temporary patch with
loongarch for the time being patch's virt-manager, the open source work
of virt-manager adding loongarch will be followed up later or
synchronized with the open source libvirt.
You can get the virt-manager code with loongarch patch from the link below:
https://github.com/loongson/virt-manager
branch: loongarch
loongarch's virtual machine bios is not yet available in qemu, so you can get it
from the following link
https://github.com/loongson/Firmware/tree/main/LoongArchVirtMachine
(Note: You should clone the repository using git instead of downloading the file via wget
or you'll get xml)
We named the bios edk2-loongarch64-code.fd, edk2-loongarch64-vars.fd is used to store
pflash images of non-volatile
variables.After installing qemu-system-loongarch64, you need to manually copy these two
files to the /user/share/qemu
directory.
Since there is no fedora operating system that supports the loongarch
architecture, you can find an iso that supports loongarch at the link
below for testing purposes:
https://github.com/fedora-remix-loongarch/releases-info
Well, if you have completed the above steps I think you can now install loongarch
virtual machine,
you can install it through the virt-manager graphical interface, or install it through
vrit-install,
here is an example of installing it using virt-install:
virt-install \
--virt-type=qemu \
--name loongarch-test \
--memory 4096 \
--vcpus=4 \
--arch=loongarch64 \
--boot cdrom \
--disk device=cdrom,bus=scsi,path=/root/livecd-fedora-mate-4.loongarch64.iso \
--disk
path=/var/lib/libvirt/images/debian12-loongarch64.qcow2,size=10,format=qcow2,bus=scsi \
--network network=default \
--osinfo archlinux \
--feature acpi=true \
--video=virtio \
--graphics=vnc,listen=0.0.0.0
lixianglai (5):
Add loongarch cpu support
Add loongarch cpu model and vendor info
Config some capabilities for loongarch virt machine
Implement the method of getting host info for loongarch
Add bios path for loongarch
po/POTFILES | 1 +
src/conf/schemas/basictypes.rng | 1 +
src/cpu/cpu.c | 2 +
src/cpu/cpu.h | 2 +
src/cpu/cpu_loongarch.c | 742 +++++++++++++++++++++++++++++
src/cpu/cpu_loongarch.h | 25 +
src/cpu/cpu_loongarch_data.h | 37 ++
src/cpu/meson.build | 1 +
src/cpu_map/index.xml | 5 +
src/cpu_map/loongarch_la464.xml | 6 +
src/cpu_map/loongarch_vendors.xml | 3 +
src/cpu_map/meson.build | 2 +
src/qemu/qemu.conf.in | 3 +-
src/qemu/qemu_capabilities.c | 6 +
src/qemu/qemu_conf.c | 3 +-
src/qemu/qemu_domain.c | 32 ++
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_domain_address.c | 55 +++
src/qemu/qemu_validate.c | 2 +-
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/util/virarch.c | 4 +
src/util/virarch.h | 4 +
src/util/virhostcpu.c | 4 +-
src/util/virsysinfo.c | 5 +-
24 files changed, 940 insertions(+), 7 deletions(-)
create mode 100644 src/cpu/cpu_loongarch.c
create mode 100644 src/cpu/cpu_loongarch.h
create mode 100644 src/cpu/cpu_loongarch_data.h
create mode 100644 src/cpu_map/loongarch_la464.xml
create mode 100644 src/cpu_map/loongarch_vendors.xml
--
2.27.0