diff --git a/Add-loongarch-into-QEMU_ARCH_VIRTIO_PCI-to-support-q.patch b/Add-loongarch-into-QEMU_ARCH_VIRTIO_PCI-to-support-q.patch new file mode 100644 index 0000000000000000000000000000000000000000..7991934f46a0a2cd538f02e8901e70a3f5f4ab31 --- /dev/null +++ b/Add-loongarch-into-QEMU_ARCH_VIRTIO_PCI-to-support-q.patch @@ -0,0 +1,28 @@ +From 1ebc0cc2ede04d6e70291ff1344ee80c38e5ebd2 Mon Sep 17 00:00:00 2001 +From: Tianrui Zhao +Date: Mon, 19 Jun 2023 09:38:16 +0800 +Subject: [PATCH] Add loongarch into QEMU_ARCH_VIRTIO_PCI to support qdev + alias + +Signed-off-by: Tianrui Zhao +--- + softmmu/qdev-monitor.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c +index 01f3834db..49491d74a 100644 +--- a/softmmu/qdev-monitor.c ++++ b/softmmu/qdev-monitor.c +@@ -60,7 +60,8 @@ typedef struct QDevAlias + QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \ + QEMU_ARCH_MIPS | QEMU_ARCH_PPC | \ + QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \ +- QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA) ++ QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA | \ ++ QEMU_ARCH_LOONGARCH64) + #define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X) + #define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K) + +-- +2.39.3 + diff --git a/Add-usb-storage-config-for-loongarch.patch b/Add-usb-storage-config-for-loongarch.patch new file mode 100644 index 0000000000000000000000000000000000000000..86857da0080ba42640c324ef9de267143189f9e7 --- /dev/null +++ b/Add-usb-storage-config-for-loongarch.patch @@ -0,0 +1,26 @@ +From be087165d6ff6c45e768b85a23834d5e68fa0197 Mon Sep 17 00:00:00 2001 +From: Tianrui Zhao +Date: Mon, 19 Jun 2023 09:34:02 +0800 +Subject: [PATCH] Add usb-storage config for loongarch + +Signed-off-by: Tianrui Zhao +--- + configs/devices/loongarch64-softmmu/loongarch64-rh-devices.mak | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configs/devices/loongarch64-softmmu/loongarch64-rh-devices.mak b/configs/devices/loongarch64-softmmu/loongarch64-rh-devices.mak +index 696ee9b72..15fc2d00f 100644 +--- a/configs/devices/loongarch64-softmmu/loongarch64-rh-devices.mak ++++ b/configs/devices/loongarch64-softmmu/loongarch64-rh-devices.mak +@@ -147,6 +147,8 @@ CONFIG_USB_EHCI=y + CONFIG_USB_EHCI_PCI=y + CONFIG_USB_EHCI_SYSBUS=y + CONFIG_USB_STORAGE_BOT=y ++CONFIG_USB_STORAGE_CORE=y ++CONFIG_USB_STORAGE_CLASSIC=y + CONFIG_TPM_EMULATOR=y + CONFIG_TPM_TIS=y + CONFIG_PLATFORM_BUS=y +-- +2.39.3 + diff --git a/Fix-LoongArch-KVM-header-macros.patch b/Fix-LoongArch-KVM-header-macros.patch new file mode 100644 index 0000000000000000000000000000000000000000..a6c82333ad4479605da8f266dff3b77427eef116 --- /dev/null +++ b/Fix-LoongArch-KVM-header-macros.patch @@ -0,0 +1,32 @@ +From 6291b67e4a12d65595de2884e5939a19a3c7b052 Mon Sep 17 00:00:00 2001 +From: Tianrui Zhao +Date: Tue, 20 Jun 2023 16:34:43 +0800 +Subject: [PATCH] Fix LoongArch KVM header macros + +Signed-off-by: Tianrui Zhao +--- + linux-headers/linux/kvm.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h +index 1e6aed0fb..f99455294 100644 +--- a/linux-headers/linux/kvm.h ++++ b/linux-headers/linux/kvm.h +@@ -2057,10 +2057,10 @@ struct kvm_loongarch_vcpu_state { + __u64 core_ext_ioisr[4]; + }; + +-#define KVM_CAP_LOONGARCH_FPU 800 +-#define KVM_CAP_LOONGARCH_LSX 801 +-#define KVM_CAP_LOONGARCH_VZ 802 +-#define KVM_REG_LOONGARCH 0x9000000000000000ULL ++#define KVM_CAP_LOONGARCH_FPU 165 ++#define KVM_CAP_LOONGARCH_LSX 166 ++#define KVM_CAP_LOONGARCH_VZ 167 ++#define KVM_REG_LOONGARCH 0x8000000000000000ULL + #define KVM_LARCH_GET_VCPU_STATE _IOR(KVMIO, 0xc0, struct kvm_loongarch_vcpu_state) + #define KVM_LARCH_SET_VCPU_STATE _IOW(KVMIO, 0xc1, struct kvm_loongarch_vcpu_state) + #define KVM_LARCH_GET_CPUCFG _IOR(KVMIO, 0xc2, struct kvm_cpucfg) +-- +2.39.3 + diff --git a/Fix-host-architecture-macro-of-LoongArch-to-HOST_LOO.patch b/Fix-host-architecture-macro-of-LoongArch-to-HOST_LOO.patch new file mode 100644 index 0000000000000000000000000000000000000000..ea7daee349a79c527e777db4d484cd7ebc9e311d --- /dev/null +++ b/Fix-host-architecture-macro-of-LoongArch-to-HOST_LOO.patch @@ -0,0 +1,26 @@ +From 442aa58bc9508065c85a3d2b9790943559c2c812 Mon Sep 17 00:00:00 2001 +From: Tianrui Zhao +Date: Mon, 19 Jun 2023 16:38:29 +0800 +Subject: [PATCH] Fix host architecture macro of LoongArch to HOST_LOONGARCH64 + +Signed-off-by: Tianrui Zhao +--- + accel/kvm/kvm-all.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c +index e7d1e9ace..fbd6f5fcc 100644 +--- a/accel/kvm/kvm-all.c ++++ b/accel/kvm/kvm-all.c +@@ -2423,7 +2423,7 @@ static int kvm_init(MachineState *ms) + soft_vcpus_limit = kvm_recommended_vcpus(s); + hard_vcpus_limit = kvm_max_vcpus(s); + +-#if defined(HOST_PPC64) || defined(HOST_LOONGARCH) ++#if defined(HOST_PPC64) || defined(HOST_LOONGARCH64) + /* + * On POWER, the kernel advertises a soft limit based on the + * number of CPU threads on the host. We want to allow exceeding +-- +2.39.3 + diff --git a/qemu-kvm.spec b/qemu-kvm.spec index 6a6857ec9e264ac1fa81624b86f55cc6aba34fc6..5ae315bf1a6711d3001fb699550cf011a419287b 100644 --- a/qemu-kvm.spec +++ b/qemu-kvm.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.2 +%define anolis_release .0.3 %global SLOF_gittagdate 20191022 %global SLOF_gittagcommit 899d9883 @@ -484,7 +484,10 @@ Patch1020: fix-smbios-type4-info-for-numa-support.patch Patch1021: Fix-smp.cores-value.patch Patch1022: Add-lbt-support-for-kvm.patch Patch1023: Modify-the-ioctl-command-of-kvm.patch - +Patch1024: Add-usb-storage-config-for-loongarch.patch +Patch1025: Add-loongarch-into-QEMU_ARCH_VIRTIO_PCI-to-support-q.patch +Patch1026: Fix-host-architecture-macro-of-LoongArch-to-HOST_LOO.patch +Patch1027: Fix-LoongArch-KVM-header-macros.patch BuildRequires: wget BuildRequires: rpm-build @@ -1723,6 +1726,12 @@ sh %{_sysconfdir}/sysconfig/modules/kvm.modules &> /dev/null || : %endif %changelog +* Mon Jun 19 2023 Tianrui Zhao - 6.2.0-22.0.3.2 +- Add-usb-storage-config-for-loongarch.patch +- Add-loongarch-into-QEMU_ARCH_VIRTIO_PCI-to-support-q.patch +- Fix-host-architecture-macro-of-LoongArch-to-HOST_LOO.patch +- Fix-LoongArch-KVM-header-macros.patch + * Tue May 23 2023 xianglai li - 6.2.0-22.0.2.2 - Modify-smbios-option-lack-and-Modify-the-maximum-num.patch - rename-kvm_msr_buf-with-kvm_csr_buf.patch