diff --git a/01-add-riscv64-support.patch b/01-add-riscv64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..64c2f32deda98c36dce816838f4fdc84051b6250 --- /dev/null +++ b/01-add-riscv64-support.patch @@ -0,0 +1,27 @@ +diff --git a/vdo/cpu.h b/vdo/cpu.h +index e4b39c2b..ee449b7c 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__) ++#elif defined(__x86_64__) || defined(__aarch64__) || defined(__riscv) + #define CACHE_LINE_BYTES 64 + #else + #error "unknown cache line size" +diff --git a/vdo/volume.h b/vdo/volume.h +index 3a9a8d5e..93f13a42 100644 +--- a/vdo/volume.h ++++ b/vdo/volume.h +@@ -356,6 +356,9 @@ int __must_check get_volume_page(struct volume *volume, + byte **data_ptr, + struct delta_index_page **index_page_ptr); + ++#if defined(__riscv) ++#define get_cache_size get_cache_size_alias ++#endif + size_t __must_check get_cache_size(struct volume *volume); + + int __must_check diff --git a/kvdo.spec b/kvdo.spec index 75d7c85a7acd5c1c415d2f600fba339b696079e8..ffdbd31f49704b2f05612fcc655ba067106e1e71 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 2 +%define spec_release 3 %define kmod_name kmod-kvdo %define kmod_driver_version 8.2.1.2 %define kmod_rpm_release %{spec_release} @@ -15,12 +15,13 @@ Summary: Kernel Modules for Virtual Data Optimizer 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 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Requires: dkms Requires: kernel-devel >= %{kmod_kernel_version} Requires: make -ExclusiveArch: x86_64 aarch64 loongarch64 +ExclusiveArch: x86_64 aarch64 loongarch64 riscv64 ExcludeArch: s390 s390x ppc ppc64 ppc64le i686 %description @@ -77,6 +78,9 @@ rm -rf $RPM_BUILD_ROOT %{_usr}/src/%{kmod_name}-%{version}-%{kmod_rpm_release}/* %changelog +* Wed Apr 12 2023 laokz - 8.2.1.2-3 +- Add riscv64 support + * Thu Feb 16 2023 Wenlong Zhang - 8.2.1.2-2 - Add loongarch64 support