From fc909b5786b9381227ab5e0feab34534df0eecf9 Mon Sep 17 00:00:00 2001 From: yangzhenyu Date: Sun, 8 Dec 2024 00:56:35 +0800 Subject: [PATCH] * Add loongarch64 support for kmod-kvdo --- 02-add-support-for-loongarch64.patch | 26 ++++++++++++++++++++++++++ kvdo.spec | 9 ++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 02-add-support-for-loongarch64.patch diff --git a/02-add-support-for-loongarch64.patch b/02-add-support-for-loongarch64.patch new file mode 100644 index 0000000..9529010 --- /dev/null +++ b/02-add-support-for-loongarch64.patch @@ -0,0 +1,26 @@ +diff --git a/vdo/cpu.h b/vdo/cpu.h +index ee449b7..b3fbfd9 100644 +--- a/vdo/cpu.h ++++ b/vdo/cpu.h +@@ -20,7 +20,7 @@ + #define CACHE_LINE_BYTES 128 + #elif defined(__s390x__) + #define CACHE_LINE_BYTES 256 +-#elif defined(__x86_64__) || defined(__aarch64__) || defined(__riscv) ++#elif defined(__x86_64__) || defined(__aarch64__) || defined(__riscv) || defined(__loongarch64) + #define CACHE_LINE_BYTES 64 + #else + #error "unknown cache line size" +diff --git a/vdo/volume.h b/vdo/volume.h +index 93f13a4..9d43185 100644 +--- a/vdo/volume.h ++++ b/vdo/volume.h +@@ -356,7 +356,7 @@ int __must_check get_volume_page(struct volume *volume, + byte **data_ptr, + struct delta_index_page **index_page_ptr); + +-#if defined(__riscv) ++#if defined(__riscv) || defined(__loongarch64) + #define get_cache_size get_cache_size_alias + #endif + size_t __must_check get_cache_size(struct volume *volume); diff --git a/kvdo.spec b/kvdo.spec index bd9c131..dc13a1c 100644 --- a/kvdo.spec +++ b/kvdo.spec @@ -1,5 +1,5 @@ #This spec is obtained from source code(kvdo-6.2.2.24.tar.gz) -%define spec_release 4 +%define spec_release 5 %define kmod_name kmod-kvdo %define kmod_driver_version 8.2.1.2 %define kmod_rpm_release %{spec_release} @@ -16,6 +16,7 @@ License: GPLv2+ URL: http://github.com/dm-vdo/kvdo Source0: https://github.com/dm-vdo/kvdo/archive/refs/tags/%{kmod_driver_version}.tar.gz Patch1: 01-add-riscv64-support.patch +Patch2: 02-add-support-for-loongarch64.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Requires: dkms @@ -78,6 +79,12 @@ rm -rf $RPM_BUILD_ROOT %{_usr}/src/%{kmod_name}-%{version}-%{kmod_rpm_release}/* %changelog +* Tue Nov 26 2024 yangzhenyu - 8.2.1.2-5 +- Type:other +- ID:NA +- SUG:NA +- DESC:Add loongarch64 support + * Fri Mar 8 2024 xurui - 8.2.1.2-4 - Add ppc64le support -- Gitee