Subdirectory kernel relocated to new repo starlingx/kernel

* Moved subdirectories from kernel/ into a new repo
* Removed references to kernel from this repo's file lists

Change-Id: I386418f51169dd9b8c977bae328060077ac44b93
Depends on: I4b171accd8b489c92f6d2c69cb7aa5c63e75f336
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
This commit is contained in:
Davlet Panech 2020-04-07 11:20:16 -04:00
parent 045ba2a0e2
commit bceb6c148c
174 changed files with 0 additions and 22759 deletions

View File

@ -1,3 +1,2 @@
mlnx-ofa_kernel-4.5-OFED.4.5.1.0.1.1.gb4fdfac.src.rpm
libibverbs-41mlnx1-OFED.4.5.0.1.0.45101.src.rpm
rdma-core-45mlnx1-1.45101.src.rpm

View File

@ -2,36 +2,10 @@
# If these have dependencies, they will be pulled in automatically
#
# kernel
perf
#
# Network Drivers
#
# iavf-kmod
kmod-iavf
# i40e-kmod
kmod-i40e
# ixgbevf-kmod
kmod-ixgbevf
# ixgbe-kmod
kmod-ixgbe
# qat17
qat17
#
# TPM2 libs to enable vTPM on Guest
#
# tpm-kmod
kmod-tpm
# tss2
tss2

View File

@ -2,33 +2,10 @@
# If these have dependencies, they will be pulled in automatically
#
#
# Network Drivers
#
# iavf-kmod
kmod-iavf-rt
# i40e-kmod
kmod-i40e-rt
# ixgbevf-kmod
kmod-ixgbevf-rt
# ixgbe-kmod
kmod-ixgbe-rt
# qat17
qat17-rt
#
# TPM2 libs to enable vTPM on Guest
#
# tpm-kmod
kmod-tpm-rt
# tss2
tss2

View File

@ -63,52 +63,6 @@ docker-distribution
# helm
helm
# e1000e-kmod
kmod-e1000e
kmod-e1000e-rt
# i40e-kmod
kmod-i40e
kmod-i40e-rt
# iavf-kmod
kmod-iavf
kmod-iavf-rt
# ixgbevf-kmod
kmod-ixgbevf
kmod-ixgbevf-rt
# ixgbe-kmod
kmod-ixgbe
kmod-ixgbe-rt
# qat17
qat17
qat17-rt
# tpm-kmod
kmod-tpm
kmod-tpm-rt
# integrity-kmod
kmod-integrity
kmod-integrity-rt
# drbd-kernel
kmod-drbd
kmod-drbd-rt
# opae-intel-fpga-driver
kmod-opae-fpga-driver
kmod-opae-fpga-driver-rt
# rpm
rpm-plugin-systemd-inhibit
@ -198,13 +152,6 @@ tpm2-tools
# audit
# kernel
kernel
kernel-tools
kernel-tools-libs
perf
python-perf
# puppet
puppet
@ -252,16 +199,8 @@ python-keyring
grub2-tools
grub2-efi-x64-modules
# kernel-rt
kernel-rt
kernel-rt-kvm
kernel-rt-tools
# mellanox drivers
rdma-core
mlnx-ofa_kernel-modules
mlnx-ofa_kernel-rt-modules
# python2-ruamel-yaml
python2-ruamel-yaml

View File

@ -26,7 +26,6 @@ security/tpm2-tools
security/libtpms
security/swtpm
security/spectre-meltdown-checker
kernel/kernel-std
config/puppet-4.8.2
config/puppet-modules/puppet-boolean-1.0.2
config/puppet-modules/puppet-create_resources
@ -54,7 +53,6 @@ storage-drivers/python-lefthandclient
storage-drivers/trident-installer
security/tboot
networking/mellanox/libibverbs
kernel/kernel-modules/mlnx-ofa_kernel
networking/mellanox/rdma-core
docker/python-docker
kubernetes/containerd
@ -63,16 +61,6 @@ kubernetes/docker-distribution
kubernetes/etcd
kubernetes/helm
grub/grubby
kernel/kernel-modules/intel-e1000e
kernel/kernel-modules/intel-iavf
kernel/kernel-modules/intel-i40e
kernel/kernel-modules/intel-ixgbevf
kernel/kernel-modules/intel-ixgbe
kernel/kernel-modules/qat17
kernel/kernel-modules/tpmdd
kernel/kernel-modules/integrity
kernel/kernel-modules/drbd
kernel/kernel-modules/intel-opae-fpga
base/dpkg
base/cluster-resource-agents
base/libfdt

View File

@ -1,14 +1,2 @@
kernel/kernel-rt
networking/mellanox/libibverbs
kernel/kernel-modules/mlnx-ofa_kernel
networking/mellanox/rdma-core
kernel/kernel-modules/intel-e1000e
kernel/kernel-modules/intel-iavf
kernel/kernel-modules/intel-i40e
kernel/kernel-modules/intel-ixgbevf
kernel/kernel-modules/intel-ixgbe
kernel/kernel-modules/qat17
kernel/kernel-modules/tpmdd
kernel/kernel-modules/integrity
kernel/kernel-modules/drbd
kernel/kernel-modules/intel-opae-fpga

View File

@ -7,12 +7,10 @@ grub2-2.02-0.76.el7.centos.src.rpm
grubby-8.28-25.el7.src.rpm
haproxy-1.5.18-8.el7.src.rpm
initscripts-9.49.46-1.el7.src.rpm
kernel-3.10.0-1062.1.2.el7.src.rpm
libevent-2.0.21-4.el7.src.rpm
# libibverbs-41mlnx1-OFED.4.5.0.1.0.45101.src.rpm
lighttpd-1.4.54-1.el7.src.rpm
logrotate-3.8.6-17.el7.src.rpm
# mlnx-ofa_kernel-4.5-OFED.4.5.1.0.1.1.gb4fdfac.src.rpm
net-snmp-5.7.2-37.el7.src.rpm
net-tools-2.0-0.24.20131004git.el7.src.rpm
ntp-4.2.6p5-29.el7.centos.src.rpm

View File

@ -1 +0,0 @@
kernel-rt-3.10.0-1062.1.2.rt56.1025.el7.src.rpm

View File

@ -10,10 +10,8 @@ crictl-v1.16.0-linux-amd64.tar.gz#crictl#https://github.com/kubernetes-sigs/cri-
dpdk-18.11.tar.xz#dpdk-18.11#http://fast.dpdk.org/rel/dpdk-18.11.tar.xz#http##
dpdk-6ece49ad5a26f5e2f5c4af6c06c30376c0ddc387.tar.gz#dpdk#https://api.github.com/repos/spdk/dpdk/tarball/6ece49ad5a26f5e2f5c4af6c06c30376c0ddc387#https##
dpkg_1.18.24.tar.xz#dpkg-1.18.24#http://http.debian.net/debian/pool/main/d/dpkg/dpkg_1.18.24.tar.xz#http##
drbd-8.4.11-1.tar.gz#drbd-8.4.11-1#http://www.linbit.com/downloads/drbd/8.4/drbd-8.4.11-1.tar.gz#http##
drbd-8.4.3.tar.gz#drbd-8.4.3#http://www.linbit.com/downloads/drbd/8.4/archive/drbd-8.4.3.tar.gz#http##
dtc-1.4.4.tar.gz#dtc-1.4.4#https://www.kernel.org/pub/software/utils/dtc/dtc-1.4.4.tar.gz#http##
e1000e-3.4.2.1.tar.gz#e1000e-3.4.2.1#https://sourceforge.net/projects/e1000/files/e1000e%20stable/3.4.2.1/e1000e-3.4.2.1.tar.gz#http##
etcd-v3.3.15.tar.gz#etcd-v3.3.15#https://github.com/etcd-io/etcd/archive/v3.3.15.tar.gz#http##
gf-complete-7e61b44404f0ed410c83cfd3947a52e88ae044e1.tar.gz#gf-complete#https://api.github.com/repos/ceph/gf-complete/tarball/7e61b44404f0ed410c83cfd3947a52e88ae044e1#https##
# gnocchi-4.2.5.tar.gz#gnocchi-4.2.5#https://pypi.io/packages/source/g/gnocchi/gnocchi-4.2.5.tar.gz#http##
@ -25,13 +23,8 @@ googletest-fdb850479284e2aae047b87df6beae84236d0135.tar.gz#googletest#https://ap
# gorilla-context-08b5f424b9271eedf6f9f0ce86cb9396ed337a42.tar.gz#gorilla-context#https://github.com/gorilla/context/archive/08b5f424b9271eedf6f9f0ce86cb9396ed337a42.tar.gz#http##
# gorilla-mux-456bcfa82d672db7cae587c9b541463f65bc2718.tar.gz#gorilla-mux#https://github.com/gorilla/mux/archive/456bcfa82d672db7cae587c9b541463f65bc2718.tar.gz#http##
helm-v2.13.1-linux-amd64.tar.gz#linux-amd64#https://storage.googleapis.com/kubernetes-helm/helm-v2.13.1-linux-amd64.tar.gz#http##
i40e-2.10.19.82.tar.gz#i40e-2.10.19.82#https://sourceforge.net/projects/e1000/files/i40e%20stable/2.10.19.82/i40e-2.10.19.82.tar.gz/download#http##
iavf-3.7.61.20.tar.gz#iavf-3.7.61.20#https://sourceforge.net/projects/e1000/files/iavf%20stable/3.7.61.20/iavf-3.7.61.20.tar.gz/download#http##
!integrity-kmod-e6aef069.tar.gz#integrity#http://git.infradead.org/users/jjs/linux-tpmdd.git/snapshot/e6aef069b6e97790cb127d5eeb86ae9ff0b7b0e3.tar.gz#http_script##post-dl-script/integrity-kmod.sh
isa-l-7e1a337433a340bc0974ed0f04301bdaca374af6.tar.gz#isa-l#https://api.github.com/repos/ceph/isa-l/tarball/7e1a337433a340bc0974ed0f04301bdaca374af6#https##
isa-l_crypto-603529a4e06ac8a1662c13d6b31f122e21830352.tar.gz#isa-l_crypto#https://api.github.com/repos/01org/isa-l_crypto/tarball/603529a4e06ac8a1662c13d6b31f122e21830352#https##
ixgbe-5.5.5.tar.gz#ixgbe-5.5.5#https://sourceforge.net/projects/e1000/files/ixgbe%20stable/5.5.5/ixgbe-5.5.5.tar.gz/download#http##
ixgbevf-4.5.3.tar.gz#ixgbevf-4.5.3#https://sourceforge.net/projects/e1000/files/ixgbevf%20stable/4.5.3/ixgbevf-4.5.3.tar.gz/download#http##
jerasure-96c76b89d661c163f65a014b8042c9354ccf7f31.tar.gz#jerasure#https://api.github.com/repos/ceph/jerasure/tarball/96c76b89d661c163f65a014b8042c9354ccf7f31#https##
keycodemapdb-16e5b07.tar.gz#keycodemapdb#https://github.com/CendioOssman/keycodemapdb/tarball/16e5b0787687d8904dad2c026107409eb9bfcb95#http##
kubernetes-contrib-v1.16.2.tar.gz#kubernetes-contrib-1.16.2#https://github.com/kubernetes-retired/contrib/tarball/89f6948e24578fed2a90a87871b2263729f90ac3#http##
@ -43,7 +36,6 @@ lldpd-0.9.0.tar.gz#lldpd-0.9.0#https://media.luffy.cx/files/lldpd/lldpd-0.9.0.ta
lua-1fce39c6397056db645718b8f5821571d97869a4.tar.gz#lua#https://api.github.com/repos/ceph/lua/tarball/1fce39c6397056db645718b8f5821571d97869a4#https##
!mariadb-10.1.28.tar.gz#mariadb-10.1.28#https://github.com/MariaDB/server/archive/mariadb-10.1.28.tar.gz#http_script##post-dl-script/mariadb.sh
!MLNX_OFED_SRC-4.5-1.0.1.0.tgz#MLNX_OFED_SRC-4.5-1.0.1.0#http://content.mellanox.com/ofed/MLNX_OFED-4.5-1.0.1.0/MLNX_OFED_SRC-4.5-1.0.1.0.tgz#http_script##post-dl-script/MLNX_OFEDqat1.7.sh
opae-intel-fpga-driver-2.0.1.tar.gz#opae-intel-fpga-driver-2.0.1#https://github.com/OPAE/opae-sdk/releases/download/1.3.6-4/opae-intel-fpga-driver-2.0.1.tar.gz#http##
openvswitch-2.11.0.tar.gz#openvswitch-2.11.0#https://github.com/openvswitch/ovs/archive/v2.11.0.tar.gz#http##
puppet-boolean-22b726dd78b0a60a224cc7054aebbf28e9306f62.tar.gz#puppet-boolean#https://github.com/voxpupuli/puppet-boolean/tarball/22b726dd78b0a60a224cc7054aebbf28e9306f62#http##
puppet-dnsmasq-cff07e90890662972c97684a2baee964f68ff3ed.tar.gz#packstack/puppet/modules/dnsmasq/#https://github.com/procore/puppet-dnsmasq/tarball/cff07e90890662972c97684a2baee964f68ff3ed#http##
@ -61,7 +53,6 @@ mechanize-0.4.5.tar.gz#mechanize-0.4.5#https://github.com/python-mechanize/mecha
html5lib-python-1.0.1.tar.gz#html5lib-1.0.1#https://github.com/html5lib/html5lib-python/archive/1.0.1.tar.gz#http##
python-webencodings-0.5.1.tar.gz#webencodings-0.5.1#https://github.com/gsnedders/python-webencodings/archive/v0.5.1.tar.gz#http##
python-setuptools-v38.5.1.tar.gz#setuptools-38.5.1#https://github.com/pypa/setuptools/archive/v38.5.1.tar.gz#http##
!qat1.7.l.4.5.0-00034.tar.gz#quickassist#https://01.org/sites/default/files/downloads/qat1.7.l.4.5.0-00034.tar.gz#http_script##post-dl-script/qat1.7.sh
rapidjson-f54b0e47a08782a6131cc3d60f94d038fa6e0a51.tar.gz#rapidjson#https://api.github.com/repos/ceph/rapidjson/tarball/f54b0e47a08782a6131cc3d60f94d038fa6e0a51#https##
Redfishtool-1.1.0.tar.gz#Redfishtool-1.1.0#https://github.com/DMTF/Redfishtool/archive/1.1.0.tar.gz#http##
requests-toolbelt-0.9.1.tar.gz#requests-toolbelt-0.9.1#https://github.com/requests/toolbelt/archive/0.9.1.tar.gz#http##
@ -71,7 +62,6 @@ runc-1.0.0-rc8.tar.gz#runc#https://github.com/opencontainers/runc/archive/v1.0.0
spdk-f474ce6930f0a44360e1cc4ecd606d2348481c4c.tar.gz#spdk#https://api.github.com/repos/ceph/spdk/tarball/f474ce6930f0a44360e1cc4ecd606d2348481c4c#https##
spectre-meltdown-checker-0.37+-5cc77741.tar.gz#spectre-meltdown-checker#https://github.com/speed47/spectre-meltdown-checker/tarball/5cc77741af1d2f52140aa9f89339f56b6c4b6783#http##
swtpm-0.1.0-253eac5.tar.gz#swtpm-0.1.0#https://github.com/stefanberger/swtpm/tarball/1303be7d03294fb02204cb8242f366cbf0da076d#http##
!tpm-kmod-e6aef069.tar.gz#tpm#http://git.infradead.org/users/jjs/linux-tpmdd.git/snapshot/e6aef069b6e97790cb127d5eeb86ae9ff0b7b0e3.tar.gz#http_script#post-dl-script/tpm-kmod.sh
trident-installer-20.01.0.tar.gz#trident-installer-20.01.0#https://github.com/NetApp/trident/releases/download/v20.01.0/trident-installer-20.01.0.tar.gz#https##
!tss2-930.tar.gz#tss2-930#https://git.code.sf.net/p/ibmtpm20tss/tss#git#v930#
xxHash-1f40c6511fa8dd9d2e337ca8c9bc18b3e87663c9.tar.gz#xxHash#https://api.github.com/repos/ceph/xxHash/tarball/1f40c6511fa8dd9d2e337ca8c9bc18b3e87663c9#https##

View File

@ -1,16 +0,0 @@
Metadata-Version: 1.1
Name: drbd-kernel
Version: 8.4.7
Summary: Kernel driver for DRBD
Home-page:
Author:
Author-email:
License: GPLv2+
Description:
This module is the kernel-dependent driver for DRBD. This is split out so
that multiple kernel driver versions can be installed, one for each
installed kernel.
Platform: UNKNOWN

View File

@ -1,4 +0,0 @@
COPY_LIST="$FILES_BASE/* \
$DISTRO/patches/* \
$CGCS_BASE/downloads/drbd-8.4.11-1.tar.gz"
TIS_PATCH_VER=0

View File

@ -1,159 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name drbd
Name: drbd-kernel%{?bt_ext}
Summary: Kernel driver for DRBD
Version: 8.4.11
%define upstream_release 1
Release: %{upstream_release}%{?_tis_dist}.%{tis_patch_ver}
%global tarball_version %(echo "%{version}-%{?upstream_release}" | sed -e "s,%{?dist}$,,")
Group: System Environment/Kernel
License: GPLv2+
Summary: %{kmod_name} kernel module(s)
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
ExclusiveArch: x86_64
# Sources.
Source0: http://oss.linbit.com/drbd/drbd-%{tarball_version}.tar.gz
# WRS
Patch0001: 0001-remove_bind_before_connect_error.patch
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
Summary: drbd kernel module(s)
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: drbd-kernel = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
BuildRequires: kernel%{?bt_ext}-devel
%description
This module is the kernel-dependent driver for DRBD. This is split out so
that multiple kernel driver versions can be installed, one for each
installed kernel.
%package -n kmod-drbd%{?bt_ext}
Summary: drbd kernel module(s)
%description -n kmod-drbd%{?bt_ext}
This module is the kernel-dependent driver for DRBD. This is split out so
that multiple kernel driver versions can be installed, one for each
installed kernel.
%post -n kmod-drbd%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/extra/drbd | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-drbd%{?bt_ext}
rpm -ql kmod-drbd%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-drbd%{?bt_ext}-modules
%postun -n kmod-drbd%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-drbd%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-drbd%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-drbd%{?bt_ext}
%defattr(644,root,root,755)
/lib/modules/%{kversion}/
%config(noreplace)/etc/depmod.d/drbd.conf
%doc /usr/share/doc/kmod-drbd-%{version}/
# Disable the building of the debug package(s).
%define debug_package %{nil}
%prep
%setup -q -n drbd-%{tarball_version}
%patch0001 -p1
%build
rm -rf obj
mkdir obj
ln -s ../scripts obj/
cp -r drbd obj/default
make -C obj/default %{_smp_mflags} all KDIR=/usr/src/kernels/%{kversion}
%install
pwd
%{__install} -d %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} obj/default/%{kmod_name}.ko %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} ChangeLog %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} COPYING %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
mv obj/default/.kernel.config.gz obj/k-config-$kernelrelease.gz
%{__install} obj/k-config-$kernelrelease.gz %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
echo "override drbd * weak-updates" > %{buildroot}%{_sysconfdir}/depmod.d/drbd.conf
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Wed Dec 16 2015 Philipp Reisner <phil@linbit.com> - 8.4.7-1
- New upstream release.
* Wed Sep 16 2015 Lars Ellenberg <lars@linbit.com> - 8.4.6-5
- New upstream release.
* Thu Jul 30 2015 Lars Ellenberg <lars@linbit.com> - 8.4.6-4
- New upstream release.
* Fri Apr 3 2015 Philipp Reisner <phil@linbit.com> - 8.4.6-1
- New upstream release.
* Mon Jun 2 2014 Philipp Reisner <phil@linbit.com> - 8.4.5-1
- New upstream release.
* Fri Oct 11 2013 Philipp Reisner <phil@linbit.com> - 8.4.4-1
- New upstream release.
* Tue Feb 5 2013 Philipp Reisner <phil@linbit.com> - 8.4.3-1
- New upstream release.
* Thu Sep 6 2012 Philipp Reisner <phil@linbit.com> - 8.4.2-1
- New upstream release.
* Tue Dec 20 2011 Philipp Reisner <phil@linbit.com> - 8.4.1-1
- New upstream release.
* Mon Jul 18 2011 Philipp Reisner <phil@linbit.com> - 8.4.0-1
- New upstream release.
* Fri Jan 28 2011 Philipp Reisner <phil@linbit.com> - 8.3.10-1
- New upstream release.
* Thu Nov 25 2010 Andreas Gruenbacher <agruen@linbit.com> - 8.3.9-1
- Convert to a Kernel Module Package.

View File

@ -1,11 +0,0 @@
%defattr(644,root,root,755)
%doc COPYING
%doc ChangeLog
%if 0%(grep -q "release 5" /etc/redhat-release && echo 1)
/lib/modules/%verrel%variant
%doc obj/k-config-%verrel%variant.gz
%else
/lib/modules/%verrel%dotvariant
%doc obj/k-config-%verrel%dotvariant.gz
%endif
%config /etc/depmod.d/drbd.conf

View File

@ -1,12 +0,0 @@
Index: drbd-8.4.7-1/drbd/drbd_receiver.c
===================================================================
--- drbd-8.4.7-1.orig/drbd/drbd_receiver.c
+++ drbd-8.4.7-1/drbd/drbd_receiver.c
@@ -719,6 +719,7 @@ out:
/* peer not (yet) available, network problem */
case ECONNREFUSED: case ENETUNREACH:
case EHOSTDOWN: case EHOSTUNREACH:
+ case EADDRNOTAVAIL:
disconnect_on_error = 0;
break;
default:

View File

@ -1,5 +0,0 @@
COPY_LIST=" \
$FILES_BASE/* \
$PATCHES_BASE/* \
$STX_BASE/downloads/integrity-kmod-e6aef069.tar.gz"
TIS_PATCH_VER=7

View File

@ -1,344 +0,0 @@
"This software program is licensed subject to the GNU General Public License
(GPL). Version 2, June 1991, available at
<http://www.gnu.org/licenses/gpl-2.0.html>"
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,231 +0,0 @@
Integrity and IMA Modules for CentOS 7 (Linux version 3.10)
===============================================================================
===============================================================================
Kam Nasim <kam.nasim@windriver.com>
Copyright (c) 2017 Wind River Systems, Inc.
SPDX-License-Identifier: Apache-2.0
August, 2017
===============================================================================
Contents
--------
- Overview
- Rebasing Guidelines
- Changesets
================================================================================
Important Notes
---------------
No support for APPENDING IMA policies
----------------------------------------------
A provision was introduced in April 2014 to allow multiple IMA policies to be
appended.This change involved setting up inode hooks which could not be
backported in the 3.10 Kernel. Therefore we do not allow the following operation
types:
echo /etc/ima/ima_policy > /sys/kernel/security/ima/policy
only an overwrite is possible:
cat policy-file > <securityfs>/ima/policy
EVM support disabled in Kernel
------------------------------------------------
The EVM Kernel Configuration option was mutually exclusive to the CONFIG_INTEGRITY
Kernel configuration option. Since Integrity is being disabled in the Kernel, EVM
would also need to be built out-of-tree as a Kernel module and would require some
refactoring if it is to be used with this module pack.
IMA Keyring allocated inside the Kernel
-----------------------------------------
Normally, the _ima Keyring is allocated from user space, but this has the
added disadvantage of persisting the public key on the file system. Corruption
of this public key may cripple the system by triggering APPRAISAL failures if
ima 'Enforcement' is enabled. To prevent this, the IMA public key is compiled
into the Kernel and is placed in the Kernel SOURCE (ima_signing_key.pub)
Overview
--------
This module pack builds Integrity and IMA kernel modules for the 3.10 kernel version.
If newer kernel version are to be supported in the future then the COMPAT
layer (kcompat.h) will need to be adjusted to address kernel-driver compatibility
issues. As well as certain LINUX_VERSION_CODE <= KERNEL_VERSION(3,10,0) ifdefs
It supports Linux supported x86_64 systems.
These drivers are only supported as a loadable module at this time.
Rebasing Guidelines
--------------------
On rebasing TiC software heed the following:
- always rebase the Kernel first before rebasing this package
- get the HEAD from the tpmdd repo and generate a tarball, the tarball
should follow the naming convention: tpm-kmod-<gitHEAD>; use the short-hand
form of the git commit ID (8 characters)
- update the integrity-kmod spec to Source the new tarball
- apply all existing patches against the new tarball, and adjust the kcompat
layer (LINUX_VERSION_CODE ifdefs, kcompat.h and common.mk) accordingly
IMA Signing Key Generation Guidelines
--------------------------------------
The following may be used to generate an IMA key pair:
openssl req -newkey rsa:2048 -nodes -days 10950 -x509 -outform DER -out ima_signing_key.pub -keyout ima_signing_key.priv
The "ima_signing_key.pub" MUST be placed in the Kernel source (files/) so that the
Kernel build can pick it up and compile it in.
================================================================================
Change Sets
-------------------------
This driver is a fork from the tpmdd repo:
https://sourceforge.net/projects/tpmdd/
http://git.infradead.org/users/jjs/linux-tpmdd.git/
Sync Head: 668a827057187403999b7ecfcf86b59979c8c3b2
COMPAT NOTES:
1. In newer kernels, VFS layer read operations have been refactored:
VFS: refactor vfs_read()
integrity_kernel_read() duplicates the file read operations code
in vfs_read(). This patch refactors vfs_read() code creating a
helper function __vfs_read(). It is used by both vfs_read() and
integrity_kernel_read().
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
The compat layer therefore needs to redefine the integrity vfs code to use
the original implementation
2. In newer kernels, a wrapper has been developed around inode mutex un/lock
commit 5955102c9984fa081b2d570cfac75c97eecf8f3b
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Fri Jan 22 15:40:57 2016 -0500
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
inode_foo(inode) being mutex_foo(&inode->i_mutex).
Please, use those for access to ->i_mutex; over the coming cycle
->i_mutex will become rwsem, with ->lookup() done with it held
only shared.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
The compat layer needs to replace all instances of inode locking
with the underlying mutex locking/unlocking calls
3. In newer kernels, security PRE and POST Hooks are defined which
have their seperate appraisal calls
commit 39eeb4fb97f60dbdfc823c1a673a8844b9226b60
Author: Mimi Zohar <zohar@linux.vnet.ibm.com>
Date: Sat Jan 30 22:23:26 2016 -0500
security: define kernel_read_file hook
The kernel_read_file security hook is called prior to reading the file
into memory.
Changelog v4+:
- export security_kernel_read_file()
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
The compat layer needs to ignore all PRE and POST File hooks and
cannot support such PRE and POST appraisals
4. In newer kernels, IMA policies can be applied by path as opposed to
content allowing multiple policies to be appended
commit 7429b092811fb20c6a5b261c2c116a6a90cb9a29
Author: Dmitry Kasatkin <dmitry.kasatkin@huawei.com>
Date: Fri Apr 11 17:47:01 2014 +0300
ima: load policy using path
We currently cannot do appraisal or signature vetting of IMA policies
since we currently can only load IMA policies by writing the contents
of the policy directly in, as follows:
cat policy-file > <securityfs>/ima/policy
If we provide the kernel the path to the IMA policy so it can load
the policy itself it'd be able to later appraise or vet the file
signature if it has one. This patch adds support to load the IMA
policy with a given path as follows:
echo /etc/ima/ima_policy > /sys/kernel/security/ima/policy
Changelog v4+:
- moved kernel_read_file_from_path() error messages to callers
v3:
- moved kernel_read_file_from_path() to a separate patch
v2:
- after re-ordering the patches, replace calling integrity_kernel_read()
to read the file with kernel_read_file_from_path() (Mimi)
- Patch description re-written by Luis R. Rodriguez
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@huawei.com>
This feature was removed from the IMA modules since it required extensive
backporting to the INODE and VFS layers inthe base kernel
5. In newer kernels, IMA allows measurement lists to be preserved over
Kernel reinstalls or kexecs
commit d9ddf077bb85b54200dfcb5f2edec4f0d6a7c2ca
Author: Mimi Zohar <zohar@linux.vnet.ibm.com>
Date: Thu Jan 14 20:59:14 2016 -0500
ima: support for kexec image and initramfs
Add IMA policy support for measuring/appraising the kexec image and
initramfs. Two new IMA policy identifiers KEXEC_KERNEL_CHECK and
KEXEC_INITRAMFS_CHECK are defined.
Example policy rules:
measure func=KEXEC_KERNEL_CHECK
appraise func=KEXEC_KERNEL_CHECK appraise_type=imasig
measure func=KEXEC_INITRAMFS_CHECK
appraise func=KEXEC_INITRAMFS_CHECK appraise_type=imasig
Moving the enumeration to the vfs layer simplified the patches, allowing
the IMA changes, for the most part, to be separated from the other
changes. Unfortunately, passing either a kernel_read_file_id or a
ima_hooks enumeration within IMA is messy.
This feature was removed from the IMA modules since it required defining a
new Kexec cache in the base Kernel which was an extensive backporting effort

View File

@ -1 +0,0 @@
options ima ima_appraise_param="log" ima_use_tpm=0

View File

@ -1,4 +0,0 @@
# EXT4_SUPER_MAGIC
measure func=FILE_CHECK uid=0 fsmagic=0xEF53
appraise func=FILE_MMAP mask=MAY_EXEC uid=0 appraise_type=imasig fsmagic=0xEF53
appraise func=BPRM_CHECK mask=MAY_EXEC uid=0 appraise_type=imasig fsmagic=0xEF53

View File

@ -1 +0,0 @@
options integrity integrity_audit=0

View File

@ -1,3 +0,0 @@
tpm_tis
integrity
ima

View File

@ -1,139 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name integrity
Name: %{kmod_name}-kmod%{?bt_ext}
# the version is the Kernel version from which
# this driver is extracted
Version: 4.12
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name}%{?bt_ext} kernel module(s)
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, tpm-kmod%{?bt_ext}-symbols, openssl
ExclusiveArch: x86_64
# Sources.
# the integrity is available as a tarball, with
# the git commit Id referenced in the name
Source0: %{kmod_name}-kmod-e6aef069.tar.gz
Source1: modules-load.conf
Source2: COPYING
Source3: README
Source4: integrity.conf
Source5: ima.conf
Source6: ima.policy
# Patches
Patch01: 0001-integrity-kcompat-support.patch
Patch02: 0002-integrity-expose-module-params.patch
Patch03: 0003-integrity-restrict-by-iversion.patch
Patch04: 0004-integrity-disable-set-xattr-on-imasig.patch
Patch05: Changes-for-CentOS-7.4-support.patch
Patch06: Changes-for-CentOS-7.6-support.patch
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
%package -n kmod-integrity%{?bt_ext}
Summary: Integrity kernel module(s) and driver
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: integrity-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
%description -n kmod-integrity%{?bt_ext}
This package provides the %{version} Integrity / IMA kernel module(s) and drivers built
for the Linux kernel using the %{_target_cpu} family of processors.
%post -n kmod-integrity%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/kernel/security/integrity/ | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-integrity%{?bt_ext}
rpm -ql kmod-integrity%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-integrity%{?bt_ext}-modules
%postun -n kmod-integrity%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-integrity%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-integrity%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-integrity%{?bt_ext}
%defattr(-,root,root,-)
/lib/modules/%{kversion}/
%doc /usr/share/doc/kmod-integrity/
%{_sysconfdir}/modules-load.d/ima.conf
%config(noreplace) %{_sysconfdir}/modprobe.d/integrity.conf
%config(noreplace) %{_sysconfdir}/modprobe.d/ima.conf
%{_sysconfdir}/ima.policy
# Disable the building of the debug package(s).
%define debug_package %{nil}
%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p 1 -n %{kmod_name}
%build
# build out all the Integrity / IMA kernel modules
%{__make} KSRC=%{_usrsrc}/kernels/%{kversion} KBUILD_EXTRA_SYMBOLS=%{_usrsrc}/debug/tpm/Module.symvers
%install
%{__install} -d %{buildroot}/lib/modules/%{kversion}/kernel/security/%{kmod_name}/
%{__install} *.ko %{buildroot}/lib/modules/%{kversion}/kernel/security/%{kmod_name}/
%{__install} -d %{buildroot}/lib/modules/%{kversion}/kernel/security/%{kmod_name}/ima/
%{__install} ima/*.ko %{buildroot}/lib/modules/%{kversion}/kernel/security/%{kmod_name}/ima/
%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
%{__install} -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/modules-load.d/ima.conf
%{__install} -d %{buildroot}%{_sysconfdir}/modprobe.d
%{__install} -p -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/modprobe.d/integrity.conf
%{__install} -p -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/modprobe.d/ima.conf
%{__install} -p -m 0400 %{SOURCE6} %{buildroot}%{_sysconfdir}/ima.policy
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}/
%{__install} %{SOURCE2} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}/
%{__install} %{SOURCE3} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}/
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Mon Aug 21 2017 Kam Nasim <kam.nasim@windriver.com> 4.12
- Initial RPM package.

View File

@ -1,156 +0,0 @@
From 6d0d8278d37b3874e0b272a6d01663fbfc91cdcb Mon Sep 17 00:00:00 2001
From: Kam Nasim <kam.nasim@windriver.com>
Date: Fri, 22 Sep 2017 14:19:39 -0400
Subject: [PATCH] US103091: IMA: System Configuration
Expose integrity_audit and ima_appraise (which were only available
as boot parameters), as Module parameters since it is perceived that
customers would want to tune these at runtime. The integrity_audit
parameter can be toggled at runtime, however the ima_appraise modparam
will require a node reboot inorder to change appraise type.
In addition we introduce a new module param to disable IMA-TPM
interactions. Ths is tunable at runtime.
---
ima/ima_appraise.c | 47 +++++++++++++++++++++++++++++++++++++++++++++--
ima/ima_init.c | 18 ++++++++++++------
integrity_audit.c | 2 ++
kcompat.h | 4 ++++
4 files changed, 63 insertions(+), 8 deletions(-)
diff --git a/ima/ima_appraise.c b/ima/ima_appraise.c
index b0d4286..88b5091 100644
--- a/ima/ima_appraise.c
+++ b/ima/ima_appraise.c
@@ -21,7 +21,21 @@
#include "ima.h"
-static int __init default_appraise_setup(char *str)
+static char *ima_appraise_param = "log";
+static int ima_appraise_param_set(const char *,
+ const struct kernel_param *);
+static struct kernel_param_ops ima_appraise_param_ops = {
+ .set = ima_appraise_param_set,
+ .get = param_get_charp,
+};
+module_param_cb(ima_appraise_param, &ima_appraise_param_ops,
+ &ima_appraise_param, 0444);
+MODULE_PARM_DESC(ima_appraise_param,
+ "IMA appraise type " \
+ "{ \"off\" | \"enforce\" | \"fix\" | \"log\" }" \
+ "(default: log).");
+
+static int default_appraise_setup(char *str)
{
if (strncmp(str, "off", 3) == 0)
ima_appraise = 0;
@@ -29,11 +43,40 @@ static int __init default_appraise_setup(char *str)
ima_appraise = IMA_APPRAISE_LOG;
else if (strncmp(str, "fix", 3) == 0)
ima_appraise = IMA_APPRAISE_FIX;
- return 1;
+ else if (strncmp(str, "enforce", 7) == 0)
+ ima_appraise = IMA_APPRAISE_ENFORCE;
+ else {
+ return -1;
+ }
+ return 1;
}
__setup("ima_appraise=", default_appraise_setup);
+
+static int ima_appraise_param_set(const char *val,
+ const struct kernel_param *kp)
+{
+ char *ima_appraise_type = strstrip((char *)val);
+
+ /* no change required */
+ if (!strcmp(ima_appraise_type, *(char **)kp->arg))
+ return 0;
+
+ /* set the ima_appraise mode and only
+ * update the kernel parameter if the parameter
+ * was successfully set */
+ int ret;
+ ret = default_appraise_setup(ima_appraise_type);
+ if (ret == -1) {
+ pr_err("Undefined value for ima_appraise_param: %s\n",
+ ima_appraise_type);
+ return -EINVAL;
+ }
+
+ return param_set_charp(ima_appraise_type, kp);
+}
+
/*
* ima_must_appraise - set appraise flag
*
diff --git a/ima/ima_init.c b/ima/ima_init.c
index 0759c8c..a7362e8 100644
--- a/ima/ima_init.c
+++ b/ima/ima_init.c
@@ -26,7 +26,11 @@
/* name for boot aggregate entry */
static const char *boot_aggregate_name = "boot_aggregate";
-int ima_used_chip;
+int ima_used_chip = -1;
+module_param_named(ima_use_tpm, ima_used_chip, int, 0644);
+MODULE_PARM_DESC(ima_use_tpm,
+ "Enable TPM interaction for storing measurement aggregate " \
+ " { 0(disable) | 1(enable) }(default: 0).");
/* Add the boot aggregate to the IMA measurement list and extend
* the PCR register.
@@ -108,11 +112,13 @@ int __init ima_init(void)
{
u8 pcr_i[TPM_DIGEST_SIZE];
int rc;
-
- ima_used_chip = 0;
- rc = tpm_pcr_read(TPM_ANY_NUM, 0, pcr_i);
- if (rc == 0)
- ima_used_chip = 1;
+
+ if (ima_used_chip != 0) {
+ ima_used_chip = 0;
+ rc = tpm_pcr_read(TPM_ANY_NUM, 0, pcr_i);
+ if (rc == 0)
+ ima_used_chip = 1;
+ }
if (!ima_used_chip)
pr_info("No TPM chip found, activating TPM-bypass! (rc=%d)\n",
diff --git a/integrity_audit.c b/integrity_audit.c
index ba5e532..da29f91 100644
--- a/integrity_audit.c
+++ b/integrity_audit.c
@@ -17,6 +17,8 @@
#include "integrity.h"
static int integrity_audit_info;
+module_param_named(integrity_audit, integrity_audit_info, uint, 0644);
+MODULE_PARM_DESC(integrity_audit, "Enable debug integrity auditing.");
/* ima_audit_setup - enable informational auditing messages */
static int __init integrity_audit_setup(char *str)
diff --git a/kcompat.h b/kcompat.h
index 936b76c..a5445aa 100644
--- a/kcompat.h
+++ b/kcompat.h
@@ -9,6 +9,10 @@
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(3,10,0) )
+#include <linux/string.h>
+#include <linux/moduleparam.h>
+#include <linux/module.h>
+
/* kcompat definitions */
#define CONFIG_TCG_TPM_MODULE 1
--
1.8.3.1

View File

@ -1,54 +0,0 @@
From 0c83c892509e592692e5002d855ce1f3001149e5 Mon Sep 17 00:00:00 2001
From: Kam Nasim <kam.nasim@windriver.com>
Date: Fri, 22 Sep 2017 16:47:36 -0400
Subject: [PATCH] US103091: IMA: System Configuration
Since IMA does measurements on all EXT4 file systems (as per IMA
policy), we end up with a large number of measurements for log files and
the DRBD fs. Therefore we restrict IMA to only do measurements &
appraisals on file systems that have i_version set, which is only the
rootfs.
---
ima/ima_main.c | 6 +++++-
kcompat.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ima/ima_main.c b/ima/ima_main.c
index 5d6ba23..ea3ace3 100644
--- a/ima/ima_main.c
+++ b/ima/ima_main.c
@@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/file.h>
+#include <linux/fs.h>
#include <linux/binfmts.h>
#include <linux/mount.h>
#include <linux/mman.h>
@@ -178,7 +179,10 @@ static int process_measurement(struct file *file, char *buf, loff_t size,
bool violation_check;
enum hash_algo hash_algo;
- if (!ima_policy_flag || !S_ISREG(inode->i_mode))
+ /* WRS: Only do measurements & appraisals
+ * on inodes that have i_version set (i.e the rootfs)
+ */
+ if (!ima_policy_flag || !S_ISREG(inode->i_mode) || !IS_I_VERSION(inode))
return 0;
/* Return an IMA_MEASURE, IMA_APPRAISE, IMA_AUDIT action
diff --git a/kcompat.h b/kcompat.h
index a5445aa..59e32a8 100644
--- a/kcompat.h
+++ b/kcompat.h
@@ -19,6 +19,7 @@
#define CONFIG_IMA 1
#define CONFIG_IMA_APPRAISE_SIGNED_INIT 1
#define CONFIG_IMA_APPRAISE 1
+#define CONFIG_IMA_LSM_RULES 1
#define CONFIG_IMA_DEFAULT_HASH "sha256"
#define CONFIG_IMA_MEASURE_PCR_IDX 10
#define CONFIG_IMA_DEFAULT_TEMPLATE "ima-sig"
--
1.8.3.1

View File

@ -1,120 +0,0 @@
From 928f2de735ab38802984938618aa051dd55f536c Mon Sep 17 00:00:00 2001
From: Kam Nasim <kam.nasim@windriver.com>
Date: Wed, 4 Oct 2017 14:23:13 -0400
Subject: [PATCH] US103091: IMA: System Configuration
When appraise_type="imasig" is set in the IMA policy then don't allow
IMA to put a hash value for the security.ima xattr, if the extended
attribute is missing. This is a fool's errand, as there is already a
check in the driver which will give an appraisal failure if it detects
that the security.ima xattr is a Hash and NOT a Signature, so appraisal
would fail again next time that file is executed.
The advantage of this fix is that it improves driver performance as we
are not collecting a measurement on appraisal failure
By virtue of the same, we will not remove the security.ima xattr if we
detect that imasig is set on that iint
---
ima/ima_appraise.c | 33 +++++++++++++++++++++++++++++----
ima/ima_main.c | 2 --
2 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/ima/ima_appraise.c b/ima/ima_appraise.c
index 88b5091..cff2ad2 100644
--- a/ima/ima_appraise.c
+++ b/ima/ima_appraise.c
@@ -205,7 +208,11 @@ int ima_appraise_measurement(enum ima_hooks func,
if (rc && rc != -ENODATA)
goto out;
- cause = "missing-hash";
+ if (iint->flags & IMA_DIGSIG_REQUIRED)
+ cause = "missing-signature";
+ else
+ cause = "missing-hash";
+
status = INTEGRITY_NOLABEL;
if (opened & FILE_CREATED)
iint->flags |= IMA_NEW_FILE;
@@ -352,7 +355,8 @@ void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file)
int rc = 0;
/* do not collect and update hash for digital signatures */
- if (iint->flags & IMA_DIGSIG)
+ /* WRS: Don't do it if appraise_type is set to imasig */
+ if ((iint->flags & IMA_DIGSIG) || (iint->flags & IMA_DIGSIG_REQUIRED))
return;
rc = ima_collect_measurement(iint, file, NULL, 0, ima_hash_algo);
@@ -376,6 +380,7 @@ void __ima_inode_post_setattr(struct dentry *dentry)
struct inode *inode = d_backing_inode(dentry);
struct integrity_iint_cache *iint;
int must_appraise, rc;
+ int imasig = 0;
if (!(ima_policy_flag & IMA_APPRAISE) || !S_ISREG(inode->i_mode)
|| !inode->i_op->removexattr)
@@ -384,11 +389,20 @@ void __ima_inode_post_setattr(struct dentry *dentry)
must_appraise = ima_must_appraise(inode, MAY_ACCESS, POST_SETATTR);
iint = integrity_iint_find(inode);
if (iint) {
+ /* WRS: Before we clear all the ACTION RULE FLAGS, check if
+ * imasig was set on this iint, which implies that we are
+ * expecting a signature for the security.ima xattr
+ */
+ if (iint->flags & IMA_DIGSIG_REQUIRED)
+ imasig = 1;
iint->flags &= ~(IMA_APPRAISE | IMA_APPRAISED |
IMA_APPRAISE_SUBMASK | IMA_APPRAISED_SUBMASK |
IMA_ACTION_RULE_FLAGS);
- if (must_appraise)
+ if (must_appraise) {
iint->flags |= IMA_APPRAISE;
+ if (imasig)
+ iint->flags |= IMA_DIGSIG_REQUIRED;
+ }
}
if (!must_appraise)
rc = inode->i_op->removexattr(dentry, XATTR_NAME_IMA);
@@ -450,6 +464,17 @@ int __ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,
int __ima_inode_removexattr(struct dentry *dentry, const char *xattr_name)
{
int result;
+
+ /* WRS: If this security.ima xattr is a digital signature
+ * then we will not allow it to be removed (only if we
+ * have a cached iint entry for it)
+ */
+ struct inode *inode = d_backing_inode(dentry);
+ struct integrity_iint_cache *iint = integrity_iint_find(inode);
+ if (iint) {
+ if (iint->flags & IMA_DIGSIG_REQUIRED)
+ return -EPERM;
+ }
result = ima_protect_xattr(dentry, xattr_name, NULL, 0);
if (result == 1) {
diff --git a/ima/ima_main.c b/ima/ima_main.c
index ea3ace3..15ac6a7 100644
--- a/ima/ima_main.c
+++ b/ima/ima_main.c
@@ -129,7 +129,6 @@ static void ima_check_last_writer(struct integrity_iint_cache *iint,
if (!(mode & FMODE_WRITE))
return;
- inode_lock(inode);
if (atomic_read(&inode->i_writecount) == 1) {
if ((iint->version != inode->i_version) ||
(iint->flags & IMA_NEW_FILE)) {
@@ -139,7 +138,6 @@ static void ima_check_last_writer(struct integrity_iint_cache *iint,
ima_update_xattr(iint, file);
}
}
- inode_unlock(inode);
}
/**
--
1.8.3.1

View File

@ -1,28 +0,0 @@
From cf5d8b554d6fdacf3ad3d18333bd00f8b937ff54 Mon Sep 17 00:00:00 2001
Message-Id: <cf5d8b554d6fdacf3ad3d18333bd00f8b937ff54.1507754332.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Wed, 11 Oct 2017 16:38:36 -0400
Subject: [PATCH 1/1] Changes for CentOS 7.4 support
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
kcompat.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/kcompat.h b/kcompat.h
index 59e32a8..3d4e8f6 100644
--- a/kcompat.h
+++ b/kcompat.h
@@ -31,9 +31,5 @@
#define __GFP_RECLAIM __GFP_WAIT
-#define inode_lock(_node) mutex_lock(&_node->i_mutex)
-#define inode_unlock(_node) mutex_unlock(&_node->i_mutex)
-
-
#endif
#endif
--
1.8.3.1

View File

@ -1,78 +0,0 @@
From 5b60e1a889246a5a0d131e74ceaf240fc0637c9f Mon Sep 17 00:00:00 2001
From: Shuicheng Lin <shuicheng.lin@intel.com>
Date: Sat, 29 Dec 2018 02:51:39 +0800
Subject: [PATCH] pick upstream patch to fix build failure with CentOS 7.6
3.10.0-957.1.3 kernel
Pick upstream patch from "git://git.infradead.org/users/jjs/linux-tpmdd.git"
"
From aad887f6641145fec2a801da2ce4ed36cf99c6a5 Mon Sep 17 00:00:00 2001
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date: Sun, 5 Nov 2017 13:16:26 +0200
Subject: [PATCH] tpm: use struct tpm_chip for tpm_chip_find_get()
Device number (the character device index) is not a stable identifier
for a TPM chip. That is the reason why every call site passes
TPM_ANY_NUM to tpm_chip_find_get().
This commit changes the API in a way that instead a struct tpm_chip
instance is given and NULL means the default chip. In addition, this
commit refines the documentation to be up to date with the
implementation.
Suggested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> (@chip_num -> @chip part)
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@ziepe.ca>
Tested-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
"
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
---
ima/ima_crypto.c | 2 +-
ima/ima_init.c | 2 +-
ima/ima_queue.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ima/ima_crypto.c b/ima/ima_crypto.c
index 802d5d2..3371d13 100644
--- a/ima/ima_crypto.c
+++ b/ima/ima_crypto.c
@@ -644,7 +644,7 @@ static void __init ima_pcrread(int idx, u8 *pcr)
if (!ima_used_chip)
return;
- if (tpm_pcr_read(TPM_ANY_NUM, idx, pcr) != 0)
+ if (tpm_pcr_read(NULL, idx, pcr) != 0)
pr_err("Error Communicating to TPM chip\n");
}
diff --git a/ima/ima_init.c b/ima/ima_init.c
index a7362e8..577c7b7 100644
--- a/ima/ima_init.c
+++ b/ima/ima_init.c
@@ -115,7 +115,7 @@ int __init ima_init(void)
if (ima_used_chip != 0) {
ima_used_chip = 0;
- rc = tpm_pcr_read(TPM_ANY_NUM, 0, pcr_i);
+ rc = tpm_pcr_read(NULL, 0, pcr_i);
if (rc == 0)
ima_used_chip = 1;
}
diff --git a/ima/ima_queue.c b/ima/ima_queue.c
index d9aa5ab..9946363 100644
--- a/ima/ima_queue.c
+++ b/ima/ima_queue.c
@@ -145,7 +145,7 @@ static int ima_pcr_extend(const u8 *hash, int pcr)
if (!ima_used_chip)
return result;
- result = tpm_pcr_extend(TPM_ANY_NUM, pcr, hash);
+ result = tpm_pcr_extend(NULL, pcr, hash);
if (result != 0)
pr_err("Error Communicating to TPM chip, result: %d\n", result);
return result;
--
2.7.4

View File

@ -1,3 +0,0 @@
0001-integrity-kcompat-support.patch
0002-integrity-expose-module-params.patch
0003-integrity-restrict-by-iversion.patch

View File

@ -1,4 +0,0 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/e1000e-3.4.2.1.tar.gz"
TIS_PATCH_VER=1

View File

@ -1,125 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name e1000e
Name: %{kmod_name}-kmod%{?bt_ext}
Version: 3.4.2.1
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name}%{?bt_ext} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
ExclusiveArch: x86_64
# Sources.
Source0: %{kmod_name}-%{version}.tar.gz
Source5: GPL-v2.0.txt
Source11: modules-load.conf
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
%package -n kmod-e1000e%{?bt_ext}
Summary: e1000e kernel module(s)
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: e1000e-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
%description -n kmod-e1000e%{?bt_ext}
This package provides the e1000e kernel module(s) built
for the Linux kernel using the %{_target_cpu} family of processors.
%post -n kmod-e1000e%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/extra/e1000e | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-e1000e%{?bt_ext}
rpm -ql kmod-e1000e%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-e1000e%{?bt_ext}-modules
%postun -n kmod-e1000e%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-e1000e%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-e1000e%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-e1000e%{?bt_ext}
%defattr(644,root,root,755)
/lib/modules/%{kversion}/
%config(noreplace)/etc/depmod.d/kmod-e1000e.conf
%doc /usr/share/doc/kmod-e1000e-%{version}/
%doc /usr/share/man/man7/
%{_sysconfdir}/modules-load.d/e1000e.conf
# Disable the building of the debug package(s).
%define debug_package %{nil}
%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p 1 -n %{kmod_name}-%{version}
%{__gzip} %{kmod_name}.7
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
%build
pushd src >/dev/null
%{__make} KSRC=%{_usrsrc}/kernels/%{kversion}
popd >/dev/null
%install
%{__install} -d %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} src/%{kmod_name}.ko %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} %{SOURCE5} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} pci.updates %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} README %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} -d %{buildroot}%{_mandir}/man7/
%{__install} %{kmod_name}.7.gz %{buildroot}%{_mandir}/man7/
%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
%{__install} -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/modules-load.d/e1000e.conf
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Fri Feb 24 2017 Matt Peters <matt.peters@windriver.com> 3.3.5.3
- Initial RPM package

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,4 +0,0 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/i40e-2.10.19.82.tar.gz"
TIS_PATCH_VER=1

View File

@ -1,128 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name i40e
Name: %{kmod_name}-kmod%{?bt_ext}
Version: 2.10.19.82
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name}%{?bt_ext} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
ExclusiveArch: x86_64
# Sources.
Source0: %{kmod_name}-%{version}.tar.gz
Source5: GPL-v2.0.txt
Source11: modules-load.conf
Patch01: i40e-Enable-getting-link-status-from-VF.patch
Patch02: i40e-add-more-debug-info-for-VFs-still-in-reset.patch
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
%package -n kmod-i40e%{?bt_ext}
Summary: i40e kernel module(s)
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: i40e-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
%description -n kmod-i40e%{?bt_ext}
This package provides the i40e kernel module(s) built
for the Linux kernel using the %{_target_cpu} family of processors.
%post -n kmod-i40e%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/extra/i40e | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-i40e%{?bt_ext}
rpm -ql kmod-i40e%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-i40e%{?bt_ext}-modules
%postun -n kmod-i40e%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-i40e%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-i40e%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-i40e%{?bt_ext}
%defattr(644,root,root,755)
/lib/modules/%{kversion}/
%config(noreplace)/etc/depmod.d/kmod-i40e.conf
%doc /usr/share/doc/kmod-i40e-%{version}/
%doc /usr/share/man/man7/
%{_sysconfdir}/modules-load.d/i40e.conf
# Disable the building of the debug package(s).
%define debug_package %{nil}
%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p 1 -n %{kmod_name}-%{version}
%{__gzip} %{kmod_name}.7
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
%build
pushd src >/dev/null
%{__make} KSRC=%{_usrsrc}/kernels/%{kversion}
popd >/dev/null
%install
%{__install} -d %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} src/%{kmod_name}.ko %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} %{SOURCE5} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} pci.updates %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} README %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} -d %{buildroot}%{_mandir}/man7/
%{__install} %{kmod_name}.7.gz %{buildroot}%{_mandir}/man7/
%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
%{__install} -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/modules-load.d/i40e.conf
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Thu Feb 11 2016 Matthias Saou <matthias@saou.eu> 1.4.25-1
- Initial RPM package, based on elrepo.org's ixgbe one.

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,128 +0,0 @@
From b8c666367cd98a2b0033c043f6f206abd8e238a6 Mon Sep 17 00:00:00 2001
Message-Id: <b8c666367cd98a2b0033c043f6f206abd8e238a6.1572295393.git.Jim.Somerville@windriver.com>
From: Vadim Suraev <vsuraev@northforgeinc.com>
Date: Mon, 8 Feb 2016 15:57:30 -0500
Subject: [PATCH 1/2] i40e: Enable getting link status from VF
Add handling of custom OP code sent from the PMD VF to get link status via the
virtual channel interface.
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Signed-off-by: eric zhang <eric.zhang@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
src/i40e_virtchnl_pf.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/virtchnl.h | 1 +
2 files changed, 79 insertions(+)
diff --git a/src/i40e_virtchnl_pf.c b/src/i40e_virtchnl_pf.c
index 9e48f0d..21b4606 100644
--- a/src/i40e_virtchnl_pf.c
+++ b/src/i40e_virtchnl_pf.c
@@ -2467,6 +2467,81 @@ err_out:
aq_ret);
}
+struct i40e_eth_link {
+ uint16_t link_speed; /**< ETH_LINK_SPEED_[10, 100, 1000, 10000] */
+ uint16_t link_duplex; /**< ETH_LINK_[HALF_DUPLEX, FULL_DUPLEX] */
+ uint8_t link_status : 1; /**< 1 -> link up, 0 -> link down */
+}__attribute__((aligned(8)));
+
+#define ETH_LINK_SPEED_AUTONEG 0 /**< Auto-negotiate link speed. */
+#define ETH_LINK_SPEED_10 10 /**< 10 megabits/second. */
+#define ETH_LINK_SPEED_100 100 /**< 100 megabits/second. */
+#define ETH_LINK_SPEED_1000 1000 /**< 1 gigabits/second. */
+#define ETH_LINK_SPEED_10000 10000 /**< 10 gigabits/second. */
+#define ETH_LINK_SPEED_10G 10000 /**< alias of 10 gigabits/second. */
+#define ETH_LINK_SPEED_20G 20000 /**< 20 gigabits/second. */
+#define ETH_LINK_SPEED_40G 40000 /**< 40 gigabits/second. */
+
+#define ETH_LINK_AUTONEG_DUPLEX 0 /**< Auto-negotiate duplex. */
+#define ETH_LINK_HALF_DUPLEX 1 /**< Half-duplex connection. */
+#define ETH_LINK_FULL_DUPLEX 2 /**< Full-duplex connection. */
+
+static void
+i40e_vc_get_link_status(struct i40e_vf *vf)
+{
+ struct i40e_pf *pf = vf->pf;
+ struct i40e_hw *hw;
+ i40e_status aq_ret = I40E_SUCCESS;
+ i40e_status status;
+ struct i40e_eth_link eth_link;
+ bool new_link;
+
+ if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
+ !test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) {
+ aq_ret = I40E_ERR_PARAM;
+ goto error_param;
+ }
+ hw = &pf->hw;
+
+ /* set this to force the get_link_status call to refresh state */
+ pf->hw.phy.get_link_info = true;
+
+ status = i40e_get_link_status(&pf->hw, &new_link);
+ if (status != I40E_SUCCESS) {
+ dev_dbg(&pf->pdev->dev, "couldn't get link state, status: %d\n",
+ status);
+ aq_ret = I40E_ERR_INVALID_LINK_SETTINGS;
+ goto error_param;
+ }
+
+ /* Update link status first to acquire latest link change */
+ eth_link.link_status = new_link ? 1 : 0;
+
+ switch(hw->phy.link_info.link_speed) {
+ case I40E_LINK_SPEED_40GB:
+ eth_link.link_speed = ETH_LINK_SPEED_40G;
+ break;
+ case I40E_LINK_SPEED_10GB:
+ eth_link.link_speed = ETH_LINK_SPEED_10G;
+ break;
+ case I40E_LINK_SPEED_1GB:
+ eth_link.link_speed = ETH_LINK_SPEED_1000;
+ break;
+ case I40E_LINK_SPEED_100MB:
+ eth_link.link_speed = ETH_LINK_SPEED_100;
+ break;
+ default:
+ eth_link.link_speed = ETH_LINK_SPEED_AUTONEG;
+ break;
+ }
+ eth_link.link_duplex = ETH_LINK_FULL_DUPLEX;/* always */
+
+error_param:
+ i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_LINK_STAT,
+ aq_ret, (uint8_t *)&eth_link,
+ sizeof(eth_link));
+}
+
/**
* i40e_vc_config_queues_msg
* @vf: pointer to the VF info
@@ -4166,6 +4241,9 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode,
case VIRTCHNL_OP_REQUEST_QUEUES:
ret = i40e_vc_request_queues_msg(vf, msg);
break;
+ case VIRTCHNL_OP_GET_LINK_STAT:
+ i40e_vc_get_link_status(vf);
+ break;
#ifdef __TC_MQPRIO_MODE_MAX
case VIRTCHNL_OP_ENABLE_CHANNELS:
ret = i40e_vc_add_qch_msg(vf, msg);
diff --git a/src/virtchnl.h b/src/virtchnl.h
index a22cc43..d3d9324 100644
--- a/src/virtchnl.h
+++ b/src/virtchnl.h
@@ -128,6 +128,7 @@ enum virtchnl_ops {
VIRTCHNL_OP_DISABLE_CHANNELS = 31,
VIRTCHNL_OP_ADD_CLOUD_FILTER = 32,
VIRTCHNL_OP_DEL_CLOUD_FILTER = 33,
+ VIRTCHNL_OP_GET_LINK_STAT = 0x101,
};
/* These macros are used to generate compilation errors if a structure/union
--
1.8.3.1

View File

@ -1,64 +0,0 @@
From 40b257ecf5d36abf14a4ef98fc2e44dba7100fea Mon Sep 17 00:00:00 2001
Message-Id: <40b257ecf5d36abf14a4ef98fc2e44dba7100fea.1572295393.git.Jim.Somerville@windriver.com>
In-Reply-To: <b8c666367cd98a2b0033c043f6f206abd8e238a6.1572295393.git.Jim.Somerville@windriver.com>
References: <b8c666367cd98a2b0033c043f6f206abd8e238a6.1572295393.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Mon, 26 Mar 2018 11:03:47 -0400
Subject: [PATCH 2/2] i40e add more debug info for VFs still in reset
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
src/i40e_virtchnl_pf.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/i40e_virtchnl_pf.c b/src/i40e_virtchnl_pf.c
index 21b4606..dfb9568 100644
--- a/src/i40e_virtchnl_pf.c
+++ b/src/i40e_virtchnl_pf.c
@@ -4363,8 +4363,8 @@ static int i40e_set_vf_mac(struct i40e_vf *vf, struct i40e_vsi *vsi,
msleep(20);
}
if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
- dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n",
- vf->vf_id);
+ dev_err(&pf->pdev->dev, "%s: VF %d still in reset. Try again.\n",
+ __func__, vf->vf_id);
ret = -EAGAIN;
goto error_param;
}
@@ -4522,8 +4522,8 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
vf = &pf->vf[vf_id];
vsi = pf->vsi[vf->lan_vsi_idx];
if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
- dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n",
- vf_id);
+ dev_err(&pf->pdev->dev, "%s: VF %d still in reset. Try again.\n",
+ __func__, vf_id);
ret = -EAGAIN;
goto error_pvid;
}
@@ -4678,8 +4678,8 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int max_tx_rate)
vf = &pf->vf[vf_id];
vsi = pf->vsi[vf->lan_vsi_idx];
if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
- dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n",
- vf_id);
+ dev_err(&pf->pdev->dev, "%s: VF %d still in reset. Try again.\n",
+ __func__, vf_id);
ret = -EAGAIN;
goto error;
}
@@ -4881,8 +4881,8 @@ int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable)
vf = &(pf->vf[vf_id]);
if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
- dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n",
- vf_id);
+ dev_err(&pf->pdev->dev, "%s: VF %d still in reset. Try again.\n",
+ __func__, vf_id);
ret = -EAGAIN;
goto out;
}
--
1.8.3.1

View File

@ -1,4 +0,0 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/iavf-3.7.61.20.tar.gz"
TIS_PATCH_VER=1

View File

@ -1,125 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name iavf
Name: %{kmod_name}-kmod%{?bt_ext}
Version: 3.7.61.20
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
ExclusiveArch: x86_64
# Sources.
Source0: %{kmod_name}-%{version}.tar.gz
Source5: GPL-v2.0.txt
Source11: modules-load.conf
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
%package -n kmod-iavf%{?bt_ext}
Summary: iavf kernel module(s)
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: iavf-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
%description -n kmod-iavf%{?bt_ext}
This package provides the iavf kernel module(s) built
for the Linux kernel using the %{_target_cpu} family of processors.
%post -n kmod-iavf%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/extra/iavf | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-iavf%{?bt_ext}
rpm -ql kmod-iavf%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-iavf%{?bt_ext}-modules
%postun -n kmod-iavf%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-iavf%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-iavf%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-iavf%{?bt_ext}
%defattr(644,root,root,755)
/lib/modules/%{kversion}/
%config(noreplace)/etc/depmod.d/kmod-iavf.conf
%doc /usr/share/doc/kmod-iavf-%{version}/
%doc /usr/share/man/man7/
%{_sysconfdir}/modules-load.d/iavf.conf
# Disable the building of the debug package(s).
%define debug_package %{nil}
%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p 1 -n %{kmod_name}-%{version}
%{__gzip} %{kmod_name}.7
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
%build
pushd src >/dev/null
%{__make} KSRC=%{_usrsrc}/kernels/%{kversion}
popd >/dev/null
%install
%{__install} -d %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} src/%{kmod_name}.ko %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} %{SOURCE5} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} pci.updates %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} README %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} -d %{buildroot}%{_mandir}/man7/
%{__install} %{kmod_name}.7.gz %{buildroot}%{_mandir}/man7/
%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
%{__install} -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/modules-load.d/iavf.conf
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Thu Feb 11 2016 Matthias Saou <matthias@saou.eu> 1.4.25-1
- Initial RPM package, based on elrepo.org's ixgbe one.

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,4 +0,0 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/ixgbe-5.5.5.tar.gz"
TIS_PATCH_VER=1

View File

@ -1,124 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name ixgbe
Name: %{kmod_name}-kmod%{?bt_ext}
Version: 5.5.5
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
ExclusiveArch: x86_64
# Sources.
Source0: %{kmod_name}-%{version}.tar.gz
Source5: GPL-v2.0.txt
Source11: modules-load.conf
#Patch01: first-patch-would-go-here.patch
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
%package -n kmod-ixgbe%{?bt_ext}
Summary: ixgbe kernel module(s)
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: ixgbe-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
BuildRequires: kernel%{?bt_ext}-devel
%description -n kmod-ixgbe%{?bt_ext}
This package provides the ixgbe kernel module(s) built
for the Linux kernel using the %{_target_cpu} family of processors.
%post -n kmod-ixgbe%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/extra/ixgbe | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-ixgbe%{?bt_ext}
rpm -ql kmod-ixgbe%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-ixgbe%{?bt_ext}-modules
%postun -n kmod-ixgbe%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-ixgbe%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-ixgbe%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-ixgbe%{?bt_ext}
%defattr(644,root,root,755)
/lib/modules/%{kversion}/
%config(noreplace)/etc/depmod.d/kmod-ixgbe.conf
%doc /usr/share/doc/kmod-ixgbe-%{version}/
%doc /usr/share/man/man7/
%{_sysconfdir}/modules-load.d/ixgbe.conf
# Disable the building of the debug package(s).
%define debug_package %{nil}
%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p 1 -n %{kmod_name}-%{version}
%{__gzip} %{kmod_name}.7
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
%build
pushd src >/dev/null
%{__make} KSRC=%{_usrsrc}/kernels/%{kversion}
popd >/dev/null
%install
%{__install} -d %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} src/%{kmod_name}.ko %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} %{SOURCE5} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} pci.updates %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} README %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} -d %{buildroot}%{_mandir}/man7/
%{__install} %{kmod_name}.7.gz %{buildroot}%{_mandir}/man7/
%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
%{__install} -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/modules-load.d/ixgbe.conf
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Thu Feb 11 2016 Matthias Saou <matthias@saou.eu> 1.4.25-1
- Initial RPM package, based on elrepo.org's ixgbe one.

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,4 +0,0 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/ixgbevf-4.5.3.tar.gz"
TIS_PATCH_VER=1

View File

@ -1,122 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name ixgbevf
Name: %{kmod_name}-kmod%{?bt_ext}
Version: 4.5.3
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
ExclusiveArch: x86_64
# Sources.
Source0: %{kmod_name}-%{version}.tar.gz
Source5: GPL-v2.0.txt
Source11: modules-load.conf
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
%package -n kmod-ixgbevf%{?bt_ext}
Summary: ixgbevf kernel module(s)
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: ixgbevf-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
BuildRequires: kernel%{?bt_ext}-devel
%description -n kmod-ixgbevf%{?bt_ext}
This package provides the ixgbevf kernel module(s) built
for the Linux kernel using the %{_target_cpu} family of processors.
%post -n kmod-ixgbevf%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/extra/ixgbevf | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-ixgbevf%{?bt_ext}
rpm -ql kmod-ixgbevf%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-ixgbevf%{?bt_ext}-modules
%postun -n kmod-ixgbevf%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-ixgbevf%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-ixgbevf%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-ixgbevf%{?bt_ext}
%defattr(644,root,root,755)
/lib/modules/%{kversion}/
%config(noreplace)/etc/depmod.d/kmod-ixgbevf.conf
%doc /usr/share/doc/kmod-ixgbevf-%{version}/
%doc /usr/share/man/man7/
%{_sysconfdir}/modules-load.d/ixgbevf.conf
# Disable the building of the debug package(s).
%define debug_package %{nil}
%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p 1 -n %{kmod_name}-%{version}
%{__gzip} %{kmod_name}.7
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
%build
pushd src >/dev/null
%{__make} KSRC=%{_usrsrc}/kernels/%{kversion}
popd >/dev/null
%install
%{__install} -d %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} src/%{kmod_name}.ko %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} %{SOURCE5} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} pci.updates %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} README %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} -d %{buildroot}%{_mandir}/man7/
%{__install} %{kmod_name}.7.gz %{buildroot}%{_mandir}/man7/
%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
%{__install} -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/modules-load.d/ixgbevf.conf
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Thu Feb 11 2016 Matthias Saou <matthias@saou.eu> 1.4.25-1
- Initial RPM package, based on elrepo.org's ixgbevf one.

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,4 +0,0 @@
COPY_LIST=" \
$PATCHES_BASE/* \
$STX_BASE/downloads/opae-intel-fpga-driver-2.0.1.tar.gz"
TIS_PATCH_VER=1

View File

@ -1,117 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name opae-intel-fpga-driver
# If a release doesn't have an iteration number, just use 0
%define iteration 6
Name: %{kmod_name}-kmod%{?bt_ext}
Version: 2.0.1
Release: %{iteration}%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name}%{?bt_ext} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
ExclusiveArch: x86_64
# Sources.
# The source tarball name may or may not include the iteration number.
Source0: %{kmod_name}-%{version}.tar.gz
Patch01: Remove-regmap-mmio-as-it-is-built-into-the-kernel.patch
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
%package -n kmod-opae-fpga-driver%{?bt_ext}
Summary: OPAE fpga driver kernel module(s)
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: opae-intel-fpga-driver-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
%description -n kmod-opae-fpga-driver%{?bt_ext}
This package provides the opae-fpga-driver kernel module(s) built
for the Linux kernel using the %{_target_cpu} family of processors.
%post -n kmod-opae-fpga-driver%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/extra/opae-intel-fpga-driver | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-opae-fpga-driver%{?bt_ext}
rpm -ql kmod-opae-fpga-driver%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-opae-fpga-driver%{?bt_ext}-modules
%postun -n kmod-opae-fpga-driver%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-opae-fpga-driver%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-opae-fpga-driver%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-opae-fpga-driver%{?bt_ext}
%defattr(644,root,root,755)
/lib/modules/%{kversion}/
%config(noreplace)/etc/depmod.d/kmod-opae-intel-fpga-driver.conf
%doc /usr/share/doc/kmod-%{kmod_name}-%{version}/
# Disable the building of the debug package(s).
%define debug_package %{nil}
%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p 1 -n %{kmod_name}-%{version}
%{__gzip} %{kmod_name}.7
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
%build
%{__make} KERNELDIR=%{_usrsrc}/kernels/%{kversion}
%install
%{__install} -d %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} %{_builddir}/%{kmod_name}-%{version}/*.ko %{buildroot}/lib/modules/%{kversion}/extra/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} COPYING %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Thu Feb 11 2016 Matthias Saou <matthias@saou.eu> 1.4.25-1
- Initial RPM package, based on elrepo.org's ixgbe one.

View File

@ -1,55 +0,0 @@
From 94704d9260d7057549b9f66461f7c2328f6080d3 Mon Sep 17 00:00:00 2001
Message-Id: <94704d9260d7057549b9f66461f7c2328f6080d3.1578602281.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Thu, 9 Jan 2020 15:36:55 -0500
Subject: [PATCH 1/1] Remove regmap mmio as it is built into the kernel
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
Makefile | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/Makefile b/Makefile
index 0dfd0a8..3386289 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,6 @@ ccflags-y += -I$(PWD)/scripts/dtc/libfdt-4-12
ifeq ($(kerval),3.10)
obj-m += spi-bitbang-mod.o
- obj-m += regmap-mmio-mod.o
endif
obj-m += i2c-altera.o
@@ -45,8 +44,6 @@ intel-max10-y += lib-4-12/fdt_sw.o
intel-max10-y += lib-4-12/fdt_strerror.o
intel-max10-y += lib-4-12/fdt_empty_tree.o
-regmap-mmio-mod-y := drivers/base/regmap/regmap-mmio-3-10.o
-
i2c-altera-y := drivers/i2c/busses/i2c-altera.o
intel-generic-qspi-y := drivers/mtd/spi-nor/intel-generic-qspi.o
@@ -99,9 +96,6 @@ load-drv:
if ! egrep -q '^intel_generic_qspi ' /proc/modules; then insmod intel-generic-qspi.ko; fi
if ! egrep -q '^intel_on_chip_flash ' /proc/modules; then insmod intel-on-chip-flash.ko; fi
if ! egrep -q '^altera_asmip2 ' /proc/modules; then insmod altera-asmip2.ko; fi
-ifeq ($(kerval),3.10)
- if ! egrep -q '^regmap_mmio_mod ' /proc/modules; then insmod regmap-mmio-mod.ko; fi
-endif
if ! egrep -q '^i2c_altera ' /proc/modules; then insmod i2c-altera.ko; fi
ifeq ($(kerval),3.10)
if ! egrep -q '^spi_bitbang_mod ' /proc/modules; then insmod spi-bitbang-mod.ko; fi
@@ -137,9 +131,6 @@ ifeq ($(kerval),3.10)
if egrep -q '^spi_bitbang_mod ' /proc/modules; then rmmod spi_bitbang_mod; fi
endif
if egrep -q '^i2c_altera ' /proc/modules; then rmmod i2c_altera; fi
-ifeq ($(kerval),3.10)
- if egrep -q '^regmap_mmio_mod ' /proc/modules; then rmmod regmap_mmio_mod; fi
-endif
if egrep -q '^altera_asmip2 ' /proc/modules; then rmmod altera_asmip2; fi
if egrep -q '^intel_on_chip_flash ' /proc/modules; then rmmod intel_on_chip_flash; fi
if egrep -q '^intel_generic_qspi ' /proc/modules; then rmmod intel_generic_qspi; fi
--
1.8.3.1

View File

@ -1,3 +0,0 @@
COPY_LIST="$PKG_BASE/files/modules-load.conf"
TIS_PATCH_VER=2
BUILD_IS_SLOW=3

View File

@ -1,199 +0,0 @@
From 6152dc85e1b94ec93a3378f4f77b3b33907aac35 Mon Sep 17 00:00:00 2001
Message-Id: <6152dc85e1b94ec93a3378f4f77b3b33907aac35.1579886617.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Mon, 20 Jan 2020 11:40:06 -0500
Subject: [PATCH 1/1] Support TiS system
This patch added the following to support TiS system:
- Support package versioning for TiS format
- Add rt support
- Compile fix in dcbnl.h
- Fix compile for some ks stuff
- Fix compile to neuter some stats output
- Disable use of kernel page pool functionality
- Load all kernel modules
- Sign kernel module
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Signed-off-by: Kam Nasim <kam.nasim@windriver.com>
Signed-off-by: eric zhang <eric.zhang@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/mlnx-ofa_kernel.spec | 51 +++++++++++++++++++++++++++++++---------------
1 file changed, 35 insertions(+), 16 deletions(-)
diff --git a/SPECS/mlnx-ofa_kernel.spec b/SPECS/mlnx-ofa_kernel.spec
index 85af93f..6e77d09 100644
--- a/SPECS/mlnx-ofa_kernel.spec
+++ b/SPECS/mlnx-ofa_kernel.spec
@@ -27,8 +27,14 @@
#
# KMP is disabled by default
-%{!?KMP: %global KMP 0}
+%if "%{_tis_build_type}" == "rt"
+%define bt_ext -rt
+%else
+%undefine bt_ext
+%endif
+%{!?KMP: %global KMP 0}
+BuildRequires: kernel%{?bt_ext}-devel, openssl
%global WITH_SYSTEMD %(if ( test -d "%{_unitdir}" > /dev/null); then echo -n '1'; else echo -n '0'; fi)
%{!?configure_options: %global configure_options --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-mlx4-mod --with-mlx4_en-mod --with-mlx5-mod --with-mlxfw-mod --with-ipoib-mod}
@@ -41,12 +47,11 @@
%global BLUENIX %(if (grep -qiE "Bluenix" /etc/issue /etc/*release* 2>/dev/null); then echo -n '1'; else echo -n '0'; fi)
%global XENSERVER65 %(if (grep -qiE "XenServer.*6\.5" /etc/issue /etc/*release* 2>/dev/null); then echo -n '1'; else echo -n '0'; fi)
-%{!?KVERSION: %global KVERSION %(uname -r)}
+%{!?KVERSION: %global KVERSION %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')}
%global kernel_version %{KVERSION}
%global krelver %(echo -n %{KVERSION} | sed -e 's/-/_/g')
# take path to kernel sources if provided, otherwise look in default location (for non KMP rpms).
-%{!?K_SRC: %global K_SRC /lib/modules/%{KVERSION}/build}
-
+%{!?K_SRC: %global K_SRC /usr/src/kernels/%{KVERSION}}
# Select packages to build
# Kernel module packages to be included into kernel-ib
@@ -63,7 +68,9 @@
%{!?KERNEL_SOURCES: %global KERNEL_SOURCES /lib/modules/%{KVERSION}/source}
-%{!?_name: %global _name mlnx-ofa_kernel}
+
+%define _basename mlnx-ofa_kernel
+%define _name %{_basename}%{?bt_ext}
%{!?_version: %global _version 4.5}
%{!?_release: %global _release OFED.4.5.1.0.1.1.gb4fdfac}
%global _kmp_rel %{_release}%{?_kmp_build_num}%{?_dist}
@@ -75,11 +82,17 @@
Summary: Infiniband HCA Driver
Name: %{_name}
Version: %{_version}
-Release: %{_release}%{?_dist}
+Release: %{_release}%{?_tis_dist}.%{tis_patch_ver}
License: GPLv2
Url: http://www.mellanox.com/
Group: System Environment/Base
-Source: %{_name}-%{_version}.tgz
+Source: %{_basename}-%{_version}.tgz
+Source100: modules-load.conf
+Patch01: 0001-neuter-HAVE_IEEE_GETQCN.patch
+Patch02: 0001-neuter-a-bunch-of-ks-stuff.patch
+Patch03: 0001-neuter-some-stats-output.patch
+Patch04: Disable-use-of-page-pool.patch
+
BuildRoot: %{?build_root:%{build_root}}%{!?build_root:/var/tmp/OFED}
Vendor: Mellanox Technologies
Obsoletes: kernel-ib
@@ -135,7 +148,6 @@ EOF)
%global kernel_release() %{KVERSION}
%global flavors_to_build default
%package -n %{non_kmp_pname}
-Requires: %{utils_pname}
Requires: coreutils
Requires: pciutils
Requires: grep
@@ -162,7 +174,7 @@ Obsoletes: mlnx-en-doc
Obsoletes: mlnx-en-debuginfo
Obsoletes: mlnx-en-sources
Version: %{_version}
-Release: %{_release}.kver.%{krelver}
+Release: %{_release}%{?_tis_dist}.%{tis_patch_ver}
Summary: Infiniband Driver and ULPs kernel modules
Group: System Environment/Libraries
%description -n %{non_kmp_pname}
@@ -174,7 +186,7 @@ The driver sources are located at: http://www.mellanox.com/downloads/ofed/mlnx-o
%package -n %{devel_pname}
Version: %{_version}
# build KMP rpms?
-Release: %{_release}%{?_dist}
+Release: %{_release}%{?_dist}%{?_tis_dist}.%{tis_patch_ver}
Obsoletes: kernel-ib-devel
Obsoletes: compat-rdma-devel
Obsoletes: kernel-ib
@@ -212,13 +224,12 @@ The driver sources are located at: http://www.mellanox.com/downloads/ofed/mlnx-o
else \
echo -n '0'; fi)
-%if "%{WITH_MOD_SIGN}" == "1"
# call module sign script
%global __modsign_install_post \
%{_builddir}/$NAME-$VERSION/source/ofed_scripts/tools/sign-modules %{buildroot}/lib/modules/ %{kernel_source default} || exit 1 \
%{nil}
-%global __debug_package 1
+%define debug_package %{nil}
%global buildsubdir %{_name}-%{version}
# Disgusting hack alert! We need to ensure we sign modules *after* all
# invocations of strip occur, which is in __debug_install_post if
@@ -231,7 +242,6 @@ The driver sources are located at: http://www.mellanox.com/downloads/ofed/mlnx-o
%{__modsign_install_post} \
%{nil}
-%endif # end of setup module sign scripts
#
%if "%{_vendor}" == "suse"
%debug_package
@@ -262,12 +272,17 @@ The driver sources are located at: http://www.mellanox.com/downloads/ofed/mlnx-o
%{!?install_mod_dir: %global install_mod_dir updates}
%prep
-%setup -n %{_name}-%{_version}
+%setup -n %{_basename}-%{_version}
set -- *
mkdir source
mv "$@" source/
mkdir obj
+%patch01 -p1
+%patch02 -p1
+%patch03 -p1
+%patch04 -p1
+
%build
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
export INSTALL_MOD_DIR=%{install_mod_dir}
@@ -282,7 +297,6 @@ for flavor in %flavors_to_build; do
find compat -type f -exec touch -t 200012201010 '{}' \; || true
./configure --build-dummy-mods --prefix=%{_prefix} --kernel-version $KVERSION --kernel-sources $KSRC --modules-dir $LIB_MOD_DIR $CONF_OPTIONS %{?_smp_mflags}
make %{?_smp_mflags} kernel
- make build_py_scripts
cd -
done
@@ -291,9 +305,11 @@ touch ofed-files
export RECORD_PY_FILES=1
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=%{install_mod_dir}
-export NAME=%{name}
+export NAME=%{_basename}
export VERSION=%{version}
export PREFIX=%{_prefix}
+export MODULE_SIGN_PRIV_KEY=/usr/src/kernels/%{KVERSION}/signing_key.priv
+export MODULE_SIGN_PUB_KEY=/usr/src/kernels/%{KVERSION}/signing_key.x509
for flavor in %flavors_to_build; do
export KSRC=%{kernel_source $flavor}
export KVERSION=%{kernel_release $KSRC}
@@ -343,6 +359,8 @@ echo "override ${mod_name} * weak-updates/%{_name}${mod_path}" >> %{buildroot}%{
echo "override ${mod_name} * extra/%{_name}${mod_path}" >> %{buildroot}%{_sysconfdir}/depmod.d/zz01-%{_name}-${mod_name}.conf
done
%endif
+%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
+%{__install} -m 644 %{SOURCE100} %{buildroot}%{_sysconfdir}/modules-load.d/mlnx.conf
%endif
# copy sources
@@ -686,6 +704,7 @@ fi
%config(noreplace) %{_sysconfdir}/depmod.d/zz01-%{_name}-*.conf
%endif
%endif
+%{_sysconfdir}/modules-load.d/mlnx.conf
%endif
%files -n %{devel_pname}
--
1.8.3.1

View File

@ -1 +0,0 @@
0001-Support-TiS-system.patch

View File

@ -1,26 +0,0 @@
From e1b8dd12605b5654bd94011cb6c587fd0c0bc9af Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 20 Dec 2016 11:58:26 -0500
Subject: [PATCH 2/3] neuter HAVE_IEEE_GETQCN
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
source/include/linux/dcbnl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/include/linux/dcbnl.h b/source/include/linux/dcbnl.h
index 2c8ca62..eabf6da 100644
--- a/source/include/linux/dcbnl.h
+++ b/source/include/linux/dcbnl.h
@@ -5,7 +5,7 @@
#include_next <linux/dcbnl.h>
-#ifndef HAVE_IEEE_GETQCN
+#if 0
#ifndef HAVE_STRUCT_IEEE_QCN
enum dcbnl_cndd_states {
--
1.8.3.1

View File

@ -1,47 +0,0 @@
From 63f73a02fd73f6a01bce1fbf65ae2a6a628f0626 Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 20 Dec 2016 16:22:47 -0500
Subject: [PATCH 1/3] neuter a bunch of ks stuff
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
source/include/linux/compat-3.17.h | 2 +-
source/include/linux/compat-4.0.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/source/include/linux/compat-3.17.h b/source/include/linux/compat-3.17.h
index 6a5ff3b..ad799f0 100644
--- a/source/include/linux/compat-3.17.h
+++ b/source/include/linux/compat-3.17.h
@@ -6,7 +6,7 @@
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0))
-#ifndef HAVE_KTIME_GET_REAL_NS
+#if 0
#include <linux/hrtimer.h>
#include <linux/ktime.h>
static inline u64 ktime_get_real_ns(void) {
diff --git a/source/include/linux/compat-4.0.h b/source/include/linux/compat-4.0.h
index b3c37aa..900d49a 100644
--- a/source/include/linux/compat-4.0.h
+++ b/source/include/linux/compat-4.0.h
@@ -6,6 +6,7 @@
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0))
#include <linux/string.h>
+#if 0
#define kstrdup_const LINUX_BACKPORT(kstrdup_const)
static inline const char *kstrdup_const(const char *s, gfp_t gfp)
{
@@ -21,6 +22,7 @@ static inline void kfree_const(const void *x)
kfree(x);
}
#endif
+#endif
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) */
#endif /* LINUX_4_0_COMPAT_H */
--
1.8.3.1

View File

@ -1,31 +0,0 @@
From 12de070f8f73794e45ee6956c9957d0ff0c5133f Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 20 Dec 2016 16:56:01 -0500
Subject: [PATCH 3/3] neuter some stats output
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
source/drivers/net/ethernet/mellanox/mlx4/en_sysfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source/drivers/net/ethernet/mellanox/mlx4/en_sysfs.c b/source/drivers/net/ethernet/mellanox/mlx4/en_sysfs.c
index cb7c829..21f5fc6 100644
--- a/source/drivers/net/ethernet/mellanox/mlx4/en_sysfs.c
+++ b/source/drivers/net/ethernet/mellanox/mlx4/en_sysfs.c
@@ -186,11 +186,13 @@ static ssize_t mlx4_en_show_qcnstats(struct device *d,
len += sprintf(buf + len, "%s %d %s", "priority", i, ": ");
len += sprintf(buf + len, "%lld ", qcn_stats.rppp_rp_centiseconds[i]);
len += sprintf(buf + len, "%u ", qcn_stats.rppp_created_rps[i]);
+#if 0
len += sprintf(buf + len, "%u ", qcn_stats.ignored_cnm[i]);
len += sprintf(buf + len, "%u ", qcn_stats.estimated_total_rate[i]);
len += sprintf(buf + len, "%u ", qcn_stats.cnms_handled_successfully[i]);
len += sprintf(buf + len, "%u ", qcn_stats.min_total_limiters_rate[i]);
len += sprintf(buf + len, "%u ", qcn_stats.max_total_limiters_rate[i]);
+#endif
len += sprintf(buf + len, "%s", "|");
}
len += sprintf(buf + len, "\n");
--
1.8.3.1

View File

@ -1,77 +0,0 @@
From 470e37909b707b2209ae3ed1a9d82758b114691c Mon Sep 17 00:00:00 2001
Message-Id: <470e37909b707b2209ae3ed1a9d82758b114691c.1579638263.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 21 Jan 2020 14:42:03 -0500
Subject: [PATCH 1/1] Disable use of page pool
Don't use it until they are configured on by default
in the kernel, else you may get undefined symbols and
some of the mlx5 related modules fail to load.
The header file is there in CentOS 7.7, but the
CONFIG_PAGE_POOL option isn't enabled. So the simplistic
configure test passes here but the kernel doesn't have the
required procedures.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
source/compat/aclocal.m4 | 4 +---
source/compat/config/rdma.m4 | 4 +---
source/compat/configure | 4 ++--
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/source/compat/aclocal.m4 b/source/compat/aclocal.m4
index 192f6a0..31520d4 100644
--- a/source/compat/aclocal.m4
+++ b/source/compat/aclocal.m4
@@ -12330,9 +12330,7 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
],[
return 0;
],[
- AC_MSG_RESULT(yes)
- MLNX_AC_DEFINE(HAVE_NET_PAGE_POOL_H, 1,
- [net/page_pool.h is defined])
+ AC_MSG_RESULT(no)
],[
AC_MSG_RESULT(no)
])
diff --git a/source/compat/config/rdma.m4 b/source/compat/config/rdma.m4
index 5fbe4f7..e502f8d 100644
--- a/source/compat/config/rdma.m4
+++ b/source/compat/config/rdma.m4
@@ -10226,9 +10226,7 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
],[
return 0;
],[
- AC_MSG_RESULT(yes)
- MLNX_AC_DEFINE(HAVE_NET_PAGE_POOL_H, 1,
- [net/page_pool.h is defined])
+ AC_MSG_RESULT(no)
],[
AC_MSG_RESULT(no)
])
diff --git a/source/compat/configure b/source/compat/configure
index 68ceff5..2e955b3 100755
--- a/source/compat/configure
+++ b/source/compat/configure
@@ -102487,7 +102487,7 @@ if { ac_try='env $CROSS_VARS $MAKE -d modules ${LD:+"LD=$CROSS_COMPILE$LD"} CC="
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
cat >>CONFDEFS_H_DIR/confdefs.h.${CONFDEFS_H_INDEX} <<\_ACEOF
-#define HAVE_NET_PAGE_POOL_H 1
+/* Intentionally removed #define HAVE_NET_PAGE_POOL_H 1 */
_ACEOF
@@ -102546,7 +102546,7 @@ if { ac_try='env $CROSS_VARS $MAKE -d modules ${LD:+"LD=$CROSS_COMPILE$LD"} CC="
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
cat >>CONFDEFS_H_DIR/confdefs.h.${CONFDEFS_H_INDEX} <<\_ACEOF
-#define HAVE_NET_PAGE_POOL_H 1
+/* Intentionally removed #define HAVE_NET_PAGE_POOL_H 1 */
_ACEOF
--
1.8.3.1

View File

@ -1 +0,0 @@
repo:stx/downloads/mlnx-ofa_kernel-4.5-OFED.4.5.1.0.1.1.gb4fdfac.src.rpm

View File

@ -1,22 +0,0 @@
mlx_compat
ib_cm
ib_core
ib_ucm
ib_uverbs
iw_cm
rdma_cm
rdma_ucm
mlx4_ib
mlx5_ib
rdma_rxe
ib_iser
ib_isert
ib_srp
mlx4_core
mlx4_en
mlx5_core
nvme-rdma
nvmet-rdma
rpcrdma
svcrdma
xprtrdma

View File

@ -1,13 +0,0 @@
Metadata-Version: 1.1
Name: qat17
Version: 1.0
Summary: Intel(r) QuickAssist Technology API
Home-page: https://01.org/packet-processing/intel%C2%AE-quickassist-technology-drivers-and-patches
Author:
Author-email:
License: GPLv2
Description: Intel(r) QuickAssist Technology API
Platform: UNKNOWN

View File

@ -1,6 +0,0 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/qat1.7.l.4.5.0-00034.tar.gz \
"
TIS_PATCH_VER=1
BUILD_IS_SLOW=3

View File

@ -1,134 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
Summary: Intel(r) QuickAssist Technology API
%define pkgname qat17
Name: %{pkgname}%{?bt_ext}
Version: 4.5.0
%define upstream_release 00034
Release: %{upstream_release}%{?_tis_dist}.%{tis_patch_ver}
License: GPLv2
Group: base
Packager: Wind River <info@windriver.com>
URL: https://01.org/packet-processing/intel%C2%AE-quickassist-technology-drivers-and-patches
BuildRequires: kernel%{?bt_ext}-devel
BuildRequires: zlib-devel
BuildRequires: openssl-devel
BuildRequires: pciutils
BuildRequires: libudev-devel
BuildRequires: boost-devel
BuildRequires: perl
BuildRequires: openssl
%define icp_tools accelcomp
%define kernel_version %(rpm -q kernel%{?bt_ext}-devel | sed 's/kernel%{?bt_ext}-devel-//')
%define staging_kernel_dir /usr/src/kernels/%{kernel_version}/
%define qat_unpack_dir %{_builddir}/%{name}-%{version}
%define qat_src_dir %{qat_unpack_dir}
Source: qat1.7.l.%{version}-%{upstream_release}.tar.gz
Source1: qat
# Use our own service script rather than massively patching theirs
Source2: qat_service
#Patch1: 0001-Install-config-file-for-each-VF.patch
Patch2: Get-and-report-the-return-code-on-firmware-load-fail.patch
%description
Intel(r) QuickAssist Technology API
%prep
rm -rf %{qat_unpack_dir}
mkdir -p %{qat_unpack_dir}
cd %{qat_unpack_dir}
gzip -dc %{_sourcedir}/qat1.7.l.%{version}-%{upstream_release}.tar.gz | tar -xvvf -
if [ $? -ne 0 ]; then
exit $?
fi
#%patch1 -p1
%patch2 -p1
%build
ICP_ROOT=%{qat_src_dir}
KERNEL_SOURCE_ROOT=%{staging_kernel_dir}
mkdir -p %{qat_src_dir}/build
ICP_BUILD_OUTPUT=%{qat_src_dir}/build
export ICP_ROOT KERNEL_SOURCE_ROOT ICP_BUILD_OUTPUT
cd %{qat_src_dir}
%configure --enable-icp-sriov=host
make -C %{qat_src_dir}/
# intel test sample
make -C %{qat_src_dir}/ sample-all
%install
%{__install} -d %{buildroot}%{_sysconfdir}/default
%{__install} -m 750 %SOURCE1 %{buildroot}%{_sysconfdir}/default
%{__install} -d %{buildroot}%{_sysconfdir}/modprobe.d
%{__install} -d %{buildroot}%{_sysconfdir}/qat/conf_files
%{__install} -m 640 %{qat_src_dir}/build/*.conf %{buildroot}%{_sysconfdir}/qat/conf_files
%{__install} -m 640 %{qat_src_dir}/build/*.vm %{buildroot}%{_sysconfdir}/qat/conf_files
%{__install} -d %{buildroot}%{_sbindir}
%{__install} -m 750 %{qat_src_dir}/build/adf_ctl %{buildroot}%{_sbindir}
%{__install} -d %{buildroot}%{_sysconfdir}/init.d
%{__install} -m 750 %SOURCE2 %{buildroot}%{_sysconfdir}/init.d/qat_service
%{__install} -d %{buildroot}%{_libdir}
%{__install} -m 750 %{qat_src_dir}/build/*.so %{buildroot}%{_libdir}
%{__install} -d %{buildroot}/lib/modules/%{kernel_version}/kernel/drivers/crypto/qat/
%{__install} -m 750 %{qat_src_dir}/build/*qat*.ko %{buildroot}/lib/modules/%{kernel_version}/kernel/drivers/crypto/qat/
%{__install} -m 750 %{qat_src_dir}/build/usdm_drv.ko %{buildroot}/lib/modules/%{kernel_version}/kernel/drivers/crypto/qat
# intel test sample
%{__install} -d %{buildroot}/usr/lib/firmware
%{__install} -m 750 %{qat_src_dir}/build/cpa_sample_code %{buildroot}%{_sbindir}/cpa_sample_code
%{__install} -m 640 %{qat_src_dir}/quickassist/lookaside/access_layer/src/sample_code/performance/compression/calgary %{buildroot}/usr/lib/firmware
%{__install} -m 640 %{qat_src_dir}/quickassist/lookaside/access_layer/src/sample_code/performance/compression/calgary32 %{buildroot}/usr/lib/firmware
%{__install} -m 640 %{qat_src_dir}/quickassist/lookaside/access_layer/src/sample_code/performance/compression/canterbury %{buildroot}/usr/lib/firmware
# device firmware
# install to the updates directory so this firmware will get grabbed ahead of
# anything supplied by the linux-firmware package
%{__install} -d %{buildroot}/usr/lib/firmware/updates
%{__install} -m 640 %{qat_src_dir}/build/*.bin %{buildroot}/usr/lib/firmware/updates
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kernel_version}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kernel_version}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kernel_version}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%files
"%{_sbindir}/*"
"%{_sysconfdir}/default/qat"
"%{_sysconfdir}/init.d/qat_service"
"/lib/modules/%{kernel_version}/kernel/drivers/crypto/qat/*.ko"
"%{_libdir}/*.so"
"/usr/lib/firmware/*"
"/usr/lib/firmware/updates/*"
"%{_sysconfdir}/qat/*"
"%{_sysconfdir}/qat/conf_files/*"

View File

@ -1,42 +0,0 @@
From 996bdb87cbaab4d8f498ec7897c38bc9d19e29e7 Mon Sep 17 00:00:00 2001
Message-Id: <996bdb87cbaab4d8f498ec7897c38bc9d19e29e7.1511969785.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Wed, 29 Nov 2017 10:36:12 -0500
Subject: [PATCH 1/1] Get and report the return code on firmware load failure
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
.../qat/drivers/crypto/qat/qat_common/adf_accel_engine.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_accel_engine.c b/quickassist/qat/drivers/crypto/qat/qat_common/adf_accel_engine.c
index 5a5d42b..9c109e3 100755
--- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_accel_engine.c
+++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_accel_engine.c
@@ -64,6 +64,7 @@ int adf_ae_fw_load(struct adf_accel_dev *accel_dev)
struct adf_hw_device_data *hw_device = accel_dev->hw_device;
void *uof_addr, *mmp_addr;
u32 uof_size, mmp_size;
+ int rc;
char uofname[ADF_CFG_MAX_VAL_LEN_IN_BYTES];
struct adf_accel_pci *pci_info = &accel_dev->accel_pci_dev;
struct adf_mmp_version_s mmp_ver = { {0} };
@@ -77,10 +78,11 @@ int adf_ae_fw_load(struct adf_accel_dev *accel_dev)
if (!hw_device->fw_name)
return 0;
- if (request_firmware(&loader_data->mmp_fw, hw_device->fw_mmp_name,
- &accel_dev->accel_pci_dev.pci_dev->dev)) {
- dev_err(&GET_DEV(accel_dev), "Failed to load MMP firmware %s\n",
- hw_device->fw_mmp_name);
+ rc = request_firmware(&loader_data->mmp_fw, hw_device->fw_mmp_name,
+ &accel_dev->accel_pci_dev.pci_dev->dev);
+ if (rc) {
+ dev_err(&GET_DEV(accel_dev), "Failed to load MMP firmware %s rc=%d\n",
+ hw_device->fw_mmp_name, rc);
return -EFAULT;
}
if (request_firmware(&loader_data->uof_fw, hw_device->fw_name,
--
2.7.4

View File

@ -1 +0,0 @@
SRIOV_ENABLE=1

View File

@ -1,384 +0,0 @@
#!/bin/bash
#################################################################
#
# BSD LICENSE
#
# Copyright(c) 2007-2018 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# version: QAT1.7.L.4.5.0-00034
#
#################################################################
#
### BEGIN INIT INFO
# Provides: QAT
# Required-Start: $ALL
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop: 0 1 4 6
# Description: Intel QAT service
### END INIT INFO
#
# qat_service Start/Stop the Intel QAT.
#
# chkconfig: 345 99 99
# description: modprobe the QAT modules, which loads dependant \
# modules, before calling the user space \
# utility to pass configuration parameters
test -f /etc/default/qat && . /etc/default/qat
SRIOV_ENABLE=${SRIOV_ENABLE-0}
LEGACY_LOADED=${LEGACY_LOADED-0}
DO_ENABLE_SRIOV=${DO_ENABLE_SRIOV-0}
ENABLE_KAPI=${ENABLE_KAPI-0}
# to protect parallel qat-service run instances
for pid in $(pidof -x qat_service ); do
if [ $pid != $$ ]; then
echo "[$(date)] : qat_service : Process is already running with PID $pid"
exit 1
fi
done
usage() {
echo
echo --------------------------------------------------------
echo USAGE:
echo --------------------------------------------------------
echo "# $0 start||stop||status||restart||shutdown"
echo --------------------------------------------------------
echo " Note: If there is more devices in the system"
echo " you can start, stop or restart separate device by "
echo " passing the dev to be restarted or stopped as a"
echo " parameter for instance: "
echo " $0 stop qat_dev<N>"
echo " where N is device number."
echo " To see all devices in the system use:"
echo " $0 status"
echo --------------------------------------------------------
exit 1
}
inventory_the_devices() {
# dynamically inventory the devices by looking at the pci bus
# store the total number of each type of device seen
numDh895xDevicesPF=$(lspci -n | egrep -c "${INTEL_VENDORID}:${DH895_DEVICE_PCI_ID}")
numDh895xDevicesVF=$(lspci -n | egrep -c "${INTEL_VENDORID}:${DH895_DEVICE_PCI_ID_VM}")
numC62xDevicesPF=$(lspci -n | egrep -c "${INTEL_VENDORID}:${C62X_DEVICE_PCI_ID}")
numC62xDevicesVF=$(lspci -n | egrep -c "${INTEL_VENDORID}:${C62X_DEVICE_PCI_ID_VM}")
numC3xxDevicesPF=$(lspci -n | egrep -c "${INTEL_VENDORID}:${C3XX_DEVICE_PCI_ID}")
numC3xxDevicesVF=$(lspci -n | egrep -c "${INTEL_VENDORID}:${C3XX_DEVICE_PCI_ID_VM}")
numD15xxDevicesPF=$(lspci -n | egrep -c "${INTEL_VENDORID}:${D15XX_DEVICE_PCI_ID}")
numD15xxDevicesVF=$(lspci -n | egrep -c "${INTEL_VENDORID}:${D15XX_DEVICE_PCI_ID_VM}")
}
disable_sriov() {
PF_LIST=`${ADF_CTL} $1 status | grep -e "^ *qat_dev" | grep -v "vf," | awk '{print $1}'`
for PF_DEV in ${PF_LIST}
do
# Extract the BSF to build the path to /sys/bus/.../sriov)_numvfs
BSF=`${ADF_CTL} ${PF_DEV} status | tail -1 | awk '{print $10}' | awk 'BEGIN{FS=","}{print $1}'`
D=`echo $BSF | awk 'BEGIN{FS=":"}{print $1}'`
B=`echo $BSF | awk 'BEGIN{FS=":"}{print $2}'`
# Get a list of all the VFs for this PF and bring them down
VF_LIST=`${ADF_CTL} status | grep "bsf: ${D}:${B}" | grep "vf," | awk '{print $1}'`
for VF_DEV in ${VF_LIST}
do
${ADF_CTL} ${VF_DEV} down
done
done
}
enable_sriov() {
PF_LIST=`${ADF_CTL} $1 status | grep -e "^ *qat_dev" | grep -v "vf," | awk '{print $1}'`
for PF_DEV in ${PF_LIST}
do
# Extract the BSF to build the path to /sys/bus/.../sriov)_numvfs
BSF=`${ADF_CTL} ${PF_DEV} status | tail -1 | awk '{print $10}' | awk 'BEGIN{FS=","}{print $1}'`
D=`echo ${BSF} | awk 'BEGIN{FS=":"}{print $1}'`
B=`echo ${BSF} | awk 'BEGIN{FS=":"}{print $2}'`
SF=`echo ${BSF} | awk 'BEGIN{FS=":"}{print $3}'`
S=`echo ${SF} | awk 'BEGIN{FS="."}{print $1}'`
F=`echo ${SF} | awk 'BEGIN{FS="."}{print $2}'`
SYSFS_DIR=/sys/bus/pci/devices/${D}:${B}:${S}.${F}
if [ ! -e ${SYSFS_DIR}/sriov_numvfs ]; then
echo "Cannot enable SRIOV for ${PF_DEV}. No sriov_numvs file"
exit 1
fi
NUMVFS=`cat ${SYSFS_DIR}/sriov_numvfs`
if [ ${NUMVFS} != 0 ]; then
echo "SRIOV is already enabled for ${PF_DEV}"
exit 1
fi
cat ${SYSFS_DIR}/sriov_totalvfs > ${SYSFS_DIR}/sriov_numvfs
if [ $? != 0 ]; then
echo "Could not enable SRIOV for ${PF_DEV}"
exit 1;
fi
# Get a list of all the VFs for this PF and bring then down
VF_LIST=`${ADF_CTL} status | grep "bsf: ${D}:${B}" | grep "vf," | awk '{print $1}'`
for VF_DEV in ${VF_LIST}
do
${ADF_CTL} ${VF_DEV} down && ${ADF_CTL} ${VF_DEV} up
done
done
}
check_sriov() {
# Check if sriov should be enabled.
if [ ${SRIOV_ENABLE} == 1 ]; then
# If a specific device ($2), or any (empty $2) is specified that is a pf, then enable sriov.
${ADF_CTL} $1 status | grep -e "^ *qat_dev" | grep -v vf > /dev/null
if [ $? == 0 ]; then
DO_ENABLE_SRIOV=1
else
DO_ENABLE_SRIOV=0
fi
else
DO_ENABLE_SRIOV=0
fi
}
load_the_required_modules() {
# Using the collected inventory, install the modules. No harm done if already installed.
if [ ${numDh895xDevicesPF} != 0 ] && [ ${LEGACY_LOADED} == 0 ]; then
modprobe qat_dh895xcc
fi
if [ ${numC62xDevicesPF} != 0 ]; then
modprobe qat_c62x
fi
if [ ${numC3xxDevicesPF} != 0 ]; then
modprobe qat_c3xxx
fi
if [ ${numD15xxDevicesPF} != 0 ]; then
modprobe qat_d15xx
fi
if [ `lsmod | grep "usdm_drv" | wc -l` == "0" ]; then
modprobe usdm_drv
fi
# Loading VF drivers as necessary
# The VF devices only appear after SRIOV is enabled on the PF,
# therefore we can't use lspci to determine that the VF driver should be loaded.
# Instead, if we want SRIOV, and we have a specific PF device, then load the driver.
if [ ${SRIOV_ENABLE} == 1 ]; then
if [ ${numDh895xDevicesPF} != 0 -o ${numDh895xDevicesVF} != 0 ] && [ ${LEGACY_LOADED} == 0 ]; then
modprobe qat_dh895xccvf
fi
if [ ${numC62xDevicesPF} != 0 -o ${numC62xDevicesVF} != 0 ]; then
modprobe qat_c62xvf
fi
if [ ${numC3xxDevicesPF} != 0 -o ${numC3xxDevicesVF} != 0 ]; then
modprobe qat_c3xxxvf
fi
if [ ${numD15xxDevicesPF} != 0 -o ${numD15xxDevicesVF} != 0 ]; then
modprobe qat_d15xxvf
fi
fi
if [ `lsmod | grep "qat_api" | wc -l` == "0" ] && [ ${ENABLE_KAPI} == 1 ]; then
modprobe qat_api
fi
}
copy_in_config_files() {
local num_devices=${1}
local device_file_prefix=${2}
local source_file_suffix="${3}"
if [ ${num_devices} != 0 ]; then
for (( dev=0; dev<${num_devices}; dev++ ))
do
if [ -e /etc/qat/conf_files/${device_file_prefix}_dev${dev}.conf${source_file_suffix} ]; then
cp /etc/qat/conf_files/${device_file_prefix}_dev${dev}.conf${source_file_suffix} /etc/${device_file_prefix}_dev${dev}.conf
else
echo "QAT: ${device_file_prefix}: using dev0 device config for device ${dev}, settings may be suboptimal"
cp /etc/qat/conf_files/${device_file_prefix}_dev0.conf${source_file_suffix} /etc/${device_file_prefix}_dev${dev}.conf
fi
done
fi
}
establish_the_device_PF_config_files() {
copy_in_config_files ${numDh895xDevicesPF} 'dh895xcc' ''
copy_in_config_files ${numC62xDevicesPF} 'c6xx' ''
copy_in_config_files ${numC3xxDevicesPF} 'c3xxx' ''
copy_in_config_files ${numD15xxDevicesPF} 'd15xx' ''
}
establish_the_device_VF_config_files() {
copy_in_config_files $(( ${numDh895xDevicesPF} * ${QAT_DH895XCC_NUM_VFS} )) 'dh895xccvf' '.vm'
copy_in_config_files $(( ${numC62xDevicesPF} * ${QAT_DHC62X_NUM_VFS} )) 'c6xxvf' '.vm'
copy_in_config_files $(( ${numC3xxDevicesPF} * ${QAT_DHC3XXX_NUM_VFS} )) 'c3xxxvf' '.vm'
copy_in_config_files $(( ${numD15xxDevicesPF} * ${QAT_DHD15XX_NUM_VFS} )) 'd15xxvf' '.vm'
}
establish_the_guest_VF_config_files() {
copy_in_config_files ${numDh895xDevicesVF} 'dh895xccvf' '.vm'
copy_in_config_files ${numC62xDevicesVF} 'c6xxvf' '.vm'
copy_in_config_files ${numC3xxDevicesVF} 'c3xxxvf' '.vm'
copy_in_config_files ${numD15xxDevicesVF} 'd15xxvf' '.vm'
}
############### Mainline Begins ################
# Set the SRIOV_ENABLE variable by sourcing the qat file
test -f /etc/default/qat && . /etc/default/qat
INTEL_VENDORID="8086"
DH895_DEVICE_PCI_ID="0435"
DH895_DEVICE_PCI_ID_VM="0443"
C62X_DEVICE_PCI_ID="37c8"
C62X_DEVICE_PCI_ID_VM="37c9"
C3XX_DEVICE_PCI_ID="19e2"
C3XX_DEVICE_PCI_ID_VM="19e3"
D15XX_DEVICE_PCI_ID="6f54"
D15XX_DEVICE_PCI_ID_VM="6f55"
QAT_DH895XCC_NUM_VFS=32
QAT_DHC62X_NUM_VFS=16
QAT_DHD15XX_NUM_VFS=16
QAT_DHC3XXX_NUM_VFS=16
ADF_CTL=/usr/sbin/adf_ctl
inventory_the_devices
case $1 in
Start|start)
load_the_required_modules
# Make sure the devices are off
${ADF_CTL} $2 down
establish_the_device_PF_config_files
${ADF_CTL} $2 status | grep -e "^ *qat_dev" | grep -v vf > /dev/null
if [ $? == 0 ]; then
PHYS_FUNCTIONS=1
else
PHYS_FUNCTIONS=0
fi
${ADF_CTL} $2 status | grep -e "^ *qat_dev" | grep vf > /dev/null
if [ $? == 0 ]; then
VIRT_FUNCTIONS=1
else
VIRT_FUNCTIONS=0
fi
# Check if sriov should be enabled.
if [ ${SRIOV_ENABLE} == 1 ]; then
if [ ${PHYS_FUNCTIONS} == 1 ]; then
# We have physical functions
DO_ENABLE_SRIOV=1
else
# No physical functions
DO_ENABLE_SRIOV=0
fi
else
DO_ENABLE_SRIOV=0
fi
if [ ${DO_ENABLE_SRIOV} == 1 ]; then
echo "enabling sriov"
establish_the_device_VF_config_files
enable_sriov $2
else
if [ ${PHYS_FUNCTIONS} == 0 ]; then
if [ ${VIRT_FUNCTIONS} == 1 ]; then
establish_the_guest_VF_config_files
fi
fi
fi
# Turn the devices on
${ADF_CTL} $2 up
# Show device status
${ADF_CTL} $2 status
;;
Shutdown|shutdown)
check_sriov $2
if [ ${DO_ENABLE_SRIOV} == 1 ]; then
echo disable sriov
disable_sriov $2
fi
${ADF_CTL} down
modprobe -q -r qat_api
modprobe -q -r usdm_drv
modprobe -q -r qat_dh895xccvf
modprobe -q -r qat_c62xvf
modprobe -q -r qat_c3xxxvf
modprobe -q -r qat_dh895xcc
modprobe -q -r qat_c62x
modprobe -q -r qat_c3xxx
modprobe -q -r qat_d15xx
modprobe -q -r qat_d15xxvf
modprobe -q -r intel_qat
;;
Stop|stop)
check_sriov $2
if [ ${DO_ENABLE_SRIOV} == 1 ]; then
echo disable sriov
disable_sriov $2
fi
${ADF_CTL} $2 down
;;
Restart|restart)
${ADF_CTL} $2 down && ${ADF_CTL} $2 up
;;
Status|status)
${ADF_CTL} status
if [ "$?" -ne 0 ]
then
echo "No devices found. Please start the driver using:"
echo "$0 start"
fi
;;
*)
usage
;;
esac
exit 0

View File

@ -1,5 +0,0 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$PKG_BASE/patches/* \
$STX_BASE/downloads/tpm-kmod-e6aef069.tar.gz"
TIS_PATCH_VER=6

View File

@ -1,146 +0,0 @@
%if "%{?_tis_build_type}" == "rt"
%define bt_ext -rt
%else
%undefine bt_ext
%endif
# Define the kmod package name here.
%define kmod_name tpm
Name: %{kmod_name}-kmod%{?bt_ext}
# the version is the Kernel version from which
# this driver is extracted
Version: 4.12
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name}%{?bt_ext} kernel module(s)
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
ExclusiveArch: x86_64
# Sources.
# the tpmdd is available as a tarball, with
# the git commit Id referenced in the name
Source0: %{kmod_name}-kmod-e6aef069.tar.gz
Source1: modules-load.conf
Source2: COPYING
Source3: README
# Patches
Patch01: 0001-disable-arm64-acpi-command.patch
Patch02: 0002-tpmdd-kcompat-support.patch
Patch03: UPSTREAM-0001-tpm-replace-msleep-with-usleep_range.patch
Patch04: UPSTREAM-0002-tpm-reduce-tpm-polling-delay-in-tpm_tis_core.patch
Patch05: UPSTREAM-0003-tpm-use-tpm_msleep-value-as-max-delay.patch
Patch06: UPSTREAM-0004-tpm-wait-for-stat-to-specify-variable-polling-time.patch
Patch07: UPSTREAM-0005-tpm-ignore-burstcount-to-improve-send-performance.patch
Patch08: UPSTREAM-0006-tpm-use-struct-tpm_chip.patch
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
%package -n kmod-tpm%{?bt_ext}
Summary: TPM kernel module(s) and drivers
Group: System Environment/Kernel
%global _use_internal_dependency_generator 0
Provides: kernel-modules >= %{kversion}
Provides: tpm-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
%description -n kmod-tpm%{?bt_ext}
This package provides the %{version} TPM kernel module(s) and drivers built
for the Linux kernel using the %{_target_cpu} family of processors.
%package symbols
Summary: Contains the Module.symvers file for this module
Group: Development/System
%description symbols
This package provides the Module.symvers file which will be used
by other dependant Kernel modules, if they use Kernel symbols that
this module exports
%files symbols
%defattr(-,root,root)
%{_usrsrc}/debug/tpm/Module.symvers
%post -n kmod-tpm%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(find /lib/modules/%{kversion}/kernel/drivers/char/tpm | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
%preun -n kmod-tpm%{?bt_ext}
rpm -ql kmod-tpm%{?bt_ext}-%{version}-%{release}.x86_64 | grep '\.ko$' > /var/run/rpm-kmod-tpm%{?bt_ext}-modules
%postun -n kmod-tpm%{?bt_ext}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-%{kversion}" ]; then
/usr/sbin/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
fi
modules=( $(cat /var/run/rpm-kmod-tpm%{?bt_ext}-modules) )
rm /var/run/rpm-kmod-tpm%{?bt_ext}-modules
if [ -x "/sbin/weak-modules" ]; then
printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
%files -n kmod-tpm%{?bt_ext}
%defattr(644,root,root,755)
/lib/modules/%{kversion}/
%doc /usr/share/doc/kmod-tpm/
%{_sysconfdir}/modules-load.d/tpm_tis.conf
# Disable the building of the debug package(s).
%define debug_package %{nil}
%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p 1 -n %{kmod_name}
%build
# build out all the TPM kernel modules
%{__make} KSRC=%{_usrsrc}/kernels/%{kversion}
%install
%{__install} -d %{buildroot}/lib/modules/%{kversion}/kernel/drivers/char/%{kmod_name}/
%{__install} *.ko %{buildroot}/lib/modules/%{kversion}/kernel/drivers/char/%{kmod_name}/
# install the Module.symvers file
%{__install} -d %{buildroot}%{_usrsrc}/debug/%{kmod_name}/
%{__install} Module.symvers %{buildroot}%{_usrsrc}/debug/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
%{__install} -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/modules-load.d/tpm_tis.conf
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}/
%{__install} %{SOURCE2} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}/
%{__install} %{SOURCE3} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}/
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
# Always Sign the modules(s).
# If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey /usr/src/kernels/%{kversion}/signing_key.priv}
%{!?pubkey: %define pubkey /usr/src/kernels/%{kversion}/signing_key.x509}
for module in $(find %{buildroot} -type f -name \*.ko);
do %{__perl} /usr/src/kernels/%{kversion}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module;
done
%clean
%{__rm} -rf %{buildroot}
%changelog
* Wed Apr 19 2017 Kam Nasim <kam.nasim@windriver.com> 4.12
- Initial RPM package.

View File

@ -1,344 +0,0 @@
"This software program is licensed subject to the GNU General Public License
(GPL). Version 2, June 1991, available at
<http://www.gnu.org/licenses/gpl-2.0.html>"
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,184 +0,0 @@
TPM Device Driver for CentOS 7 (Linux version 3.10)
===============================================================================
===============================================================================
Kam Nasim <kam.nasim@windriver.com>
Copyright (c) 2017 Wind River Systems, Inc.
SPDX-License-Identifier: Apache-2.0
April, 2017
===============================================================================
Contents
--------
- Overview
- Rebasing Guidelines
- Changesets
================================================================================
Important Notes
---------------
Out-of-tree tpmdd now supported for RT Kernel
----------------------------------------------
The RT Kernel also uses the TPM kernel module. The out of kernel
tpmdd (kmod-tpm) package is installed on the RT kernel
Supports both TPM 1.2 and TPM 2.0 TCG Specifications
-------------------------------------------------------------
The entire TPM device driver set is now built out of tree, and supports both
TPM v1.2 and v2.0 TCG version of the device
IMA support disabled in Kernel
------------------------------------------------
TPM based Integrity Measurement Architecture (IMA) has been disabled in the Kernel,
since it requires the TPM driver to be built-in to the kernel so that it is available
during bootup to set up the PCR banks. Since the in-kernel TPM driver will trump our
out-of-tree TPM kernel modules, IMA support has been disabled and would require some
refactoring if it is to be used with this driver pack.
No support for legacy STMicroelectronics ST33ZP24 TPM drivers
--------------------------------------------------------------
Owing to a large number of dependency issues in the v3.10 Kernel, this driver
pack excludes the STM (ST33ZP24) drivers. These are legacy drivers for the
TPM 1.2 specification only, and would not apply to TPM 2.0 devices.
Overview
--------
This driver pack build TPM kernel modules for the 3.10 kernel version.
If newer kernel version are to be supported in the future then the COMPAT
layer (kcompat.h) will need to be adjusted to address kernel-driver compatibility
issues.
It supports Linux supported x86_64 systems.
These drivers are only supported as a loadable module at this time.
Rebasing Guidelines
--------------------
On rebasing TiC software heed the following:
- always rebase the Kernel first before rebasing this package
- get the HEAD from the tpmdd repo and generate a tarball, the tarball
should follow the naming convention: tpm-kmod-<gitHEAD>; use the short-hand
form of the git commit ID (8 characters)
- update the tpm-kmod spec to Source the new tarball
- apply all existing patches against the new tarball, and adjust the kcompat
layer (kcompat.h and common.mk) accordingly
================================================================================
Change Sets
-------------------------
This driver is a fork from the tpmdd repo:
https://sourceforge.net/projects/tpmdd/
http://git.infradead.org/users/jjs/linux-tpmdd.git/
Sync Head: 668a827057187403999b7ecfcf86b59979c8c3b2
COMPAT NOTES:
1. In newer kernels, IDR has been re-implemented using Radix trees:
commit 0a835c4f090af2c76fc2932c539c3b32fd21fbbb
Author: Matthew Wilcox <mawilcox@microsoft.com>
Date: Tue Dec 20 10:27:56 2016 -0500
Reimplement IDR and IDA using the radix tree
The IDR is very similar to the radix tree. It has some functionality that
the radix tree did not have (alloc next free, cyclic allocation, a
callback-based for_each, destroy tree), which is readily implementable on
top of the radix tree. A few small changes were needed in order to use a
tag to represent nodes with free space below them. More extensive
changes were needed to support storing NULL as a valid entry in an IDR.
Plain radix trees still interpret NULL as a not-present entry.
The IDA is reimplemented as a client of the newly enhanced radix tree. As
in the current implementation, it uses a bitmap at the last level of the
tree.
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
The compat layer therefore needs to redefine the idr_destroy() to
use the original idr.h based defination and not the one found in radix-trees.h
2. In newer kernels, a wrapper has been developed around inode mutex un/lock
commit 5955102c9984fa081b2d570cfac75c97eecf8f3b
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Fri Jan 22 15:40:57 2016 -0500
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
inode_foo(inode) being mutex_foo(&inode->i_mutex).
Please, use those for access to ->i_mutex; over the coming cycle
->i_mutex will become rwsem, with ->lookup() done with it held
only shared.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
The compat layer needs to replace all instances of inode locking
with the underlying mutex locking/unlocking calls
3. In newer kernels, ACPI memory map cleanup routines have changed
commit a238317ce8185519ed083e81e84260907fbbcf7f
Author: Lv Zheng <lv.zheng@intel.com>
Date: Tue May 20 15:39:41 2014 +0800
ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem.
ACPICA doesn't include protections around address space checking, Linux
build tests always complain increased sparse warnings around ACPICA
internal acpi_os_map/unmap_memory() invocations. This patch tries to fix
this issue permanently.
The compat layer needs to replace all instances of ACPI iomem map/unmapping with
the legacy os memory mapping/unmapping calls
4. In newer kernels, Infineon PNP module loading/unloading ops have changed
commit 1551660369d00a7e8cdfa12e9af132053eb67140
Author: Peter Huewe <PeterHuewe@gmx.de>
Date: Mon Mar 16 21:46:31 2015 +0100
PNP: tpm/tpm_infineon: Use module_pnp_driver to register driver
Removing some boilerplate by using module_pnp_driver instead of calling
register and unregister in the otherwise empty init/exit functions
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The compat layer needs to continue loading the PNP module the old way
using explicit init() and exit() functions

View File

@ -1,3 +0,0 @@
tpm
tpm_tis_core
tpm_tis

View File

@ -1,39 +0,0 @@
From: Kam Nasim <kam.nasim@windriver.com>
Date: Tue, 26 Apr 2017 12:23:03 -0400
Subject: [PATCH] ARM64 based ACPI commands should not be compiled
---
tpm_crb.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/tpm_crb.c
+++ b/tpm_crb.c
@@ -531,7 +531,6 @@ static int crb_acpi_add(struct acpi_devi
struct crb_priv *priv;
struct tpm_chip *chip;
struct device *dev = &device->dev;
- struct tpm2_crb_smc *crb_smc;
acpi_status status;
u32 sm;
int rc;
@@ -564,6 +563,7 @@ static int crb_acpi_add(struct acpi_devi
sm == ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD)
priv->flags |= CRB_FL_ACPI_START;
+#ifdef CONFIG_ARM64
if (sm == ACPI_TPM2_COMMAND_BUFFER_WITH_SMC) {
if (buf->header.length < (sizeof(*buf) + sizeof(*crb_smc))) {
dev_err(dev,
@@ -572,10 +572,11 @@ static int crb_acpi_add(struct acpi_devi
ACPI_TPM2_COMMAND_BUFFER_WITH_SMC);
return -EINVAL;
}
- crb_smc = ACPI_ADD_PTR(struct tpm2_crb_smc, buf, sizeof(*buf));
+ struct tpm2_crb_smc *crb_smc = ACPI_ADD_PTR(struct tpm2_crb_smc, buf, sizeof(*buf));
priv->smc_func_id = crb_smc->smc_func_id;
priv->flags |= CRB_FL_CRB_SMC_START;
}
+#endif
rc = crb_map_io(device, priv, buf);
if (rc)

View File

@ -1,543 +0,0 @@
From 70386017de51483cfc9c0fc3e809d6f9867c4c5f Mon Sep 17 00:00:00 2001
Message-Id: <70386017de51483cfc9c0fc3e809d6f9867c4c5f.1507751678.git.Jim.Somerville@windriver.com>
From: Kam Nasim <kam.nasim@windriver.com>
Date: Wed, 26 Apr 2017 12:23:03 -0400
Subject: [PATCH 1/1] compat changes for building tpmdd out-of-tree
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
Makefile | 110 ++++++++++++++++++++-
common.mk | 332 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
kcompat.h | 39 ++++++++
tpm.h | 3 +
4 files changed, 482 insertions(+), 2 deletions(-)
create mode 100644 common.mk
create mode 100644 kcompat.h
diff --git a/Makefile b/Makefile
index 23681f0..f3250cc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
-#
+
+ifneq ($(KERNELRELEASE),)
+# kbuild part of makefile
# Makefile for the kernel tpm device drivers.
#
+
obj-$(CONFIG_TCG_TPM) += tpm.o
tpm-y := tpm-interface.o tpm-dev.o tpm-sysfs.o tpm-chip.o tpm2-cmd.o \
tpm-dev-common.o tpmrm-dev.o tpm1_eventlog.o tpm2_eventlog.o \
@@ -17,7 +20,110 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
-obj-$(CONFIG_TCG_TIS_ST33ZP24) += st33zp24/
obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
obj-$(CONFIG_TCG_CRB) += tpm_crb.o
obj-$(CONFIG_TCG_VTPM_PROXY) += tpm_vtpm_proxy.o
+
+else # ifneq($(KERNELRELEASE),)
+# normal makefile
+
+# driver will be provided by the spec file
+DRIVER=
+
+ifeq (,$(wildcard common.mk))
+ $(error Cannot find common.mk build rules)
+else
+ include common.mk
+endif
+
+###############
+# Build rules #
+###############
+
+# Standard compilation, with regular output
+default:
+ @+$(call kernelbuild,modules)
+
+# Noisy output, for extra debugging
+noisy:
+ @+$(call kernelbuild,modules,V=1)
+
+# Silence any output generated
+silent:
+ @+$(call kernelbuild,modules,>/dev/null)
+
+# Enable higher warning level
+checkwarnings: clean
+ @+$(call kernelbuild,modules,W=1)
+
+# Run sparse static analyzer
+sparse: clean
+ @+$(call kernelbuild,modules,C=2 CF="-D__CHECK_ENDIAN__ -Wbitwise -Wcontext")
+
+# Run coccicheck static analyzer
+ccc: clean
+ @+$(call kernelbuild,modules,coccicheck MODE=report)
+
+# Clean the module subdirectories
+clean:
+ @+$(call kernelbuild,clean)
+ @-rm -rf *.ko
+
+# Install the modules
+install: default
+ @echo "Installing modules..."
+ @+$(call kernelbuild,modules_install)
+ @echo "Running depmod..."
+ @$(call cmd_depmod)
+ifeq (${cmd_initrd},)
+ @echo "Unable to update initrd. You may need to do this manually."
+else
+ @echo "Updating initrd..."
+ -@$(call cmd_initrd)
+endif
+
+# Target used by rpmbuild spec file
+rpm: default
+ @install -D -m 644 ${DRIVER}.ko ${INSTALL_MOD_PATH}/lib/modules/${KVER}/${INSTALL_MOD_DIR}/${DRIVER}.ko
+
+uninstall:
+ rm -f ${INSTALL_MOD_PATH}/lib/modules/${KVER}/${INSTALL_MOD_DIR}/${DRIVER}.ko;
+ $(call cmd_depmod)
+ifeq (${cmd_initrd},)
+ @echo "Unable to update initrd. You may need to do this manually."
+else
+ @echo "Updating initrd..."
+ -@$(call cmd_initrd)
+endif
+
+########
+# Help #
+########
+help:
+ @echo 'Cleaning targets:'
+ @echo ' clean - Clean files generated by kernel module build'
+ @echo 'Build targets:'
+ @echo ' default - Build module(s) with standard verbosity'
+ @echo ' noisy - Build module(s) with V=1 verbosity -- very noisy'
+ @echo ' silent - Build module(s), squelching all output'
+ @echo 'Static Analysis:'
+ @echo ' checkwarnings - Clean, then build module(s) with W=1 warnings enabled'
+ @echo ' sparse - Clean, then check module(s) using sparse'
+ @echo ' ccc - Clean, then check module(s) using coccicheck'
+ @echo 'Other targets:'
+ @echo ' install - Build then install the module(s)'
+ @echo ' uninstall - Uninstall the module(s)'
+ @echo ' help - Display this help message'
+ @echo 'Variables:'
+ @echo ' LINUX_VERSION - Debug tool to force kernel LINUX_VERSION_CODE. Use at your own risk.'
+ @echo ' W=N - Kernel variable for setting warning levels'
+ @echo ' V=N - Kernel variable for setting output verbosity'
+ @echo ' INSTALL_MOD_PATH - Add prefix for the module and manpage installation path'
+ @echo ' INSTALL_MOD_DIR - Use module directory other than updates/drivers/char/tpm/${DRIVER}'
+ @echo ' KSRC - Specifies the full path to the kernel tree to build against'
+ @echo ' Other variables may be available for tuning make process, see'
+ @echo ' Kernel Kbuild documentation for more information'
+
+.PHONY: default noisy clean silent sparse ccc install uninstall help
+
+endif # ifneq($(KERNELRELEASE),)
diff --git a/common.mk b/common.mk
new file mode 100644
index 0000000..671ca33
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,332 @@
+################################################################################
+#
+# Linux TPM Driver
+# Copyright(c) 2013 - 2017 Intel Corporation.
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# The full GNU General Public License is included in this distribution in
+# the file called "COPYING".
+#
+# Contact Information:
+# e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
+# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+################################################################################
+
+
+# common Makefile rules useful for out-of-tree Linux driver builds
+#
+# Usage: include common.mk
+#
+# After including, you probably want to add a minimum_kver_check call
+#
+# Required Variables:
+# DRIVER
+# -- Set to the lowercase driver name
+
+#####################
+# Helpful functions #
+#####################
+
+readlink = $(shell readlink -f ${1})
+
+# helper functions for converting kernel version to version codes
+get_kver = $(or $(word ${2},$(subst ., ,${1})),0)
+get_kvercode = $(shell [ "${1}" -ge 0 -a "${1}" -le 255 2>/dev/null ] && \
+ [ "${2}" -ge 0 -a "${2}" -le 255 2>/dev/null ] && \
+ [ "${3}" -ge 0 -a "${3}" -le 255 2>/dev/null ] && \
+ printf %d $$(( ( ${1} << 16 ) + ( ${2} << 8 ) + ( ${3} ) )) )
+
+################
+# depmod Macro #
+################
+
+cmd_depmod = /sbin/depmod $(if ${SYSTEM_MAP_FILE},-e -F ${SYSTEM_MAP_FILE}) \
+ $(if $(strip ${INSTALL_MOD_PATH}),-b ${INSTALL_MOD_PATH}) \
+ -a ${KVER}
+
+################
+# dracut Macro #
+################
+
+cmd_initrd := $(shell \
+ if which dracut > /dev/null 2>&1 ; then \
+ echo "dracut --force"; \
+ elif which update-initramfs > /dev/null 2>&1 ; then \
+ echo "update-initramfs -u"; \
+ fi )
+
+#####################
+# Environment tests #
+#####################
+
+DRIVER_UPPERCASE := $(shell echo ${DRIVER} | tr "[:lower:]" "[:upper:]" | tr "TPM" "TCG")
+
+ifeq (,${BUILD_KERNEL})
+BUILD_KERNEL=$(shell uname -r)
+endif
+
+# Kernel Search Path
+# All the places we look for kernel source
+KSP := /lib/modules/${BUILD_KERNEL}/source \
+ /lib/modules/${BUILD_KERNEL}/build \
+ /usr/src/linux-${BUILD_KERNEL} \
+ /usr/src/linux-$(${BUILD_KERNEL} | sed 's/-.*//') \
+ /usr/src/kernel-headers-${BUILD_KERNEL} \
+ /usr/src/kernel-source-${BUILD_KERNEL} \
+ /usr/src/linux-$(${BUILD_KERNEL} | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
+ /usr/src/linux \
+ /usr/src/kernels/${BUILD_KERNEL} \
+ /usr/src/kernels
+
+# prune the list down to only values that exist and have an include/linux
+# sub-directory. We can't use include/config because some older kernels don't
+# have this.
+test_dir = $(shell [ -e ${dir}/include/linux ] && echo ${dir})
+KSP := $(foreach dir, ${KSP}, ${test_dir})
+
+# we will use this first valid entry in the search path
+ifeq (,${KSRC})
+ KSRC := $(firstword ${KSP})
+endif
+
+ifeq (,${KSRC})
+ $(warning *** Kernel header files not in any of the expected locations.)
+ $(warning *** Install the appropriate kernel development package, e.g.)
+ $(error kernel-devel, for building kernel modules and try again)
+else
+ifeq (/lib/modules/${BUILD_KERNEL}/source, ${KSRC})
+ KOBJ := /lib/modules/${BUILD_KERNEL}/build
+else
+ KOBJ := ${KSRC}
+endif
+endif
+
+# Version file Search Path
+VSP := ${KOBJ}/include/generated/utsrelease.h \
+ ${KOBJ}/include/linux/utsrelease.h \
+ ${KOBJ}/include/linux/version.h \
+ ${KOBJ}/include/generated/uapi/linux/version.h \
+ /boot/vmlinuz.version.h
+
+# Config file Search Path
+CSP := ${KOBJ}/include/generated/autoconf.h \
+ ${KOBJ}/include/linux/autoconf.h \
+ /boot/vmlinuz.autoconf.h
+
+# System.map Search Path (for depmod)
+MSP := ${KSRC}/System.map \
+ /boot/System.map-${BUILD_KERNEL}
+
+# prune the lists down to only files that exist
+test_file = $(shell [ -f ${file} ] && echo ${file})
+VSP := $(foreach file, ${VSP}, ${test_file})
+CSP := $(foreach file, ${CSP}, ${test_file})
+MSP := $(foreach file, ${MSP}, ${test_file})
+
+
+# and use the first valid entry in the Search Paths
+ifeq (,${VERSION_FILE})
+ VERSION_FILE := $(firstword ${VSP})
+endif
+
+ifeq (,${CONFIG_FILE})
+ CONFIG_FILE := $(firstword ${CSP})
+endif
+
+ifeq (,${SYSTEM_MAP_FILE})
+ SYSTEM_MAP_FILE := $(firstword ${MSP})
+endif
+
+ifeq (,$(wildcard ${VERSION_FILE}))
+ $(error Linux kernel source not configured - missing version header file)
+endif
+
+ifeq (,$(wildcard ${CONFIG_FILE}))
+ $(error Linux kernel source not configured - missing autoconf.h)
+endif
+
+ifeq (,$(wildcard ${SYSTEM_MAP_FILE}))
+ $(warning Missing System.map file - depmod will not check for missing symbols)
+endif
+
+#######################
+# Linux Version Setup #
+#######################
+
+# The following command line parameter is intended for development of KCOMPAT
+# against upstream kernels such as net-next which have broken or non-updated
+# version codes in their Makefile. They are intended for debugging and
+# development purpose only so that we can easily test new KCOMPAT early. If you
+# don't know what this means, you do not need to set this flag. There is no
+# arcane magic here.
+
+# Convert LINUX_VERSION into LINUX_VERSION_CODE
+ifneq (${LINUX_VERSION},)
+ LINUX_VERSION_CODE=$(call get_kvercode,$(call get_kver,${LINUX_VERSION},1),$(call get_kver,${LINUX_VERSION},2),$(call get_kver,${LINUX_VERSION},3))
+endif
+
+# Honor LINUX_VERSION_CODE
+ifneq (${LINUX_VERSION_CODE},)
+ $(warning Forcing target kernel to build with LINUX_VERSION_CODE of ${LINUX_VERSION_CODE}$(if ${LINUX_VERSION}, from LINUX_VERSION=${LINUX_VERSION}). Do this at your own risk.)
+ KVER_CODE := ${LINUX_VERSION_CODE}
+ EXTRA_CFLAGS += -DLINUX_VERSION_CODE=${LINUX_VERSION_CODE}
+endif
+
+# Determine SLE_LOCALVERSION_CODE for SuSE SLE >= 11 (needed by kcompat)
+# This assumes SuSE will continue setting CONFIG_LOCALVERSION to the string
+# appended to the stable kernel version on which their kernel is based with
+# additional versioning information (up to 3 numbers), a possible abbreviated
+# git SHA1 commit id and a kernel type, e.g. CONFIG_LOCALVERSION=-1.2.3-default
+# or CONFIG_LOCALVERSION=-999.gdeadbee-default
+ifeq (1,$(shell ${CC} -E -dM ${CONFIG_FILE} 2> /dev/null |\
+ grep -m 1 CONFIG_SUSE_KERNEL | awk '{ print $$3 }'))
+
+ifneq (10,$(shell ${CC} -E -dM ${CONFIG_FILE} 2> /dev/null |\
+ grep -m 1 CONFIG_SLE_VERSION | awk '{ print $$3 }'))
+
+ LOCALVERSION := $(shell ${CC} -E -dM ${CONFIG_FILE} 2> /dev/null |\
+ grep -m 1 CONFIG_LOCALVERSION | awk '{ print $$3 }' |\
+ cut -d'-' -f2 | sed 's/\.g[[:xdigit:]]\{7\}//')
+ LOCALVER_A := $(shell echo ${LOCALVERSION} | cut -d'.' -f1)
+ LOCALVER_B := $(shell echo ${LOCALVERSION} | cut -s -d'.' -f2)
+ LOCALVER_C := $(shell echo ${LOCALVERSION} | cut -s -d'.' -f3)
+ SLE_LOCALVERSION_CODE := $(shell expr ${LOCALVER_A} \* 65536 + \
+ 0${LOCALVER_B} \* 256 + 0${LOCALVER_C})
+ EXTRA_CFLAGS += -DSLE_LOCALVERSION_CODE=${SLE_LOCALVERSION_CODE}
+endif
+endif
+
+EXTRA_CFLAGS += ${CFLAGS_EXTRA}
+
+# get the kernel version - we use this to find the correct install path
+KVER := $(shell ${CC} ${EXTRA_CFLAGS} -E -dM ${VERSION_FILE} | grep UTS_RELEASE | \
+ awk '{ print $$3 }' | sed 's/\"//g')
+
+# assume source symlink is the same as build, otherwise adjust KOBJ
+ifneq (,$(wildcard /lib/modules/${KVER}/build))
+ ifneq (${KSRC},$(call readlink,/lib/modules/${KVER}/build))
+ KOBJ=/lib/modules/${KVER}/build
+ endif
+endif
+
+ifeq (${KVER_CODE},)
+ KVER_CODE := $(shell ${CC} ${EXTRA_CFLAGS} -E -dM ${VSP} 2> /dev/null |\
+ grep -m 1 LINUX_VERSION_CODE | awk '{ print $$3 }' | sed 's/\"//g')
+endif
+
+# minimum_kver_check
+#
+# helper function to provide uniform output for different drivers to abort the
+# build based on kernel version check. Usage: "$(call minimum_kver_check,2,6,XX)".
+define _minimum_kver_check
+ifeq (0,$(shell [ ${KVER_CODE} -lt $(call get_kvercode,${1},${2},${3}) ]; echo "$$?"))
+ $$(warning *** Aborting the build.)
+ $$(error This driver is not supported on kernel versions older than ${1}.${2}.${3})
+endif
+endef
+minimum_kver_check = $(eval $(call _minimum_kver_check,${1},${2},${3}))
+
+################
+# Manual Pages #
+################
+
+MANSECTION = 7
+
+ifeq (,${MANDIR})
+ # find the best place to install the man page
+ MANPATH := $(shell (manpath 2>/dev/null || echo $MANPATH) | sed 's/:/ /g')
+ ifneq (,${MANPATH})
+ # test based on inclusion in MANPATH
+ test_dir = $(findstring ${dir}, ${MANPATH})
+ else
+ # no MANPATH, test based on directory existence
+ test_dir = $(shell [ -e ${dir} ] && echo ${dir})
+ endif
+ # our preferred install path
+ # should /usr/local/man be in here ?
+ MANDIR := /usr/share/man /usr/man
+ MANDIR := $(foreach dir, ${MANDIR}, ${test_dir})
+ MANDIR := $(firstword ${MANDIR})
+endif
+ifeq (,${MANDIR})
+ # fallback to /usr/man
+ MANDIR := /usr/man
+endif
+
+####################
+# CCFLAGS variable #
+####################
+
+# set correct CCFLAGS variable for kernels older than 2.6.24
+ifeq (0,$(shell [ ${KVER_CODE} -lt $(call get_kvercode,2,6,24) ]; echo $$?))
+CCFLAGS_VAR := EXTRA_CFLAGS
+else
+CCFLAGS_VAR := ccflags-y
+endif
+
+#################
+# KBUILD_OUTPUT #
+#################
+
+# Only set KBUILD_OUTPUT if KOBJ differs from KSRC
+ifneq (${KSRC},${KOBJ})
+export KBUILD_OUTPUT ?= ${KOBJ}
+endif
+
+############################
+# Module Install Directory #
+############################
+
+# Default to using updates/drivers/char/tpm/ path, since depmod since
+# v3.1 defaults to checking updates folder first, and only checking kernels/
+# and extra afterwards. We use updates instead of kernel/* due to desire to
+# prevent over-writing built-in modules files.
+export INSTALL_MOD_DIR ?= updates/drivers/char/tpm/
+
+
+######################
+# Kernel Build Macro #
+######################
+
+# kernel build function
+# ${1} is the kernel build target
+# ${2} may contain any extra rules to pass directly to the sub-make process
+#
+# This function is expected to be executed by
+# @+$(call kernelbuild,<target>,<extra parameters>)
+# from within a Makefile recipe.
+#
+# The following variables are expected to be defined for its use:
+# GCC_I_SYS -- if set it will enable use of gcc-i-sys.sh wrapper to use -isystem
+# CCFLAGS_VAR -- the CCFLAGS variable to set extra CFLAGS
+# EXTRA_CFLAGS -- a set of extra CFLAGS to pass into the ccflags-y variable
+# KSRC -- the location of the kernel source tree to build against
+# DRIVER_UPPERCASE -- the uppercase name of the kernel module, set from DRIVER
+#
+kernelbuild = ${MAKE} $(if ${GCC_I_SYS},CC="${GCC_I_SYS}") \
+ ${CCFLAGS_VAR}="${EXTRA_CFLAGS}" \
+ -C "${KSRC}" \
+ CONFIG_TCG_TPM=m \
+ CONFIG_ACPI=y \
+ CONFIG_TCG_TIS_CORE=m \
+ CONFIG_TCG_TIS=m \
+ CONFIG_TCG_TIS_I2C_ATMEL=m \
+ CONFIG_TCG_TIS_I2C_INFINEON=m \
+ CONFIG_TCG_TIS_I2C_NUVOTON=m \
+ CONFIG_TCG_NSC=m \
+ CONFIG_TCG_ATMEL=m \
+ CONFIG_TCG_INFINEON=m \
+ CONFIG_TCG_CRB=m \
+ CONFIG_${DRIVER_UPPERCASE}=m \
+ modules \
+ M="${CURDIR}" \
+ ${2} ${1}
diff --git a/kcompat.h b/kcompat.h
new file mode 100644
index 0000000..cd9578a
--- /dev/null
+++ b/kcompat.h
@@ -0,0 +1,39 @@
+/**********************************************************************
+ *
+ * Copyright (c) 2017 Wind River Systems, Inc.
+* SPDX-License-Identifier: Apache-2.0
+*
+*
+*
+ **********************************************************************/
+
+#ifndef _KCOMPAT_H_
+#define _KCOMPAT_H_
+
+#ifndef LINUX_VERSION_CODE
+#include <linux/version.h>
+#else
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#endif
+#include <linux/moduleparam.h>
+#include <linux/pm_runtime.h>
+
+#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(3,10,0) )
+#include <linux/idr.h>
+#include <linux/printk.h>
+
+// would normally be passed in from the Kernel, had
+// we set CONFIG_TCG_TPM=y in the KConfig, however
+// that has the added disadvantage of building the
+// TPM driver in-kernel.
+#define CONFIG_TCG_TPM_MODULE 1
+
+#define acpi_os_map_iomem(x, y) acpi_os_map_memory(x, y)
+#define acpi_os_unmap_iomem(x, y) acpi_os_unmap_memory(x, y)
+
+#define module_pnp_driver(__pnp_driver) \
+ module_driver(__pnp_driver, pnp_register_driver, \
+ pnp_unregister_driver)
+
+#endif
+#endif
diff --git a/tpm.h b/tpm.h
index 4b4c8de..b744e2f 100644
--- a/tpm.h
+++ b/tpm.h
@@ -23,6 +23,9 @@
#ifndef __TPM_H__
#define __TPM_H__
+// WRS: the kernel compat layer
+#include "kcompat.h"
+
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/fs.h>
--
1.8.3.1

View File

@ -1,200 +0,0 @@
From 9f3fc7bcddcb51234e23494531f93ab60475e1c3 Mon Sep 17 00:00:00 2001
From: Hamza Attak <hamza@hpe.com>
Date: Mon, 14 Aug 2017 19:09:16 +0100
Subject: [PATCH] tpm: replace msleep() with usleep_range() in TPM 1.2/2.0
generic drivers
The patch simply replaces all msleep function calls with usleep_range calls
in the generic drivers.
Tested with an Infineon TPM 1.2, using the generic tpm-tis module, for a
thousand PCR extends, we see results going from 1m57s unpatched to 40s
with the new patch. We obtain similar results when using the original and
patched tpm_infineon driver, which is also part of the patch.
Similarly with a STM TPM 2.0, using the CRB driver, it takes about 20ms per
extend unpatched and around 7ms with the new patch.
Note that the PCR consistency is untouched with this patch, each TPM has
been tested with 10 million extends and the aggregated PCR value is
continuously verified to be correct.
As an extension of this work, this could potentially and easily be applied
to other vendor's drivers. Still, these changes are not included in the
proposed patch as they are untested.
Signed-off-by: Hamza Attak <hamza@hpe.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
---
tpm-interface.c | 10 +++++-----
tpm.h | 9 ++++++++-
tpm2-cmd.c | 2 +-
tpm_infineon.c | 6 +++---
tpm_tis_core.c | 8 ++++----
5 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/tpm-interface.c b/tpm-interface.c
index fe597e6..1d6729b 100644
--- a/tpm-interface.c
+++ b/tpm-interface.c
@@ -455,7 +455,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
goto out;
}
- msleep(TPM_TIMEOUT); /* CHECK */
+ tpm_msleep(TPM_TIMEOUT);
rmb();
} while (time_before(jiffies, stop));
@@ -970,7 +970,7 @@ int tpm_do_selftest(struct tpm_chip *chip)
dev_info(
&chip->dev, HW_ERR
"TPM command timed out during continue self test");
- msleep(delay_msec);
+ tpm_msleep(delay_msec);
continue;
}
@@ -985,7 +985,7 @@ int tpm_do_selftest(struct tpm_chip *chip)
}
if (rc != TPM_WARN_DOING_SELFTEST)
return rc;
- msleep(delay_msec);
+ tpm_msleep(delay_msec);
} while (--loops > 0);
return rc;
@@ -1085,7 +1085,7 @@ int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
}
} else {
do {
- msleep(TPM_TIMEOUT);
+ tpm_msleep(TPM_TIMEOUT);
status = chip->ops->status(chip);
if ((status & mask) == mask)
return 0;
@@ -1150,7 +1150,7 @@ int tpm_pm_suspend(struct device *dev)
*/
if (rc != TPM_WARN_RETRY)
break;
- msleep(TPM_TIMEOUT_RETRY);
+ tpm_msleep(TPM_TIMEOUT_RETRY);
}
if (rc)
diff --git a/tpm.h b/tpm.h
index 04fbff2..2d5466a 100644
--- a/tpm.h
+++ b/tpm.h
@@ -50,7 +50,8 @@ enum tpm_const {
enum tpm_timeout {
TPM_TIMEOUT = 5, /* msecs */
- TPM_TIMEOUT_RETRY = 100 /* msecs */
+ TPM_TIMEOUT_RETRY = 100, /* msecs */
+ TPM_TIMEOUT_RANGE_US = 300 /* usecs */
};
/* TPM addresses */
@@ -527,6 +528,12 @@ ssize_t tpm_getcap(struct tpm_chip *chip, u32 subcap_id, cap_t *cap,
int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
wait_queue_head_t *queue, bool check_cancel);
+static inline void tpm_msleep(unsigned int delay_msec)
+{
+ usleep_range(delay_msec * 1000,
+ (delay_msec * 1000) + TPM_TIMEOUT_RANGE_US);
+};
+
struct tpm_chip *tpm_chip_find_get(int chip_num);
__must_check int tpm_try_get_ops(struct tpm_chip *chip);
void tpm_put_ops(struct tpm_chip *chip);
diff --git a/tpm2-cmd.c b/tpm2-cmd.c
index f7f34b2a..e1a41b7 100644
--- a/tpm2-cmd.c
+++ b/tpm2-cmd.c
@@ -899,7 +899,7 @@ static int tpm2_do_selftest(struct tpm_chip *chip)
if (rc != TPM2_RC_TESTING)
break;
- msleep(delay_msec);
+ tpm_msleep(delay_msec);
}
return rc;
diff --git a/tpm_infineon.c b/tpm_infineon.c
index 3b1b9f9..d8f1004 100644
--- a/tpm_infineon.c
+++ b/tpm_infineon.c
@@ -191,7 +191,7 @@ static int wait(struct tpm_chip *chip, int wait_for_bit)
/* check the status-register if wait_for_bit is set */
if (status & 1 << wait_for_bit)
break;
- msleep(TPM_MSLEEP_TIME);
+ tpm_msleep(TPM_MSLEEP_TIME);
}
if (i == TPM_MAX_TRIES) { /* timeout occurs */
if (wait_for_bit == STAT_XFE)
@@ -226,7 +226,7 @@ static void tpm_wtx(struct tpm_chip *chip)
wait_and_send(chip, TPM_CTRL_WTX);
wait_and_send(chip, 0x00);
wait_and_send(chip, 0x00);
- msleep(TPM_WTX_MSLEEP_TIME);
+ tpm_msleep(TPM_WTX_MSLEEP_TIME);
}
static void tpm_wtx_abort(struct tpm_chip *chip)
@@ -237,7 +237,7 @@ static void tpm_wtx_abort(struct tpm_chip *chip)
wait_and_send(chip, 0x00);
wait_and_send(chip, 0x00);
number_of_wtx = 0;
- msleep(TPM_WTX_MSLEEP_TIME);
+ tpm_msleep(TPM_WTX_MSLEEP_TIME);
}
static int tpm_inf_recv(struct tpm_chip *chip, u8 * buf, size_t count)
diff --git a/tpm_tis_core.c b/tpm_tis_core.c
index b617b2e..63bc6c3 100644
--- a/tpm_tis_core.c
+++ b/tpm_tis_core.c
@@ -51,7 +51,7 @@ static int wait_startup(struct tpm_chip *chip, int l)
if (access & TPM_ACCESS_VALID)
return 0;
- msleep(TPM_TIMEOUT);
+ tpm_msleep(TPM_TIMEOUT);
} while (time_before(jiffies, stop));
return -1;
}
@@ -117,7 +117,7 @@ static int request_locality(struct tpm_chip *chip, int l)
do {
if (check_locality(chip, l))
return l;
- msleep(TPM_TIMEOUT);
+ tpm_msleep(TPM_TIMEOUT);
} while (time_before(jiffies, stop));
}
return -1;
@@ -164,7 +164,7 @@ static int get_burstcount(struct tpm_chip *chip)
burstcnt = (value >> 8) & 0xFFFF;
if (burstcnt)
return burstcnt;
- msleep(TPM_TIMEOUT);
+ tpm_msleep(TPM_TIMEOUT);
} while (time_before(jiffies, stop));
return -EBUSY;
}
@@ -396,7 +396,7 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
priv->irq = irq;
chip->flags |= TPM_CHIP_FLAG_IRQ;
if (!priv->irq_tested)
- msleep(1);
+ tpm_msleep(1);
if (!priv->irq_tested)
disable_interrupts(chip);
priv->irq_tested = true;
--
1.8.3.1

View File

@ -1,59 +0,0 @@
From 19b460f3fe98b0513bf5a52f63e19bc120bd8093 Mon Sep 17 00:00:00 2001
From: Nayna Jain <nayna@linux.vnet.ibm.com>
Date: Fri, 10 Nov 2017 16:33:06 -0500
Subject: [PATCH] =?UTF-8?q?tpm:=20reduce=C2=A0tpm=C2=A0polling=C2=A0delay?=
=?UTF-8?q?=C2=A0in=C2=A0tpm=5Ftis=5Fcore?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The existing wait_for_tpm_stat() polls for the chip status after
5msec sleep. As per TCG ddwg input, it is expected that tpm might
return status in few usec. So, reducing the delay in polling to
1msec.
Similarly, get_burstcount() function sleeps for 5msec before
retrying for next query to burstcount in a loop. If it takes
lesser time for TPM to return, this 5msec delay is longer than
necessary.
After this change, performance on a TPM 1.2 with an 8 byte
burstcount for 1000 extends improved from ~14sec to ~9sec.
Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
tpm-interface.c | 2 +-
tpm_tis_core.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tpm-interface.c b/tpm-interface.c
index 66d671b..9971422 100644
--- a/tpm-interface.c
+++ b/tpm-interface.c
@@ -1050,7 +1050,7 @@ again:
}
} else {
do {
- tpm_msleep(TPM_TIMEOUT);
+ tpm_msleep(1);
status = chip->ops->status(chip);
if ((status & mask) == mask)
return 0;
diff --git a/tpm_tis_core.c b/tpm_tis_core.c
index 63bc6c3..d87255f 100644
--- a/tpm_tis_core.c
+++ b/tpm_tis_core.c
@@ -164,7 +164,7 @@ static int get_burstcount(struct tpm_chip *chip)
burstcnt = (value >> 8) & 0xFFFF;
if (burstcnt)
return burstcnt;
- tpm_msleep(TPM_TIMEOUT);
+ tpm_msleep(1);
} while (time_before(jiffies, stop));
return -EBUSY;
}
--
1.8.3.1

View File

@ -1,37 +0,0 @@
From 86d94390d9b97639fecb3e032120b93004a3036d Mon Sep 17 00:00:00 2001
From: Nayna Jain <nayna@linux.vnet.ibm.com>
Date: Fri, 10 Nov 2017 16:42:19 -0500
Subject: [PATCH] tpm: use tpm_msleep() value as max delay
Currently, tpm_msleep() uses delay_msec as the minimum value in
usleep_range. However, that is the maximum time we want to wait.
The function is modified to use the delay_msec as the maximum
value, not the minimum value.
After this change, performance on a TPM 1.2 with an 8 byte
burstcount for 1000 extends improved from ~9sec to ~8sec.
Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
---
tpm.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tpm.h b/tpm.h
index d9c3659..6f3297e 100644
--- a/tpm.h
+++ b/tpm.h
@@ -550,8 +550,8 @@ int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
static inline void tpm_msleep(unsigned int delay_msec)
{
- usleep_range(delay_msec * 1000,
- (delay_msec * 1000) + TPM_TIMEOUT_RANGE_US);
+ usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US,
+ delay_msec * 1000);
};
struct tpm_chip *tpm_chip_find_get(int chip_num);
--
1.8.3.1

View File

@ -1,123 +0,0 @@
From 2e23fe68b72638a1185f6243528f05f7dc665a3a Mon Sep 17 00:00:00 2001
From: Nayna Jain <nayna@linux.vnet.ibm.com>
Date: Tue, 14 Nov 2017 11:01:56 -0500
Subject: [PATCH] tpm: define __wait_for_tpm_stat to specify variable polling
sleep time
The existing wait_for_tpm_stat() checks the chip status before
sleeping for 5 msec in a polling loop. For some functions although
the status isn't ready immediately, the status returns extremely
quickly. Waiting for 5 msec causes an unnecessary delay. An
example is the send() call in the tpms_tis driver.
This patch defines __wait_for_tpm_stat(), allowing the caller
to specify the polling sleep timeout value within the loop.
The existing wait_for_tpm_stat() becomes a wrapper for this
function.
After this change, performance on a TPM 1.2 with an 8 byte
burstcount for 1000 extends improved from ~14sec to ~10sec.
Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
---
tpm-interface.c | 15 ++++++++++++---
tpm.h | 3 +++
tpm_tis_core.c | 13 +++++++------
3 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/tpm-interface.c b/tpm-interface.c
index 9971422..69041ec 100644
--- a/tpm-interface.c
+++ b/tpm-interface.c
@@ -1015,8 +1015,9 @@ static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask,
return false;
}
-int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
- wait_queue_head_t *queue, bool check_cancel)
+int __wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
+ unsigned int poll_sleep, wait_queue_head_t *queue,
+ bool check_cancel)
{
unsigned long stop;
long rc;
@@ -1050,7 +1051,7 @@ again:
}
} else {
do {
- tpm_msleep(1);
+ tpm_msleep(poll_sleep);
status = chip->ops->status(chip);
if ((status & mask) == mask)
return 0;
@@ -1058,6 +1059,14 @@ again:
}
return -ETIME;
}
+EXPORT_SYMBOL_GPL(__wait_for_tpm_stat);
+
+int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
+ wait_queue_head_t *queue, bool check_cancel)
+{
+ return __wait_for_tpm_stat(chip, mask, timeout, TPM_TIMEOUT,
+ queue, check_cancel);
+}
EXPORT_SYMBOL_GPL(wait_for_tpm_stat);
#define TPM_ORD_SAVESTATE cpu_to_be32(152)
diff --git a/tpm.h b/tpm.h
index 6f3297e..e2c9f06 100644
--- a/tpm.h
+++ b/tpm.h
@@ -545,6 +545,9 @@ int tpm_do_selftest(struct tpm_chip *chip);
unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, u32 ordinal);
int tpm_pm_suspend(struct device *dev);
int tpm_pm_resume(struct device *dev);
+int __wait_for_tpm_stat(struct tpm_chip *chip, u8 mask,
+ unsigned long timeout, unsigned int poll_sleep,
+ wait_queue_head_t *queue, bool check_cancel);
int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
wait_queue_head_t *queue, bool check_cancel);
diff --git a/tpm_tis_core.c b/tpm_tis_core.c
index d87255f..330b1a7 100644
--- a/tpm_tis_core.c
+++ b/tpm_tis_core.c
@@ -262,9 +262,9 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
status = tpm_tis_status(chip);
if ((status & TPM_STS_COMMAND_READY) == 0) {
tpm_tis_ready(chip);
- if (wait_for_tpm_stat
- (chip, TPM_STS_COMMAND_READY, chip->timeout_b,
- &priv->int_queue, false) < 0) {
+ if (__wait_for_tpm_stat
+ (chip, TPM_STS_COMMAND_READY, chip->timeout_b, 1,
+ &priv->int_queue, false) < 0) {
rc = -ETIME;
goto out_err;
}
@@ -285,7 +285,8 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
count += burstcnt;
- if (wait_for_tpm_stat(chip, TPM_STS_VALID, chip->timeout_c,
+ if (__wait_for_tpm_stat(chip, TPM_STS_VALID,
+ chip->timeout_c, 1,
&priv->int_queue, false) < 0) {
rc = -ETIME;
goto out_err;
@@ -302,8 +303,8 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
if (rc < 0)
goto out_err;
- if (wait_for_tpm_stat(chip, TPM_STS_VALID, chip->timeout_c,
- &priv->int_queue, false) < 0) {
+ if (__wait_for_tpm_stat(chip, TPM_STS_VALID, chip->timeout_c,
+ 1, &priv->int_queue, false) < 0) {
rc = -ETIME;
goto out_err;
}
--
1.8.3.1

View File

@ -1,97 +0,0 @@
From e82060f0cf390ba8e4f79a54e68cef9a38088104 Mon Sep 17 00:00:00 2001
From: Nayna Jain <nayna@linux.vnet.ibm.com>
Date: Fri, 10 Nov 2017 17:16:35 -0500
Subject: [PATCH] tpm: ignore burstcount to improve tpm_tis send() performance
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The TPM burstcount status indicates the number of bytes that can
be sent to the TPM without causing bus wait states.  Effectively,
it is the number of empty bytes in the command FIFO.
This patch optimizes the tpm_tis_send_data() function by checking
the burstcount only once. And if the burstcount is valid, it writes
all the bytes at once, permitting wait state.
After this change, performance on a TPM 1.2 with an 8 byte
burstcount for 1000 extends improved from ~41sec to ~14sec.
Suggested-by: Ken Goldman <kgold@linux.vnet.ibm.com> in
conjunction with the TPM Device Driver work group.
Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
tpm_tis_core.c | 42 +++++++++++++++---------------------------
1 file changed, 15 insertions(+), 27 deletions(-)
diff --git a/tpm_tis_core.c b/tpm_tis_core.c
index a338701..a6b4149 100644
--- a/tpm_tis_core.c
+++ b/tpm_tis_core.c
@@ -256,7 +256,6 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
{
struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev);
int rc, status, burstcnt;
- size_t count = 0;
bool itpm = priv->flags & TPM_TIS_ITPM_WORKAROUND;
status = tpm_tis_status(chip);
@@ -270,36 +269,25 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
}
}
- while (count < len - 1) {
- burstcnt = get_burstcount(chip);
- if (burstcnt < 0) {
- dev_err(&chip->dev, "Unable to read burstcount\n");
- rc = burstcnt;
- goto out_err;
- }
- burstcnt = min_t(int, burstcnt, len - count - 1);
- rc = tpm_tis_write_bytes(priv, TPM_DATA_FIFO(priv->locality),
- burstcnt, buf + count);
- if (rc < 0)
- goto out_err;
- count += burstcnt;
-
- if (__wait_for_tpm_stat(chip, TPM_STS_VALID,
- chip->timeout_c, 1,
- &priv->int_queue, false) < 0) {
- rc = -ETIME;
- goto out_err;
- }
- status = tpm_tis_status(chip);
- if (!itpm && (status & TPM_STS_DATA_EXPECT) == 0) {
- rc = -EIO;
- goto out_err;
- }
+ /*
+ * Get the initial burstcount to ensure TPM is ready to
+ * accept data, even when waiting for burstcount is disabled.
+ */
+ burstcnt = get_burstcount(chip);
+ if (burstcnt < 0) {
+ dev_err(&chip->dev, "Unable to read burstcount\n");
+ rc = burstcnt;
+ goto out_err;
}
+ rc = tpm_tis_write_bytes(priv, TPM_DATA_FIFO(priv->locality),
+ len -1, buf);
+ if (rc < 0)
+ goto out_err;
+
/* write last byte */
- rc = tpm_tis_write8(priv, TPM_DATA_FIFO(priv->locality), buf[count]);
+ rc = tpm_tis_write8(priv, TPM_DATA_FIFO(priv->locality), buf[len-1]);
if (rc < 0)
goto out_err;
--
1.8.3.1

View File

@ -1,327 +0,0 @@
From 5b60e1a889246a5a0d131e74ceaf240fc0637c9f Mon Sep 17 00:00:00 2001
From: Shuicheng Lin <shuicheng.lin@intel.com>
Date: Sat, 29 Dec 2018 02:51:39 +0800
Subject: [PATCH] pick upstream patch to fix build failure with CentOS 7.6
3.10.0-957.1.3 kernel
[commit aad887f6641145fec2a801da2ce4ed36cf99c6a5 from Upstream linux-tpmdd repo]
"
From aad887f6641145fec2a801da2ce4ed36cf99c6a5 Mon Sep 17 00:00:00 2001
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date: Sun, 5 Nov 2017 13:16:26 +0200
Subject: [PATCH] tpm: use struct tpm_chip for tpm_chip_find_get()
Device number (the character device index) is not a stable identifier
for a TPM chip. That is the reason why every call site passes
TPM_ANY_NUM to tpm_chip_find_get().
This commit changes the API in a way that instead a struct tpm_chip
instance is given and NULL means the default chip. In addition, this
commit refines the documentation to be up to date with the
implementation.
Suggested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> (@chip_num -> @chip part)
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@ziepe.ca>
Tested-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
"
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
---
tpm-chip.c | 15 +++----
tpm-interface.c | 133 +++++++++++++++++++++++++++++---------------------------
tpm.h | 2 +-
3 files changed, 76 insertions(+), 74 deletions(-)
diff --git a/tpm-chip.c b/tpm-chip.c
index a321bd5..84710e0 100644
--- a/tpm-chip.c
+++ b/tpm-chip.c
@@ -80,21 +80,21 @@ void tpm_put_ops(struct tpm_chip *chip)
EXPORT_SYMBOL_GPL(tpm_put_ops);
/**
- * tpm_chip_find_get() - return tpm_chip for a given chip number
- * @chip_num: id to find
+ * tpm_chip_find_get() - find and reserve a TPM chip
+ * @chip: a &struct tpm_chip instance, %NULL for the default chip
*
* The return'd chip has been tpm_try_get_ops'd and must be released via
* tpm_put_ops
*/
-struct tpm_chip *tpm_chip_find_get(int chip_num)
+struct tpm_chip *tpm_chip_find_get(struct tpm_chip *chip)
{
- struct tpm_chip *chip, *res = NULL;
+ struct tpm_chip *res = NULL;
+ int chip_num = 0;
int chip_prev;
mutex_lock(&idr_lock);
- if (chip_num == TPM_ANY_NUM) {
- chip_num = 0;
+ if (!chip) {
do {
chip_prev = chip_num;
chip = idr_get_next(&dev_nums_idr, &chip_num);
@@ -104,8 +104,7 @@ struct tpm_chip *tpm_chip_find_get(int chip_num)
}
} while (chip_prev != chip_num);
} else {
- chip = idr_find(&dev_nums_idr, chip_num);
- if (chip && !tpm_try_get_ops(chip))
+ if (!tpm_try_get_ops(chip))
res = chip;
}
diff --git a/tpm-interface.c b/tpm-interface.c
index 69041ec..036c6b6 100644
--- a/tpm-interface.c
+++ b/tpm-interface.c
@@ -787,19 +787,18 @@ int tpm_pcr_read_dev(struct tpm_chip *chip, int pcr_idx, u8 *res_buf)
}
/**
- * tpm_is_tpm2 - is the chip a TPM2 chip?
- * @chip_num: tpm idx # or ANY
+ * tpm_is_tpm2 - do we a have a TPM2 chip?
+ * @chip: a &struct tpm_chip instance, %NULL for the default chip
*
* Returns < 0 on error, and 1 or 0 on success depending whether the chip
* is a TPM2 chip.
*/
-int tpm_is_tpm2(u32 chip_num)
+int tpm_is_tpm2(struct tpm_chip *chip)
{
- struct tpm_chip *chip;
int rc;
- chip = tpm_chip_find_get(chip_num);
- if (chip == NULL)
+ chip = tpm_chip_find_get(chip);
+ if (!chip)
return -ENODEV;
rc = (chip->flags & TPM_CHIP_FLAG_TPM2) != 0;
@@ -811,23 +810,18 @@ int tpm_is_tpm2(u32 chip_num)
EXPORT_SYMBOL_GPL(tpm_is_tpm2);
/**
- * tpm_pcr_read - read a pcr value
- * @chip_num: tpm idx # or ANY
- * @pcr_idx: pcr idx to retrieve
- * @res_buf: TPM_PCR value
- * size of res_buf is 20 bytes (or NULL if you don't care)
- *
- * The TPM driver should be built-in, but for whatever reason it
- * isn't, protect against the chip disappearing, by incrementing
- * the module usage count.
+ * tpm_pcr_read - read a PCR value from SHA1 bank
+ * @chip: a &struct tpm_chip instance, %NULL for the default chip
+ * @pcr_idx: the PCR to be retrieved
+ * @res_buf: the value of the PCR
+ * Return: same as with tpm_transmit_cmd()
*/
-int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf)
+int tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf)
{
- struct tpm_chip *chip;
int rc;
- chip = tpm_chip_find_get(chip_num);
- if (chip == NULL)
+ chip = tpm_chip_find_get(chip);
+ if (!chip)
return -ENODEV;
if (chip->flags & TPM_CHIP_FLAG_TPM2)
rc = tpm2_pcr_read(chip, pcr_idx, res_buf);
@@ -848,26 +842,27 @@ static const struct tpm_input_header pcrextend_header = {
};
/**
- * tpm_pcr_extend - extend pcr value with hash
- * @chip_num: tpm idx # or AN&
- * @pcr_idx: pcr idx to extend
- * @hash: hash value used to extend pcr value
+ * tpm_pcr_extend - extend a PCR value in SHA1 bank.
+ * @chip: a &struct tpm_chip instance, %NULL for the default chip
+ * @pcr_idx: the PCR to be retrieved
+ * @hash: the hash value used to extend the PCR value
*
- * The TPM driver should be built-in, but for whatever reason it
- * isn't, protect against the chip disappearing, by incrementing
- * the module usage count.
+ * Note: with TPM 2.0 extends also those banks with a known digest size to the
+ * cryto subsystem in order to prevent malicious use of those PCR banks. In the
+ * future we should dynamically determine digest sizes.
+ *
+ * Return: same as with tpm_transmit_cmd()
*/
-int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash)
+int tpm_pcr_extend(struct tpm_chip *chip, int pcr_idx, const u8 *hash)
{
struct tpm_cmd_t cmd;
int rc;
- struct tpm_chip *chip;
struct tpm2_digest digest_list[ARRAY_SIZE(chip->active_banks)];
u32 count = 0;
int i;
- chip = tpm_chip_find_get(chip_num);
- if (chip == NULL)
+ chip = tpm_chip_find_get(chip);
+ if (!chip)
return -ENODEV;
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
@@ -984,17 +979,24 @@ out:
return rc;
}
-int tpm_send(u32 chip_num, void *cmd, size_t buflen)
+/**
+ * tpm_send - send a TPM command
+ * @chip: a &struct tpm_chip instance, %NULL for the default chip
+ * @cmd: a TPM command buffer
+ * @buflen: the length of the TPM command buffer
+ *
+ * Return: same as with tpm_transmit_cmd()
+ */
+int tpm_send(struct tpm_chip *chip, void *cmd, size_t buflen)
{
- struct tpm_chip *chip;
int rc;
- chip = tpm_chip_find_get(chip_num);
- if (chip == NULL)
+ chip = tpm_chip_find_get(chip);
+ if (!chip)
return -ENODEV;
rc = tpm_transmit_cmd(chip, NULL, cmd, buflen, 0, 0,
- "attempting tpm_cmd");
+ "attempting to a send a command");
tpm_put_ops(chip);
return rc;
}
@@ -1164,16 +1166,15 @@ static const struct tpm_input_header tpm_getrandom_header = {
};
/**
- * tpm_get_random() - Get random bytes from the tpm's RNG
- * @chip_num: A specific chip number for the request or TPM_ANY_NUM
- * @out: destination buffer for the random bytes
- * @max: the max number of bytes to write to @out
+ * tpm_get_random() - get random bytes from the TPM's RNG
+ * @chip: a &struct tpm_chip instance, %NULL for the default chip
+ * @out: destination buffer for the random bytes
+ * @max: the max number of bytes to write to @out
*
- * Returns < 0 on error and the number of bytes read on success
+ * Return: same as with tpm_transmit_cmd()
*/
-int tpm_get_random(u32 chip_num, u8 *out, size_t max)
+int tpm_get_random(struct tpm_chip *chip, u8 *out, size_t max)
{
- struct tpm_chip *chip;
struct tpm_cmd_t tpm_cmd;
u32 recd, num_bytes = min_t(u32, max, TPM_MAX_RNG_DATA), rlength;
int err, total = 0, retries = 5;
@@ -1182,8 +1183,8 @@ int tpm_get_random(u32 chip_num, u8 *out, size_t max)
if (!out || !num_bytes || max > TPM_MAX_RNG_DATA)
return -EINVAL;
- chip = tpm_chip_find_get(chip_num);
- if (chip == NULL)
+ chip = tpm_chip_find_get(chip);
+ if (!chip)
return -ENODEV;
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
@@ -1225,22 +1226,23 @@ int tpm_get_random(u32 chip_num, u8 *out, size_t max)
EXPORT_SYMBOL_GPL(tpm_get_random);
/**
- * tpm_seal_trusted() - seal a trusted key
- * @chip_num: A specific chip number for the request or TPM_ANY_NUM
- * @options: authentication values and other options
- * @payload: the key data in clear and encrypted form
+ * tpm_seal_trusted() - seal a trusted key payload
+ * @chip: a &struct tpm_chip instance, %NULL for the default chip
+ * @options: authentication values and other options
+ * @payload: the key data in clear and encrypted form
+ *
+ * Note: only TPM 2.0 chip are supported. TPM 1.x implementation is located in
+ * the keyring subsystem.
*
- * Returns < 0 on error and 0 on success. At the moment, only TPM 2.0 chips
- * are supported.
+ * Return: same as with tpm_transmit_cmd()
*/
-int tpm_seal_trusted(u32 chip_num, struct trusted_key_payload *payload,
+int tpm_seal_trusted(struct tpm_chip *chip, struct trusted_key_payload *payload,
struct trusted_key_options *options)
{
- struct tpm_chip *chip;
int rc;
- chip = tpm_chip_find_get(chip_num);
- if (chip == NULL || !(chip->flags & TPM_CHIP_FLAG_TPM2))
+ chip = tpm_chip_find_get(chip);
+ if (!chip || !(chip->flags & TPM_CHIP_FLAG_TPM2))
return -ENODEV;
rc = tpm2_seal_trusted(chip, payload, options);
@@ -1251,22 +1253,23 @@ int tpm_seal_trusted(u32 chip_num, struct trusted_key_payload *payload,
EXPORT_SYMBOL_GPL(tpm_seal_trusted);
/**
- * tpm_unseal_trusted() - unseal a trusted key
- * @chip_num: A specific chip number for the request or TPM_ANY_NUM
- * @options: authentication values and other options
- * @payload: the key data in clear and encrypted form
+ * @chip: a &struct tpm_chip instance, %NULL for the default chip
+ * @options: authentication values and other options
+ * @payload: the key data in clear and encrypted form
+ *
+ * Note: only TPM 2.0 chip are supported. TPM 1.x implementation is located in
+ * the keyring subsystem.
*
- * Returns < 0 on error and 0 on success. At the moment, only TPM 2.0 chips
- * are supported.
+ * Return: same as with tpm_transmit_cmd()
*/
-int tpm_unseal_trusted(u32 chip_num, struct trusted_key_payload *payload,
- struct trusted_key_options *options)
+int tpm_unseal_trusted(struct tpm_chip *chip,
+ struct trusted_key_payload *payload,
+ struct trusted_key_options *options)
{
- struct tpm_chip *chip;
int rc;
- chip = tpm_chip_find_get(chip_num);
- if (chip == NULL || !(chip->flags & TPM_CHIP_FLAG_TPM2))
+ chip = tpm_chip_find_get(chip);
+ if (!chip || !(chip->flags & TPM_CHIP_FLAG_TPM2))
return -ENODEV;
rc = tpm2_unseal_trusted(chip, payload, options);
diff --git a/tpm.h b/tpm.h
index e2c9f06..6d847a2 100644
--- a/tpm.h
+++ b/tpm.h
@@ -557,7 +557,7 @@ static inline void tpm_msleep(unsigned int delay_msec)
delay_msec * 1000);
};
-struct tpm_chip *tpm_chip_find_get(int chip_num);
+struct tpm_chip *tpm_chip_find_get(struct tpm_chip *chip);
__must_check int tpm_try_get_ops(struct tpm_chip *chip);
void tpm_put_ops(struct tpm_chip *chip);
--
2.7.4

View File

@ -1,7 +0,0 @@
0001-disable-arm64-acpi-command.patch
0002-tpmdd-kcompat-support.patch
UPSTREAM-0001-tpm-replace-msleep-with-usleep_range.patch
UPSTREAM-0002-tpm-reduce-tpm-polling-delay-in-tpm_tis_core.patch
UPSTREAM-0003-tpm-use-tpm_msleep-value-as-max-delay.patch
UPSTREAM-0004-tpm-wait-for-stat-to-specify-variable-polling-time.patch
UPSTREAM-0005-tpm-ignore-burstcount-to-improve-send-performance.patch

View File

@ -1,4 +0,0 @@
COPY_LIST="files/*"
TIS_PATCH_VER=5
BUILD_IS_BIG=11
BUILD_IS_SLOW=12

View File

@ -1,529 +0,0 @@
From 4a2a30175a859e5a60b5a0e999c9edfde03eee7c Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Mon, 23 Apr 2018 15:18:45 -0400
Subject: [PATCH] Build logic and sources for TiC
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
Signed-off-by: Robin Lu <bin1.lu@intel.com>
---
SPECS/kernel-rt.spec | 279 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 273 insertions(+), 6 deletions(-)
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
index a922773..adffde2 100644
--- a/SPECS/kernel-rt.spec
+++ b/SPECS/kernel-rt.spec
@@ -17,23 +17,33 @@ Summary: The Linux Realtime kernel
# The Build ID
# %%define buildid .local
+%define buildid .tis.%{tis_patch_ver}
# For a kernel released for public testing, released_kernel should be 1.
# For internal testing builds during development, it should be 0.
%global released_kernel 1
+# If we want to sign the kernel and modules, do_sign should be 1.
+# To speed up builds (don't sign) use 0.
+%global do_sign 1
+
# conditional with/without variables
# Note that the logic here is inverted; a bcond_without implies
# that the variable is on by default (since you use --without to turn it off)
# Likewise a bcond_with implies the variable is off by default (turned on by --with)
%bcond_without rt
%bcond_without doc
-%bcond_without debug
-%bcond_with headers
+%bcond_with debug
+%bcond_without headers
%bcond_with vanilla
-%bcond_without trace
+%bcond_with trace
%bcond_with perf
-%bcond_without debuginfo
+%bcond_with debuginfo
+%bcond_without tools
+
+# Architectures we build tools/cpupower on
+%define cpupowerarchs x86_64 ppc64 ppc64le
+
# What parts do we want to build? We must build at least one kernel.
# These are the kernels that are built IF the architecture allows it.
@@ -53,7 +63,11 @@ Summary: The Linux Realtime kernel
# Verbose output?
# %%global verbose V=1
+%if %{do_sign}
%global signmodules 1
+%else
+%global signmodules 0
+%endif
# if patch fuzzy patch applying will be forbidden
%global with_fuzzy_patches 0
@@ -84,7 +98,7 @@ Summary: The Linux Realtime kernel
%global with_sparse %{?_with_sparse: 1} %{?!_with_sparse: 0}
%global pkg_release_simple %{rhel_build}.%{rttag}.%{rtbuild}
-%global pkg_release %{rhel_build}.%{rttag}.%{rtbuild}%{?buildid}%{?dist}
+%global pkg_release %{pkg_release_simple}%{?dist}%{?buildid}
%global KVERREL %{rpmversion}-%{pkg_release}.%{_target_cpu}
@@ -290,9 +304,14 @@ BuildRequires: xmlto, asciidoc
BuildRequires: openssl
BuildRequires: hmaccalc
BuildRequires: elfutils-libelf-devel
+%if %{do_sign}
%ifarch x86_64
BuildRequires: pesign >= 0.109-4
%endif
+%endif
+%if %{with_tools}
+BuildRequires: pciutils-devel gettext ncurses-devel
+%endif
%if %{with_sparse}
BuildRequires: sparse >= 0.4.1
%endif
@@ -340,6 +359,13 @@ Source25: merge.pl
Source27: sanity_check.py
Source29: extrakeys.pub
+Source37: centos.cer
+Source38: ima_signing_key.pub
+%if %{?released_kernel}
+%define pesign_name redhatsecureboot301
+%else
+%define pesign_name redhatsecureboot003
+%endif
### Configuration files
Source50: kernel-%{version}-x86_64-rt.config
@@ -352,6 +378,14 @@ Source81: find-debuginfo.sh
# Sources for kernel modprobe config files
Source1000: modprobe-dccp-blacklist.conf
+# Sources for kernel-rt-tools
+Source2000: cpupower.service
+Source2001: cpupower.config
+
+Source30000: kernel-3.10.0-x86_64-rt.config.tis_extra
+Source30001: kernel-3.10.0-x86_64-rt-debug.config.tis_extra
+Source30002: kernel-3.10.0-x86_64-rt-trace.config.tis_extra
+
# Empty final patch file to facilitate testing of kernel patches
Patch999999: linux-kernel-test.patch
@@ -374,6 +408,7 @@ This kernel has been compiled with the RT patch applied and is intended
for use in deterministic response-time situations
+%if %{builddoc}
%package doc
Summary: Various documentation bits found in the kernel source
Group: Documentation
@@ -386,6 +421,7 @@ device drivers shipped with it are documented in these files.
You will want to install this package if you need a reference to the
options that can be passed to Linux kernel modules at load time.
+%endif
%package headers
Summary: Header files for the Linux kernel for use by glibc
@@ -393,6 +429,7 @@ Group: Development/System
Obsoletes: glibc-kernheaders < 3.0-46
Provides: glibc-kernheaders = 3.0-46
Provides: kernel-rt-extras = %{version}-%{release}
+Provides: kernel-headers
%description headers
Kernel-headers includes the C header files that specify the interface
between the Linux kernel and userspace libraries and programs. The
@@ -442,6 +479,7 @@ AutoReq: no\
This package provides KVM modules for package %{name}%{?1:-%{1}}.\
%{nil}
+%if %{builddebuginfo}
#
# This macro creates a kernel-rt-<subpackage>-kvm-debuginfo package.
# %%kernel_kvm_debuginfo_package <subpackage>
@@ -458,7 +496,9 @@ This package provides debug information for package %{name}%{?1:-%{1}}.\
This is required to use SystemTap with %{name}%{?1:-%{1}}-%{KVERREL}.\
%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVERREL}%{?1:\.%{1}}/.*|/.*%%{KVERREL}%{?1:\.%{1}}(\.debug)?' -o debuginfo%{?1}-kvm.list}\
%{nil}
+%endif
+%if %{builddebuginfo}
#
# This macro creates a kernel-<subpackage>-debuginfo package.
# %%kernel_debuginfo_package <subpackage>
@@ -476,6 +516,7 @@ This package provides debug information for package %{name}%{?1:-%{1}}.\
This is required to use SystemTap with %{name}%{?1:-%{1}}-%{KVERREL}.\
%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVERREL}%{?1:\.%{1}}/.*|/.*%%{KVERREL}%{?1:\.%{1}}(\.debug)?' -o debuginfo%{?1}.list}\
%{nil}
+%endif
#
# This macro creates a kernel-<subpackage>-devel package.
@@ -490,6 +531,7 @@ Provides: kernel-rt-devel = %{version}-%{release}%{?1:.%{1}}\
Provides: kernel-rt%{?1:-%{1}}-devel-%{_target_cpu} = %{version}-%{release}\
Provides: kernel-rt-devel-%{_target_cpu} = %{version}-%{release}%{?1:.%{1}}\
Provides: kernel-rt-devel-uname-r = %{KVERREL}%{?1:.%{1}}\
+Provides: kernel-devel = %{version}-%{release}%{?1:.%{1}}\
AutoReqProv: no\
Requires(pre): /usr/bin/find\
%description -n kernel-rt%{?variant}%{?1:-%{1}}-devel\
@@ -502,6 +544,7 @@ against the %{?2:%{2} }kernel package.\
# %%define variant_summary The Linux kernel compiled for <configuration>
# %%kernel_variant_package [-n <pretty-name>] <subpackage>
#
+%if %{builddebuginfo}
%define kernel_variant_package(n:) \
%package %1\
Summary: %{variant_summary}\
@@ -512,15 +555,29 @@ Group: System Environment/Kernel\
%{expand:%%kernel_kvm_package %1}\
%{expand:%%kernel_kvm_debuginfo_package %1}\
%{nil}
+%else
+%define kernel_variant_package(n:) \
+%package %1\
+Summary: %{variant_summary}\
+Group: System Environment/Kernel\
+%kernel_reqprovconf\
+%{expand:%%kernel_devel_package %1 %{!?-n:%1}%{?-n:%{-n*}}}\
+%{expand:%%kernel_kvm_package %1}\
+%{nil}
+%endif
# First the auxiliary packages of the main kernel package.
%kernel_devel_package
+%if %{builddebuginfo}
%kernel_debuginfo_package
+%endif
# create the production kvm module package
%kernel_kvm_package
+%if %{builddebuginfo}
%kernel_kvm_debuginfo_package
+%endif
# Now, each variant package.
@@ -570,6 +627,54 @@ It should only be installed when trying to gather additional information
on kernel bugs.
%endif
+%if %{with_tools}
+
+%package -n kernel-rt-tools
+Summary: Assortment of tools for the Linux kernel
+Group: Development/System
+License: GPLv2
+Provides: cpupowerutils-rt = 1:009-0.6.p1
+Obsoletes: cpupowerutils-rt < 1:009-0.6.p1
+Provides: cpufreq-utils-rt = 1:009-0.6.p1
+Provides: cpufrequtils-rt = 1:009-0.6.p1
+Obsoletes: cpufreq-utils-rt < 1:009-0.6.p1
+Obsoletes: cpufrequtils-rt < 1:009-0.6.p1
+Obsoletes: cpuspeed-rt < 1:2.0
+Requires: kernel-rt-tools-libs = %{version}-%{release}
+%description -n kernel-rt-tools
+This package contains the tools/ directory from the kernel source
+and the supporting documentation.
+
+%package -n kernel-rt-tools-libs
+Summary: Libraries for the kernels-tools
+Group: Development/System
+License: GPLv2
+%description -n kernel-rt-tools-libs
+This package contains the libraries built from the tools/ directory
+from the kernel source.
+
+%package -n kernel-rt-tools-libs-devel
+Summary: Assortment of tools for the Linux kernel
+Group: Development/System
+License: GPLv2
+Requires: kernel-rt-tools = %{version}-%{release}
+Provides: cpupowerutils-devel = 1:009-0.6.p1.1
+Obsoletes: cpupowerutils-devel <= 1:009-0.6.p1
+Requires: kernel-rt-tools-libs = %{version}-%{release}
+Provides: kernel-rt-tools-devel
+%description -n kernel-rt-tools-libs-devel
+This package contains the development files for the tools/ directory from
+the kernel source.
+
+%endif # with_tools
+
+%if %{do_sign}
+%package unsigned
+Summary: Unsigned build of the Linux kernel
+%description unsigned
+Contains an unsigned version of the Linux kernel
+%endif # do_sign
+
%prep
## ApplyPatch routine
patch_command='patch -p1 -F1 -s'
@@ -614,6 +719,12 @@ cp -rl vanilla-%{kversion} linux-%{kversion}.%{_target_cpu}
cd linux-%{kversion}.%{_target_cpu}
+# Copy any TiS-specific config changes
+cp $RPM_SOURCE_DIR/kernel-%{version}-*.config.tis_extra .
+
+# Copy TiS specific IMA public key
+cp %{SOURCE38} .
+
## Apply Patches here
ApplyPatch linux-kernel-test.patch
@@ -637,6 +748,15 @@ for i in *.config
do
mv $i .config
Arch=`head -1 .config | cut -b 3-`
+
+ # Handle StarlingX Cloud customizations. Use -n to match oldnoconfig below. We want this before
+ # the make line below so that the one below removes any dependencies of ones that we
+ # turn off here. We also want it before "make listnewconfig" so that we can set the
+ # config option for new configs introduced in the StarlingX Cloud patches.
+ if [ -f ${i}.tis_extra ]; then
+ scripts/kconfig/merge_config.sh -m -n .config ${i}.tis_extra
+ fi
+
make %{?cross_opts} ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true
%if %{listnewconfig_fail}
if [ -s .newoptions ]; then
@@ -771,9 +891,13 @@ BuildKernel() {
cp arch/$Arch/boot/zImage.stub $RPM_BUILD_ROOT/%{image_install_path}/zImage.stub-$KernelVer || :
fi
# EFI SecureBoot signing, x86_64-only
+%if %{do_sign}
+ cp $KernelImage vmlinuz.unsigned
+ $CopyKernel vmlinuz.unsigned $RPM_BUILD_ROOT/%{image_install_path}/vmlinuz.unsigned
%ifarch x86_64
- %pesign -s -i $KernelImage -o $KernelImage.signed -a %{SOURCE13} -c %{SOURCE14} -n %{pesign_name}
+ %pesign -s -i $KernelImage -o $KernelImage.signed -a %{SOURCE37} -c %{SOURCE37} -n %{pesign_name}
mv $KernelImage.signed $KernelImage
+%endif
%endif
$CopyKernel $KernelImage $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer
chmod 755 $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer
@@ -919,6 +1043,12 @@ BuildKernel() {
cp signing_key.priv signing_key.priv.sign${Flavour:+.${Flavour}}
cp signing_key.x509 signing_key.x509.sign${Flavour:+.${Flavour}}
+ # STX: Copy these keys as part of the devel package
+ # The Module signing keys are to ensure that only Out-of-tree
+ # built against the StarlingX Kernel get signed and loaded sans warnings
+ cp signing_key.priv ${RPM_BUILD_ROOT}/lib/modules/${KernelVer}/build/
+ cp signing_key.x509 ${RPM_BUILD_ROOT}/lib/modules/${KernelVer}/build/
+
# remove files that will be auto generated by depmod at rpm -i time
for i in alias alias.bin builtin.bin ccwmap dep dep.bin ieee1394map inputmap isapnpmap ofmap pcimap seriomap symbols symbols.bin usbmap softdep devname
do
@@ -934,6 +1064,15 @@ BuildKernel() {
install -Dm644 %{SOURCE1000} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/dccp-blacklist.conf
+ # create the kABI metadata for use in packaging
+ # NOTENOTE: the name symvers is used by the rpm backend
+ # NOTENOTE: to discover and run the /usr/lib/rpm/fileattrs/kabi.attr
+ # NOTENOTE: script which dynamically adds exported kernel symbol
+ # NOTENOTE: checksums to the rpm metadata provides list.
+ # NOTENOTE: if you change the symvers name, update the backend too
+ echo "**** GENERATING kernel ABI metadata ****"
+ gzip -c9 < Module.symvers > $RPM_BUILD_ROOT/boot/symvers-$KernelVer.gz
+
# prune junk from kernel-devel
find $RPM_BUILD_ROOT/usr/src/kernels -name ".*.cmd" -exec rm -f {} \;
}
@@ -981,6 +1120,31 @@ BuildKernel %make_target %kernel_image vanilla
BuildKernel %make_target %kernel_image
%endif
+%if %{with_tools}
+%ifarch %{cpupowerarchs}
+# cpupower
+# make sure version-gen.sh is executable.
+chmod +x tools/power/cpupower/utils/version-gen.sh
+make %{?cross_opts} %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false
+%ifarch x86_64
+ pushd tools/power/cpupower/debug/x86_64
+ make %{?_smp_mflags} centrino-decode powernow-k8-decode
+ popd
+%endif
+%ifarch x86_64
+ pushd tools/power/x86/x86_energy_perf_policy/
+ make
+ popd
+ pushd tools/power/x86/turbostat
+ make
+ popd
+%endif #turbostat/x86_energy_perf_policy
+%endif
+pushd tools
+make tmon
+popd
+%endif
+
%if %{builddoc}
# Make the HTML and man pages.
make -j1 htmldocs mandocs || %{doc_build_fail}
@@ -1013,6 +1177,7 @@ popd
# if it isn't.
%ifnarch noarch
+%if %{do_sign}
%define __modsign_install_post \
if [ "%{with_rt}" -ne "0" ]; then \
Arch=`head -1 configs/kernel-%{version}-%{_target_cpu}-rt.config | cut -b 3-` \
@@ -1031,6 +1196,24 @@ popd
%{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.${AAA} || exit 1 \
done \
%{nil}
+%else
+%define __modsign_install_post \
+ if [ "%{with_rt}" -ne "0" ]; then \
+ Arch=`head -1 configs/kernel-%{version}-%{_target_cpu}-rt.config | cut -b 3-` \
+ rm -rf .tmp_versions \
+ mv .tmp_versions.sign .tmp_versions \
+ mv signing_key.priv.sign signing_key.priv \
+ mv signing_key.x509.sign signing_key.x509 \
+ fi\
+ for AAA in %{?with_trace:trace} %{?with_debug:debug} %{?with_vanilla:vanilla}; do \
+ Arch=`head -1 configs/kernel-%{version}-%{_target_cpu}-rt-${AAA}.config | cut -b 3-` \
+ rm -rf .tmp_versions \
+ mv .tmp_versions.sign.${AAA} .tmp_versions \
+ mv signing_key.priv.sign.${AAA} signing_key.priv \
+ mv signing_key.x509.sign.${AAA} signing_key.x509 \
+ done \
+%{nil}
+%endif
%endif
###
@@ -1120,6 +1303,39 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/doc/perf
%endif # buildperf
%endif
+%if %{with_tools}
+%ifarch %{cpupowerarchs}
+make -C tools/power/cpupower DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install
+rm -f %{buildroot}%{_libdir}/*.{a,la}
+%find_lang cpupower
+mv cpupower.lang ../
+%ifarch x86_64
+ pushd tools/power/cpupower/debug/x86_64
+ install -m755 centrino-decode %{buildroot}%{_bindir}/centrino-decode
+ install -m755 powernow-k8-decode %{buildroot}%{_bindir}/powernow-k8-decode
+ popd
+%endif
+chmod 0755 %{buildroot}%{_libdir}/libcpupower.so*
+mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig
+install -m644 %{SOURCE2000} %{buildroot}%{_unitdir}/cpupower.service
+install -m644 %{SOURCE2001} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
+%ifarch %{ix86} x86_64
+ mkdir -p %{buildroot}%{_mandir}/man8
+ pushd tools/power/x86/x86_energy_perf_policy
+ make DESTDIR=%{buildroot} install
+ popd
+ pushd tools/power/x86/turbostat
+ make DESTDIR=%{buildroot} install
+ popd
+%endif #turbostat/x86_energy_perf_policy
+pushd tools/thermal/tmon
+make INSTALL_ROOT=%{buildroot} install
+popd
+%endif
+
+%endif
+
+
%if %{buildheaders}
# Install kernel headers
make ARCH=%{hdrarch} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install
@@ -1174,6 +1390,14 @@ rm -rf $RPM_BUILD_ROOT
### scripts
###
+%if %{with_tools}
+%post -n kernel-rt-tools
+/sbin/ldconfig
+
+%postun -n kernel-rt-tools
+/sbin/ldconfig
+%endif
+
#
# This macro defines a %%post script for a kernel*-devel package.
# %%kernel_devel_post [<subpackage>]
@@ -1337,6 +1561,43 @@ fi
%endif
%endif
+
+%if %{with_tools}
+%files -n kernel-rt-tools -f cpupower.lang
+%defattr(-,root,root)
+%ifarch %{cpupowerarchs}
+%{_bindir}/cpupower
+%ifarch x86_64
+%{_bindir}/centrino-decode
+%{_bindir}/powernow-k8-decode
+%endif
+%{_unitdir}/cpupower.service
+%{_mandir}/man[1-8]/cpupower*
+%config(noreplace) %{_sysconfdir}/sysconfig/cpupower
+%ifarch %{ix86} x86_64
+%{_bindir}/x86_energy_perf_policy
+%{_mandir}/man8/x86_energy_perf_policy*
+%{_bindir}/turbostat
+%{_mandir}/man8/turbostat*
+%endif
+%endif
+%{_bindir}/tmon
+
+%ifarch %{cpupowerarchs}
+%files -n kernel-rt-tools-libs
+%defattr(-,root,root)
+%{_libdir}/libcpupower.so.0
+%{_libdir}/libcpupower.so.0.0.0
+
+%files -n kernel-rt-tools-libs-devel
+%defattr(-,root,root)
+%{_libdir}/libcpupower.so
+%{_includedir}/cpufreq.h
+%endif
+
+%endif # with_tools
+
+
# This is %{image_install_path} on an arch where that includes ELF files,
# or empty otherwise.
%global elf_image_install_path %{?kernel_image_elf:%{image_install_path}}
@@ -1353,6 +1614,7 @@ fi
/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\
/%{image_install_path}/.vmlinuz-%{KVERREL}%{?2:.%{2}}.hmac\
/boot/System.map-%{KVERREL}%{?2:.%{2}}\
+/boot/symvers-%{KVERREL}%{?2:.%{2}}.gz\
/boot/config-%{KVERREL}%{?2:.%{2}}\
/boot/symvers*\
%exclude /lib/modules/%{KVERREL}%{?2:.%{2}}/kernel/arch/x86/kvm\
@@ -1432,6 +1694,11 @@ fi
%kernel_variant_files %{buildvanilla} vanilla
%endif
+%if %{do_sign}
+%files unsigned
+/boot/vmlinuz.unsigned
+%endif # do_sign
+
%changelog
* Mon Sep 16 2019 Luis Claudio R. Goncalves <lgoncalv@redhat.com> [3.10.0-1062.1.2.rt56.1025.el7]
- [rt] Update source tree to match RHEL rhel-7.7.z tree [1740918 1708718]
--
1.8.3.1

View File

@ -1,42 +0,0 @@
From 611efdc47a31f229612fd324925c76f6fb204d9c Mon Sep 17 00:00:00 2001
Message-Id: <611efdc47a31f229612fd324925c76f6fb204d9c.1584650624.git.Jim.Somerville@windriver.com>
In-Reply-To: <0a8e423b2d06a4604c51a1e5bfcc305203d49a62.1584650624.git.Jim.Somerville@windriver.com>
References: <0a8e423b2d06a4604c51a1e5bfcc305203d49a62.1584650624.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Fri, 13 Mar 2020 16:15:29 -0400
Subject: [PATCH 2/2] Compile issues
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel-rt.spec | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
index c549d7e..f8fe5be 100644
--- a/SPECS/kernel-rt.spec
+++ b/SPECS/kernel-rt.spec
@@ -426,6 +426,11 @@ Patch1033: rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch
Patch1034: rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch
# Workaround for broken bios causing IOMMU issues
Patch1035: Allow-dmar-quirks-for-broken-bioses.patch
+Patch1100: fix-compilation-issues.patch
+# Fix CentOS 7.6 upgrade compile error
+Patch1101: fix-CentOS-7.6-upgrade-compile-error.patch
+# Compile fix for disabling CONFIG_MEMCG_KMEM
+Patch1102: compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -799,6 +804,9 @@ ApplyPatch ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch
ApplyPatch rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch
ApplyPatch rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch
ApplyPatch Allow-dmar-quirks-for-broken-bioses.patch
+ApplyPatch fix-compilation-issues.patch
+ApplyPatch fix-CentOS-7.6-upgrade-compile-error.patch
+ApplyPatch compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch
# move off upstream version mechanism
if [ -e localversion-rt ]; then
--
1.8.3.1

View File

@ -1,104 +0,0 @@
From 0a8e423b2d06a4604c51a1e5bfcc305203d49a62 Mon Sep 17 00:00:00 2001
Message-Id: <0a8e423b2d06a4604c51a1e5bfcc305203d49a62.1584650624.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Fri, 13 Mar 2020 16:15:29 -0400
Subject: [PATCH 1/2] Kernel source patches for TiC
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel-rt.spec | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
index c48b73e..c549d7e 100644
--- a/SPECS/kernel-rt.spec
+++ b/SPECS/kernel-rt.spec
@@ -388,6 +388,44 @@ Source30002: kernel-3.10.0-x86_64-rt-trace.config.tis_extra
# Empty final patch file to facilitate testing of kernel patches
Patch999999: linux-kernel-test.patch
+Patch1000: debrand-single-cpu.patch
+Patch1001: debrand-rh_taint.patch
+Patch1002: debrand-rh-i686-cpu.patch
+Patch1003: affine-compute-kernel-threads.patch
+Patch1004: Affine-irqs-and-workqueues-with-kthread_cpus.patch
+Patch1005: CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch
+Patch1006: cma-add-placement-specifier-for-cma-kernel-parameter.patch
+Patch1007: intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch
+Patch1008: Make-kernel-start-eth-devices-at-offset.patch
+Patch1009: memblock-introduce-memblock_alloc_range.patch
+Patch1010: Notification-of-death-of-arbitrary-processes.patch
+Patch1011: PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch
+Patch1012: x86-enable-DMA-CMA-with-swiotlb.patch
+Patch1013: Add-missing-ifdef-around-max-latency-variable.patch
+Patch1015: Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch
+Patch1016: x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch
+Patch1018: Porting-Cacheinfo-from-Kernel-4.10.17.patch
+Patch1019: Fix-cacheinfo-compilation-issues-for-3.10.patch
+Patch1020: cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch
+Patch1021: cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch
+Patch1022: CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch
+Patch1023: cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch
+Patch1024: US101216-IMA-support-in-Titanium-kernel.patch
+Patch1025: US103091-IMA-System-Configuration.patch
+# Fix compile warnings that break the build
+Patch1026: aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch
+Patch1027: dpt_i2o-fix-build-warning.patch
+# DRBD was choking on write same
+Patch1028: turn-off-write-same-in-smartqpi-driver.patch
+Patch1029: restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch
+Patch1030: robustify-CFS-bandwidth-timer-locking.patch
+Patch1031: epoll-fix-use-after-free-in-eventpoll_release_file.patch
+# Fix three potential kernel memory leaks
+Patch1032: ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch
+Patch1033: rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch
+Patch1034: rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch
+# Workaround for broken bios causing IOMMU issues
+Patch1035: Allow-dmar-quirks-for-broken-bioses.patch
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -727,6 +765,40 @@ cp %{SOURCE38} .
## Apply Patches here
ApplyPatch linux-kernel-test.patch
+ApplyPatch debrand-single-cpu.patch
+ApplyPatch debrand-rh_taint.patch
+ApplyPatch debrand-rh-i686-cpu.patch
+ApplyPatch affine-compute-kernel-threads.patch
+ApplyPatch Affine-irqs-and-workqueues-with-kthread_cpus.patch
+ApplyPatch CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch
+ApplyPatch cma-add-placement-specifier-for-cma-kernel-parameter.patch
+ApplyPatch intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch
+ApplyPatch Make-kernel-start-eth-devices-at-offset.patch
+ApplyPatch memblock-introduce-memblock_alloc_range.patch
+ApplyPatch PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch
+ApplyPatch Notification-of-death-of-arbitrary-processes.patch
+ApplyPatch x86-enable-DMA-CMA-with-swiotlb.patch
+ApplyPatch Add-missing-ifdef-around-max-latency-variable.patch
+ApplyPatch Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch
+ApplyPatch x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch
+ApplyPatch Porting-Cacheinfo-from-Kernel-4.10.17.patch
+ApplyPatch Fix-cacheinfo-compilation-issues-for-3.10.patch
+ApplyPatch cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch
+ApplyPatch cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch
+ApplyPatch CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch
+ApplyPatch cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch
+ApplyPatch US101216-IMA-support-in-Titanium-kernel.patch
+ApplyPatch US103091-IMA-System-Configuration.patch
+ApplyPatch aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch
+ApplyPatch dpt_i2o-fix-build-warning.patch
+ApplyPatch turn-off-write-same-in-smartqpi-driver.patch
+ApplyPatch restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch
+ApplyPatch robustify-CFS-bandwidth-timer-locking.patch
+ApplyPatch epoll-fix-use-after-free-in-eventpoll_release_file.patch
+ApplyPatch ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch
+ApplyPatch rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch
+ApplyPatch rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch
+ApplyPatch Allow-dmar-quirks-for-broken-bioses.patch
# move off upstream version mechanism
if [ -e localversion-rt ]; then
--
1.8.3.1

View File

@ -1,3 +0,0 @@
Build-logic-and-sources-for-TiC.patch
Kernel-source-patches-for-TiC.patch
Compile-issues.patch

View File

@ -1,52 +0,0 @@
From d249a02d441998c43aeb1755c85cffb062628500 Mon Sep 17 00:00:00 2001
Message-Id: <d249a02d441998c43aeb1755c85cffb062628500.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Thu, 22 Dec 2016 17:54:11 -0500
Subject: [PATCH 14/32] Add missing ifdef around max latency variable
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
kernel/trace/trace_hwlat.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index 4b30d8b..1bb578c 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -167,7 +167,9 @@ void trace_hwlat_callback(bool enter)
*/
static int get_sample(void)
{
+#ifdef CONFIG_TRACER_MAX_TRACE
struct trace_array *tr = hwlat_trace;
+#endif
time_type start, t1, t2, last_t2;
s64 diff, total, last_total = 0;
u64 sample = 0;
@@ -254,9 +256,11 @@ static int get_sample(void)
s.nmi_count = nmi_count;
trace_hwlat_sample(&s);
+#ifdef CONFIG_TRACER_MAX_TRACE
/* Keep a running maximum ever recorded hardware latency */
if (sample > tr->max_latency)
tr->max_latency = sample;
+#endif
}
out:
@@ -582,7 +586,9 @@ static int hwlat_tracer_init(struct trace_array *tr)
disable_migrate = false;
hwlat_data.count = 0;
+#ifdef CONFIG_TRACER_MAX_TRACE
tr->max_latency = 0;
+#endif
save_tracing_thresh = tracing_thresh;
/* tracing_thresh is in nsecs, we speak in usecs */
--
1.8.3.1

View File

@ -1,73 +0,0 @@
From 1584ae45f750efec21265fb0b8ac6a02975dfb76 Mon Sep 17 00:00:00 2001
Message-Id: <1584ae45f750efec21265fb0b8ac6a02975dfb76.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
Date: Tue, 24 Nov 2015 16:27:29 -0500
Subject: [PATCH 05/32] Affine irqs and workqueues with kthread_cpus
If the kthread_cpus boot arg is set it means we want to affine
kernel threads to the specified CPU mask as much as possible
in order to avoid doing work on other CPUs.
In this commit we extend the meaning of that boot arg to also
apply to the CPU affinity of unbound and ordered workqueues.
We also use the kthread_cpus value to determine the default irq
affinity. Specifically, as long as the previously-calculated
irq affinity intersects with the kthread_cpus affinity then we'll
use the intersection of the two as the default irq affinity.
Signed-off-by: Chris Friesen <chris.friesen@windriver.com>
[VT: replacing spaces with tabs. Performed tests]
Signed-off-by: Vu Tran <vu.tran@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
kernel/irq/manage.c | 7 +++++++
kernel/workqueue.c | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index bd59426..bad147c 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -410,6 +410,13 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask)
if (cpumask_intersects(mask, nodemask))
cpumask_and(mask, mask, nodemask);
}
+
+ /* This will narrow down the affinity further if we've specified
+ * a reduced cpu_kthread_mask in the boot args.
+ */
+ if (cpumask_intersects(mask, cpu_kthread_mask))
+ cpumask_and(mask, mask, cpu_kthread_mask);
+
irq_do_set_affinity(&desc->irq_data, mask, false);
return 0;
}
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 986e283..7160e71 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5483,6 +5483,8 @@ static int __init init_workqueues(void)
BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL)));
attrs->nice = std_nice[i];
+ /* If we've specified a kthread mask apply it here too. */
+ cpumask_copy(attrs->cpumask, cpu_kthread_mask);
unbound_std_wq_attrs[i] = attrs;
/*
@@ -5493,6 +5495,8 @@ static int __init init_workqueues(void)
BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL)));
attrs->nice = std_nice[i];
attrs->no_numa = true;
+ /* If we've specified a kthread mask apply it here too. */
+ cpumask_copy(attrs->cpumask, cpu_kthread_mask);
ordered_wq_attrs[i] = attrs;
}
--
1.8.3.1

View File

@ -1,79 +0,0 @@
From 340fbe20b7ede7b9a6dca8c3d03cead97257a99d Mon Sep 17 00:00:00 2001
Message-Id: <340fbe20b7ede7b9a6dca8c3d03cead97257a99d.1584649859.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Wed, 29 Jan 2020 14:19:22 -0500
Subject: [PATCH 1/1] Allow dmar quirks for broken bioses
Problem:
Broken bios creates inaccurate DMAR tables,
reporting some bridges as having endpoint types.
This causes IOMMU initialization to bail
out early with an error code, the result of
which is vfio not working correctly.
This is seen on some Skylake based Wolfpass
server platforms with up-to-date bios installed.
Solution:
Instead of just bailing out of IOMMU
initialization when such a condition is found,
we report it and continue. The IOMMU ends
up successfully initialized anyway. We do this
only on platforms that have the Skylake bridges
where this issue has been seen.
This change is inspired by a similar one posted by
Lu Baolu of Intel Corp to lkml
https://lkml.org/lkml/2019/12/24/15
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/iommu/dmar.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 4658dc3..eeaef2e 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -75,6 +75,26 @@ static unsigned long dmar_seq_ids[BITS_TO_LONGS(DMAR_UNITS_SUPPORTED)];
static int alloc_iommu(struct dmar_drhd_unit *drhd);
static void free_iommu(struct intel_iommu *iommu);
+static int scope_mismatch_quirk;
+static void quirk_dmar_scope_mismatch(struct pci_dev *dev)
+{
+ pci_info(dev, "scope mismatch ignored\n");
+ scope_mismatch_quirk = 1;
+}
+
+/*
+ * We expect devices with endpoint scope to have normal PCI
+ * headers, and devices with bridge scope to have bridge PCI
+ * headers. However some PCI devices may be listed in the
+ * DMAR table with bridge scope, even though they have a
+ * normal PCI header and vice versa. We don't declare a
+ * scope mismatch for the special cases below, even though
+ * the bios creates broken tables.
+ */
+/* Sky Lake-E PCI Express Root Port A */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2030,
+ quirk_dmar_scope_mismatch);
+
static void dmar_register_drhd_unit(struct dmar_drhd_unit *drhd)
{
/*
@@ -257,7 +277,10 @@ int dmar_insert_dev_scope(struct dmar_pci_notify_info *info,
info->dev->class >> 8 != PCI_CLASS_BRIDGE_OTHER))) {
pr_warn("Device scope type does not match for %s\n",
pci_name(info->dev));
- return -EINVAL;
+ if (!scope_mismatch_quirk)
+ return -EINVAL;
+ else
+ pr_warn("but continuing anyway\n");
}
for_each_dev_scope(devices, devices_cnt, i, tmp)
--
1.8.3.1

View File

@ -1,58 +0,0 @@
From a4302d3590621f64e639f8e075f423d5120c007e Mon Sep 17 00:00:00 2001
Message-Id: <a4302d3590621f64e639f8e075f423d5120c007e.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Allain Legacy <allain.legacy@windriver.com>
Date: Fri, 29 Jan 2016 12:13:40 -0500
Subject: [PATCH 06/32] CGTS-3744: route: do not cache fib route info on local
routes with oif
For local routes that require a particular output interface we do not want to
cache the result. Caching the result causes incorrect behaviour when there are
multiple source addresses on the interface. The end result being that if the
intended recipient is waiting on that interface for the packet he won't receive
it because it will be delivered on the loopback interface and the IP_PKTINFO
ipi_ifindex will be set to the loopback interface as well.
This can be tested by running a program such as "dhcp_release" which attempts
to inject a packet on a particular interface so that it is received by another
program on the same board. The receiving process should see an IP_PKTINFO
ipi_ifndex value of the source interface (e.g., eth1) instead of the loopback
interface (e.g., lo). The packet will still appear on the loopback interface
in tcpdump but the important aspect is that the CMSG info is correct.
Sample dhcp_release command line:
dhcp_release eth1 192.168.204.222 02:11:33:22:44:66
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
net/ipv4/route.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f19aca2..5246096 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2121,6 +2121,17 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
*/
if (fi && res->prefixlen < 4)
fi = NULL;
+ } else if ((type == RTN_LOCAL) && (orig_oif != 0)) {
+ /*
+ * For local routes that require a particular output interface we do
+ * not want to cache the result. Caching the result causes incorrect
+ * behaviour when there are multiple source addresses on the interface.
+ * The end result being that if the intended recipient is waiting on
+ * that interface for the packet he won't receive it because it will be
+ * delivered on the loopback interface and the IP_PKTINFO ipi_ifindex
+ * will be set to the loopback interface as well.
+ */
+ fi = NULL;
}
fnhe = NULL;
--
1.8.3.1

View File

@ -1,60 +0,0 @@
From ef42dfab80cff26850695de8c95c3e1ba294e05c Mon Sep 17 00:00:00 2001
From: Alex Shi <alex.shi@linaro.org>
Date: Thu, 12 Jan 2017 21:27:03 +0800
Subject: [PATCH] CPU / PM: expose pm_qos_resume_latency for CPUs
[ commit 37efa4b41ffb31dcdfc3beb97d47992bb2a083e5 from linux-stable ]
The cpu-dma PM QoS constraint impacts all the cpus in the system. There is no way
to let the user to choose a PM QoS constraint per cpu.
The following patch exposes to the userspace a per cpu based sysfs file
in order to let the userspace to change the value of the PM QoS latency
constraint.
This change is inoperative in its form and the cpuidle governors have to
take into account the per cpu latency constraint in addition to the
global cpu-dma latency constraint in order to operate properly.
BTW
The pm_qos_resume_latency usage defined in
Documentation/ABI/testing/sysfs-devices-power
The /sys/devices/.../power/pm_qos_resume_latency_us attribute
contains the PM QoS resume latency limit for the given device,
which is the maximum allowed time it can take to resume the
device, after it has been suspended at run time, from a resume
request to the moment the device will be ready to process I/O,
in microseconds. If it is equal to 0, however, this means that
the PM QoS resume latency may be arbitrary.
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/base/cpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 65e786d..91d620f 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -15,6 +15,7 @@
#include <linux/percpu.h>
#include <linux/acpi.h>
#include <linux/tick.h>
+#include <linux/pm_qos.h>
#include "base.h"
@@ -318,6 +319,7 @@ int register_cpu(struct cpu *cpu, int num)
per_cpu(cpu_sys_devices, num) = &cpu->dev;
if (!error)
register_cpu_under_node(num, cpu_to_node(num));
+ dev_pm_qos_expose_latency_limit(&cpu->dev, 0);
#ifdef CONFIG_KEXEC
if (!error)
--
2.7.4

View File

@ -1,36 +0,0 @@
From 615791de3136070eb8fc9100aa8b5ead6905e56a Mon Sep 17 00:00:00 2001
Message-Id: <615791de3136070eb8fc9100aa8b5ead6905e56a.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
Date: Wed, 11 Jan 2017 13:38:37 -0500
Subject: [PATCH 16/32] Enable building kernel with CONFIG_BLK_DEV_NBD
By default, the CentOS 7.3 kernel will fail to build if
CONFIG_BLK_DEV_NBD is enabled, either as module or builtin.
The issue seems to be due to the use of REQ_TYPE_SPECIAL in the
NBD code. Switching it to use REQ_TYPE_DRV_PRIV instead makes the
problem go away.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/block/nbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index a40a4f0..e0c6b62 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -616,7 +616,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
fsync_bdev(bdev);
mutex_lock(&nbd->tx_lock);
blk_rq_init(NULL, &sreq);
- sreq.cmd_type = REQ_TYPE_SPECIAL;
+ sreq.cmd_type = REQ_TYPE_DRV_PRIV;
nbd_cmd(&sreq) = NBD_CMD_DISC;
/* Check again after getting mutex back. */
--
1.8.3.1

View File

@ -1,114 +0,0 @@
From 8eea2ba32882bcbcaf10588c99f7fec0104e9854 Mon Sep 17 00:00:00 2001
Message-Id: <8eea2ba32882bcbcaf10588c99f7fec0104e9854.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Alex Kozyrev <alex.kozyrev@windriver.com>
Date: Wed, 19 Jul 2017 02:25:15 -0500
Subject: [PATCH 20/32] Fix cacheinfo compilation issues for 3.10
Had to revert commit 7cc277b489b4fe91f42eb596b282879c2d13152e:
"Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs. No functional change."
There is no hotplug state machine in 3.10 kernel.
Also implemented cpumap_print_to_pagebuf() function in place.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/base/cacheinfo.c | 65 ++++++++++++++++++++++++++++++++++++------------
1 file changed, 49 insertions(+), 16 deletions(-)
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index eb3af27..c924f7e 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -383,7 +383,12 @@ static ssize_t shared_cpumap_show_func(struct device *dev, bool list, char *buf)
struct cacheinfo *this_leaf = dev_get_drvdata(dev);
const struct cpumask *mask = &this_leaf->shared_cpu_map;
- return cpumap_print_to_pagebuf(list, buf, mask);
+ int len = list?
+ cpulist_scnprintf(buf, PAGE_SIZE-2, mask) :
+ cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
+ buf[len++] = '\n';
+ buf[len] = '\0';
+ return len;
}
static ssize_t shared_cpu_map_show(struct device *dev,
@@ -633,30 +638,58 @@ err:
return rc;
}
-static int cacheinfo_cpu_online(unsigned int cpu)
+static void cache_remove_dev(unsigned int cpu)
{
- int rc = detect_cache_attributes(cpu);
+ if (!cpumask_test_cpu(cpu, &cache_dev_map))
+ return;
+ cpumask_clear_cpu(cpu, &cache_dev_map);
- if (rc)
- return rc;
- rc = cache_add_dev(cpu);
- if (rc)
- free_cache_attributes(cpu);
- return rc;
+ cpu_cache_sysfs_exit(cpu);
}
-static int cacheinfo_cpu_pre_down(unsigned int cpu)
+static int cacheinfo_cpu_callback(struct notifier_block *nfb,
+ unsigned long action, void *hcpu)
{
- if (cpumask_test_and_clear_cpu(cpu, &cache_dev_map))
- cpu_cache_sysfs_exit(cpu);
+ unsigned int cpu = (unsigned long)hcpu;
+ int rc = 0;
- free_cache_attributes(cpu);
- return 0;
+ switch (action & ~CPU_TASKS_FROZEN) {
+ case CPU_ONLINE:
+ rc = detect_cache_attributes(cpu);
+ if (!rc)
+ rc = cache_add_dev(cpu);
+ break;
+ case CPU_DEAD:
+ cache_remove_dev(cpu);
+ if (per_cpu_cacheinfo(cpu))
+ free_cache_attributes(cpu);
+ break;
+ }
+ return notifier_from_errno(rc);
}
static int __init cacheinfo_sysfs_init(void)
{
- return cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "base/cacheinfo:online",
- cacheinfo_cpu_online, cacheinfo_cpu_pre_down);
+ int cpu, rc = 0;
+
+ cpu_notifier_register_begin();
+
+ for_each_online_cpu(cpu) {
+ rc = detect_cache_attributes(cpu);
+ if (rc)
+ goto out;
+ rc = cache_add_dev(cpu);
+ if (rc) {
+ free_cache_attributes(cpu);
+ pr_err("error populating cacheinfo..cpu%d\n", cpu);
+ goto out;
+ }
+ }
+ __hotcpu_notifier(cacheinfo_cpu_callback, 0);
+
+out:
+ cpu_notifier_register_done();
+ return rc;
}
+
device_initcall(cacheinfo_sysfs_init);
--
1.8.3.1

View File

@ -1,37 +0,0 @@
From 97a7d3c050d7996f6a630184fa428a4d170c2ea8 Mon Sep 17 00:00:00 2001
Message-Id: <97a7d3c050d7996f6a630184fa428a4d170c2ea8.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
Date: Thu, 12 May 2016 18:00:00 -0400
Subject: [PATCH 09/32] Make kernel start eth devices at offset
In order to avoid naming collisions, we want to make the kernel
start naming its "ethX" devices at eth1000 instead of eth0. This
will let us rename to a range starting at eth0.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
net/core/dev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 1425f9d..db04f3b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1092,6 +1092,12 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
set_bit(i, inuse);
}
+ /* STX extension, want kernel to start at eth1000 */
+ if (strcmp(name, "eth%d") == 0) {
+ for (i=0; i < 1000; i++)
+ set_bit(i, inuse);
+ }
+
i = find_first_zero_bit(inuse, max_netdevices);
free_page((unsigned long) inuse);
}
--
1.8.3.1

View File

@ -1,536 +0,0 @@
From 220edc1ccc6a0bc3dfb94a92946bf2b9a6cc0c61 Mon Sep 17 00:00:00 2001
From: Chris Friesen <chris.friesen@windriver.com>
Date: Thu, 7 Apr 2016 11:16:19 -0600
Subject: [PATCH] Notification of death of arbitrary processes
Note: this commit was copied from Titanium Cloud Rel2
This exposes a new feature which may be called to request
notification when an arbitrary process changes state. The
caller specifies a pid, signal number, and event mask, and
when that pid dies, or is stopped, or anything else that
would normally cause a SIGCHLD, the kernel will send the
specified signal to the caller if the event is in the event
mask originally passed down. The siginfo_t struct will
contain the same information as would be included with SIGCHLD.
This is exposed to userspace via the prctl() call with the
PR_DO_NOTIFY_TASK_STATE option.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
include/linux/init_task.h | 9 ++
include/linux/sched.h | 6 ++
include/uapi/linux/prctl.h | 18 ++++
init/Kconfig | 15 +++
kernel/Makefile | 1 +
kernel/death_notify.c | 227 +++++++++++++++++++++++++++++++++++++++++++++
kernel/death_notify.h | 45 +++++++++
kernel/exit.c | 6 ++
kernel/fork.c | 4 +
kernel/signal.c | 11 +++
kernel/sys.c | 9 ++
11 files changed, 351 insertions(+)
create mode 100644 kernel/death_notify.c
create mode 100644 kernel/death_notify.h
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d8c82e0..ba0c12e 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -77,6 +77,14 @@ extern struct nsproxy init_nsproxy;
.signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh), \
}
+#ifdef CONFIG_SIGEXIT
+#define INIT_SIGEXIT(tsk) \
+ .notify = LIST_HEAD_INIT(tsk.notify), \
+ .monitor = LIST_HEAD_INIT(tsk.monitor),
+#else
+#define INIT_SIGEXIT(tsk)
+#endif
+
extern struct group_info init_groups;
#define INIT_STRUCT_PID { \
@@ -231,6 +239,7 @@ extern struct task_group root_task_group;
.alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \
.journal_info = NULL, \
.cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
+ INIT_SIGEXIT(tsk) \
.pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
.timer_slack_ns = 50000, /* 50 usec default slack */ \
INIT_TIMER_LIST \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 97ff026..0785453 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1686,6 +1686,12 @@ struct task_struct {
short il_next;
short pref_node_fork;
#endif
+#ifdef CONFIG_SIGEXIT
+ /* list of processes to notify on death */
+ struct list_head notify;
+ /* list of outstanding monitor requests */
+ struct list_head monitor;
+#endif
#ifdef CONFIG_NUMA_BALANCING
int numa_scan_seq;
unsigned int numa_scan_period;
diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h
index a817b5c..2cf7776 100644
--- a/include/uapi/linux/prctl.h
+++ b/include/uapi/linux/prctl.h
@@ -55,6 +55,24 @@
#define PR_SET_NAME 15 /* Set process name */
#define PR_GET_NAME 16 /* Get process name */
+#ifdef CONFIG_SIGEXIT
+#define PR_DO_NOTIFY_TASK_STATE 17 /* Set/get notification for task
+ state changes */
+
+/* This is the data structure for requestion process death
+ * (and other state change) information. Sig of -1 means
+ * query, sig of 0 means deregistration, positive sig means
+ * that you want to set it. sig and events are value-result
+ * and will be updated with the previous values on every
+ * successful call.
+ */
+struct task_state_notify_info {
+ pid_t pid;
+ int sig;
+ unsigned int events;
+};
+#endif
+
/* Get/set process endian */
#define PR_GET_ENDIAN 19
#define PR_SET_ENDIAN 20
diff --git a/init/Kconfig b/init/Kconfig
index 1d645a1..37e48c0 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1581,6 +1581,21 @@ config VM_EVENT_COUNTERS
on EXPERT systems. /proc/vmstat will only show page counts
if VM event counters are disabled.
+config SIGEXIT
+ bool "Notification of death of arbitrary processes"
+ default n
+ help
+ When enabled this exposes a new feature which may be called to request
+ notification when an arbitrary process changes state. The caller specifies
+ a pid, signal number, and event mask, and when that pid dies, or is
+ stopped, or anything else that would normally cause a SIGCHLD, the
+ kernel will send the specified signal to the caller if the event is in
+ the event mask originally passed down. The siginfo_t struct will
+ contain the same information as would be included with SIGCHLD.
+
+ This is exposed to userspace via the prctl()
+ call with the PR_DO_NOTIFY_TASK_STATE option
+
config SLUB_DEBUG
default y
bool "Enable SLUB debugging support" if EXPERT
diff --git a/kernel/Makefile b/kernel/Makefile
index 762218c..d357e7d 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -120,6 +120,7 @@ obj-$(CONFIG_TRACEPOINTS) += trace/
obj-$(CONFIG_IRQ_WORK) += irq_work.o
obj-$(CONFIG_CPU_PM) += cpu_pm.o
obj-$(CONFIG_BPF) += bpf/
+obj-$(CONFIG_SIGEXIT) += death_notify.o
obj-$(CONFIG_PERF_EVENTS) += events/
diff --git a/kernel/death_notify.c b/kernel/death_notify.c
new file mode 100644
index 0000000..5eb8bfc
--- /dev/null
+++ b/kernel/death_notify.c
@@ -0,0 +1,227 @@
+/*
+ * kernel/death_notify.c, Process death notification support
+ *
+ * Copyright (c) 2006-2014 Wind River Systems, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/prctl.h>
+#include <linux/uaccess.h>
+
+#include "death_notify.h"
+
+static void unlink_status_notifier(struct signotifier *n)
+{
+ list_del(&n->monitor_list);
+ list_del(&n->notify_list);
+ kfree(n);
+}
+
+static void handle_already_monitoring(struct signotifier *node,
+ struct task_state_notify_info *args,
+ struct task_state_notify_info *oldargs)
+{
+ /* Store the old values */
+ oldargs->sig = node->sig;
+ oldargs->events = node->events;
+
+ /* We know that args->sig is 0 or a valid signal. */
+ if (args->sig > 0) {
+ /* Update the new values */
+ node->sig = args->sig;
+ node->events = args->events;
+ } else if (!args->sig) {
+ /* args->sig of 0 means to deregister */
+ unlink_status_notifier(node);
+ }
+}
+
+static void setup_new_node(struct task_struct *p,
+ struct signotifier *node,
+ struct task_state_notify_info *args)
+{
+ node->notify_tsk = current;
+ node->sig = args->sig;
+ node->events = args->events;
+
+ /* Add this node to the list of notification requests
+ * for the specified process.
+ */
+ list_add_tail(&node->notify_list, &p->notify);
+
+ /* Also add this node to the list of monitor requests
+ * for the current process.
+ */
+ list_add_tail(&node->monitor_list, &current->monitor);
+}
+
+
+/* Returns 0 if arguments are valid, 1 if they are not. */
+static int invalid_args(struct task_state_notify_info *args)
+{
+ int ret = 1;
+
+ if (args->pid <= 0)
+ goto out;
+
+ /* Sig of -1 implies query, sig of 0 implies deregistration.
+ * Otherwise sig must be positive and within range.
+ */
+ if ((args->sig < -1) || (args->sig > _NSIG))
+ goto out;
+
+ /* If positive sig, must have valid events. */
+ if (args->sig > 0) {
+ if (!args->events || (args->events >= (1 << (NSIGCHLD+1))))
+ goto out;
+ }
+
+ ret = 0;
+out:
+ return ret;
+}
+
+/* Notify those registered for process state updates via do_notify_task_state().
+ * If "del" is nonzero, the process is dying and we want to free
+ * the nodes in the list as we go.
+ *
+ * Note: we only notify processes for events in which they have registered
+ * interest.
+ *
+ * Must be called holding a lock on tasklist_lock.
+ */
+void do_notify_others(struct task_struct *tsk, struct siginfo *info)
+{
+ struct signotifier *node;
+ unsigned int events;
+
+ /* This method of generating the event bit must be
+ * matched in the userspace library.
+ */
+ events = 1 << (info->si_code & 0xFF);
+
+ list_for_each_entry(node, &tsk->notify, notify_list) {
+ if (events & node->events) {
+ info->si_signo = node->sig;
+ group_send_sig_info(node->sig, info, node->notify_tsk);
+ }
+ }
+}
+
+void release_notify_others(struct task_struct *p)
+{
+ struct signotifier *n, *t;
+
+ /* Need to clean up any outstanding requests where we
+ * wanted to be notified when others died.
+ */
+ list_for_each_entry_safe(n, t, &p->monitor, monitor_list) {
+ unlink_status_notifier(n);
+ }
+
+ /* Also need to clean up any outstanding requests where others
+ * wanted to be notified when we died.
+ */
+ list_for_each_entry_safe(n, t, &p->notify, notify_list) {
+ unlink_status_notifier(n);
+ }
+}
+
+/* If the config is defined, then processes can call this routine
+ * to request notification when the specified task's state changes.
+ * On the death (or other state change) of the specified process,
+ * we will send them the specified signal if the event is listed
+ * in their event bitfield.
+ *
+ * A sig of 0 means that we want to deregister.
+ *
+ * The sig/events fields are value/result. On success we update them
+ * to reflect what they were before the call.
+ *
+ * Returns error code on error, on success we return 0.
+ */
+int do_notify_task_state(unsigned long arg)
+{
+ int err;
+ struct task_struct *p;
+ struct signotifier *node, *tmp;
+ struct task_state_notify_info args, oldargs;
+
+ if (copy_from_user(&args, (struct task_state_notify_info __user *)arg,
+ sizeof(args)))
+ return -EFAULT;
+ oldargs.pid = args.pid;
+
+ /* Validate the arguments passed in. */
+ err = -EINVAL;
+ if (invalid_args(&args))
+ goto out;
+
+ /* We must hold a write lock on tasklist_lock to add the notification
+ * later on, and we need some lock on tasklist_lock for
+ * find_task_by_pid(), so may as well take the write lock now.
+ * Must use write_lock_irq().
+ */
+ write_lock_irq(&tasklist_lock);
+
+ err = -ESRCH;
+ p = find_task_by_vpid(args.pid);
+ if (!p)
+ goto unlock_out;
+
+ /* Now we know pid exists, unlikely to fail. */
+ err = 0;
+
+ /* Check if we're already monitoring the specified pid. If so, update
+ * the monitoring parameters and return the old ones.
+ */
+ list_for_each_entry(tmp, &p->notify, notify_list) {
+ if (tmp->notify_tsk == current) {
+ handle_already_monitoring(tmp, &args, &oldargs);
+ goto unlock_out;
+ }
+ }
+
+ /* If we get here, we're not currently monitoring the process. */
+ oldargs.sig = 0;
+ oldargs.events = 0;
+
+ /* If we wanted to set up a new monitor, do it now. If we didn't
+ * manage to allocate memory for the new node, then we return
+ * an appropriate error.
+ */
+ if (args.sig > 0) {
+ node = kmalloc(sizeof(*node), GFP_ATOMIC);
+ if (node)
+ setup_new_node(p, node, &args);
+ else
+ err = -ENOMEM;
+ }
+
+unlock_out:
+ write_unlock_irq(&tasklist_lock);
+
+ /* Copy the old values back to caller. */
+ if (copy_to_user((struct task_state_notify_info __user *)arg,
+ &oldargs, sizeof(oldargs)))
+ err = -EFAULT;
+
+out:
+ return err;
+}
diff --git a/kernel/death_notify.h b/kernel/death_notify.h
new file mode 100644
index 0000000..b2b8e8c
--- /dev/null
+++ b/kernel/death_notify.h
@@ -0,0 +1,45 @@
+/*
+ * kernel/death_notify.h, Process death notification support
+ *
+ * Copyright (c) 2006-2014 Wind River Systems, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifndef _KERNEL_DEATH_NOTIFY_H
+#define _KERNEL_DEATH_NOTIFY_H
+
+#ifdef CONFIG_SIGEXIT
+
+struct signotifier {
+ struct task_struct *notify_tsk;
+ struct list_head notify_list;
+ struct list_head monitor_list;
+ int sig;
+ unsigned int events;
+};
+
+extern int do_notify_task_state(unsigned long arg);
+extern void do_notify_others(struct task_struct *tsk,
+ struct siginfo *info);
+extern void release_notify_others(struct task_struct *p);
+
+#else /* !CONFIG_SIGEXIT */
+
+static inline void do_notify_others(struct task_struct *tsk,
+ struct siginfo *info) {}
+static inline void release_notify_others(struct task_struct *p) {}
+
+#endif /* CONFIG_SIGEXIT */
+#endif
diff --git a/kernel/exit.c b/kernel/exit.c
index 8a908ea..448a3c3 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -59,6 +59,9 @@
#include <asm/unistd.h>
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
static void exit_mm(struct task_struct * tsk);
@@ -184,6 +187,9 @@ repeat:
proc_flush_task(p);
tasklist_write_lock_irq();
+#ifdef CONFIG_SIGEXIT
+ release_notify_others(p);
+#endif
ptrace_release_task(p);
__exit_signal(p);
diff --git a/kernel/fork.c b/kernel/fork.c
index 6bda4c0..f3cd3ad 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1518,6 +1518,10 @@ static struct task_struct *copy_process(unsigned long clone_flags,
p->sequential_io = 0;
p->sequential_io_avg = 0;
#endif
+#ifdef CONFIG_SIGEXIT
+ INIT_LIST_HEAD(&p->notify);
+ INIT_LIST_HEAD(&p->monitor);
+#endif
/* Perform scheduler related setup. Assign this task to a CPU. */
retval = sched_fork(clone_flags, p);
diff --git a/kernel/signal.c b/kernel/signal.c
index 59e84a2..728daa9 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -47,6 +47,9 @@
#include <asm/siginfo.h>
#include <asm/cacheflush.h>
#include "audit.h" /* audit_signal_info() */
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
/*
* SLAB caches for signal bits.
@@ -1849,6 +1852,10 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
__wake_up_parent(tsk, tsk->parent);
spin_unlock_irqrestore(&psig->siglock, flags);
+#ifdef CONFIG_SIGEXIT
+ do_notify_others(tsk, &info);
+#endif
+
return autoreap;
}
@@ -1920,6 +1927,10 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
*/
__wake_up_parent(tsk, parent);
spin_unlock_irqrestore(&sighand->siglock, flags);
+
+#ifdef CONFIG_SIGEXIT
+ do_notify_others(tsk, &info);
+#endif
}
static inline int may_ptrace_stop(void)
diff --git a/kernel/sys.c b/kernel/sys.c
index e79ea7e..5d43b93 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -67,6 +67,10 @@
/* Hardening for Spectre-v1 */
#include <linux/nospec.h>
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
+
#ifndef SET_UNALIGN_CTL
# define SET_UNALIGN_CTL(a,b) (-EINVAL)
#endif
@@ -2478,6 +2482,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
else
error = PR_MCE_KILL_DEFAULT;
break;
+#ifdef CONFIG_SIGEXIT
+ case PR_DO_NOTIFY_TASK_STATE:
+ error = do_notify_task_state(arg2);
+ break;
+#endif
case PR_SET_MM:
error = prctl_set_mm(arg2, arg3, arg4, arg5);
break;
--
2.7.4

View File

@ -1,34 +0,0 @@
From a0da95b0152227a9a80d98edf5fc0af345479dce Mon Sep 17 00:00:00 2001
Message-Id: <a0da95b0152227a9a80d98edf5fc0af345479dce.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Dahir Osman <dahir.osman@windriver.com>
Date: Wed, 13 Jan 2016 10:01:11 -0500
Subject: [PATCH 12/32] PCI: Add ACS quirk for Intel Fortville NICs
Use quirks to determine isolation for now until a later kernel can
properly read the Fortville ACS capabilities.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/pci/quirks.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 5614e3f..4a0bfed 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4401,6 +4401,10 @@ static const struct pci_dev_acs_enabled {
/* I219 */
{ PCI_VENDOR_ID_INTEL, 0x15b7, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x15b8, pci_quirk_mf_endpoint_acs },
+ /* I40 */
+ { PCI_VENDOR_ID_INTEL, 0x1572, pci_quirk_mf_endpoint_acs },
+ { PCI_VENDOR_ID_INTEL, 0x1586, pci_quirk_mf_endpoint_acs },
+ { PCI_VENDOR_ID_INTEL, 0x1583, pci_quirk_mf_endpoint_acs },
/* Intel PCH root ports */
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs },
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_spt_pch_acs },
--
1.8.3.1

View File

@ -1,375 +0,0 @@
From 7e592781c3f5635f8b455cfcc2daaca572c633da Mon Sep 17 00:00:00 2001
Message-Id: <7e592781c3f5635f8b455cfcc2daaca572c633da.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Kam Nasim <kam.nasim@windriver.com>
Date: Wed, 23 Aug 2017 17:58:12 -0400
Subject: [PATCH 25/32] US101216: IMA support in Titanium kernel
facilitate building the IMA subsytem out-of-the-kernel tree as a Kernel
module (for which CONFIG_IMA and CONFIG_INTEGRITY will be undefined) by:
- exporting certain function symbols which will be linked to the kernel
module. This includes redefining the export symbols for kernel
functions such that when the kernel module loads, it dynamically points
to those new function definations and reverts to Kernel default
definitions on module deinit
- enabling inode readcount
- modification to ima_file_check to pass in file OPEN status
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
Signed-off-by: Robin Lu <bin1.lu@intel.com>
---
fs/namei.c | 2 +-
fs/nfsd/vfs.c | 2 +-
fs/xattr.c | 1 +
include/linux/fs.h | 15 +------
include/linux/ima.h | 77 +++++++-------------------------
include/linux/integrity.h | 22 ++++-----
security/security.c | 111 +++++++++++++++++++++++++++++++++++++++++++++-
7 files changed, 140 insertions(+), 90 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 9f90b63..bf91ea0 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3243,7 +3243,7 @@ opened:
error = open_check_o_direct(file);
if (error)
goto exit_fput;
- error = ima_file_check(file, op->acc_mode);
+ error = ima_file_check(file, op->acc_mode, *opened);
if (error)
goto exit_fput;
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 00e98c3..cb9250e 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -898,7 +898,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
goto out_nfserr;
}
- host_err = ima_file_check(file, may_flags);
+ host_err = ima_file_check(file, may_flags, 0);
if (host_err) {
fput(file);
goto out_nfserr;
diff --git a/fs/xattr.c b/fs/xattr.c
index e540aca..cc307ec 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -208,6 +208,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
*xattr_value = value;
return error;
}
+EXPORT_SYMBOL_GPL(vfs_getxattr_alloc);
/* Compare an extended attribute value with the given value */
int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index eb6f994..2dbaf80 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -681,9 +681,8 @@ struct inode {
struct fsnotify_mark_connector __rcu *i_fsnotify_marks)
#endif
-#if defined(CONFIG_IMA) && defined(CONFIG_X86_64)
atomic_t i_readcount; /* struct files open RO */
-#endif
+
void *i_private; /* fs or device private pointer */
};
@@ -2852,7 +2851,6 @@ static inline bool inode_is_open_for_write(const struct inode *inode)
return atomic_read(&inode->i_writecount) > 0;
}
-#ifdef CONFIG_IMA
static inline void i_readcount_dec(struct inode *inode)
{
BUG_ON(!atomic_read(&inode->i_readcount));
@@ -2862,16 +2860,7 @@ static inline void i_readcount_inc(struct inode *inode)
{
atomic_inc(&inode->i_readcount);
}
-#else
-static inline void i_readcount_dec(struct inode *inode)
-{
- return;
-}
-static inline void i_readcount_inc(struct inode *inode)
-{
- return;
-}
-#endif
+
extern int do_pipe_flags(int *, int);
extern int kernel_read(struct file *, loff_t, char *, unsigned long);
diff --git a/include/linux/ima.h b/include/linux/ima.h
index 1b7f268..9fee45c 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -13,64 +13,21 @@
#include <linux/fs.h>
struct linux_binprm;
-#ifdef CONFIG_IMA
-extern int ima_bprm_check(struct linux_binprm *bprm);
-extern int ima_file_check(struct file *file, int mask);
-extern void ima_file_free(struct file *file);
-extern int ima_file_mmap(struct file *file, unsigned long prot);
-extern int ima_module_check(struct file *file);
-
-#else
-static inline int ima_bprm_check(struct linux_binprm *bprm)
-{
- return 0;
-}
-
-static inline int ima_file_check(struct file *file, int mask)
-{
- return 0;
-}
-
-static inline void ima_file_free(struct file *file)
-{
- return;
-}
-
-static inline int ima_file_mmap(struct file *file, unsigned long prot)
-{
- return 0;
-}
-
-static inline int ima_module_check(struct file *file)
-{
- return 0;
-}
-
-#endif /* CONFIG_IMA */
-
-#ifdef CONFIG_IMA_APPRAISE
-extern void ima_inode_post_setattr(struct dentry *dentry);
-extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,
+/*
+ * The IMA Kernel module has to redefine these symbols so that
+ * the kernel module can link a dynamic function, as a hook into
+ * the Kernel FS calls (which use these)
+ */
+/* ifdef CONFIG_IMA */
+extern int (*ima_bprm_check)(struct linux_binprm *bprm);
+extern int (*ima_file_check)(struct file *file, int mask, int opened);
+extern void (*ima_file_free)(struct file *file);
+extern int (*ima_file_mmap)(struct file *file, unsigned long prot);
+extern int (*ima_module_check)(struct file *file);
+
+/* ifdef CONFIG_IMA_APPRAISE */
+extern void (*ima_inode_post_setattr)(struct dentry *dentry);
+extern int (*ima_inode_setxattr)(struct dentry *dentry, const char *xattr_name,
const void *xattr_value, size_t xattr_value_len);
-extern int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name);
-#else
-static inline void ima_inode_post_setattr(struct dentry *dentry)
-{
- return;
-}
-
-static inline int ima_inode_setxattr(struct dentry *dentry,
- const char *xattr_name,
- const void *xattr_value,
- size_t xattr_value_len)
-{
- return 0;
-}
-
-static inline int ima_inode_removexattr(struct dentry *dentry,
- const char *xattr_name)
-{
- return 0;
-}
-#endif /* CONFIG_IMA_APPRAISE */
-#endif /* _LINUX_IMA_H */
+extern int (*ima_inode_removexattr)(struct dentry *dentry, const char *xattr_name);
+#endif
diff --git a/include/linux/integrity.h b/include/linux/integrity.h
index 83222ce..a5040b6 100644
--- a/include/linux/integrity.h
+++ b/include/linux/integrity.h
@@ -21,20 +21,14 @@ enum integrity_status {
};
/* List of EVM protected security xattrs */
-#ifdef CONFIG_INTEGRITY
-extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode);
-extern void integrity_inode_free(struct inode *inode);
+/*
+ * The Integrity Kernel module has to redefine these symbols so that
+ * the kernel module can link a dynamic function, as a hook into
+ * the Kernel Security subsystem (which use these)
+ */
-#else
-static inline struct integrity_iint_cache *
- integrity_inode_get(struct inode *inode)
-{
- return NULL;
-}
+/* #ifdef CONFIG_INTEGRITY */
+extern struct integrity_iint_cache *(*integrity_inode_get)(struct inode *inode);
+extern void (*integrity_inode_free)(struct inode *inode);
-static inline void integrity_inode_free(struct inode *inode)
-{
- return;
-}
-#endif /* CONFIG_INTEGRITY */
#endif /* _LINUX_INTEGRITY_H */
diff --git a/security/security.c b/security/security.c
index f069482..646a0e3 100644
--- a/security/security.c
+++ b/security/security.c
@@ -161,6 +161,110 @@ EXPORT_SYMBOL(unregister_lsm_notifier);
/* Security operations */
+/*
+ * Export these symbols since the IMA and Integrity
+ * modules will redefine it. We do this EXPORT in
+ * the security endpoint as this is the last Kernel
+ * hook into the Integrity / IMA modules
+ */
+#ifndef CONFIG_INTEGRITY
+static struct integrity_iint_cache* integrity_inode_get_kmod(struct inode *inode)
+{
+ return NULL;
+}
+
+static void integrity_inode_free_kmod(struct inode *inode)
+{
+ return;
+}
+
+struct integrity_iint_cache *
+ (*integrity_inode_get)(struct inode *) = &integrity_inode_get_kmod;
+void
+ (*integrity_inode_free)(struct inode*) = &integrity_inode_free_kmod;
+
+EXPORT_SYMBOL_GPL(integrity_inode_get);
+EXPORT_SYMBOL_GPL(integrity_inode_free);
+#endif
+
+#ifndef CONFIG_IMA
+static int ima_bprm_check_kmod(struct linux_binprm *bprm)
+{
+ return 0;
+}
+
+static int ima_file_check_kmod(struct file *file, int mask, int opened)
+{
+ return 0;
+}
+
+static void ima_file_free_kmod(struct file *file)
+{
+ return;
+}
+
+static int ima_file_mmap_kmod(struct file *file, unsigned long prot)
+{
+ return 0;
+}
+
+static int ima_module_check_kmod(struct file *file)
+{
+ return 0;
+}
+
+int
+ (*ima_bprm_check)(struct linux_binprm *) = &ima_bprm_check_kmod;
+int
+ (*ima_file_check)(struct file *, int, int) = &ima_file_check_kmod;
+void
+ (*ima_file_free)(struct file *) = &ima_file_free_kmod;
+int
+ (*ima_file_mmap)(struct file*, unsigned long) = &ima_file_mmap_kmod;
+int
+ (*ima_module_check)(struct file *) = &ima_module_check_kmod;
+
+EXPORT_SYMBOL_GPL(ima_bprm_check);
+EXPORT_SYMBOL_GPL(ima_file_check);
+EXPORT_SYMBOL_GPL(ima_file_free);
+EXPORT_SYMBOL_GPL(ima_file_mmap);
+EXPORT_SYMBOL_GPL(ima_module_check);
+#endif
+
+#ifndef CONFIG_IMA_APPRAISE
+static void ima_inode_post_setattr_kmod(struct dentry *dentry)
+{
+ return;
+}
+
+static int ima_inode_setxattr_kmod(struct dentry *dentry,
+ const char *xattr_name,
+ const void *xattr_value,
+ size_t xattr_value_len)
+{
+ return 0;
+}
+
+static int ima_inode_removexattr_kmod(struct dentry *dentry,
+ const char *xattr_name)
+{
+ return 0;
+}
+
+void
+ (*ima_inode_post_setattr)(struct dentry *) = &ima_inode_post_setattr_kmod;
+int
+ (*ima_inode_setxattr)(struct dentry *, const char *,
+ const void *, size_t) = &ima_inode_setxattr_kmod;
+int
+ (*ima_inode_removexattr)(struct dentry *,
+ const char *) = &ima_inode_removexattr_kmod;
+
+EXPORT_SYMBOL_GPL(ima_inode_post_setattr);
+EXPORT_SYMBOL_GPL(ima_inode_setxattr);
+EXPORT_SYMBOL_GPL(ima_inode_removexattr);
+#endif
+
int security_ptrace_access_check(struct task_struct *child, unsigned int mode)
{
#ifdef CONFIG_SECURITY_YAMA_STACKED
@@ -718,8 +822,11 @@ EXPORT_SYMBOL(security_inode_listsecurity);
void security_inode_getsecid(struct inode *inode, u32 *secid)
{
- security_ops->inode_getsecid(inode, secid);
+ if (unlikely(IS_PRIVATE(inode)))
+ return;
+ security_ops->inode_getsecid(inode, secid);
}
+EXPORT_SYMBOL_GPL(security_inode_getsecid);
int security_inode_copy_up(struct dentry *src, struct cred **new)
{
@@ -1528,6 +1635,7 @@ int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule)
{
return security_ops->audit_rule_init(field, op, rulestr, lsmrule);
}
+EXPORT_SYMBOL_GPL(security_audit_rule_init);
int security_audit_rule_known(struct audit_krule *krule)
{
@@ -1544,6 +1652,7 @@ int security_audit_rule_match(u32 secid, u32 field, u32 op, void *lsmrule,
{
return security_ops->audit_rule_match(secid, field, op, lsmrule, actx);
}
+EXPORT_SYMBOL_GPL(security_audit_rule_match);
#endif /* CONFIG_AUDIT */
--
1.8.3.1

Some files were not shown because too many files have changed in this diff Show More