diff --git a/1000-bugfix-support-5.10.patch b/1000-bugfix-support-5.10.patch index f10dec65b8cecd7cf995ee33e0a0c6f7977c7de1..2426c45b910cd1ec1dee8261a1c511635851d056 100644 --- a/1000-bugfix-support-5.10.patch +++ b/1000-bugfix-support-5.10.patch @@ -1,8 +1,16 @@ -commit 6d3281629dd2d2eb46a4e88964e79fd1fccfedc5 -Author: Jiayu Ni -Date: Mon Oct 10 09:14:12 2022 +0800 +From a76687984a3404446ee3e14269b84d54fa29fc68 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiayu Ni +Date: Mon, 17 Jul 2023 16:28:39 +0800 +Subject: [PATCH] drivers: support 5.10 kernel - Support 5.10 +Signed-off-by: Jiayu Ni +Signed-off-by: Artie Ding +--- + quickassist/qat/drivers/crypto/qat/Makefile | 8 +++----- + .../drivers/crypto/qat/qat_common/adf_vdcm_adi.c | 15 +++++--------- + .../drivers/crypto/qat/qat_common/adf_vdcm_core.c | 24 +++++++++++----------- + 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/quickassist/qat/drivers/crypto/qat/Makefile b/quickassist/qat/drivers/crypto/qat/Makefile index e7280d8..5312e72 100644 @@ -188,3 +196,6 @@ index 616df63..5dc63ee 100644 static struct adf_vdcm_vqat_type *adf_vdcm_lookup_vqat_type(struct device *dev, struct mdev_type *mtype) { +-- +1.8.3.1 + diff --git a/1002-bugfix-crash-of-rmmod-vdcm.patch b/1002-bugfix-crash-of-rmmod-vdcm.patch index 6a92bc058f265aae4d445b3bc8c219f30908a3a4..dafc123d17d85b69a3756a223b57950beb628461 100644 --- a/1002-bugfix-crash-of-rmmod-vdcm.patch +++ b/1002-bugfix-crash-of-rmmod-vdcm.patch @@ -24,7 +24,7 @@ index 309c8fe..e683efb 100644 goto out_err_dev_stop; #ifdef CONFIG_CRYPTO_DEV_QAT_VDCM -+ if (vdcm_mod == NULL) ++ if (vdcm_mod == NULL) + vdcm_mod = find_module("qat_vdcm"); + if (vdcm_mod != NULL) { + try_module_get(vdcm_mod); diff --git a/1004-build-split-kernel-space-and-user-space-building.patch b/1004-build-split-kernel-space-and-user-space-building.patch new file mode 100644 index 0000000000000000000000000000000000000000..cc303e13e72130a19dc6d0a29349a0adeac04130 --- /dev/null +++ b/1004-build-split-kernel-space-and-user-space-building.patch @@ -0,0 +1,224 @@ +From f81a9c2e962659e4acb37cded4d6ec54bb5d544a Mon Sep 17 00:00:00 2001 +Message-Id: +From: Artie Ding +Date: Mon, 17 Jul 2023 16:36:58 +0800 +Subject: [PATCH] build: split kernel space and user space building + +Signed-off-by: Artie Ding +--- + Makefile.in | 72 ++++++++++++++++++++++++++++++++++++++++++++++++---- + quickassist/Makefile | 9 +++++++ + 2 files changed, 76 insertions(+), 5 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index baccc06..08a8313 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -493,6 +493,12 @@ INSTALL_TARGETS = qat-driver-install quickassist-install adf-ctl-install qat-ser + UNINSTALL_TARGETS = qat-driver-uninstall quickassist-uninstall qat-service-uninstall adf-ctl-uninstall sample-uninstall + CLEAN_TARGETS = qat-driver-clean quickassist-clean adf-ctl-clean qat-service-clean sample-clean + ++#User space targets lists ++ALL_US_TARGETS = quickassist-us-all adf-ctl-all qat-service-us-all adf-rl-all ++INSTALL_US_TARGETS = quickassist-install adf-ctl-install qat-service-install ++UNINSTALL_US_TARGETS = quickassist-uninstall qat-service-uninstall adf-ctl-uninstall sample-uninstall ++CLEAN_US_TARGETS = quickassist-clean adf-ctl-clean qat-service-clean sample-clean ++ + # Naming standards: + # + # Use XXX_DIR for directory paths for something +@@ -810,6 +816,9 @@ PRINT_ACC_DEVICE_INFO = $(PRINT_ACC_DEVICE_INFO_SH); PrintAccDeviceInfo + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + ++all-us: config.h ++ $(MAKE) $(AM_MAKEFLAGS) all-us-am ++ + .SUFFIXES: + am--refresh: Makefile + @: +@@ -1088,15 +1097,21 @@ distcleancheck: distclean + check-am: all-am + check: check-am + all-am: Makefile config.h all-local ++all-us-am: Makefile config.h all-us-local + installdirs: + install: install-am + install-exec: install-exec-am ++install-us-exec: install-us-exec-am + install-data: install-data-am + uninstall: uninstall-am ++uninstall-us: uninstall-us-am + + install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + ++install-us-am: all-us-am ++ @$(MAKE) $(AM_MAKEFLAGS) install-us-exec-am install-data-am ++ + installcheck: installcheck-am + install-strip: + if test -z '$(STRIP)'; then \ +@@ -1123,6 +1138,8 @@ clean: clean-am + + clean-am: clean-generic clean-local mostlyclean-am + ++clean-us-am: clean-generic clean-us-local mostlyclean-am ++ + distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +@@ -1148,6 +1165,8 @@ install-dvi-am: + + install-exec-am: install-exec-local + ++install-us-exec-am: install-us-exec-local ++ + install-html: install-html-am + + install-html-am: +@@ -1188,23 +1207,25 @@ ps-am: + + uninstall-am: uninstall-local + ++uninstall-us-am: uninstall-us-local ++ + .MAKE: all install-am install-strip + +-.PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \ +- check-am clean clean-cscope clean-generic clean-local cscope \ ++.PHONY: CTAGS GTAGS TAGS all all-am all-us-am all-local all-us-local am--refresh check \ ++ check-am clean clean-cscope clean-generic clean-local clean-us-local cscope \ + cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ +- install-exec install-exec-am install-exec-local install-html \ ++ install-exec install-exec-am install-exec-local install-us-exec-local install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ +- uninstall-am uninstall-local ++ uninstall-am uninstall-us-am uninstall-local uninstall-us-local + + .PRECIOUS: Makefile + +@@ -1222,6 +1243,20 @@ quickassist-uninstall: + quickassist-clean: + @$(MAKE) clean -C $(QUICKASSIST_DIR) + ++######################## ++# QUICKASSIST Makefile # ++######################## ++ ++quickassist-us-all: ++ @$(MAKE) -C $(QUICKASSIST_DIR) all_us ++ ++quickassist-us-install: ++ ++quickassist-us-uninstall: ++ ++quickassist-us-clean: ++ @$(MAKE) clean -C $(QUICKASSIST_DIR) ++ + ################### + # QAT Sample Code # + ################### +@@ -1771,6 +1806,16 @@ qat-service-uninstall: + qat-service-clean: + @$(ECHO) qat-service-clean + ++qat-service-us-all: ++ @$(INSTALL) -D -m 750 $(QUICKASSIST_DIR)/build_system/build_files/qat_service $(ICP_BUILD_OUTPUT)/qat_service ++ @$(INSTALL) -D -m 750 $(QUICKASSIST_DIR)/build_system/build_files/vqat_ctl $(ICP_BUILD_OUTPUT)/vqat_ctl ++ @$(SED) -i "s|/usr/sbin/adf_ctl|$(prefix)/bin/adf_ctl|g" $(ICP_BUILD_OUTPUT)/qat_service ++ @$(foreach bin, $(BIN_LIST), \ ++ if [ -e $(QUICKASSIST_QAT_DIR)/fw/$(bin) ]; then \ ++ $(INSTALL) -D -m 750 $(QUICKASSIST_QAT_DIR)/fw/$(bin) $(ICP_BUILD_OUTPUT)/$(notdir $(bin)); \ ++ fi; \ ++ ) ++ + ########################### + # RL related targets # + ########################### +@@ -1856,6 +1901,14 @@ qat-driver-uninstall: + qat-driver-clean: + @$(MAKE) KDIR=$(KERNEL_SOURCE_ROOT) -C $(QAT_DRIVER_DIR) clean + ++usdm-driver-all: ++ @cd $(QUICKASSIST_DIR) && $(MAKE) cmn_ko ++ ++usdm-driver-uninstall: ++ ++usdm-driver-clean: ++ @cd $(QUICKASSIST_DIR) && $(MAKE) clean ++ + ########### + # Targets # + ########### +@@ -1869,6 +1922,15 @@ install-exec-local: $(INSTALL_TARGETS) + + uninstall-local: $(UNINSTALL_TARGETS) + ++all-us-local: $(ALL_US_TARGETS) ++ ++clean-us-local: $(CLEAN_US_TARGETS) ++ @$(RM) $(ICP_BUILD_OUTPUT) ++ ++install-us-exec-local: $(INSTALL_US_TARGETS) ++ ++uninstall-us-local: $(UNINSTALL_US_TARGETS) ++ + default-local: all + + samples: sample-all +@@ -1881,7 +1943,7 @@ device-info: + + .PHONY: device-info samples samples-install + +-.NOTPARALLEL: qat-service-all ++.NOTPARALLEL: qat-service-all qat-service-us-all + + export + +diff --git a/quickassist/Makefile b/quickassist/Makefile +index 808f67f..f87b998 100755 +--- a/quickassist/Makefile ++++ b/quickassist/Makefile +@@ -67,6 +67,7 @@ LAC_LIB_DIR=$(LAC_PATH)/build/libs + + #Release Package build steps + ALL_TARGETS = clean lac_lib_dir qat_direct libosal_user lac_user ++ALL_US_TARGETS = clean lac_lib_dir libosal_user lac_us_user + + + ifdef ICP_SRIOV +@@ -76,6 +77,8 @@ endif + all: $(ALL_TARGETS) + @echo 'Build Done'; + ++all_us: $(ALL_US_TARGETS) ++ @echo 'Build Done'; + + user: lac_lib_dir libosal_user lac_user + +@@ -124,6 +127,12 @@ lac_user: clean output_dir qat_direct libosal_user cmn_user cmn_ko + @cd $(LAC_PATH) && export ICP_ENV_DIR=$(ICP_TOP_ENV) && cd src && $(MAKE) ARCH=$(ICP_ARCH_USER) lib_shared ICP_OS_LEVEL=user_space; + cp $(LAC_PATH)/src/build/linux_2.6/user_space/lib$(BASENAME)_s.so $(ICP_BUILD_OUTPUT)/; + ++lac_us_user: clean output_dir qat_direct libosal_user cmn_user ++ @echo ; echo 'Building LAC in user space'; ++ @cd $(LAC_PATH) && export ICP_ENV_DIR=$(ICP_TOP_ENV) && cd src && $(MAKE) ARCH=$(ICP_ARCH_USER) lib_static ICP_OS_LEVEL=user_space; ++ cp $(LAC_PATH)/src/build/linux_2.6/user_space/lib$(BASENAME).a $(ICP_BUILD_OUTPUT)/; ++ @cd $(LAC_PATH) && export ICP_ENV_DIR=$(ICP_TOP_ENV) && cd src && $(MAKE) ARCH=$(ICP_ARCH_USER) lib_shared ICP_OS_LEVEL=user_space; ++ cp $(LAC_PATH)/src/build/linux_2.6/user_space/lib$(BASENAME)_s.so $(ICP_BUILD_OUTPUT)/; + + clean: + ifeq ($(ICP_NO_CLEAN),) +-- +1.8.3.1 + diff --git a/intel-QAT20.spec b/intel-QAT20.spec index e379e568cc0dfd84ca733b8f1d1321b6dd46f244..09c24b9552e136aa1cbcab511b519f5458ab8110 100644 --- a/intel-QAT20.spec +++ b/intel-QAT20.spec @@ -1,4 +1,4 @@ -%define anolis_release 10 +%define anolis_release 11 %define debug_package %{nil} %global kernel_version %(rpm -qa kernel-devel | sed -e 's/kernel-devel-//g') %define QAT_release 00004 @@ -14,11 +14,10 @@ Patch1000: 1000-bugfix-support-5.10.patch Patch1001: 1001-bugfix-split-qat-vdcm-module.patch Patch1002: 1002-bugfix-crash-of-rmmod-vdcm.patch Patch1003: 1003-src-fix-warning-when-compiling.patch +Patch1004: 1004-build-split-kernel-space-and-user-space-building.patch BuildRequires: gcc gcc-c++ make systemd-devel openssl-devel zlib-devel yasm BuildRequires: libudev-devel >= 1.47 -BuildRequires: kernel-devel >= 5.10.112 -BuildRequires: kernel-core >= 5.10.112 BuildRequires: boost-devel Requires: kmod-%{name}-driver >= %{version} ExclusiveArch: x86_64 @@ -33,7 +32,7 @@ version %{version} %build unset ICP_ROOT ICP_ARCH_USER ICP_BUILDSYSTEM_PATH ICP_BUILD_OUTPUT ICP_ENV_DIR ICP_TOOLS_TARGET %configure -%make_build +%make_build all-us %make_build samples %pre @@ -48,15 +47,6 @@ mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}/usr/bin/QAT mkdir -p %{buildroot}/usr/bin/QAT/build mkdir -p %{buildroot}/lib/firmware -MODPATH=drivers/crypto/qat -KERNEL_VER=%{kernel_version} -SRCMODDIR=${RPM_BUILD_DIR}/%{name}-%{version}/quickassist/qat/${MODPATH} -DSTMODDIR=%{buildroot}/lib/modules/${KERNEL_VER}/updates/${MODPATH} -mkdir -p %{buildroot}/lib/modules/${KERNEL_VER}/kernel -mkdir -p ${DSTMODDIR}/qat_common/ -mkdir -p ${DSTMODDIR}/qat_4xxx/ -mkdir -p ${DSTMODDIR}/qat_4xxxvf/ -mkdir -p ${DSTMODDIR}/qat_vqat/ /usr/bin/install -D -m 750 quickassist/build_system/build_files/qat_service %{buildroot}/etc/init.d /usr/bin/install -D -m 664 quickassist/build_system/build_files/qat.service %{buildroot}//usr/bin/QAT/build /usr/bin/install -D -m 750 build/adf_ctl %{buildroot}%{_sbindir} @@ -238,6 +228,9 @@ fi ${RM} -rf /etc/udev/rules.d/00-qat.rules /etc/default/qat %changelog +* Tue Jul 17 2023 Artie Ding - 0.9.4-00004.11 +- Split kernel driver and user space package + * Wed Dec 28 2022 Xuchun Shang - 0.9.4-00004.10 - Add support for high-freq machine