From bceb6c148cb5771c5de3d87cade866c5ce34c71a Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Tue, 7 Apr 2020 11:20:16 -0400 Subject: [PATCH] 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 --- centos_extra_downloads.lst | 1 - centos_guest_image.inc | 26 - centos_guest_image_rt.inc | 23 - centos_iso_image.inc | 61 - centos_pkg_dirs | 12 - centos_pkg_dirs_rt | 12 - centos_srpms_centos.lst | 2 - centos_srpms_centos3rdparties.lst | 1 - centos_tarball-dl.lst | 10 - kernel/kernel-modules/drbd/PKG-INFO | 16 - .../drbd/centos/build_srpm.data | 4 - .../drbd/centos/drbd-kernel.spec | 159 -- .../drbd/centos/files/filelist-redhat | 11 - ...001-remove_bind_before_connect_error.patch | 12 - .../integrity/centos/build_srpm.data | 5 - .../integrity/centos/files/COPYING | 344 --- .../integrity/centos/files/README | 231 -- .../integrity/centos/files/ima.conf | 1 - .../integrity/centos/files/ima.policy | 4 - .../integrity/centos/files/integrity.conf | 1 - .../integrity/centos/files/modules-load.conf | 3 - .../integrity/centos/integrity-kmod.spec | 139 -- .../0001-integrity-kcompat-support.patch | 1322 ---------- .../0002-integrity-expose-module-params.patch | 156 -- .../0003-integrity-restrict-by-iversion.patch | 54 - ...ntegrity-disable-set-xattr-on-imasig.patch | 120 - .../Changes-for-CentOS-7.4-support.patch | 28 - .../Changes-for-CentOS-7.6-support.patch | 78 - .../patches/integrity-kmod.spec.patchlist | 3 - .../intel-e1000e/centos/build_srpm.data | 4 - .../intel-e1000e/centos/e1000e-kmod.spec | 125 - .../intel-e1000e/files/GPL-v2.0.txt | 339 --- .../intel-e1000e/files/modules-load.conf | 1 - .../intel-i40e/centos/build_srpm.data | 4 - .../intel-i40e/centos/i40e-kmod.spec | 128 - .../intel-i40e/files/GPL-v2.0.txt | 339 --- ...e-Enable-getting-link-status-from-VF.patch | 128 - ...re-debug-info-for-VFs-still-in-reset.patch | 64 - .../intel-i40e/files/modules-load.conf | 1 - .../intel-iavf/centos/build_srpm.data | 4 - .../intel-iavf/centos/iavf-kmod.spec | 125 - .../intel-iavf/files/GPL-v2.0.txt | 339 --- .../intel-iavf/files/modules-load.conf | 1 - .../intel-ixgbe/centos/build_srpm.data | 4 - .../intel-ixgbe/centos/ixgbe-kmod.spec | 124 - .../intel-ixgbe/files/GPL-v2.0.txt | 339 --- .../intel-ixgbe/files/modules-load.conf | 1 - .../intel-ixgbevf/centos/build_srpm.data | 4 - .../intel-ixgbevf/centos/ixgbevf-kmod.spec | 122 - .../intel-ixgbevf/files/GPL-v2.0.txt | 339 --- .../intel-ixgbevf/files/modules-load.conf | 1 - .../intel-opae-fpga/centos/build_srpm.data | 4 - .../intel-opae-fpga/centos/fpga-kmod.spec | 117 - ...-mmio-as-it-is-built-into-the-kernel.patch | 55 - .../mlnx-ofa_kernel/centos/build_srpm.data | 3 - .../0001-Support-TiS-system.patch | 199 -- .../centos/meta_patches/PATCH_ORDER | 1 - .../0001-neuter-HAVE_IEEE_GETQCN.patch | 26 - .../0001-neuter-a-bunch-of-ks-stuff.patch | 47 - .../0001-neuter-some-stats-output.patch | 31 - .../patches/Disable-use-of-page-pool.patch | 77 - .../mlnx-ofa_kernel/centos/srpm_path | 1 - .../mlnx-ofa_kernel/files/modules-load.conf | 22 - kernel/kernel-modules/qat17/PKG-INFO | 13 - .../qat17/centos/build_srpm.data | 6 - kernel/kernel-modules/qat17/centos/qat17.spec | 134 -- ...he-return-code-on-firmware-load-fail.patch | 42 - kernel/kernel-modules/qat17/files/qat | 1 - kernel/kernel-modules/qat17/files/qat_service | 384 --- .../tpmdd/centos/build_srpm.data | 5 - .../kernel-modules/tpmdd/centos/tpm-kmod.spec | 146 -- kernel/kernel-modules/tpmdd/files/COPYING | 344 --- kernel/kernel-modules/tpmdd/files/README | 184 -- .../tpmdd/files/modules-load.conf | 3 - .../0001-disable-arm64-acpi-command.patch | 39 - .../patches/0002-tpmdd-kcompat-support.patch | 543 ----- ...tpm-replace-msleep-with-usleep_range.patch | 200 -- ...ce-tpm-polling-delay-in-tpm_tis_core.patch | 59 - ...pm-use-tpm_msleep-value-as-max-delay.patch | 37 - ...tat-to-specify-variable-polling-time.patch | 123 - ...rstcount-to-improve-send-performance.patch | 97 - ...PSTREAM-0006-tpm-use-struct-tpm_chip.patch | 327 --- .../tpmdd/patches/tpm-kmod.spec.patchlist | 7 - kernel/kernel-rt/centos/build_srpm.data | 4 - .../Build-logic-and-sources-for-TiC.patch | 529 ---- .../centos/meta_patches/Compile-issues.patch | 42 - .../Kernel-source-patches-for-TiC.patch | 104 - .../kernel-rt/centos/meta_patches/PATCH_ORDER | 3 - ...ng-ifdef-around-max-latency-variable.patch | 52 - ...rqs-and-workqueues-with-kthread_cpus.patch | 73 - .../Allow-dmar-quirks-for-broken-bioses.patch | 79 - ...do-not-cache-fib-route-info-on-local.patch | 58 - ...xpose-pm_qos_resume_latency-for-CPUs.patch | 60 - ...lding-kernel-with-CONFIG_BLK_DEV_NBD.patch | 36 - ...acheinfo-compilation-issues-for-3.10.patch | 114 - ...e-kernel-start-eth-devices-at-offset.patch | 37 - ...tion-of-death-of-arbitrary-processes.patch | 536 ----- ...d-ACS-quirk-for-Intel-Fortville-NICs.patch | 34 - ...orting-Cacheinfo-from-Kernel-4.10.17.patch | 2125 ----------------- ...01216-IMA-support-in-Titanium-kernel.patch | 375 --- .../US103091-IMA-System-Configuration.patch | 236 -- .../affine-compute-kernel-threads.patch | 168 -- ...ding-user-settings-if-flash-is-not-f.patch | 55 - ...t-specifier-for-cma-kernel-parameter.patch | 224 -- ...-fix-for-disabling-CONFIG_MEMCG_KMEM.patch | 35 - ...id-taking-spinlock-for-accessing-QoS.patch | 92 - ...-per-CPU-PM-QoS-resume-latency-consi.patch | 71 - ...p-seeking-deeper-idle-if-current-sta.patch | 52 - .../kernel-rt/centos/patches/cpupower.config | 3 - .../kernel-rt/centos/patches/cpupower.service | 13 - .../centos/patches/debrand-rh-i686-cpu.patch | 29 - .../centos/patches/debrand-rh_taint.patch | 29 - .../centos/patches/debrand-single-cpu.patch | 27 - .../patches/dpt_i2o-fix-build-warning.patch | 44 - ...after-free-in-eventpoll_release_file.patch | 52 - ...fix-CentOS-7.6-upgrade-compile-error.patch | 66 - .../patches/fix-compilation-issues.patch | 27 - ...w-ignoring-Ethernet-device-RMRR-with.patch | 120 - .../ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch | 57 - ...el-3.10.0-x86_64-rt-debug.config.tis_extra | 6 - ...el-3.10.0-x86_64-rt-trace.config.tis_extra | 6 - .../kernel-3.10.0-x86_64-rt.config.tis_extra | 965 -------- ...block-introduce-memblock_alloc_range.patch | 96 - ...kthreads-to-CPUs-in-cpu_kthread_mask.patch | 47 - ...e-leaked-posix-acl-in-ext4_acl_chmod.patch | 67 - ...leaked-posix-acl-in-ext4_xattr_set_a.patch | 79 - ...obustify-CFS-bandwidth-timer-locking.patch | 167 -- ...rn-off-write-same-in-smartqpi-driver.patch | 28 - .../x86-enable-DMA-CMA-with-swiotlb.patch | 156 -- ...oc_coherent-return-zeroed-memory-if-.patch | 87 - kernel/kernel-rt/centos/srpm_path | 1 - kernel/kernel-rt/files/centos.cer | Bin 1500 -> 0 bytes kernel/kernel-rt/files/ima_signing_key.pub | Bin 987 -> 0 bytes kernel/kernel-std/centos/build_srpm.data | 4 - .../Build-logic-and-sources-for-TiC.patch | 233 -- .../centos/meta_patches/Compile-issues.patch | 44 - .../Kernel-source-patches-for-TiC.patch | 101 - .../centos/meta_patches/PATCH_ORDER | 3 - ...rqs-and-workqueues-with-kthread_cpus.patch | 73 - .../Allow-dmar-quirks-for-broken-bioses.patch | 79 - ...do-not-cache-fib-route-info-on-local.patch | 58 - ...xpose-pm_qos_resume_latency-for-CPUs.patch | 60 - ...lding-kernel-with-CONFIG_BLK_DEV_NBD.patch | 36 - ...acheinfo-compilation-issues-for-3.10.patch | 114 - ...e-when-transparent-hugepages-are-off.patch | 68 - ...e-kernel-start-eth-devices-at-offset.patch | 37 - ...tion-of-death-of-arbitrary-processes.patch | 536 ----- ...d-ACS-quirk-for-Intel-Fortville-NICs.patch | 34 - ...orting-Cacheinfo-from-Kernel-4.10.17.patch | 2125 ----------------- ...01216-IMA-support-in-Titanium-kernel.patch | 375 --- .../US103091-IMA-System-Configuration.patch | 246 -- .../affine-compute-kernel-threads.patch | 168 -- ...ding-user-settings-if-flash-is-not-f.patch | 55 - ...t-specifier-for-cma-kernel-parameter.patch | 224 -- ...-fix-for-disabling-CONFIG_MEMCG_KMEM.patch | 35 - ...id-taking-spinlock-for-accessing-QoS.patch | 92 - ...-per-CPU-PM-QoS-resume-latency-consi.patch | 71 - ...p-seeking-deeper-idle-if-current-sta.patch | 52 - .../patches/dpt_i2o-fix-build-warning.patch | 44 - ...after-free-in-eventpoll_release_file.patch | 52 - ...fix-CentOS-7.6-upgrade-compile-error.patch | 66 - .../patches/fix-compilation-issues.patch | 96 - ...w-ignoring-Ethernet-device-RMRR-with.patch | 120 - .../ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch | 57 - .../kernel-3.10.0-x86_64.config.tis_extra | 821 ------- ...block-introduce-memblock_alloc_range.patch | 96 - ...-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch | 47 - ...e-leaked-posix-acl-in-ext4_acl_chmod.patch | 67 - ...leaked-posix-acl-in-ext4_xattr_set_a.patch | 79 - ...rn-off-write-same-in-smartqpi-driver.patch | 28 - .../x86-enable-DMA-CMA-with-swiotlb.patch | 156 -- ...oc_coherent-return-zeroed-memory-if-.patch | 87 - kernel/kernel-std/centos/srpm_path | 2 - kernel/kernel-std/files/ima_signing_key.pub | Bin 987 -> 0 bytes 174 files changed, 22759 deletions(-) delete mode 100644 centos_srpms_centos3rdparties.lst delete mode 100644 kernel/kernel-modules/drbd/PKG-INFO delete mode 100644 kernel/kernel-modules/drbd/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/drbd/centos/drbd-kernel.spec delete mode 100644 kernel/kernel-modules/drbd/centos/files/filelist-redhat delete mode 100644 kernel/kernel-modules/drbd/centos/patches/0001-remove_bind_before_connect_error.patch delete mode 100644 kernel/kernel-modules/integrity/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/integrity/centos/files/COPYING delete mode 100644 kernel/kernel-modules/integrity/centos/files/README delete mode 100644 kernel/kernel-modules/integrity/centos/files/ima.conf delete mode 100644 kernel/kernel-modules/integrity/centos/files/ima.policy delete mode 100644 kernel/kernel-modules/integrity/centos/files/integrity.conf delete mode 100644 kernel/kernel-modules/integrity/centos/files/modules-load.conf delete mode 100644 kernel/kernel-modules/integrity/centos/integrity-kmod.spec delete mode 100644 kernel/kernel-modules/integrity/centos/patches/0001-integrity-kcompat-support.patch delete mode 100644 kernel/kernel-modules/integrity/centos/patches/0002-integrity-expose-module-params.patch delete mode 100644 kernel/kernel-modules/integrity/centos/patches/0003-integrity-restrict-by-iversion.patch delete mode 100644 kernel/kernel-modules/integrity/centos/patches/0004-integrity-disable-set-xattr-on-imasig.patch delete mode 100644 kernel/kernel-modules/integrity/centos/patches/Changes-for-CentOS-7.4-support.patch delete mode 100644 kernel/kernel-modules/integrity/centos/patches/Changes-for-CentOS-7.6-support.patch delete mode 100644 kernel/kernel-modules/integrity/centos/patches/integrity-kmod.spec.patchlist delete mode 100644 kernel/kernel-modules/intel-e1000e/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec delete mode 100644 kernel/kernel-modules/intel-e1000e/files/GPL-v2.0.txt delete mode 100644 kernel/kernel-modules/intel-e1000e/files/modules-load.conf delete mode 100644 kernel/kernel-modules/intel-i40e/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/intel-i40e/centos/i40e-kmod.spec delete mode 100644 kernel/kernel-modules/intel-i40e/files/GPL-v2.0.txt delete mode 100644 kernel/kernel-modules/intel-i40e/files/i40e-Enable-getting-link-status-from-VF.patch delete mode 100644 kernel/kernel-modules/intel-i40e/files/i40e-add-more-debug-info-for-VFs-still-in-reset.patch delete mode 100644 kernel/kernel-modules/intel-i40e/files/modules-load.conf delete mode 100644 kernel/kernel-modules/intel-iavf/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/intel-iavf/centos/iavf-kmod.spec delete mode 100644 kernel/kernel-modules/intel-iavf/files/GPL-v2.0.txt delete mode 100644 kernel/kernel-modules/intel-iavf/files/modules-load.conf delete mode 100644 kernel/kernel-modules/intel-ixgbe/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/intel-ixgbe/centos/ixgbe-kmod.spec delete mode 100644 kernel/kernel-modules/intel-ixgbe/files/GPL-v2.0.txt delete mode 100644 kernel/kernel-modules/intel-ixgbe/files/modules-load.conf delete mode 100644 kernel/kernel-modules/intel-ixgbevf/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/intel-ixgbevf/centos/ixgbevf-kmod.spec delete mode 100644 kernel/kernel-modules/intel-ixgbevf/files/GPL-v2.0.txt delete mode 100644 kernel/kernel-modules/intel-ixgbevf/files/modules-load.conf delete mode 100644 kernel/kernel-modules/intel-opae-fpga/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/intel-opae-fpga/centos/fpga-kmod.spec delete mode 100644 kernel/kernel-modules/intel-opae-fpga/centos/patches/Remove-regmap-mmio-as-it-is-built-into-the-kernel.patch delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/0001-Support-TiS-system.patch delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/PATCH_ORDER delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-HAVE_IEEE_GETQCN.patch delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-a-bunch-of-ks-stuff.patch delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-some-stats-output.patch delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/Disable-use-of-page-pool.patch delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/centos/srpm_path delete mode 100644 kernel/kernel-modules/mlnx-ofa_kernel/files/modules-load.conf delete mode 100644 kernel/kernel-modules/qat17/PKG-INFO delete mode 100644 kernel/kernel-modules/qat17/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/qat17/centos/qat17.spec delete mode 100644 kernel/kernel-modules/qat17/files/Get-and-report-the-return-code-on-firmware-load-fail.patch delete mode 100644 kernel/kernel-modules/qat17/files/qat delete mode 100755 kernel/kernel-modules/qat17/files/qat_service delete mode 100644 kernel/kernel-modules/tpmdd/centos/build_srpm.data delete mode 100644 kernel/kernel-modules/tpmdd/centos/tpm-kmod.spec delete mode 100644 kernel/kernel-modules/tpmdd/files/COPYING delete mode 100644 kernel/kernel-modules/tpmdd/files/README delete mode 100644 kernel/kernel-modules/tpmdd/files/modules-load.conf delete mode 100644 kernel/kernel-modules/tpmdd/patches/0001-disable-arm64-acpi-command.patch delete mode 100644 kernel/kernel-modules/tpmdd/patches/0002-tpmdd-kcompat-support.patch delete mode 100644 kernel/kernel-modules/tpmdd/patches/UPSTREAM-0001-tpm-replace-msleep-with-usleep_range.patch delete mode 100644 kernel/kernel-modules/tpmdd/patches/UPSTREAM-0002-tpm-reduce-tpm-polling-delay-in-tpm_tis_core.patch delete mode 100644 kernel/kernel-modules/tpmdd/patches/UPSTREAM-0003-tpm-use-tpm_msleep-value-as-max-delay.patch delete mode 100644 kernel/kernel-modules/tpmdd/patches/UPSTREAM-0004-tpm-wait-for-stat-to-specify-variable-polling-time.patch delete mode 100644 kernel/kernel-modules/tpmdd/patches/UPSTREAM-0005-tpm-ignore-burstcount-to-improve-send-performance.patch delete mode 100644 kernel/kernel-modules/tpmdd/patches/UPSTREAM-0006-tpm-use-struct-tpm_chip.patch delete mode 100644 kernel/kernel-modules/tpmdd/patches/tpm-kmod.spec.patchlist delete mode 100644 kernel/kernel-rt/centos/build_srpm.data delete mode 100644 kernel/kernel-rt/centos/meta_patches/Build-logic-and-sources-for-TiC.patch delete mode 100644 kernel/kernel-rt/centos/meta_patches/Compile-issues.patch delete mode 100644 kernel/kernel-rt/centos/meta_patches/Kernel-source-patches-for-TiC.patch delete mode 100644 kernel/kernel-rt/centos/meta_patches/PATCH_ORDER delete mode 100644 kernel/kernel-rt/centos/patches/Add-missing-ifdef-around-max-latency-variable.patch delete mode 100644 kernel/kernel-rt/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch delete mode 100644 kernel/kernel-rt/centos/patches/Allow-dmar-quirks-for-broken-bioses.patch delete mode 100644 kernel/kernel-rt/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch delete mode 100644 kernel/kernel-rt/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch delete mode 100644 kernel/kernel-rt/centos/patches/Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch delete mode 100644 kernel/kernel-rt/centos/patches/Fix-cacheinfo-compilation-issues-for-3.10.patch delete mode 100644 kernel/kernel-rt/centos/patches/Make-kernel-start-eth-devices-at-offset.patch delete mode 100644 kernel/kernel-rt/centos/patches/Notification-of-death-of-arbitrary-processes.patch delete mode 100644 kernel/kernel-rt/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch delete mode 100644 kernel/kernel-rt/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch delete mode 100644 kernel/kernel-rt/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch delete mode 100644 kernel/kernel-rt/centos/patches/US103091-IMA-System-Configuration.patch delete mode 100644 kernel/kernel-rt/centos/patches/affine-compute-kernel-threads.patch delete mode 100644 kernel/kernel-rt/centos/patches/aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch delete mode 100644 kernel/kernel-rt/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch delete mode 100644 kernel/kernel-rt/centos/patches/compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch delete mode 100644 kernel/kernel-rt/centos/patches/cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch delete mode 100644 kernel/kernel-rt/centos/patches/cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch delete mode 100644 kernel/kernel-rt/centos/patches/cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch delete mode 100644 kernel/kernel-rt/centos/patches/cpupower.config delete mode 100644 kernel/kernel-rt/centos/patches/cpupower.service delete mode 100644 kernel/kernel-rt/centos/patches/debrand-rh-i686-cpu.patch delete mode 100644 kernel/kernel-rt/centos/patches/debrand-rh_taint.patch delete mode 100644 kernel/kernel-rt/centos/patches/debrand-single-cpu.patch delete mode 100644 kernel/kernel-rt/centos/patches/dpt_i2o-fix-build-warning.patch delete mode 100644 kernel/kernel-rt/centos/patches/epoll-fix-use-after-free-in-eventpoll_release_file.patch delete mode 100644 kernel/kernel-rt/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch delete mode 100644 kernel/kernel-rt/centos/patches/fix-compilation-issues.patch delete mode 100644 kernel/kernel-rt/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch delete mode 100644 kernel/kernel-rt/centos/patches/ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch delete mode 100644 kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt-debug.config.tis_extra delete mode 100644 kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt-trace.config.tis_extra delete mode 100644 kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt.config.tis_extra delete mode 100644 kernel/kernel-rt/centos/patches/memblock-introduce-memblock_alloc_range.patch delete mode 100644 kernel/kernel-rt/centos/patches/restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch delete mode 100644 kernel/kernel-rt/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch delete mode 100644 kernel/kernel-rt/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch delete mode 100644 kernel/kernel-rt/centos/patches/robustify-CFS-bandwidth-timer-locking.patch delete mode 100644 kernel/kernel-rt/centos/patches/turn-off-write-same-in-smartqpi-driver.patch delete mode 100644 kernel/kernel-rt/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch delete mode 100644 kernel/kernel-rt/centos/patches/x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch delete mode 100644 kernel/kernel-rt/centos/srpm_path delete mode 100644 kernel/kernel-rt/files/centos.cer delete mode 100644 kernel/kernel-rt/files/ima_signing_key.pub delete mode 100644 kernel/kernel-std/centos/build_srpm.data delete mode 100644 kernel/kernel-std/centos/meta_patches/Build-logic-and-sources-for-TiC.patch delete mode 100644 kernel/kernel-std/centos/meta_patches/Compile-issues.patch delete mode 100644 kernel/kernel-std/centos/meta_patches/Kernel-source-patches-for-TiC.patch delete mode 100644 kernel/kernel-std/centos/meta_patches/PATCH_ORDER delete mode 100644 kernel/kernel-std/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch delete mode 100644 kernel/kernel-std/centos/patches/Allow-dmar-quirks-for-broken-bioses.patch delete mode 100644 kernel/kernel-std/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch delete mode 100644 kernel/kernel-std/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch delete mode 100644 kernel/kernel-std/centos/patches/Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch delete mode 100644 kernel/kernel-std/centos/patches/Fix-cacheinfo-compilation-issues-for-3.10.patch delete mode 100644 kernel/kernel-std/centos/patches/Fix-compile-issue-when-transparent-hugepages-are-off.patch delete mode 100644 kernel/kernel-std/centos/patches/Make-kernel-start-eth-devices-at-offset.patch delete mode 100644 kernel/kernel-std/centos/patches/Notification-of-death-of-arbitrary-processes.patch delete mode 100644 kernel/kernel-std/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch delete mode 100644 kernel/kernel-std/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch delete mode 100644 kernel/kernel-std/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch delete mode 100644 kernel/kernel-std/centos/patches/US103091-IMA-System-Configuration.patch delete mode 100644 kernel/kernel-std/centos/patches/affine-compute-kernel-threads.patch delete mode 100644 kernel/kernel-std/centos/patches/aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch delete mode 100644 kernel/kernel-std/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch delete mode 100644 kernel/kernel-std/centos/patches/compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch delete mode 100644 kernel/kernel-std/centos/patches/cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch delete mode 100644 kernel/kernel-std/centos/patches/cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch delete mode 100644 kernel/kernel-std/centos/patches/cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch delete mode 100644 kernel/kernel-std/centos/patches/dpt_i2o-fix-build-warning.patch delete mode 100644 kernel/kernel-std/centos/patches/epoll-fix-use-after-free-in-eventpoll_release_file.patch delete mode 100644 kernel/kernel-std/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch delete mode 100644 kernel/kernel-std/centos/patches/fix-compilation-issues.patch delete mode 100644 kernel/kernel-std/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch delete mode 100644 kernel/kernel-std/centos/patches/ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch delete mode 100644 kernel/kernel-std/centos/patches/kernel-3.10.0-x86_64.config.tis_extra delete mode 100644 kernel/kernel-std/centos/patches/memblock-introduce-memblock_alloc_range.patch delete mode 100644 kernel/kernel-std/centos/patches/rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch delete mode 100644 kernel/kernel-std/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch delete mode 100644 kernel/kernel-std/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch delete mode 100644 kernel/kernel-std/centos/patches/turn-off-write-same-in-smartqpi-driver.patch delete mode 100644 kernel/kernel-std/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch delete mode 100644 kernel/kernel-std/centos/patches/x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch delete mode 100644 kernel/kernel-std/centos/srpm_path delete mode 100644 kernel/kernel-std/files/ima_signing_key.pub diff --git a/centos_extra_downloads.lst b/centos_extra_downloads.lst index 1adb34952..a27f52755 100644 --- a/centos_extra_downloads.lst +++ b/centos_extra_downloads.lst @@ -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 diff --git a/centos_guest_image.inc b/centos_guest_image.inc index 1dd8f28fd..6ac1efcb4 100644 --- a/centos_guest_image.inc +++ b/centos_guest_image.inc @@ -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 diff --git a/centos_guest_image_rt.inc b/centos_guest_image_rt.inc index c80892cad..f1743de6c 100644 --- a/centos_guest_image_rt.inc +++ b/centos_guest_image_rt.inc @@ -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 diff --git a/centos_iso_image.inc b/centos_iso_image.inc index ee935da43..289c64292 100644 --- a/centos_iso_image.inc +++ b/centos_iso_image.inc @@ -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 diff --git a/centos_pkg_dirs b/centos_pkg_dirs index d1e403842..a7b29e49e 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -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 diff --git a/centos_pkg_dirs_rt b/centos_pkg_dirs_rt index 51a2ed799..4d252f5f4 100644 --- a/centos_pkg_dirs_rt +++ b/centos_pkg_dirs_rt @@ -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 diff --git a/centos_srpms_centos.lst b/centos_srpms_centos.lst index 6021250d2..e2d811aa4 100644 --- a/centos_srpms_centos.lst +++ b/centos_srpms_centos.lst @@ -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 diff --git a/centos_srpms_centos3rdparties.lst b/centos_srpms_centos3rdparties.lst deleted file mode 100644 index 595a90878..000000000 --- a/centos_srpms_centos3rdparties.lst +++ /dev/null @@ -1 +0,0 @@ -kernel-rt-3.10.0-1062.1.2.rt56.1025.el7.src.rpm diff --git a/centos_tarball-dl.lst b/centos_tarball-dl.lst index 23adb7830..71e909022 100644 --- a/centos_tarball-dl.lst +++ b/centos_tarball-dl.lst @@ -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## diff --git a/kernel/kernel-modules/drbd/PKG-INFO b/kernel/kernel-modules/drbd/PKG-INFO deleted file mode 100644 index 667707a10..000000000 --- a/kernel/kernel-modules/drbd/PKG-INFO +++ /dev/null @@ -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 diff --git a/kernel/kernel-modules/drbd/centos/build_srpm.data b/kernel/kernel-modules/drbd/centos/build_srpm.data deleted file mode 100644 index c6bd5a8c8..000000000 --- a/kernel/kernel-modules/drbd/centos/build_srpm.data +++ /dev/null @@ -1,4 +0,0 @@ -COPY_LIST="$FILES_BASE/* \ - $DISTRO/patches/* \ - $CGCS_BASE/downloads/drbd-8.4.11-1.tar.gz" -TIS_PATCH_VER=0 diff --git a/kernel/kernel-modules/drbd/centos/drbd-kernel.spec b/kernel/kernel-modules/drbd/centos/drbd-kernel.spec deleted file mode 100644 index f9e903d1a..000000000 --- a/kernel/kernel-modules/drbd/centos/drbd-kernel.spec +++ /dev/null @@ -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 - 8.4.7-1 -- New upstream release. - -* Wed Sep 16 2015 Lars Ellenberg - 8.4.6-5 -- New upstream release. - -* Thu Jul 30 2015 Lars Ellenberg - 8.4.6-4 -- New upstream release. - -* Fri Apr 3 2015 Philipp Reisner - 8.4.6-1 -- New upstream release. - -* Mon Jun 2 2014 Philipp Reisner - 8.4.5-1 -- New upstream release. - -* Fri Oct 11 2013 Philipp Reisner - 8.4.4-1 -- New upstream release. - -* Tue Feb 5 2013 Philipp Reisner - 8.4.3-1 -- New upstream release. - -* Thu Sep 6 2012 Philipp Reisner - 8.4.2-1 -- New upstream release. - -* Tue Dec 20 2011 Philipp Reisner - 8.4.1-1 -- New upstream release. - -* Mon Jul 18 2011 Philipp Reisner - 8.4.0-1 -- New upstream release. - -* Fri Jan 28 2011 Philipp Reisner - 8.3.10-1 -- New upstream release. - -* Thu Nov 25 2010 Andreas Gruenbacher - 8.3.9-1 -- Convert to a Kernel Module Package. diff --git a/kernel/kernel-modules/drbd/centos/files/filelist-redhat b/kernel/kernel-modules/drbd/centos/files/filelist-redhat deleted file mode 100644 index 28a2f9989..000000000 --- a/kernel/kernel-modules/drbd/centos/files/filelist-redhat +++ /dev/null @@ -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 diff --git a/kernel/kernel-modules/drbd/centos/patches/0001-remove_bind_before_connect_error.patch b/kernel/kernel-modules/drbd/centos/patches/0001-remove_bind_before_connect_error.patch deleted file mode 100644 index 88b6fbc77..000000000 --- a/kernel/kernel-modules/drbd/centos/patches/0001-remove_bind_before_connect_error.patch +++ /dev/null @@ -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: diff --git a/kernel/kernel-modules/integrity/centos/build_srpm.data b/kernel/kernel-modules/integrity/centos/build_srpm.data deleted file mode 100644 index 1e3f38ac0..000000000 --- a/kernel/kernel-modules/integrity/centos/build_srpm.data +++ /dev/null @@ -1,5 +0,0 @@ -COPY_LIST=" \ - $FILES_BASE/* \ - $PATCHES_BASE/* \ - $STX_BASE/downloads/integrity-kmod-e6aef069.tar.gz" -TIS_PATCH_VER=7 diff --git a/kernel/kernel-modules/integrity/centos/files/COPYING b/kernel/kernel-modules/integrity/centos/files/COPYING deleted file mode 100644 index e2fed1bf7..000000000 --- a/kernel/kernel-modules/integrity/centos/files/COPYING +++ /dev/null @@ -1,344 +0,0 @@ - -"This software program is licensed subject to the GNU General Public License -(GPL). Version 2, June 1991, available at -" - - 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. - - - Copyright (C) - - 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. - - , 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. diff --git a/kernel/kernel-modules/integrity/centos/files/README b/kernel/kernel-modules/integrity/centos/files/README deleted file mode 100644 index 1dbb36f9e..000000000 --- a/kernel/kernel-modules/integrity/centos/files/README +++ /dev/null @@ -1,231 +0,0 @@ - -Integrity and IMA Modules for CentOS 7 (Linux version 3.10) -=============================================================================== - -=============================================================================== - -Kam Nasim -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 > /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-; 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 - Signed-off-by: Mimi Zohar - - 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 - 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 - - 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 - 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 - Acked-by: Kees Cook - Acked-by: Luis R. Rodriguez - Acked-by: Casey Schaufler - - 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 -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 > /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 - - 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 -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 diff --git a/kernel/kernel-modules/integrity/centos/files/ima.conf b/kernel/kernel-modules/integrity/centos/files/ima.conf deleted file mode 100644 index 1c00690e6..000000000 --- a/kernel/kernel-modules/integrity/centos/files/ima.conf +++ /dev/null @@ -1 +0,0 @@ -options ima ima_appraise_param="log" ima_use_tpm=0 diff --git a/kernel/kernel-modules/integrity/centos/files/ima.policy b/kernel/kernel-modules/integrity/centos/files/ima.policy deleted file mode 100644 index 07b8b8135..000000000 --- a/kernel/kernel-modules/integrity/centos/files/ima.policy +++ /dev/null @@ -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 diff --git a/kernel/kernel-modules/integrity/centos/files/integrity.conf b/kernel/kernel-modules/integrity/centos/files/integrity.conf deleted file mode 100644 index 61694e52b..000000000 --- a/kernel/kernel-modules/integrity/centos/files/integrity.conf +++ /dev/null @@ -1 +0,0 @@ -options integrity integrity_audit=0 diff --git a/kernel/kernel-modules/integrity/centos/files/modules-load.conf b/kernel/kernel-modules/integrity/centos/files/modules-load.conf deleted file mode 100644 index 1e720a56e..000000000 --- a/kernel/kernel-modules/integrity/centos/files/modules-load.conf +++ /dev/null @@ -1,3 +0,0 @@ -tpm_tis -integrity -ima diff --git a/kernel/kernel-modules/integrity/centos/integrity-kmod.spec b/kernel/kernel-modules/integrity/centos/integrity-kmod.spec deleted file mode 100644 index 1c70a882e..000000000 --- a/kernel/kernel-modules/integrity/centos/integrity-kmod.spec +++ /dev/null @@ -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 4.12 -- Initial RPM package. - diff --git a/kernel/kernel-modules/integrity/centos/patches/0001-integrity-kcompat-support.patch b/kernel/kernel-modules/integrity/centos/patches/0001-integrity-kcompat-support.patch deleted file mode 100644 index ce82a96fc..000000000 --- a/kernel/kernel-modules/integrity/centos/patches/0001-integrity-kcompat-support.patch +++ /dev/null @@ -1,1322 +0,0 @@ -From 7e956b974091563edc1b4f5a7646f4d8dff07ee5 Mon Sep 17 00:00:00 2001 -From: Kam Nasim -Date: Fri, 8 Sep 2017 16:34:25 -0400 -Subject: [PATCH] US101216: IMA out-of-tree modules for Titanium Kernel - -Build a kcompat layer and the ability to build out the Integrity and IMA -Kernel modules against a 3.10 Linux Kernel (CentOS v7.3) ---- - Makefile | 107 ++++++++++++++++- - common.mk | 330 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - digsig.c | 35 ++++-- - digsig_asymmetric.c | 22 +++- - iint.c | 52 +++++++-- - ima/Makefile | 8 +- - ima/ima.h | 9 +- - ima/ima_api.c | 14 +-- - ima/ima_appraise.c | 42 ++++--- - ima/ima_fs.c | 4 + - ima/ima_init.c | 4 +- - ima/ima_main.c | 40 +++++-- - ima/ima_policy.c | 32 ++++- - integrity.h | 9 +- - integrity_audit.c | 17 ++- - kcompat.h | 34 ++++++ - 16 files changed, 677 insertions(+), 82 deletions(-) - create mode 100644 common.mk - create mode 100644 kcompat.h - -diff --git a/Makefile b/Makefile -index 8d1f4bf..022a1b7 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,3 +1,7 @@ -+ -+ifneq ($(KERNELRELEASE),) -+# kbuild part of makefile -+ - # - # Makefile for caching inode integrity data (iint) - # -@@ -11,5 +15,104 @@ integrity-$(CONFIG_INTEGRITY_ASYMMETRIC_KEYS) += digsig_asymmetric.o - - subdir-$(CONFIG_IMA) += ima - obj-$(CONFIG_IMA) += ima/ --subdir-$(CONFIG_EVM) += evm --obj-$(CONFIG_EVM) += evm/ -+ -+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) -+ -+# 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/security/integrity/${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..3541284 ---- /dev/null -+++ b/common.mk -@@ -0,0 +1,330 @@ -+################################################################################ -+# -+# Linux IMA subsystem -+# 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 -+# 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:]" ) -+ -+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/security/integrity/ 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/security/integrity/ -+ -+ -+###################### -+# 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,,) -+# 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 -+# -+# N.B: We specify all of our hash, template and PCR choices -+# right when we build the option. This is because the kernel module -+# will be signed, and we will prevent users from modifying these -+# options at runtime and reloading the module -+kernelbuild = ${MAKE} $(if ${GCC_I_SYS},CC="${GCC_I_SYS}") \ -+ ${CCFLAGS_VAR}="${EXTRA_CFLAGS}" \ -+ -C "${KSRC}" \ -+ CONFIG_INTEGRITY=m \ -+ CONFIG_INTEGRITY_AUDIT=y \ -+ CONFIG_INTEGRITY_SIGNATURE=y \ -+ CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y \ -+ CONFIG_IMA=m \ -+ CONFIG_${DRIVER_UPPERCASE}=m \ -+ modules \ -+ M="${CURDIR}" \ -+ ${2} ${1} -diff --git a/digsig.c b/digsig.c -index 106e855..f850ef7 100644 ---- a/digsig.c -+++ b/digsig.c -@@ -37,9 +37,9 @@ static const char *keyring_name[INTEGRITY_KEYRING_MAX] = { - }; - - #ifdef CONFIG_INTEGRITY_TRUSTED_KEYRING --static bool init_keyring __initdata = true; -+static bool init_keyring = true; - #else --static bool init_keyring __initdata; -+static bool init_keyring; - #endif - - #ifdef CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY -@@ -77,39 +77,43 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, - - return -EOPNOTSUPP; - } -+EXPORT_SYMBOL_GPL(integrity_digsig_verify); - --int __init integrity_init_keyring(const unsigned int id) -+int integrity_init_keyring(const unsigned int id) - { - const struct cred *cred = current_cred(); -- struct key_restriction *restriction; - int err = 0; - -- if (!init_keyring) -+ if (!init_keyring) { -+ /* WRS: This external keyring is created inside -+ * the Kernel as a trusted keyring for which -+ * a search reference is available -+ */ -+ keyring[id] = ima_keyring; - return 0; -- -- restriction = kzalloc(sizeof(struct key_restriction), GFP_KERNEL); -- if (!restriction) -- return -ENOMEM; -- -- restriction->check = restrict_link_to_ima; -+ } - - keyring[id] = keyring_alloc(keyring_name[id], KUIDT_INIT(0), - KGIDT_INIT(0), cred, - ((KEY_POS_ALL & ~KEY_POS_SETATTR) | - KEY_USR_VIEW | KEY_USR_READ | - KEY_USR_WRITE | KEY_USR_SEARCH), -- KEY_ALLOC_NOT_IN_QUOTA, -- restriction, NULL); -- if (IS_ERR(keyring[id])) { -+ KEY_ALLOC_NOT_IN_QUOTA, NULL); -+ -+ if (!IS_ERR(keyring[id])) { -+ set_bit(KEY_FLAG_TRUSTED_ONLY, &keyring[id]->flags); -+ } else { - err = PTR_ERR(keyring[id]); - pr_info("Can't allocate %s keyring (%d)\n", - keyring_name[id], err); - keyring[id] = NULL; - } -+ init_keyring = false; - return err; - } -+EXPORT_SYMBOL_GPL(integrity_init_keyring); - --int __init integrity_load_x509(const unsigned int id, const char *path) -+int integrity_load_x509(const unsigned int id, const char *path) - { - key_ref_t key; - char *data; -diff --git a/digsig_asymmetric.c b/digsig_asymmetric.c -index 80052ed..1753b60 100644 ---- a/digsig_asymmetric.c -+++ b/digsig_asymmetric.c -@@ -34,6 +34,7 @@ static struct key *request_asymmetric_key(struct key *keyring, uint32_t keyid) - - pr_debug("key search: \"%s\"\n", name); - -+#ifdef CONFIG_IMA_MOK_KEYRING - key = get_ima_blacklist_keyring(); - if (key) { - key_ref_t kref; -@@ -45,6 +46,7 @@ static struct key *request_asymmetric_key(struct key *keyring, uint32_t keyid) - return ERR_PTR(-EKEYREJECTED); - } - } -+#endif - - if (keyring) { - /* search in specific keyring */ -@@ -95,7 +97,11 @@ int asymmetric_verify(struct key *keyring, const char *sig, - if (siglen != __be16_to_cpu(hdr->sig_size)) - return -EBADMSG; - -+#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(3,10,0) ) -+ if (hdr->hash_algo >= PKEY_HASH__LAST) -+#else - if (hdr->hash_algo >= HASH_ALGO__LAST) -+#endif - return -ENOPKG; - - key = request_asymmetric_key(keyring, __be32_to_cpu(hdr->keyid)); -@@ -103,14 +109,24 @@ int asymmetric_verify(struct key *keyring, const char *sig, - return PTR_ERR(key); - - memset(&pks, 0, sizeof(pks)); -- -- pks.pkey_algo = "rsa"; -- pks.hash_algo = hash_algo_name[hdr->hash_algo]; -+ - pks.digest = (u8 *)data; - pks.digest_size = datalen; -+#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(3,10,0) ) -+ pks.pkey_algo = PKEY_ALGO_RSA; -+ pks.pkey_hash_algo = hdr->hash_algo; -+ pks.nr_mpi =1; -+ pks.rsa.s = mpi_read_raw_data(hdr->sig, siglen); -+ if(pks.rsa.s) -+ ret = verify_signature(key, &pks); -+ mpi_free(pks.rsa.s); -+#else -+ pks.pkey_algo = "rsa"; -+ pks.hash_algo = hash_algo_name[hdr->hash_algo]; - pks.s = hdr->sig; - pks.s_size = siglen; - ret = verify_signature(key, &pks); -+#endif - key_put(key); - pr_debug("%s() = %d\n", __func__, ret); - return ret; -diff --git a/iint.c b/iint.c -index c710d22..83405a1 100644 ---- a/iint.c -+++ b/iint.c -@@ -27,6 +27,9 @@ static struct rb_root integrity_iint_tree = RB_ROOT; - static DEFINE_RWLOCK(integrity_iint_lock); - static struct kmem_cache *iint_cache __read_mostly; - -+static struct integrity_iint_cache * (*integrity_inode_get_kernel)(struct inode *); -+static void (*integrity_inode_free_kernel)(struct inode *); -+ - /* - * __integrity_iint_find - return the iint associated with an inode - */ -@@ -67,6 +70,7 @@ struct integrity_iint_cache *integrity_iint_find(struct inode *inode) - - return iint; - } -+EXPORT_SYMBOL_GPL(integrity_iint_find); - - static void iint_free(struct integrity_iint_cache *iint) - { -@@ -90,7 +94,7 @@ static void iint_free(struct integrity_iint_cache *iint) - * - * Caller must lock i_mutex - */ --struct integrity_iint_cache *integrity_inode_get(struct inode *inode) -+static struct integrity_iint_cache *__integrity_inode_get(struct inode *inode) - { - struct rb_node **p; - struct rb_node *node, *parent = NULL; -@@ -100,7 +104,7 @@ struct integrity_iint_cache *integrity_inode_get(struct inode *inode) - if (iint) - return iint; - -- iint = kmem_cache_alloc(iint_cache, GFP_NOFS); -+ iint = kmem_cache_alloc(iint_cache, GFP_KERNEL); - if (!iint) - return NULL; - -@@ -110,7 +114,7 @@ struct integrity_iint_cache *integrity_inode_get(struct inode *inode) - while (*p) { - parent = *p; - test_iint = rb_entry(parent, struct integrity_iint_cache, -- rb_node); -+ rb_node); - if (inode < test_iint->inode) - p = &(*p)->rb_left; - else -@@ -133,7 +137,7 @@ struct integrity_iint_cache *integrity_inode_get(struct inode *inode) - * - * Free the integrity information(iint) associated with an inode. - */ --void integrity_inode_free(struct inode *inode) -+static void __integrity_inode_free(struct inode *inode) - { - struct integrity_iint_cache *iint; - -@@ -166,8 +170,21 @@ static void init_once(void *foo) - static int __init integrity_iintcache_init(void) - { - iint_cache = -- kmem_cache_create("iint_cache", sizeof(struct integrity_iint_cache), -- 0, SLAB_PANIC, init_once); -+ kmem_cache_create("iint_cache", sizeof(struct integrity_iint_cache), -+ 0, SLAB_PANIC, init_once); -+ -+ /* -+ * stow away original Kernel references -+ * for these functions to assign back -+ * on deinit -+ */ -+ integrity_inode_get_kernel = integrity_inode_get; -+ integrity_inode_free_kernel = integrity_inode_free; -+ -+ integrity_inode_get = &__integrity_inode_get; -+ integrity_inode_free = &__integrity_inode_free; -+ pr_info("Initializing Integrity Base Module\n"); -+ - return 0; - } - security_initcall(integrity_iintcache_init); -@@ -186,18 +203,22 @@ int integrity_kernel_read(struct file *file, loff_t offset, - { - mm_segment_t old_fs; - char __user *buf = (char __user *)addr; -- ssize_t ret; -+ ssize_t ret = -EINVAL; - - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - - old_fs = get_fs(); - set_fs(get_ds()); -- ret = __vfs_read(file, buf, count, &offset); -+ if (file->f_op->read) -+ ret = file->f_op->read(file, buf, count, &offset); -+ else if (file->f_op->aio_read) -+ ret = do_sync_read(file, buf, count, &offset); - set_fs(old_fs); - - return ret; - } -+EXPORT_SYMBOL_GPL(integrity_kernel_read); - - /* - * integrity_read_file - read entire file content into the buffer -@@ -259,3 +280,18 @@ void __init integrity_load_keys(void) - ima_load_x509(); - evm_load_x509(); - } -+ -+static void __exit cleanup_integrity(void) -+{ -+ /* -+ * assign back to default kernel definations -+ * for these dynamic functions -+ */ -+ integrity_inode_get = integrity_inode_get_kernel; -+ integrity_inode_free = integrity_inode_free_kernel; -+} -+ -+module_exit(cleanup_integrity); -+MODULE_DESCRIPTION("Integrity Base Driver"); -+MODULE_LICENSE("GPL"); -+ -diff --git a/ima/Makefile b/ima/Makefile -index 29f198b..cdf918c 100644 ---- a/ima/Makefile -+++ b/ima/Makefile -@@ -6,7 +6,7 @@ - obj-$(CONFIG_IMA) += ima.o - - ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \ -- ima_policy.o ima_template.o ima_template_lib.o --ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o --ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o --obj-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o -+ ima_policy.o ima_template.o ima_template_lib.o ima_appraise.o -+#ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o -+#ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o -+#obj-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o -diff --git a/ima/ima.h b/ima/ima.h -index b563fbd..5492dda 100644 ---- a/ima/ima.h -+++ b/ima/ima.h -@@ -17,6 +17,9 @@ - #ifndef __LINUX_IMA_H - #define __LINUX_IMA_H - -+// include kcompat layer -+#include "../kcompat.h" -+ - #include - #include - #include -@@ -155,6 +158,7 @@ unsigned long ima_get_binary_runtime_size(void); - int ima_init_template(void); - void ima_init_template_list(void); - -+ - /* - * used to protect h_table and sha_table - */ -@@ -242,7 +246,10 @@ enum hash_algo ima_get_hash_algo(struct evm_ima_xattr_data *xattr_value, - int xattr_len); - int ima_read_xattr(struct dentry *dentry, - struct evm_ima_xattr_data **xattr_value); -- -+void __ima_inode_post_setattr(struct dentry *dentry); -+int __ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, -+ const void *xattr_value, size_t xattr_value_len); -+int __ima_inode_removexattr(struct dentry *dentry, const char *xattr_name); - #else - static inline int ima_appraise_measurement(enum ima_hooks func, - struct integrity_iint_cache *iint, -diff --git a/ima/ima_api.c b/ima/ima_api.c -index c2edba8..e14e9d0 100644 ---- a/ima/ima_api.c -+++ b/ima/ima_api.c -@@ -307,11 +307,9 @@ void ima_audit_measurement(struct integrity_iint_cache *iint, - if (!ab) - return; - -- audit_log_format(ab, "file="); -- audit_log_untrustedstring(ab, filename); -- audit_log_format(ab, " hash="); -+ audit_log_format(ab, "file=%s", filename); - snprintf(algo_hash, sizeof(algo_hash), "%s:%s", algo_name, hash); -- audit_log_untrustedstring(ab, algo_hash); -+ audit_log_format(ab, " hash=%s", algo_hash); - - audit_log_task_info(ab, current); - audit_log_end(ab); -@@ -332,12 +330,12 @@ void ima_audit_measurement(struct integrity_iint_cache *iint, - const char *ima_d_path(const struct path *path, char **pathbuf, char *namebuf) - { - char *pathname = NULL; -- -- *pathbuf = __getname(); -+ /* We will allow 11 spaces for ' (deleted)' to be appended */ -+ *pathbuf = kmalloc(PATH_MAX + 11, GFP_KERNEL); - if (*pathbuf) { -- pathname = d_absolute_path(path, *pathbuf, PATH_MAX); -+ pathname = d_path(path, *pathbuf, PATH_MAX + 11); - if (IS_ERR(pathname)) { -- __putname(*pathbuf); -+ kfree(*pathbuf); - *pathbuf = NULL; - pathname = NULL; - } -diff --git a/ima/ima_appraise.c b/ima/ima_appraise.c -index 1fd9539..b0d4286 100644 ---- a/ima/ima_appraise.c -+++ b/ima/ima_appraise.c -@@ -8,6 +8,9 @@ - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2 of the License. - */ -+ -+#include "../kcompat.h" -+ - #include - #include - #include -@@ -58,10 +61,10 @@ static int ima_fix_xattr(struct dentry *dentry, - iint->ima_hash->xattr.ng.type = IMA_XATTR_DIGEST_NG; - iint->ima_hash->xattr.ng.algo = algo; - } -- rc = __vfs_setxattr_noperm(dentry, XATTR_NAME_IMA, -- &iint->ima_hash->xattr.data[offset], -- (sizeof(iint->ima_hash->xattr) - offset) + -- iint->ima_hash->length, 0); -+ rc = vfs_setxattr(dentry, XATTR_NAME_IMA, -+ &iint->ima_hash->xattr.data[offset], -+ (sizeof(iint->ima_hash->xattr) - offset) + -+ iint->ima_hash->length, 0); - return rc; - } - -@@ -168,14 +171,14 @@ enum hash_algo ima_get_hash_algo(struct evm_ima_xattr_data *xattr_value, - int ima_read_xattr(struct dentry *dentry, - struct evm_ima_xattr_data **xattr_value) - { -- ssize_t ret; -+ struct inode *inode = d_backing_inode(dentry); -+ if (!inode->i_op->getxattr) -+ return 0; - -- ret = vfs_getxattr_alloc(dentry, XATTR_NAME_IMA, (char **)xattr_value, -- 0, GFP_NOFS); -- if (ret == -EOPNOTSUPP) -- ret = 0; -- return ret; -+ return vfs_getxattr_alloc(dentry, XATTR_NAME_IMA, (char **)xattr_value, -+ 0, GFP_NOFS); - } -+EXPORT_SYMBOL_GPL(ima_read_xattr); - - /* - * ima_appraise_measurement - appraise file measurement -@@ -198,7 +201,7 @@ int ima_appraise_measurement(enum ima_hooks func, - enum integrity_status status = INTEGRITY_UNKNOWN; - int rc = xattr_len, hash_start = 0; - -- if (!(inode->i_opflags & IOP_XATTR)) -+ if (!inode->i_op->getxattr) - return INTEGRITY_UNKNOWN; - - if (rc <= 0) { -@@ -214,7 +217,11 @@ int ima_appraise_measurement(enum ima_hooks func, - goto out; - } - -+#ifdef CONFIG_EVM - status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value, rc, iint); -+#else -+ status = INTEGRITY_UNKNOWN; /* CONFIG_INTEGRITY */ -+#endif - if ((status != INTEGRITY_PASS) && (status != INTEGRITY_UNKNOWN)) { - if ((status == INTEGRITY_NOLABEL) - || (status == INTEGRITY_NOXATTRS)) -@@ -321,14 +328,14 @@ void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file) - * This function is called from notify_change(), which expects the caller - * to lock the inode's i_mutex. - */ --void ima_inode_post_setattr(struct dentry *dentry) -+void __ima_inode_post_setattr(struct dentry *dentry) - { - struct inode *inode = d_backing_inode(dentry); - struct integrity_iint_cache *iint; -- int must_appraise; -+ int must_appraise, rc; - - if (!(ima_policy_flag & IMA_APPRAISE) || !S_ISREG(inode->i_mode) -- || !(inode->i_opflags & IOP_XATTR)) -+ || !inode->i_op->removexattr) - return; - - must_appraise = ima_must_appraise(inode, MAY_ACCESS, POST_SETATTR); -@@ -341,7 +348,8 @@ void ima_inode_post_setattr(struct dentry *dentry) - iint->flags |= IMA_APPRAISE; - } - if (!must_appraise) -- __vfs_removexattr(dentry, XATTR_NAME_IMA); -+ rc = inode->i_op->removexattr(dentry, XATTR_NAME_IMA); -+ return; - } - - /* -@@ -378,7 +386,7 @@ static void ima_reset_appraise_flags(struct inode *inode, int digsig) - return; - } - --int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, -+int __ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, - const void *xattr_value, size_t xattr_value_len) - { - const struct evm_ima_xattr_data *xvalue = xattr_value; -@@ -396,7 +404,7 @@ int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, - return result; - } - --int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name) -+int __ima_inode_removexattr(struct dentry *dentry, const char *xattr_name) - { - int result; - -diff --git a/ima/ima_fs.c b/ima/ima_fs.c -index ca303e5..e871955 100644 ---- a/ima/ima_fs.c -+++ b/ima/ima_fs.c -@@ -274,6 +274,9 @@ static const struct file_operations ima_ascii_measurements_ops = { - - static ssize_t ima_read_policy(char *path) - { -+#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(3,10,0) ) -+ return -EINVAL; -+#else - void *data; - char *datap; - loff_t size; -@@ -307,6 +310,7 @@ static ssize_t ima_read_policy(char *path) - return -EINVAL; - else - return pathlen; -+#endif - } - - static ssize_t ima_write_policy(struct file *file, const char __user *buf, -diff --git a/ima/ima_init.c b/ima/ima_init.c -index 2967d49..0759c8c 100644 ---- a/ima/ima_init.c -+++ b/ima/ima_init.c -@@ -117,7 +117,9 @@ int __init ima_init(void) - if (!ima_used_chip) - pr_info("No TPM chip found, activating TPM-bypass! (rc=%d)\n", - rc); -- -+ else -+ pr_info("TPM chip found, using TPM for aggregate measurements!\n"); -+ - rc = integrity_init_keyring(INTEGRITY_KEYRING_IMA); - if (rc) - return rc; -diff --git a/ima/ima_main.c b/ima/ima_main.c -index 2aebb79..5d6ba23 100644 ---- a/ima/ima_main.c -+++ b/ima/ima_main.c -@@ -16,6 +16,10 @@ - * implements the IMA hooks: ima_bprm_check, ima_file_mmap, - * and ima_file_check. - */ -+ -+// include kcompat layer -+#include "../kcompat.h" -+ - #include - #include - #include -@@ -30,7 +34,10 @@ - int ima_initialized; - - #ifdef CONFIG_IMA_APPRAISE --int ima_appraise = IMA_APPRAISE_ENFORCE; -+/* -+ * WRS: Set default appraise action as "log" -+ */ -+int ima_appraise = IMA_APPRAISE_LOG; - #else - int ima_appraise; - #endif -@@ -140,7 +147,7 @@ static void ima_check_last_writer(struct integrity_iint_cache *iint, - * - * Flag files that changed, based on i_version - */ --void ima_file_free(struct file *file) -+static void __ima_file_free(struct file *file) - { - struct inode *inode = file_inode(file); - struct integrity_iint_cache *iint; -@@ -259,8 +266,7 @@ out_digsig: - rc = -EACCES; - kfree(xattr_value); - out_free: -- if (pathbuf) -- __putname(pathbuf); -+ kfree(pathbuf); - out: - inode_unlock(inode); - if ((rc && must_appraise) && (ima_appraise & IMA_APPRAISE_ENFORCE)) -@@ -279,7 +285,7 @@ out: - * On success return 0. On integrity appraisal error, assuming the file - * is in policy and IMA-appraisal is in enforcing mode, return -EACCES. - */ --int ima_file_mmap(struct file *file, unsigned long prot) -+static int __ima_file_mmap(struct file *file, unsigned long prot) - { - if (file && (prot & PROT_EXEC)) - return process_measurement(file, NULL, 0, MAY_EXEC, -@@ -300,7 +306,7 @@ int ima_file_mmap(struct file *file, unsigned long prot) - * On success return 0. On integrity appraisal error, assuming the file - * is in policy and IMA-appraisal is in enforcing mode, return -EACCES. - */ --int ima_bprm_check(struct linux_binprm *bprm) -+static int __ima_bprm_check(struct linux_binprm *bprm) - { - return process_measurement(bprm->file, NULL, 0, MAY_EXEC, - BPRM_CHECK, 0); -@@ -316,13 +322,12 @@ int ima_bprm_check(struct linux_binprm *bprm) - * On success return 0. On integrity appraisal error, assuming the file - * is in policy and IMA-appraisal is in enforcing mode, return -EACCES. - */ --int ima_file_check(struct file *file, int mask, int opened) -+static int __ima_file_check(struct file *file, int mask, int opened) - { - return process_measurement(file, NULL, 0, - mask & (MAY_READ | MAY_WRITE | MAY_EXEC | - MAY_APPEND), FILE_CHECK, opened); - } --EXPORT_SYMBOL_GPL(ima_file_check); - - /** - * ima_post_path_mknod - mark as a new inode -@@ -346,6 +351,7 @@ void ima_post_path_mknod(struct dentry *dentry) - iint->flags |= IMA_NEW_FILE; - } - -+#if ( LINUX_VERSION_CODE > KERNEL_VERSION(3,10,0) ) - /** - * ima_read_file - pre-measure/appraise hook decision based on policy - * @file: pointer to the file to be measured/appraised/audit -@@ -415,10 +421,28 @@ int ima_post_read_file(struct file *file, void *buf, loff_t size, - func = read_idmap[read_id] ?: FILE_CHECK; - return process_measurement(file, buf, size, MAY_READ, func, 0); - } -+#endif - - static int __init init_ima(void) - { - int error; -+ -+ /* -+ * On loading the module, map the kernel inline -+ * function calls (used by the FS layer) to -+ * function definations within the module. -+ * -+ * N.B: No specific unmapping (to Kernel default) -+ * required as IMA module cannot be removed (even forcebly), -+ * once it binds to the Kernel VFS layer -+ */ -+ ima_bprm_check = &__ima_bprm_check; -+ ima_file_check = &__ima_file_check; -+ ima_file_free = &__ima_file_free; -+ ima_file_mmap = &__ima_file_mmap; -+ ima_inode_post_setattr = &__ima_inode_post_setattr; -+ ima_inode_setxattr = &__ima_inode_setxattr; -+ ima_inode_removexattr = &__ima_inode_removexattr; - - ima_init_template_list(); - hash_setup(CONFIG_IMA_DEFAULT_HASH); -diff --git a/ima/ima_policy.c b/ima/ima_policy.c -index aed47b7..dd52d98 100644 ---- a/ima/ima_policy.c -+++ b/ima/ima_policy.c -@@ -85,7 +85,7 @@ struct ima_rule_entry { - * normal users can easily run the machine out of memory simply building - * and running executables. - */ --static struct ima_rule_entry dont_measure_rules[] __ro_after_init = { -+static struct ima_rule_entry dont_measure_rules[] = { - {.action = DONT_MEASURE, .fsmagic = PROC_SUPER_MAGIC, .flags = IMA_FSMAGIC}, - {.action = DONT_MEASURE, .fsmagic = SYSFS_MAGIC, .flags = IMA_FSMAGIC}, - {.action = DONT_MEASURE, .fsmagic = DEBUGFS_MAGIC, .flags = IMA_FSMAGIC}, -@@ -96,10 +96,12 @@ static struct ima_rule_entry dont_measure_rules[] __ro_after_init = { - {.action = DONT_MEASURE, .fsmagic = SELINUX_MAGIC, .flags = IMA_FSMAGIC}, - {.action = DONT_MEASURE, .fsmagic = CGROUP_SUPER_MAGIC, - .flags = IMA_FSMAGIC}, -+#if ( LINUX_VERSION_CODE > KERNEL_VERSION(3,10,0) ) - {.action = DONT_MEASURE, .fsmagic = NSFS_MAGIC, .flags = IMA_FSMAGIC} -+#endif - }; - --static struct ima_rule_entry original_measurement_rules[] __ro_after_init = { -+static struct ima_rule_entry original_measurement_rules[] = { - {.action = MEASURE, .func = MMAP_CHECK, .mask = MAY_EXEC, - .flags = IMA_FUNC | IMA_MASK}, - {.action = MEASURE, .func = BPRM_CHECK, .mask = MAY_EXEC, -@@ -111,7 +113,7 @@ static struct ima_rule_entry original_measurement_rules[] __ro_after_init = { - {.action = MEASURE, .func = FIRMWARE_CHECK, .flags = IMA_FUNC}, - }; - --static struct ima_rule_entry default_measurement_rules[] __ro_after_init = { -+static struct ima_rule_entry default_measurement_rules[] = { - {.action = MEASURE, .func = MMAP_CHECK, .mask = MAY_EXEC, - .flags = IMA_FUNC | IMA_MASK}, - {.action = MEASURE, .func = BPRM_CHECK, .mask = MAY_EXEC, -@@ -127,7 +129,7 @@ static struct ima_rule_entry default_measurement_rules[] __ro_after_init = { - {.action = MEASURE, .func = POLICY_CHECK, .flags = IMA_FUNC}, - }; - --static struct ima_rule_entry default_appraise_rules[] __ro_after_init = { -+static struct ima_rule_entry default_appraise_rules[] = { - {.action = DONT_APPRAISE, .fsmagic = PROC_SUPER_MAGIC, .flags = IMA_FSMAGIC}, - {.action = DONT_APPRAISE, .fsmagic = SYSFS_MAGIC, .flags = IMA_FSMAGIC}, - {.action = DONT_APPRAISE, .fsmagic = DEBUGFS_MAGIC, .flags = IMA_FSMAGIC}, -@@ -137,7 +139,9 @@ static struct ima_rule_entry default_appraise_rules[] __ro_after_init = { - {.action = DONT_APPRAISE, .fsmagic = BINFMTFS_MAGIC, .flags = IMA_FSMAGIC}, - {.action = DONT_APPRAISE, .fsmagic = SECURITYFS_MAGIC, .flags = IMA_FSMAGIC}, - {.action = DONT_APPRAISE, .fsmagic = SELINUX_MAGIC, .flags = IMA_FSMAGIC}, -+#if ( LINUX_VERSION_CODE > KERNEL_VERSION(3,10,0) ) - {.action = DONT_APPRAISE, .fsmagic = NSFS_MAGIC, .flags = IMA_FSMAGIC}, -+#endif - {.action = DONT_APPRAISE, .fsmagic = CGROUP_SUPER_MAGIC, .flags = IMA_FSMAGIC}, - #ifdef CONFIG_IMA_WRITE_POLICY - {.action = APPRAISE, .func = POLICY_CHECK, -@@ -249,7 +253,11 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, - if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid)) - return false; - if (rule->flags & IMA_EUID) { -+#if ( LINUX_VERSION_CODE > KERNEL_VERSION(3,10,0) ) - if (has_capability_noaudit(current, CAP_SETUID)) { -+#else -+ if (capable_wrt_inode_uidgid(inode, CAP_SETUID) || capable(CAP_SETUID)) { -+#endif - if (!rule->uid_op(cred->euid, rule->uid) - && !rule->uid_op(cred->suid, rule->uid) - && !rule->uid_op(cred->uid, rule->uid)) -@@ -556,16 +564,34 @@ static int ima_lsm_rule_init(struct ima_rule_entry *entry, - return result; - } - -+static int ima_string_contains_hex(const char *string, size_t len) -+{ -+ const unsigned char *p; -+ for (p = string; p < (const unsigned char *)string + len; p++) { -+ if (*p == '"' || *p < 0x21 || *p > 0x7e) -+ return 1; -+ } -+ return 0; -+} -+ - static void ima_log_string_op(struct audit_buffer *ab, char *key, char *value, - bool (*rule_operator)(kuid_t, kuid_t)) - { -- if (rule_operator == &uid_gt) -- audit_log_format(ab, "%s>", key); -- else if (rule_operator == &uid_lt) -- audit_log_format(ab, "%s<", key); -- else -- audit_log_format(ab, "%s=", key); -- audit_log_untrustedstring(ab, value); -+ if (ima_string_contains_hex(value, strlen(value))) { -+ if (rule_operator == &uid_gt) -+ audit_log_format(ab, "%s>(contains hex)%s", key, value); -+ else if (rule_operator == &uid_lt) -+ audit_log_format(ab, "%s<(contains hex)%s", key, value); -+ else -+ audit_log_format(ab, "%s=(contains hex)%s", key, value); -+ } else { -+ if (rule_operator == &uid_gt) -+ audit_log_format(ab, "%s>", key); -+ else if (rule_operator == &uid_lt) -+ audit_log_format(ab, "%s<", key); -+ else -+ audit_log_format(ab, "%s=", key); -+ } - audit_log_format(ab, " "); - } - static void ima_log_string(struct audit_buffer *ab, char *key, char *value) -diff --git a/integrity.h b/integrity.h -index 24520b4..c13e61d 100644 ---- a/integrity.h -+++ b/integrity.h -@@ -16,6 +16,8 @@ - #include - #include - -+#include "kcompat.h" -+ - /* iint action cache flags */ - #define IMA_MEASURE 0x00000001 - #define IMA_MEASURED 0x00000002 -@@ -91,7 +93,7 @@ struct ima_digest_data { - struct signature_v2_hdr { - uint8_t type; /* xattr type */ - uint8_t version; /* signature format version */ -- uint8_t hash_algo; /* Digest algorithm [enum hash_algo] */ -+ uint8_t hash_algo; /* Digest algorithm [enum pkey_hash_algo] */ - uint32_t keyid; /* IMA key identifier - not X509/PGP specific */ - uint16_t sig_size; /* signature size */ - uint8_t sig[0]; /* signature payload */ -@@ -131,8 +133,8 @@ int __init integrity_read_file(const char *path, char **data); - int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, - const char *digest, int digestlen); - --int __init integrity_init_keyring(const unsigned int id); --int __init integrity_load_x509(const unsigned int id, const char *path); -+int integrity_init_keyring(const unsigned int id); -+int integrity_load_x509(const unsigned int id, const char *path); - #else - - static inline int integrity_digsig_verify(const unsigned int id, -diff --git a/integrity_audit.c b/integrity_audit.c -index 90987d1..ba5e532 100644 ---- a/integrity_audit.c -+++ b/integrity_audit.c -@@ -10,6 +10,7 @@ - * Audit calls for the integrity subsystem - */ - -+#include "kcompat.h" - #include - #include - #include -@@ -45,21 +46,17 @@ void integrity_audit_msg(int audit_msgno, struct inode *inode, - from_kuid(&init_user_ns, audit_get_loginuid(current)), - audit_get_sessionid(current)); - audit_log_task_context(ab); -- audit_log_format(ab, " op="); -- audit_log_string(ab, op); -- audit_log_format(ab, " cause="); -- audit_log_string(ab, cause); -- audit_log_format(ab, " comm="); -- audit_log_untrustedstring(ab, get_task_comm(name, current)); -+ audit_log_format(ab, " op=\"%s\"", op); -+ audit_log_format(ab, " cause=\"%s\"", cause); -+ audit_log_format(ab, " comm=%s", get_task_comm(name, current)); - if (fname) { -- audit_log_format(ab, " name="); -- audit_log_untrustedstring(ab, fname); -+ audit_log_format(ab, " name=%s", fname); - } - if (inode) { -- audit_log_format(ab, " dev="); -- audit_log_untrustedstring(ab, inode->i_sb->s_id); -+ audit_log_format(ab, " dev=%s", inode->i_sb->s_id); - audit_log_format(ab, " ino=%lu", inode->i_ino); - } - audit_log_format(ab, " res=%d", !result); - audit_log_end(ab); - } -+EXPORT_SYMBOL_GPL(integrity_audit_msg); -diff --git a/kcompat.h b/kcompat.h -new file mode 100644 -index 0000000..936b76c ---- /dev/null -+++ b/kcompat.h -@@ -0,0 +1,34 @@ -+#ifndef _KCOMPAT_H_ -+#define _KCOMPAT_H_ -+ -+#ifndef LINUX_VERSION_CODE -+#include -+#else -+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -+#endif -+ -+#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(3,10,0) ) -+ -+/* kcompat definitions */ -+#define CONFIG_TCG_TPM_MODULE 1 -+ -+#define CONFIG_IMA 1 -+#define CONFIG_IMA_APPRAISE_SIGNED_INIT 1 -+#define CONFIG_IMA_APPRAISE 1 -+#define CONFIG_IMA_DEFAULT_HASH "sha256" -+#define CONFIG_IMA_MEASURE_PCR_IDX 10 -+#define CONFIG_IMA_DEFAULT_TEMPLATE "ima-sig" -+#define CONFIG_INTEGRITY 1 -+#define CONFIG_INTEGRITY_AUDIT 1 -+#define CONFIG_INTEGRITY_ASYMMETRIC_KEYS 1 -+#define CONFIG_INTEGRITY_SIGNATURE 1 -+#define CONFIG_CRYPTO_RSA 1 -+ -+#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 - diff --git a/kernel/kernel-modules/integrity/centos/patches/0002-integrity-expose-module-params.patch b/kernel/kernel-modules/integrity/centos/patches/0002-integrity-expose-module-params.patch deleted file mode 100644 index c35ab833d..000000000 --- a/kernel/kernel-modules/integrity/centos/patches/0002-integrity-expose-module-params.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 6d0d8278d37b3874e0b272a6d01663fbfc91cdcb Mon Sep 17 00:00:00 2001 -From: Kam Nasim -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 -+#include -+#include -+ - /* kcompat definitions */ - #define CONFIG_TCG_TPM_MODULE 1 - --- -1.8.3.1 - diff --git a/kernel/kernel-modules/integrity/centos/patches/0003-integrity-restrict-by-iversion.patch b/kernel/kernel-modules/integrity/centos/patches/0003-integrity-restrict-by-iversion.patch deleted file mode 100644 index 0813915f4..000000000 --- a/kernel/kernel-modules/integrity/centos/patches/0003-integrity-restrict-by-iversion.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 0c83c892509e592692e5002d855ce1f3001149e5 Mon Sep 17 00:00:00 2001 -From: Kam Nasim -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 - #include -+#include - #include - #include - #include -@@ -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 - diff --git a/kernel/kernel-modules/integrity/centos/patches/0004-integrity-disable-set-xattr-on-imasig.patch b/kernel/kernel-modules/integrity/centos/patches/0004-integrity-disable-set-xattr-on-imasig.patch deleted file mode 100644 index 1d37f6991..000000000 --- a/kernel/kernel-modules/integrity/centos/patches/0004-integrity-disable-set-xattr-on-imasig.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 928f2de735ab38802984938618aa051dd55f536c Mon Sep 17 00:00:00 2001 -From: Kam Nasim -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 - diff --git a/kernel/kernel-modules/integrity/centos/patches/Changes-for-CentOS-7.4-support.patch b/kernel/kernel-modules/integrity/centos/patches/Changes-for-CentOS-7.4-support.patch deleted file mode 100644 index b20f9b2c5..000000000 --- a/kernel/kernel-modules/integrity/centos/patches/Changes-for-CentOS-7.4-support.patch +++ /dev/null @@ -1,28 +0,0 @@ -From cf5d8b554d6fdacf3ad3d18333bd00f8b937ff54 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jim Somerville -Date: Wed, 11 Oct 2017 16:38:36 -0400 -Subject: [PATCH 1/1] Changes for CentOS 7.4 support - -Signed-off-by: Jim Somerville ---- - 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 - diff --git a/kernel/kernel-modules/integrity/centos/patches/Changes-for-CentOS-7.6-support.patch b/kernel/kernel-modules/integrity/centos/patches/Changes-for-CentOS-7.6-support.patch deleted file mode 100644 index 4d8c62473..000000000 --- a/kernel/kernel-modules/integrity/centos/patches/Changes-for-CentOS-7.6-support.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 5b60e1a889246a5a0d131e74ceaf240fc0637c9f Mon Sep 17 00:00:00 2001 -From: Shuicheng Lin -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 -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 (@chip_num -> @chip part) -Signed-off-by: Jarkko Sakkinen -Reviewed-by: Jason Gunthorpe -Tested-by: PrasannaKumar Muralidharan -" - -Signed-off-by: Shuicheng Lin ---- - 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 - diff --git a/kernel/kernel-modules/integrity/centos/patches/integrity-kmod.spec.patchlist b/kernel/kernel-modules/integrity/centos/patches/integrity-kmod.spec.patchlist deleted file mode 100644 index e2a7a19a5..000000000 --- a/kernel/kernel-modules/integrity/centos/patches/integrity-kmod.spec.patchlist +++ /dev/null @@ -1,3 +0,0 @@ -0001-integrity-kcompat-support.patch -0002-integrity-expose-module-params.patch -0003-integrity-restrict-by-iversion.patch diff --git a/kernel/kernel-modules/intel-e1000e/centos/build_srpm.data b/kernel/kernel-modules/intel-e1000e/centos/build_srpm.data deleted file mode 100644 index ea6ffa8c8..000000000 --- a/kernel/kernel-modules/intel-e1000e/centos/build_srpm.data +++ /dev/null @@ -1,4 +0,0 @@ -COPY_LIST=" \ - $PKG_BASE/files/* \ - $STX_BASE/downloads/e1000e-3.4.2.1.tar.gz" -TIS_PATCH_VER=1 diff --git a/kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec b/kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec deleted file mode 100644 index a3985e7de..000000000 --- a/kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec +++ /dev/null @@ -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 3.3.5.3 -- Initial RPM package - diff --git a/kernel/kernel-modules/intel-e1000e/files/GPL-v2.0.txt b/kernel/kernel-modules/intel-e1000e/files/GPL-v2.0.txt deleted file mode 100644 index d159169d1..000000000 --- a/kernel/kernel-modules/intel-e1000e/files/GPL-v2.0.txt +++ /dev/null @@ -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. - - - Copyright (C) - - 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. - - , 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. diff --git a/kernel/kernel-modules/intel-e1000e/files/modules-load.conf b/kernel/kernel-modules/intel-e1000e/files/modules-load.conf deleted file mode 100644 index 146fa26ac..000000000 --- a/kernel/kernel-modules/intel-e1000e/files/modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -e1000e diff --git a/kernel/kernel-modules/intel-i40e/centos/build_srpm.data b/kernel/kernel-modules/intel-i40e/centos/build_srpm.data deleted file mode 100644 index d073eee80..000000000 --- a/kernel/kernel-modules/intel-i40e/centos/build_srpm.data +++ /dev/null @@ -1,4 +0,0 @@ -COPY_LIST=" \ - $PKG_BASE/files/* \ - $STX_BASE/downloads/i40e-2.10.19.82.tar.gz" -TIS_PATCH_VER=1 diff --git a/kernel/kernel-modules/intel-i40e/centos/i40e-kmod.spec b/kernel/kernel-modules/intel-i40e/centos/i40e-kmod.spec deleted file mode 100644 index 2b22b89fc..000000000 --- a/kernel/kernel-modules/intel-i40e/centos/i40e-kmod.spec +++ /dev/null @@ -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 1.4.25-1 -- Initial RPM package, based on elrepo.org's ixgbe one. - diff --git a/kernel/kernel-modules/intel-i40e/files/GPL-v2.0.txt b/kernel/kernel-modules/intel-i40e/files/GPL-v2.0.txt deleted file mode 100644 index d159169d1..000000000 --- a/kernel/kernel-modules/intel-i40e/files/GPL-v2.0.txt +++ /dev/null @@ -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. - - - Copyright (C) - - 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. - - , 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. diff --git a/kernel/kernel-modules/intel-i40e/files/i40e-Enable-getting-link-status-from-VF.patch b/kernel/kernel-modules/intel-i40e/files/i40e-Enable-getting-link-status-from-VF.patch deleted file mode 100644 index 747f567e5..000000000 --- a/kernel/kernel-modules/intel-i40e/files/i40e-Enable-getting-link-status-from-VF.patch +++ /dev/null @@ -1,128 +0,0 @@ -From b8c666367cd98a2b0033c043f6f206abd8e238a6 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Vadim Suraev -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 -Signed-off-by: eric zhang -Signed-off-by: Jim Somerville ---- - 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 *)ð_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 - diff --git a/kernel/kernel-modules/intel-i40e/files/i40e-add-more-debug-info-for-VFs-still-in-reset.patch b/kernel/kernel-modules/intel-i40e/files/i40e-add-more-debug-info-for-VFs-still-in-reset.patch deleted file mode 100644 index 7f1fba6e6..000000000 --- a/kernel/kernel-modules/intel-i40e/files/i40e-add-more-debug-info-for-VFs-still-in-reset.patch +++ /dev/null @@ -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: -References: -From: Jim Somerville -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 ---- - 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 - diff --git a/kernel/kernel-modules/intel-i40e/files/modules-load.conf b/kernel/kernel-modules/intel-i40e/files/modules-load.conf deleted file mode 100644 index d772f16cd..000000000 --- a/kernel/kernel-modules/intel-i40e/files/modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -i40e diff --git a/kernel/kernel-modules/intel-iavf/centos/build_srpm.data b/kernel/kernel-modules/intel-iavf/centos/build_srpm.data deleted file mode 100644 index 8833d2d6a..000000000 --- a/kernel/kernel-modules/intel-iavf/centos/build_srpm.data +++ /dev/null @@ -1,4 +0,0 @@ -COPY_LIST=" \ - $PKG_BASE/files/* \ - $STX_BASE/downloads/iavf-3.7.61.20.tar.gz" -TIS_PATCH_VER=1 diff --git a/kernel/kernel-modules/intel-iavf/centos/iavf-kmod.spec b/kernel/kernel-modules/intel-iavf/centos/iavf-kmod.spec deleted file mode 100644 index 6a4a37726..000000000 --- a/kernel/kernel-modules/intel-iavf/centos/iavf-kmod.spec +++ /dev/null @@ -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 1.4.25-1 -- Initial RPM package, based on elrepo.org's ixgbe one. - diff --git a/kernel/kernel-modules/intel-iavf/files/GPL-v2.0.txt b/kernel/kernel-modules/intel-iavf/files/GPL-v2.0.txt deleted file mode 100644 index d159169d1..000000000 --- a/kernel/kernel-modules/intel-iavf/files/GPL-v2.0.txt +++ /dev/null @@ -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. - - - Copyright (C) - - 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. - - , 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. diff --git a/kernel/kernel-modules/intel-iavf/files/modules-load.conf b/kernel/kernel-modules/intel-iavf/files/modules-load.conf deleted file mode 100644 index 54c14c832..000000000 --- a/kernel/kernel-modules/intel-iavf/files/modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -iavf diff --git a/kernel/kernel-modules/intel-ixgbe/centos/build_srpm.data b/kernel/kernel-modules/intel-ixgbe/centos/build_srpm.data deleted file mode 100644 index 63ad981e2..000000000 --- a/kernel/kernel-modules/intel-ixgbe/centos/build_srpm.data +++ /dev/null @@ -1,4 +0,0 @@ -COPY_LIST=" \ - $PKG_BASE/files/* \ - $STX_BASE/downloads/ixgbe-5.5.5.tar.gz" -TIS_PATCH_VER=1 diff --git a/kernel/kernel-modules/intel-ixgbe/centos/ixgbe-kmod.spec b/kernel/kernel-modules/intel-ixgbe/centos/ixgbe-kmod.spec deleted file mode 100644 index 5f314a78c..000000000 --- a/kernel/kernel-modules/intel-ixgbe/centos/ixgbe-kmod.spec +++ /dev/null @@ -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 1.4.25-1 -- Initial RPM package, based on elrepo.org's ixgbe one. - diff --git a/kernel/kernel-modules/intel-ixgbe/files/GPL-v2.0.txt b/kernel/kernel-modules/intel-ixgbe/files/GPL-v2.0.txt deleted file mode 100644 index d159169d1..000000000 --- a/kernel/kernel-modules/intel-ixgbe/files/GPL-v2.0.txt +++ /dev/null @@ -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. - - - Copyright (C) - - 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. - - , 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. diff --git a/kernel/kernel-modules/intel-ixgbe/files/modules-load.conf b/kernel/kernel-modules/intel-ixgbe/files/modules-load.conf deleted file mode 100644 index e11d4774b..000000000 --- a/kernel/kernel-modules/intel-ixgbe/files/modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -ixgbe diff --git a/kernel/kernel-modules/intel-ixgbevf/centos/build_srpm.data b/kernel/kernel-modules/intel-ixgbevf/centos/build_srpm.data deleted file mode 100644 index 9e5ccfbab..000000000 --- a/kernel/kernel-modules/intel-ixgbevf/centos/build_srpm.data +++ /dev/null @@ -1,4 +0,0 @@ -COPY_LIST=" \ - $PKG_BASE/files/* \ - $STX_BASE/downloads/ixgbevf-4.5.3.tar.gz" -TIS_PATCH_VER=1 diff --git a/kernel/kernel-modules/intel-ixgbevf/centos/ixgbevf-kmod.spec b/kernel/kernel-modules/intel-ixgbevf/centos/ixgbevf-kmod.spec deleted file mode 100644 index b255622c3..000000000 --- a/kernel/kernel-modules/intel-ixgbevf/centos/ixgbevf-kmod.spec +++ /dev/null @@ -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 1.4.25-1 -- Initial RPM package, based on elrepo.org's ixgbevf one. - diff --git a/kernel/kernel-modules/intel-ixgbevf/files/GPL-v2.0.txt b/kernel/kernel-modules/intel-ixgbevf/files/GPL-v2.0.txt deleted file mode 100644 index d159169d1..000000000 --- a/kernel/kernel-modules/intel-ixgbevf/files/GPL-v2.0.txt +++ /dev/null @@ -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. - - - Copyright (C) - - 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. - - , 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. diff --git a/kernel/kernel-modules/intel-ixgbevf/files/modules-load.conf b/kernel/kernel-modules/intel-ixgbevf/files/modules-load.conf deleted file mode 100644 index 2ee97271c..000000000 --- a/kernel/kernel-modules/intel-ixgbevf/files/modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -ixgbevf diff --git a/kernel/kernel-modules/intel-opae-fpga/centos/build_srpm.data b/kernel/kernel-modules/intel-opae-fpga/centos/build_srpm.data deleted file mode 100644 index 60e6cb624..000000000 --- a/kernel/kernel-modules/intel-opae-fpga/centos/build_srpm.data +++ /dev/null @@ -1,4 +0,0 @@ -COPY_LIST=" \ - $PATCHES_BASE/* \ - $STX_BASE/downloads/opae-intel-fpga-driver-2.0.1.tar.gz" -TIS_PATCH_VER=1 diff --git a/kernel/kernel-modules/intel-opae-fpga/centos/fpga-kmod.spec b/kernel/kernel-modules/intel-opae-fpga/centos/fpga-kmod.spec deleted file mode 100644 index 2cf94d1a4..000000000 --- a/kernel/kernel-modules/intel-opae-fpga/centos/fpga-kmod.spec +++ /dev/null @@ -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 1.4.25-1 -- Initial RPM package, based on elrepo.org's ixgbe one. diff --git a/kernel/kernel-modules/intel-opae-fpga/centos/patches/Remove-regmap-mmio-as-it-is-built-into-the-kernel.patch b/kernel/kernel-modules/intel-opae-fpga/centos/patches/Remove-regmap-mmio-as-it-is-built-into-the-kernel.patch deleted file mode 100644 index ed2f48191..000000000 --- a/kernel/kernel-modules/intel-opae-fpga/centos/patches/Remove-regmap-mmio-as-it-is-built-into-the-kernel.patch +++ /dev/null @@ -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 -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 ---- - 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 - diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/centos/build_srpm.data b/kernel/kernel-modules/mlnx-ofa_kernel/centos/build_srpm.data deleted file mode 100644 index f5fec757c..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/centos/build_srpm.data +++ /dev/null @@ -1,3 +0,0 @@ -COPY_LIST="$PKG_BASE/files/modules-load.conf" -TIS_PATCH_VER=2 -BUILD_IS_SLOW=3 diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/0001-Support-TiS-system.patch b/kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/0001-Support-TiS-system.patch deleted file mode 100644 index acc8d5e51..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/0001-Support-TiS-system.patch +++ /dev/null @@ -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 -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 -Signed-off-by: Kam Nasim -Signed-off-by: eric zhang -Signed-off-by: Jim Somerville ---- - 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 - diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/PATCH_ORDER b/kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/PATCH_ORDER deleted file mode 100644 index 99ee2d189..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/PATCH_ORDER +++ /dev/null @@ -1 +0,0 @@ -0001-Support-TiS-system.patch diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-HAVE_IEEE_GETQCN.patch b/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-HAVE_IEEE_GETQCN.patch deleted file mode 100644 index 544213489..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-HAVE_IEEE_GETQCN.patch +++ /dev/null @@ -1,26 +0,0 @@ -From e1b8dd12605b5654bd94011cb6c587fd0c0bc9af Mon Sep 17 00:00:00 2001 -From: Jim Somerville -Date: Tue, 20 Dec 2016 11:58:26 -0500 -Subject: [PATCH 2/3] neuter HAVE_IEEE_GETQCN - -Signed-off-by: Jim Somerville ---- - 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 - --#ifndef HAVE_IEEE_GETQCN -+#if 0 - - #ifndef HAVE_STRUCT_IEEE_QCN - enum dcbnl_cndd_states { --- -1.8.3.1 - diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-a-bunch-of-ks-stuff.patch b/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-a-bunch-of-ks-stuff.patch deleted file mode 100644 index f1bd7a20e..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-a-bunch-of-ks-stuff.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 63f73a02fd73f6a01bce1fbf65ae2a6a628f0626 Mon Sep 17 00:00:00 2001 -From: Jim Somerville -Date: Tue, 20 Dec 2016 16:22:47 -0500 -Subject: [PATCH 1/3] neuter a bunch of ks stuff - -Signed-off-by: Jim Somerville ---- - 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 - #include - 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 - -+#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 - diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-some-stats-output.patch b/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-some-stats-output.patch deleted file mode 100644 index ca709b984..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/0001-neuter-some-stats-output.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 12de070f8f73794e45ee6956c9957d0ff0c5133f Mon Sep 17 00:00:00 2001 -From: Jim Somerville -Date: Tue, 20 Dec 2016 16:56:01 -0500 -Subject: [PATCH 3/3] neuter some stats output - -Signed-off-by: Jim Somerville ---- - 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 - diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/Disable-use-of-page-pool.patch b/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/Disable-use-of-page-pool.patch deleted file mode 100644 index fd8c3f673..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/centos/patches/Disable-use-of-page-pool.patch +++ /dev/null @@ -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 -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 ---- - 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 - diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/centos/srpm_path b/kernel/kernel-modules/mlnx-ofa_kernel/centos/srpm_path deleted file mode 100644 index 8a880eb54..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/centos/srpm_path +++ /dev/null @@ -1 +0,0 @@ -repo:stx/downloads/mlnx-ofa_kernel-4.5-OFED.4.5.1.0.1.1.gb4fdfac.src.rpm diff --git a/kernel/kernel-modules/mlnx-ofa_kernel/files/modules-load.conf b/kernel/kernel-modules/mlnx-ofa_kernel/files/modules-load.conf deleted file mode 100644 index 0e35f5f64..000000000 --- a/kernel/kernel-modules/mlnx-ofa_kernel/files/modules-load.conf +++ /dev/null @@ -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 diff --git a/kernel/kernel-modules/qat17/PKG-INFO b/kernel/kernel-modules/qat17/PKG-INFO deleted file mode 100644 index bc5b2fa3c..000000000 --- a/kernel/kernel-modules/qat17/PKG-INFO +++ /dev/null @@ -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 diff --git a/kernel/kernel-modules/qat17/centos/build_srpm.data b/kernel/kernel-modules/qat17/centos/build_srpm.data deleted file mode 100644 index 868374fc7..000000000 --- a/kernel/kernel-modules/qat17/centos/build_srpm.data +++ /dev/null @@ -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 diff --git a/kernel/kernel-modules/qat17/centos/qat17.spec b/kernel/kernel-modules/qat17/centos/qat17.spec deleted file mode 100644 index 8389b6e1d..000000000 --- a/kernel/kernel-modules/qat17/centos/qat17.spec +++ /dev/null @@ -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 -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/*" diff --git a/kernel/kernel-modules/qat17/files/Get-and-report-the-return-code-on-firmware-load-fail.patch b/kernel/kernel-modules/qat17/files/Get-and-report-the-return-code-on-firmware-load-fail.patch deleted file mode 100644 index d8ce27fa7..000000000 --- a/kernel/kernel-modules/qat17/files/Get-and-report-the-return-code-on-firmware-load-fail.patch +++ /dev/null @@ -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 -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 ---- - .../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 - diff --git a/kernel/kernel-modules/qat17/files/qat b/kernel/kernel-modules/qat17/files/qat deleted file mode 100644 index e2447c052..000000000 --- a/kernel/kernel-modules/qat17/files/qat +++ /dev/null @@ -1 +0,0 @@ -SRIOV_ENABLE=1 diff --git a/kernel/kernel-modules/qat17/files/qat_service b/kernel/kernel-modules/qat17/files/qat_service deleted file mode 100755 index a7b5e5451..000000000 --- a/kernel/kernel-modules/qat17/files/qat_service +++ /dev/null @@ -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" -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 - diff --git a/kernel/kernel-modules/tpmdd/centos/build_srpm.data b/kernel/kernel-modules/tpmdd/centos/build_srpm.data deleted file mode 100644 index b2e6158f8..000000000 --- a/kernel/kernel-modules/tpmdd/centos/build_srpm.data +++ /dev/null @@ -1,5 +0,0 @@ -COPY_LIST=" \ - $PKG_BASE/files/* \ - $PKG_BASE/patches/* \ - $STX_BASE/downloads/tpm-kmod-e6aef069.tar.gz" -TIS_PATCH_VER=6 diff --git a/kernel/kernel-modules/tpmdd/centos/tpm-kmod.spec b/kernel/kernel-modules/tpmdd/centos/tpm-kmod.spec deleted file mode 100644 index b0f34d71f..000000000 --- a/kernel/kernel-modules/tpmdd/centos/tpm-kmod.spec +++ /dev/null @@ -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 4.12 -- Initial RPM package. - diff --git a/kernel/kernel-modules/tpmdd/files/COPYING b/kernel/kernel-modules/tpmdd/files/COPYING deleted file mode 100644 index e2fed1bf7..000000000 --- a/kernel/kernel-modules/tpmdd/files/COPYING +++ /dev/null @@ -1,344 +0,0 @@ - -"This software program is licensed subject to the GNU General Public License -(GPL). Version 2, June 1991, available at -" - - 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. - - - Copyright (C) - - 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. - - , 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. diff --git a/kernel/kernel-modules/tpmdd/files/README b/kernel/kernel-modules/tpmdd/files/README deleted file mode 100644 index 9b1703ad4..000000000 --- a/kernel/kernel-modules/tpmdd/files/README +++ /dev/null @@ -1,184 +0,0 @@ - -TPM Device Driver for CentOS 7 (Linux version 3.10) -=============================================================================== - -=============================================================================== - -Kam Nasim -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-; 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 - 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 - Signed-off-by: Matthew Wilcox - Tested-by: Kirill A. Shutemov - Cc: Konstantin Khlebnikov - Cc: Ross Zwisler - Cc: Tejun Heo - Signed-off-by: Andrew Morton - - 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 - 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 - - 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 - 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 - 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 - Signed-off-by: Rafael J. Wysocki - - The compat layer needs to continue loading the PNP module the old way - using explicit init() and exit() functions diff --git a/kernel/kernel-modules/tpmdd/files/modules-load.conf b/kernel/kernel-modules/tpmdd/files/modules-load.conf deleted file mode 100644 index 298f940ff..000000000 --- a/kernel/kernel-modules/tpmdd/files/modules-load.conf +++ /dev/null @@ -1,3 +0,0 @@ -tpm -tpm_tis_core -tpm_tis diff --git a/kernel/kernel-modules/tpmdd/patches/0001-disable-arm64-acpi-command.patch b/kernel/kernel-modules/tpmdd/patches/0001-disable-arm64-acpi-command.patch deleted file mode 100644 index 8a2779340..000000000 --- a/kernel/kernel-modules/tpmdd/patches/0001-disable-arm64-acpi-command.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Kam Nasim -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) diff --git a/kernel/kernel-modules/tpmdd/patches/0002-tpmdd-kcompat-support.patch b/kernel/kernel-modules/tpmdd/patches/0002-tpmdd-kcompat-support.patch deleted file mode 100644 index 4dab81f9d..000000000 --- a/kernel/kernel-modules/tpmdd/patches/0002-tpmdd-kcompat-support.patch +++ /dev/null @@ -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 -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 ---- - 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 -+# 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,,) -+# 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 -+#else -+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -+#endif -+#include -+#include -+ -+#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(3,10,0) ) -+#include -+#include -+ -+// 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 - #include - #include --- -1.8.3.1 - diff --git a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0001-tpm-replace-msleep-with-usleep_range.patch b/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0001-tpm-replace-msleep-with-usleep_range.patch deleted file mode 100644 index ac9b453fc..000000000 --- a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0001-tpm-replace-msleep-with-usleep_range.patch +++ /dev/null @@ -1,200 +0,0 @@ -From 9f3fc7bcddcb51234e23494531f93ab60475e1c3 Mon Sep 17 00:00:00 2001 -From: Hamza Attak -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 -Reviewed-by: Jarkko Sakkinen -Tested-by: Jarkko Sakkinen -Signed-off-by: Jarkko Sakkinen -Signed-off-by: James Morris ---- -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 - diff --git a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0002-tpm-reduce-tpm-polling-delay-in-tpm_tis_core.patch b/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0002-tpm-reduce-tpm-polling-delay-in-tpm_tis_core.patch deleted file mode 100644 index dc12fb71b..000000000 --- a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0002-tpm-reduce-tpm-polling-delay-in-tpm_tis_core.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 19b460f3fe98b0513bf5a52f63e19bc120bd8093 Mon Sep 17 00:00:00 2001 -From: Nayna Jain -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 -Reviewed-by: Jarkko Sakkinen -Tested-by: Jarkko Sakkinen -Signed-off-by: Jarkko Sakkinen ---- - 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 - diff --git a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0003-tpm-use-tpm_msleep-value-as-max-delay.patch b/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0003-tpm-use-tpm_msleep-value-as-max-delay.patch deleted file mode 100644 index 06022b583..000000000 --- a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0003-tpm-use-tpm_msleep-value-as-max-delay.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 86d94390d9b97639fecb3e032120b93004a3036d Mon Sep 17 00:00:00 2001 -From: Nayna Jain -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 -Acked-by: Mimi Zohar ---- - 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 - diff --git a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0004-tpm-wait-for-stat-to-specify-variable-polling-time.patch b/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0004-tpm-wait-for-stat-to-specify-variable-polling-time.patch deleted file mode 100644 index 2ea33cc2c..000000000 --- a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0004-tpm-wait-for-stat-to-specify-variable-polling-time.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 2e23fe68b72638a1185f6243528f05f7dc665a3a Mon Sep 17 00:00:00 2001 -From: Nayna Jain -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 -Acked-by: Mimi Zohar ---- - 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 - diff --git a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0005-tpm-ignore-burstcount-to-improve-send-performance.patch b/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0005-tpm-ignore-burstcount-to-improve-send-performance.patch deleted file mode 100644 index bf030b9e4..000000000 --- a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0005-tpm-ignore-burstcount-to-improve-send-performance.patch +++ /dev/null @@ -1,97 +0,0 @@ -From e82060f0cf390ba8e4f79a54e68cef9a38088104 Mon Sep 17 00:00:00 2001 -From: Nayna Jain -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 in -conjunction with the TPM Device Driver work group. -Signed-off-by: Nayna Jain -Acked-by: Mimi Zohar -Reviewed-by: Jarkko Sakkinen -Tested-by: Jarkko Sakkinen -Signed-off-by: Jarkko Sakkinen ---- - 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 - diff --git a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0006-tpm-use-struct-tpm_chip.patch b/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0006-tpm-use-struct-tpm_chip.patch deleted file mode 100644 index 42f885dea..000000000 --- a/kernel/kernel-modules/tpmdd/patches/UPSTREAM-0006-tpm-use-struct-tpm_chip.patch +++ /dev/null @@ -1,327 +0,0 @@ -From 5b60e1a889246a5a0d131e74ceaf240fc0637c9f Mon Sep 17 00:00:00 2001 -From: Shuicheng Lin -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 -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 (@chip_num -> @chip part) -Signed-off-by: Jarkko Sakkinen -Reviewed-by: Jason Gunthorpe -Tested-by: PrasannaKumar Muralidharan -" - -Signed-off-by: Shuicheng Lin ---- - 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 - diff --git a/kernel/kernel-modules/tpmdd/patches/tpm-kmod.spec.patchlist b/kernel/kernel-modules/tpmdd/patches/tpm-kmod.spec.patchlist deleted file mode 100644 index e49200c68..000000000 --- a/kernel/kernel-modules/tpmdd/patches/tpm-kmod.spec.patchlist +++ /dev/null @@ -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 diff --git a/kernel/kernel-rt/centos/build_srpm.data b/kernel/kernel-rt/centos/build_srpm.data deleted file mode 100644 index 20400d2d0..000000000 --- a/kernel/kernel-rt/centos/build_srpm.data +++ /dev/null @@ -1,4 +0,0 @@ -COPY_LIST="files/*" -TIS_PATCH_VER=5 -BUILD_IS_BIG=11 -BUILD_IS_SLOW=12 diff --git a/kernel/kernel-rt/centos/meta_patches/Build-logic-and-sources-for-TiC.patch b/kernel/kernel-rt/centos/meta_patches/Build-logic-and-sources-for-TiC.patch deleted file mode 100644 index e7a091088..000000000 --- a/kernel/kernel-rt/centos/meta_patches/Build-logic-and-sources-for-TiC.patch +++ /dev/null @@ -1,529 +0,0 @@ -From 4a2a30175a859e5a60b5a0e999c9edfde03eee7c Mon Sep 17 00:00:00 2001 -From: Jim Somerville -Date: Mon, 23 Apr 2018 15:18:45 -0400 -Subject: [PATCH] Build logic and sources for TiC - -Signed-off-by: Jim Somerville -Signed-off-by: Robin Lu ---- - 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--kvm-debuginfo package. - # %%kernel_kvm_debuginfo_package -@@ -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--debuginfo package. - # %%kernel_debuginfo_package -@@ -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--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 - # %%kernel_variant_package [-n ] - # -+%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 [] -@@ -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 [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 - diff --git a/kernel/kernel-rt/centos/meta_patches/Compile-issues.patch b/kernel/kernel-rt/centos/meta_patches/Compile-issues.patch deleted file mode 100644 index 418ff76ea..000000000 --- a/kernel/kernel-rt/centos/meta_patches/Compile-issues.patch +++ /dev/null @@ -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 -Date: Fri, 13 Mar 2020 16:15:29 -0400 -Subject: [PATCH 2/2] Compile issues - -Signed-off-by: Jim Somerville ---- - 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 - diff --git a/kernel/kernel-rt/centos/meta_patches/Kernel-source-patches-for-TiC.patch b/kernel/kernel-rt/centos/meta_patches/Kernel-source-patches-for-TiC.patch deleted file mode 100644 index cb5166987..000000000 --- a/kernel/kernel-rt/centos/meta_patches/Kernel-source-patches-for-TiC.patch +++ /dev/null @@ -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 -Date: Fri, 13 Mar 2020 16:15:29 -0400 -Subject: [PATCH 1/2] Kernel source patches for TiC - -Signed-off-by: Jim Somerville ---- - 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 - diff --git a/kernel/kernel-rt/centos/meta_patches/PATCH_ORDER b/kernel/kernel-rt/centos/meta_patches/PATCH_ORDER deleted file mode 100644 index 8eab5dd84..000000000 --- a/kernel/kernel-rt/centos/meta_patches/PATCH_ORDER +++ /dev/null @@ -1,3 +0,0 @@ -Build-logic-and-sources-for-TiC.patch -Kernel-source-patches-for-TiC.patch -Compile-issues.patch diff --git a/kernel/kernel-rt/centos/patches/Add-missing-ifdef-around-max-latency-variable.patch b/kernel/kernel-rt/centos/patches/Add-missing-ifdef-around-max-latency-variable.patch deleted file mode 100644 index fd78fe9cf..000000000 --- a/kernel/kernel-rt/centos/patches/Add-missing-ifdef-around-max-latency-variable.patch +++ /dev/null @@ -1,52 +0,0 @@ -From d249a02d441998c43aeb1755c85cffb062628500 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Jim Somerville -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 ---- - 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 - diff --git a/kernel/kernel-rt/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch b/kernel/kernel-rt/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch deleted file mode 100644 index 21500b770..000000000 --- a/kernel/kernel-rt/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch +++ /dev/null @@ -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: -References: -From: Chris Friesen -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 -[VT: replacing spaces with tabs. Performed tests] -Signed-off-by: Vu Tran - -Signed-off-by: Jim Somerville ---- - 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 - diff --git a/kernel/kernel-rt/centos/patches/Allow-dmar-quirks-for-broken-bioses.patch b/kernel/kernel-rt/centos/patches/Allow-dmar-quirks-for-broken-bioses.patch deleted file mode 100644 index ee1e38cae..000000000 --- a/kernel/kernel-rt/centos/patches/Allow-dmar-quirks-for-broken-bioses.patch +++ /dev/null @@ -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 -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 ---- - 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 - diff --git a/kernel/kernel-rt/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch b/kernel/kernel-rt/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch deleted file mode 100644 index f49e30677..000000000 --- a/kernel/kernel-rt/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch +++ /dev/null @@ -1,58 +0,0 @@ -From a4302d3590621f64e639f8e075f423d5120c007e Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Allain Legacy -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 -Signed-off-by: Jim Somerville ---- - 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 - diff --git a/kernel/kernel-rt/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch b/kernel/kernel-rt/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch deleted file mode 100644 index 5c338438d..000000000 --- a/kernel/kernel-rt/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch +++ /dev/null @@ -1,60 +0,0 @@ -From ef42dfab80cff26850695de8c95c3e1ba294e05c Mon Sep 17 00:00:00 2001 -From: Alex Shi -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 -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Alex Kozyrev -Signed-off-by: Jim Somerville ---- - 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 - #include - #include -+#include - - #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 - diff --git a/kernel/kernel-rt/centos/patches/Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch b/kernel/kernel-rt/centos/patches/Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch deleted file mode 100644 index 3d570f6d8..000000000 --- a/kernel/kernel-rt/centos/patches/Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch +++ /dev/null @@ -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: -References: -From: Chris Friesen -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 ---- - 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 - diff --git a/kernel/kernel-rt/centos/patches/Fix-cacheinfo-compilation-issues-for-3.10.patch b/kernel/kernel-rt/centos/patches/Fix-cacheinfo-compilation-issues-for-3.10.patch deleted file mode 100644 index 23b6d17b0..000000000 --- a/kernel/kernel-rt/centos/patches/Fix-cacheinfo-compilation-issues-for-3.10.patch +++ /dev/null @@ -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: -References: -From: Alex Kozyrev -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 ---- - 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 - diff --git a/kernel/kernel-rt/centos/patches/Make-kernel-start-eth-devices-at-offset.patch b/kernel/kernel-rt/centos/patches/Make-kernel-start-eth-devices-at-offset.patch deleted file mode 100644 index c121e668f..000000000 --- a/kernel/kernel-rt/centos/patches/Make-kernel-start-eth-devices-at-offset.patch +++ /dev/null @@ -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: -References: -From: Chris Friesen -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 ---- - 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 - diff --git a/kernel/kernel-rt/centos/patches/Notification-of-death-of-arbitrary-processes.patch b/kernel/kernel-rt/centos/patches/Notification-of-death-of-arbitrary-processes.patch deleted file mode 100644 index f4abbe988..000000000 --- a/kernel/kernel-rt/centos/patches/Notification-of-death-of-arbitrary-processes.patch +++ /dev/null @@ -1,536 +0,0 @@ -From 220edc1ccc6a0bc3dfb94a92946bf2b9a6cc0c61 Mon Sep 17 00:00:00 2001 -From: Chris Friesen -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 ---- - 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 -+#include -+#include -+#include -+#include -+ -+#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, ¤t->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 - #include - #include -+#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 - #include - #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 - -+#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 - diff --git a/kernel/kernel-rt/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch b/kernel/kernel-rt/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch deleted file mode 100644 index c80c1f27d..000000000 --- a/kernel/kernel-rt/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a0da95b0152227a9a80d98edf5fc0af345479dce Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Dahir Osman -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 ---- - 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 - diff --git a/kernel/kernel-rt/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch b/kernel/kernel-rt/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch deleted file mode 100644 index 9eb8c135c..000000000 --- a/kernel/kernel-rt/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch +++ /dev/null @@ -1,2125 +0,0 @@ -From 7c074369c609a20df6a4467bc2de59b8945ee326 Mon Sep 17 00:00:00 2001 -From: Alex Kozyrev -Date: Wed, 19 Jul 2017 02:21:59 -0500 -Subject: [PATCH] Porting Cacheinfo from Kernel 4.10.17 - -Original source code from tag v4.10.17 in Linux stable tree for: -intel_cacheinfo.c, cacheinfo.c and cacheinfo.h. -Main commit that we are interested for is 246246cbde5e840012f853e27630ebb59f409486: -This patch adds initial support for providing processor cache information -to userspace through sysfs interface. This is based on already existing -implementations(x86, ia64, s390 and powerpc) and hence the interface is -intended to be fully compatible. - -The main purpose of this generic support is to avoid further code -duplication to support new architectures and also to unify all the existing -different implementations. - -This implementation maintains the hierarchy of cache objects which reflects -the system's cache topology. Cache devices are instantiated as needed as -CPUs come online. The cache information is replicated per-cpu even if they are -shared. A per-cpu array of cache information maintained is used mainly for -sysfs-related book keeping. - -It also implements the shared_cpu_map attribute, which is essential for -enabling both kernel and user-space to discover the system's overall cache -topology. - -This patch also add the missing ABI documentation for the cacheinfo sysfs -interface already, which is well defined and widely used. - -sysfs-devices-system-cpu was nodified by taking commit 1d78dc59f5ab6f467e49882518453adc7e4caa44: -Add an ABI document entry for /sys/devices/system/cpu/cpu*/cache/index*/id. - -cpu.h and cpu.c was enhanced with commit 3d52943b3a51497a777e6d7d840a38596a92cee9: -This patch adds a new function to create per-cpu devices. -This helps in: -1. reusing the device infrastructure to create any cpu related - attributes and corresponding sysfs instead of creating and - dealing with raw kobjects directly -2. retaining the legacy path(/sys/devices/system/cpu/..) to support - existing sysfs ABI -3. avoiding to create links in the bus directory pointing to the - device as there would be per-cpu instance of these devices with - the same name since dev->bus is not populated to cpu_sysbus on - purpose - -Signed-off-by: Jim Somerville ---- - Documentation/ABI/testing/sysfs-devices-system-cpu | 65 ++ - arch/x86/kernel/cpu/cacheinfo.c | 833 +++++++-------------- - drivers/base/Makefile | 2 +- - drivers/base/cacheinfo.c | 662 ++++++++++++++++ - drivers/base/cpu.c | 54 ++ - include/linux/cacheinfo.h | 104 +++ - include/linux/cpu.h | 3 + - 7 files changed, 1147 insertions(+), 576 deletions(-) - create mode 100644 drivers/base/cacheinfo.c - create mode 100644 include/linux/cacheinfo.h - -diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu -index ff65f15..7521be8 100644 ---- a/Documentation/ABI/testing/sysfs-devices-system-cpu -+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu -@@ -201,6 +201,71 @@ Description: address and size of the percpu note. - - crash_notes_size: size of the note of cpu#. - -+ -+What: /sys/devices/system/cpu/cpu*/cache/index*/ -+Date: July 2014(documented, existed before August 2008) -+Contact: Sudeep Holla -+ Linux kernel mailing list -+Description: Parameters for the CPU cache attributes -+ -+ allocation_policy: -+ - WriteAllocate: allocate a memory location to a cache line -+ on a cache miss because of a write -+ - ReadAllocate: allocate a memory location to a cache line -+ on a cache miss because of a read -+ - ReadWriteAllocate: both writeallocate and readallocate -+ -+ attributes: LEGACY used only on IA64 and is same as write_policy -+ -+ coherency_line_size: the minimum amount of data in bytes that gets -+ transferred from memory to cache -+ -+ level: the cache hierarchy in the multi-level cache configuration -+ -+ number_of_sets: total number of sets in the cache, a set is a -+ collection of cache lines with the same cache index -+ -+ physical_line_partition: number of physical cache line per cache tag -+ -+ shared_cpu_list: the list of logical cpus sharing the cache -+ -+ shared_cpu_map: logical cpu mask containing the list of cpus sharing -+ the cache -+ -+ size: the total cache size in kB -+ -+ type: -+ - Instruction: cache that only holds instructions -+ - Data: cache that only caches data -+ - Unified: cache that holds both data and instructions -+ -+ ways_of_associativity: degree of freedom in placing a particular block -+ of memory in the cache -+ -+ write_policy: -+ - WriteThrough: data is written to both the cache line -+ and to the block in the lower-level memory -+ - WriteBack: data is written only to the cache line and -+ the modified cache line is written to main -+ memory only when it is replaced -+ -+ -+What: /sys/devices/system/cpu/cpu*/cache/index*/id -+Date: September 2016 -+Contact: Linux kernel mailing list -+Description: Cache id -+ -+ The id provides a unique number for a specific instance of -+ a cache of a particular type. E.g. there may be a level -+ 3 unified cache on each socket in a server and we may -+ assign them ids 0, 1, 2, ... -+ -+ Note that id value can be non-contiguous. E.g. level 1 -+ caches typically exist per core, but there may not be a -+ power of two cores on a socket, so these caches may be -+ numbered 0, 1, 2, 3, 4, 5, 8, 9, 10, ... -+ -+ - What: /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats - /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/turbo_stat - /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/sub_turbo_stat -diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c -index d529019..bf23bd2 100644 ---- a/arch/x86/kernel/cpu/cacheinfo.c -+++ b/arch/x86/kernel/cpu/cacheinfo.c -@@ -1,5 +1,5 @@ - /* -- * Routines to indentify caches on Intel CPU. -+ * Routines to identify caches on Intel CPU. - * - * Changes: - * Venkatesh Pallipadi : Adding cache identification through cpuid(4) -@@ -7,16 +7,14 @@ - * Andi Kleen / Andreas Herrmann : CPUID4 emulation on AMD. - */ - --#include - #include --#include --#include -+#include - #include - #include -+#include - #include - - #include --#include - #include - #include - -@@ -116,10 +114,10 @@ static const struct _cache_table cache_table[] = - - - enum _cache_type { -- CACHE_TYPE_NULL = 0, -- CACHE_TYPE_DATA = 1, -- CACHE_TYPE_INST = 2, -- CACHE_TYPE_UNIFIED = 3 -+ CTYPE_NULL = 0, -+ CTYPE_DATA = 1, -+ CTYPE_INST = 2, -+ CTYPE_UNIFIED = 3 - }; - - union _cpuid4_leaf_eax { -@@ -160,12 +158,7 @@ struct _cpuid4_info_regs { - struct amd_northbridge *nb; - }; - --struct _cpuid4_info { -- struct _cpuid4_info_regs base; -- DECLARE_BITMAP(shared_cpu_map, NR_CPUS); --}; -- --unsigned short num_cache_leaves; -+static unsigned short num_cache_leaves; - - /* AMD doesn't have CPUID4. Emulate it here to report the same - information to the user. This makes some assumptions about the machine: -@@ -221,6 +214,13 @@ static const unsigned short assocs[] = { - static const unsigned char levels[] = { 1, 1, 2, 3 }; - static const unsigned char types[] = { 1, 2, 3, 3 }; - -+static const enum cache_type cache_type_map[] = { -+ [CTYPE_NULL] = CACHE_TYPE_NOCACHE, -+ [CTYPE_DATA] = CACHE_TYPE_DATA, -+ [CTYPE_INST] = CACHE_TYPE_INST, -+ [CTYPE_UNIFIED] = CACHE_TYPE_UNIFIED, -+}; -+ - static void - amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, - union _cpuid4_leaf_ebx *ebx, -@@ -292,14 +292,8 @@ amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, - (ebx->split.ways_of_associativity + 1) - 1; - } - --struct _cache_attr { -- struct attribute attr; -- ssize_t (*show)(struct _cpuid4_info *, char *, unsigned int); -- ssize_t (*store)(struct _cpuid4_info *, const char *, size_t count, -- unsigned int); --}; -- - #if defined(CONFIG_AMD_NB) && defined(CONFIG_SYSFS) -+ - /* - * L3 cache descriptors - */ -@@ -326,20 +320,6 @@ static void amd_calc_l3_indices(struct amd_northbridge *nb) - l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1; - } - --static void amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) --{ -- int node; -- -- /* only for L3, and not in virtualized environments */ -- if (index < 3) -- return; -- -- node = amd_get_nb_id(smp_processor_id()); -- this_leaf->nb = node_to_amd_nb(node); -- if (this_leaf->nb && !this_leaf->nb->l3_cache.indices) -- amd_calc_l3_indices(this_leaf->nb); --} -- - /* - * check whether a slot used for disabling an L3 index is occupied. - * @l3: L3 cache descriptor -@@ -347,7 +327,7 @@ static void amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) - * - * @returns: the disabled index if used or negative value if slot free. - */ --int amd_get_l3_disable_slot(struct amd_northbridge *nb, unsigned slot) -+static int amd_get_l3_disable_slot(struct amd_northbridge *nb, unsigned slot) - { - unsigned int reg = 0; - -@@ -360,15 +340,13 @@ int amd_get_l3_disable_slot(struct amd_northbridge *nb, unsigned slot) - return -1; - } - --static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf, -+static ssize_t show_cache_disable(struct cacheinfo *this_leaf, char *buf, - unsigned int slot) - { - int index; -+ struct amd_northbridge *nb = this_leaf->priv; - -- if (!this_leaf->base.nb || !amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -- return -EINVAL; -- -- index = amd_get_l3_disable_slot(this_leaf->base.nb, slot); -+ index = amd_get_l3_disable_slot(nb, slot); - if (index >= 0) - return sprintf(buf, "%d\n", index); - -@@ -377,9 +355,10 @@ static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf, - - #define SHOW_CACHE_DISABLE(slot) \ - static ssize_t \ --show_cache_disable_##slot(struct _cpuid4_info *this_leaf, char *buf, \ -- unsigned int cpu) \ -+cache_disable_##slot##_show(struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ - { \ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); \ - return show_cache_disable(this_leaf, buf, slot); \ - } - SHOW_CACHE_DISABLE(0) -@@ -425,8 +404,8 @@ static void amd_l3_disable_index(struct amd_northbridge *nb, int cpu, - * - * @return: 0 on success, error status on failure - */ --int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, unsigned slot, -- unsigned long index) -+static int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, -+ unsigned slot, unsigned long index) - { - int ret = 0; - -@@ -447,28 +426,26 @@ int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, unsigned slot, - return 0; - } - --static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf, -- const char *buf, size_t count, -- unsigned int slot) -+static ssize_t store_cache_disable(struct cacheinfo *this_leaf, -+ const char *buf, size_t count, -+ unsigned int slot) - { - unsigned long val = 0; - int cpu, err = 0; -+ struct amd_northbridge *nb = this_leaf->priv; - - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - -- if (!this_leaf->base.nb || !amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -- return -EINVAL; -- -- cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map)); -+ cpu = cpumask_first(&this_leaf->shared_cpu_map); - - if (kstrtoul(buf, 10, &val) < 0) - return -EINVAL; - -- err = amd_set_l3_disable_slot(this_leaf->base.nb, cpu, slot, val); -+ err = amd_set_l3_disable_slot(nb, cpu, slot, val); - if (err) { - if (err == -EEXIST) -- pr_warning("L3 slot %d in use/index already disabled!\n", -+ pr_warn("L3 slot %d in use/index already disabled!\n", - slot); - return err; - } -@@ -477,41 +454,36 @@ static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf, - - #define STORE_CACHE_DISABLE(slot) \ - static ssize_t \ --store_cache_disable_##slot(struct _cpuid4_info *this_leaf, \ -- const char *buf, size_t count, \ -- unsigned int cpu) \ -+cache_disable_##slot##_store(struct device *dev, \ -+ struct device_attribute *attr, \ -+ const char *buf, size_t count) \ - { \ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); \ - return store_cache_disable(this_leaf, buf, count, slot); \ - } - STORE_CACHE_DISABLE(0) - STORE_CACHE_DISABLE(1) - --static struct _cache_attr cache_disable_0 = __ATTR(cache_disable_0, 0644, -- show_cache_disable_0, store_cache_disable_0); --static struct _cache_attr cache_disable_1 = __ATTR(cache_disable_1, 0644, -- show_cache_disable_1, store_cache_disable_1); -- --static ssize_t --show_subcaches(struct _cpuid4_info *this_leaf, char *buf, unsigned int cpu) -+static ssize_t subcaches_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { -- if (!this_leaf->base.nb || !amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -- return -EINVAL; -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ int cpu = cpumask_first(&this_leaf->shared_cpu_map); - - return sprintf(buf, "%x\n", amd_get_subcaches(cpu)); - } - --static ssize_t --store_subcaches(struct _cpuid4_info *this_leaf, const char *buf, size_t count, -- unsigned int cpu) -+static ssize_t subcaches_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) - { -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ int cpu = cpumask_first(&this_leaf->shared_cpu_map); - unsigned long val; - - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - -- if (!this_leaf->base.nb || !amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -- return -EINVAL; -- - if (kstrtoul(buf, 16, &val) < 0) - return -EINVAL; - -@@ -521,9 +493,92 @@ store_subcaches(struct _cpuid4_info *this_leaf, const char *buf, size_t count, - return count; - } - --static struct _cache_attr subcaches = -- __ATTR(subcaches, 0644, show_subcaches, store_subcaches); -+static DEVICE_ATTR_RW(cache_disable_0); -+static DEVICE_ATTR_RW(cache_disable_1); -+static DEVICE_ATTR_RW(subcaches); -+ -+static umode_t -+cache_private_attrs_is_visible(struct kobject *kobj, -+ struct attribute *attr, int unused) -+{ -+ struct device *dev = kobj_to_dev(kobj); -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ umode_t mode = attr->mode; -+ -+ if (!this_leaf->priv) -+ return 0; -+ -+ if ((attr == &dev_attr_subcaches.attr) && -+ amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -+ return mode; -+ -+ if ((attr == &dev_attr_cache_disable_0.attr || -+ attr == &dev_attr_cache_disable_1.attr) && -+ amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -+ return mode; -+ -+ return 0; -+} -+ -+static struct attribute_group cache_private_group = { -+ .is_visible = cache_private_attrs_is_visible, -+}; -+ -+static void init_amd_l3_attrs(void) -+{ -+ int n = 1; -+ static struct attribute **amd_l3_attrs; -+ -+ if (amd_l3_attrs) /* already initialized */ -+ return; -+ -+ if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -+ n += 2; -+ if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -+ n += 1; -+ -+ amd_l3_attrs = kcalloc(n, sizeof(*amd_l3_attrs), GFP_KERNEL); -+ if (!amd_l3_attrs) -+ return; -+ -+ n = 0; -+ if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) { -+ amd_l3_attrs[n++] = &dev_attr_cache_disable_0.attr; -+ amd_l3_attrs[n++] = &dev_attr_cache_disable_1.attr; -+ } -+ if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -+ amd_l3_attrs[n++] = &dev_attr_subcaches.attr; -+ -+ cache_private_group.attrs = amd_l3_attrs; -+} -+ -+const struct attribute_group * -+cache_get_priv_group(struct cacheinfo *this_leaf) -+{ -+ struct amd_northbridge *nb = this_leaf->priv; -+ -+ if (this_leaf->level < 3 || !nb) -+ return NULL; -+ -+ if (nb && nb->l3_cache.indices) -+ init_amd_l3_attrs(); - -+ return &cache_private_group; -+} -+ -+static void amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) -+{ -+ int node; -+ -+ /* only for L3, and not in virtualized environments */ -+ if (index < 3) -+ return; -+ -+ node = amd_get_nb_id(smp_processor_id()); -+ this_leaf->nb = node_to_amd_nb(node); -+ if (this_leaf->nb && !this_leaf->nb->l3_cache.indices) -+ amd_calc_l3_indices(this_leaf->nb); -+} - #else - #define amd_init_l3_cache(x, y) - #endif /* CONFIG_AMD_NB && CONFIG_SYSFS */ -@@ -537,7 +592,7 @@ cpuid4_cache_lookup_regs(int index, struct _cpuid4_info_regs *this_leaf) - unsigned edx; - - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { -- if (cpu_has_topoext) -+ if (boot_cpu_has(X86_FEATURE_TOPOEXT)) - cpuid_count(0x8000001d, index, &eax.full, - &ebx.full, &ecx.full, &edx); - else -@@ -547,7 +602,7 @@ cpuid4_cache_lookup_regs(int index, struct _cpuid4_info_regs *this_leaf) - cpuid_count(4, index, &eax.full, &ebx.full, &ecx.full, &edx); - } - -- if (eax.split.type == CACHE_TYPE_NULL) -+ if (eax.split.type == CTYPE_NULL) - return -EIO; /* better error ? */ - - this_leaf->eax = eax; -@@ -576,7 +631,7 @@ static int find_num_cache_leaves(struct cpuinfo_x86 *c) - /* Do cpuid(op) loop to find out num_cache_leaves */ - cpuid_count(op, i, &eax, &ebx, &ecx, &edx); - cache_eax.full = eax; -- } while (cache_eax.split.type != CACHE_TYPE_NULL); -+ } while (cache_eax.split.type != CTYPE_NULL); - return i; - } - -@@ -622,7 +677,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id) - void init_amd_cacheinfo(struct cpuinfo_x86 *c) - { - -- if (cpu_has_topoext) { -+ if (boot_cpu_has(X86_FEATURE_TOPOEXT)) { - num_cache_leaves = find_num_cache_leaves(c); - } else if (c->extended_cpuid_level >= 0x80000006) { - if (cpuid_edx(0x80000006) & 0xf000) -@@ -639,7 +694,7 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) - unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */ - unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */ - unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb; --#ifdef CONFIG_X86_HT -+#ifdef CONFIG_SMP - unsigned int cpu = c->cpu_index; - #endif - -@@ -657,36 +712,34 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) - * parameters cpuid leaf to find the cache details - */ - for (i = 0; i < num_cache_leaves; i++) { -- struct _cpuid4_info_regs this_leaf; -+ struct _cpuid4_info_regs this_leaf = {}; - int retval; - - retval = cpuid4_cache_lookup_regs(i, &this_leaf); -- if (retval >= 0) { -- switch (this_leaf.eax.split.level) { -- case 1: -- if (this_leaf.eax.split.type == -- CACHE_TYPE_DATA) -- new_l1d = this_leaf.size/1024; -- else if (this_leaf.eax.split.type == -- CACHE_TYPE_INST) -- new_l1i = this_leaf.size/1024; -- break; -- case 2: -- new_l2 = this_leaf.size/1024; -- num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; -- index_msb = get_count_order(num_threads_sharing); -- l2_id = c->apicid & ~((1 << index_msb) - 1); -- break; -- case 3: -- new_l3 = this_leaf.size/1024; -- num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; -- index_msb = get_count_order( -- num_threads_sharing); -- l3_id = c->apicid & ~((1 << index_msb) - 1); -- break; -- default: -- break; -- } -+ if (retval < 0) -+ continue; -+ -+ switch (this_leaf.eax.split.level) { -+ case 1: -+ if (this_leaf.eax.split.type == CTYPE_DATA) -+ new_l1d = this_leaf.size/1024; -+ else if (this_leaf.eax.split.type == CTYPE_INST) -+ new_l1i = this_leaf.size/1024; -+ break; -+ case 2: -+ new_l2 = this_leaf.size/1024; -+ num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; -+ index_msb = get_count_order(num_threads_sharing); -+ l2_id = c->apicid & ~((1 << index_msb) - 1); -+ break; -+ case 3: -+ new_l3 = this_leaf.size/1024; -+ num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; -+ index_msb = get_count_order(num_threads_sharing); -+ l3_id = c->apicid & ~((1 << index_msb) - 1); -+ break; -+ default: -+ break; - } - } - } -@@ -760,34 +813,40 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) - - if (new_l2) { - l2 = new_l2; --#ifdef CONFIG_X86_HT -+#ifdef CONFIG_SMP - per_cpu(cpu_llc_id, cpu) = l2_id; - #endif - } - - if (new_l3) { - l3 = new_l3; --#ifdef CONFIG_X86_HT -+#ifdef CONFIG_SMP - per_cpu(cpu_llc_id, cpu) = l3_id; - #endif - } - -+#ifdef CONFIG_SMP -+ /* -+ * If cpu_llc_id is not yet set, this means cpuid_level < 4 which in -+ * turns means that the only possibility is SMT (as indicated in -+ * cpuid1). Since cpuid2 doesn't specify shared caches, and we know -+ * that SMT shares all caches, we can unconditionally set cpu_llc_id to -+ * c->phys_proc_id. -+ */ -+ if (per_cpu(cpu_llc_id, cpu) == BAD_APICID) -+ per_cpu(cpu_llc_id, cpu) = c->phys_proc_id; -+#endif -+ - c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d)); - - return l2; - } - --#ifdef CONFIG_SYSFS -- --/* pointer to _cpuid4_info array (for each cache leaf) */ --static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info); --#define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y])) -- --#ifdef CONFIG_SMP -- --static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) -+static int __cache_amd_cpumap_setup(unsigned int cpu, int index, -+ struct _cpuid4_info_regs *base) - { -- struct _cpuid4_info *this_leaf; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf; - int i, sibling; - - /* -@@ -796,40 +855,43 @@ static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) - */ - if (index == 3) { - for_each_cpu(i, cpu_llc_shared_mask(cpu)) { -- if (!per_cpu(ici_cpuid4_info, i)) -+ this_cpu_ci = get_cpu_cacheinfo(i); -+ if (!this_cpu_ci->info_list) - continue; -- this_leaf = CPUID4_INFO_IDX(i, index); -+ this_leaf = this_cpu_ci->info_list + index; - for_each_cpu(sibling, cpu_llc_shared_mask(cpu)) { - if (!cpu_online(sibling)) - continue; -- set_bit(sibling, this_leaf->shared_cpu_map); -+ cpumask_set_cpu(sibling, -+ &this_leaf->shared_cpu_map); - } - } -- } else if (cpu_has_topoext) { -+ } else if (boot_cpu_has(X86_FEATURE_TOPOEXT)) { - unsigned int apicid, nshared, first, last; - -- if (!per_cpu(ici_cpuid4_info, cpu)) -- return 0; -- -- this_leaf = CPUID4_INFO_IDX(cpu, index); -- nshared = this_leaf->base.eax.split.num_threads_sharing + 1; -+ this_leaf = this_cpu_ci->info_list + index; -+ nshared = base->eax.split.num_threads_sharing + 1; - apicid = cpu_data(cpu).apicid; - first = apicid - (apicid % nshared); - last = first + nshared - 1; - - for_each_online_cpu(i) { -+ this_cpu_ci = get_cpu_cacheinfo(i); -+ if (!this_cpu_ci->info_list) -+ continue; -+ - apicid = cpu_data(i).apicid; - if ((apicid < first) || (apicid > last)) - continue; -- if (!per_cpu(ici_cpuid4_info, i)) -- continue; -- this_leaf = CPUID4_INFO_IDX(i, index); -+ -+ this_leaf = this_cpu_ci->info_list + index; - - for_each_online_cpu(sibling) { - apicid = cpu_data(sibling).apicid; - if ((apicid < first) || (apicid > last)) - continue; -- set_bit(sibling, this_leaf->shared_cpu_map); -+ cpumask_set_cpu(sibling, -+ &this_leaf->shared_cpu_map); - } - } - } else -@@ -838,72 +900,70 @@ static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) - return 1; - } - --static void cache_shared_cpu_map_setup(unsigned int cpu, int index) -+static void __cache_cpumap_setup(unsigned int cpu, int index, -+ struct _cpuid4_info_regs *base) - { -- struct _cpuid4_info *this_leaf, *sibling_leaf; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf, *sibling_leaf; - unsigned long num_threads_sharing; - int index_msb, i; - struct cpuinfo_x86 *c = &cpu_data(cpu); - - if (c->x86_vendor == X86_VENDOR_AMD) { -- if (cache_shared_amd_cpu_map_setup(cpu, index)) -+ if (__cache_amd_cpumap_setup(cpu, index, base)) - return; - } - -- this_leaf = CPUID4_INFO_IDX(cpu, index); -- num_threads_sharing = 1 + this_leaf->base.eax.split.num_threads_sharing; -+ this_leaf = this_cpu_ci->info_list + index; -+ num_threads_sharing = 1 + base->eax.split.num_threads_sharing; - -+ cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); - if (num_threads_sharing == 1) -- cpumask_set_cpu(cpu, to_cpumask(this_leaf->shared_cpu_map)); -- else { -- index_msb = get_count_order(num_threads_sharing); -+ return; - -- for_each_online_cpu(i) { -- if (cpu_data(i).apicid >> index_msb == -- c->apicid >> index_msb) { -- cpumask_set_cpu(i, -- to_cpumask(this_leaf->shared_cpu_map)); -- if (i != cpu && per_cpu(ici_cpuid4_info, i)) { -- sibling_leaf = -- CPUID4_INFO_IDX(i, index); -- cpumask_set_cpu(cpu, to_cpumask( -- sibling_leaf->shared_cpu_map)); -- } -- } -+ index_msb = get_count_order(num_threads_sharing); -+ -+ for_each_online_cpu(i) -+ if (cpu_data(i).apicid >> index_msb == c->apicid >> index_msb) { -+ struct cpu_cacheinfo *sib_cpu_ci = get_cpu_cacheinfo(i); -+ -+ if (i == cpu || !sib_cpu_ci->info_list) -+ continue;/* skip if itself or no cacheinfo */ -+ sibling_leaf = sib_cpu_ci->info_list + index; -+ cpumask_set_cpu(i, &this_leaf->shared_cpu_map); -+ cpumask_set_cpu(cpu, &sibling_leaf->shared_cpu_map); - } -- } --} --static void cache_remove_shared_cpu_map(unsigned int cpu, int index) --{ -- struct _cpuid4_info *this_leaf, *sibling_leaf; -- int sibling; -- -- this_leaf = CPUID4_INFO_IDX(cpu, index); -- for_each_cpu(sibling, to_cpumask(this_leaf->shared_cpu_map)) { -- sibling_leaf = CPUID4_INFO_IDX(sibling, index); -- cpumask_clear_cpu(cpu, -- to_cpumask(sibling_leaf->shared_cpu_map)); -- } --} --#else --static void cache_shared_cpu_map_setup(unsigned int cpu, int index) --{ - } - --static void cache_remove_shared_cpu_map(unsigned int cpu, int index) -+static void ci_leaf_init(struct cacheinfo *this_leaf, -+ struct _cpuid4_info_regs *base) - { -+ this_leaf->id = base->id; -+ this_leaf->attributes = CACHE_ID; -+ this_leaf->level = base->eax.split.level; -+ this_leaf->type = cache_type_map[base->eax.split.type]; -+ this_leaf->coherency_line_size = -+ base->ebx.split.coherency_line_size + 1; -+ this_leaf->ways_of_associativity = -+ base->ebx.split.ways_of_associativity + 1; -+ this_leaf->size = base->size; -+ this_leaf->number_of_sets = base->ecx.split.number_of_sets + 1; -+ this_leaf->physical_line_partition = -+ base->ebx.split.physical_line_partition + 1; -+ this_leaf->priv = base->nb; - } --#endif - --static void free_cache_attributes(unsigned int cpu) -+static int __init_cache_level(unsigned int cpu) - { -- int i; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); - -- for (i = 0; i < num_cache_leaves; i++) -- cache_remove_shared_cpu_map(cpu, i); -- -- kfree(per_cpu(ici_cpuid4_info, cpu)); -- per_cpu(ici_cpuid4_info, cpu) = NULL; -+ if (!num_cache_leaves) -+ return -ENOENT; -+ if (!this_cpu_ci) -+ return -EINVAL; -+ this_cpu_ci->num_levels = 3; -+ this_cpu_ci->num_leaves = num_cache_leaves; -+ return 0; - } - - /* -@@ -925,414 +985,37 @@ static void get_cache_id(int cpu, struct _cpuid4_info_regs *id4_regs) - int get_cpu_cache_id(int cpu, int level) - { - int i; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); - -- if (!per_cpu(ici_cpuid4_info, cpu)) -- return -1; -+ for (i = 0; i < this_cpu_ci->num_leaves; i++) { -+ struct cacheinfo *this_leaf = this_cpu_ci->info_list + i; - -- for (i = 0; i < num_cache_leaves; i++) { -- struct _cpuid4_info *this_leaf = CPUID4_INFO_IDX(cpu, i); -- -- if (this_leaf->base.eax.split.level == level) -- return this_leaf->base.id; -+ if (this_leaf->level == level) -+ return this_leaf->id; - } - - return -1; - } - --static void get_cpu_leaves(void *_retval) -+static int __populate_cache_leaves(unsigned int cpu) - { -- int j, *retval = _retval, cpu = smp_processor_id(); -- -- /* Do cpuid and store the results */ -- for (j = 0; j < num_cache_leaves; j++) { -- struct _cpuid4_info *this_leaf = CPUID4_INFO_IDX(cpu, j); -+ unsigned int idx, ret; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf = this_cpu_ci->info_list; -+ struct _cpuid4_info_regs id4_regs = {}; - -- *retval = cpuid4_cache_lookup_regs(j, &this_leaf->base); -- if (unlikely(*retval < 0)) { -- int i; -- -- for (i = 0; i < j; i++) -- cache_remove_shared_cpu_map(cpu, i); -- break; -- } -- cache_shared_cpu_map_setup(cpu, j); -- get_cache_id(cpu, &this_leaf->base); -+ for (idx = 0; idx < this_cpu_ci->num_leaves; idx++) { -+ ret = cpuid4_cache_lookup_regs(idx, &id4_regs); -+ if (ret) -+ return ret; -+ get_cache_id(cpu, &id4_regs); -+ ci_leaf_init(this_leaf++, &id4_regs); -+ __cache_cpumap_setup(cpu, idx, &id4_regs); - } --} -- --static int detect_cache_attributes(unsigned int cpu) --{ -- int retval; -+ this_cpu_ci->cpu_map_populated = true; - -- if (num_cache_leaves == 0) -- return -ENOENT; -- -- per_cpu(ici_cpuid4_info, cpu) = kzalloc( -- sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); -- if (per_cpu(ici_cpuid4_info, cpu) == NULL) -- return -ENOMEM; -- -- smp_call_function_single(cpu, get_cpu_leaves, &retval, true); -- if (retval) { -- kfree(per_cpu(ici_cpuid4_info, cpu)); -- per_cpu(ici_cpuid4_info, cpu) = NULL; -- } -- -- return retval; --} -- --#include --#include --#include -- --/* pointer to kobject for cpuX/cache */ --static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject); -- --struct _index_kobject { -- struct kobject kobj; -- unsigned int cpu; -- unsigned short index; --}; -- --/* pointer to array of kobjects for cpuX/cache/indexY */ --static DEFINE_PER_CPU(struct _index_kobject *, ici_index_kobject); --#define INDEX_KOBJECT_PTR(x, y) (&((per_cpu(ici_index_kobject, x))[y])) -- --#define show_one_plus(file_name, object, val) \ --static ssize_t show_##file_name(struct _cpuid4_info *this_leaf, char *buf, \ -- unsigned int cpu) \ --{ \ -- return sprintf(buf, "%lu\n", (unsigned long)this_leaf->object + val); \ --} -- --show_one_plus(level, base.eax.split.level, 0); --show_one_plus(coherency_line_size, base.ebx.split.coherency_line_size, 1); --show_one_plus(physical_line_partition, base.ebx.split.physical_line_partition, 1); --show_one_plus(ways_of_associativity, base.ebx.split.ways_of_associativity, 1); --show_one_plus(number_of_sets, base.ecx.split.number_of_sets, 1); -- --static ssize_t show_id(struct _cpuid4_info *this_leaf, char *buf, -- unsigned int cpu) --{ -- return sprintf(buf, "%u\n", this_leaf->base.id); --} -- --static ssize_t show_size(struct _cpuid4_info *this_leaf, char *buf, -- unsigned int cpu) --{ -- return sprintf(buf, "%luK\n", this_leaf->base.size / 1024); --} -- --static ssize_t show_shared_cpu_map_func(struct _cpuid4_info *this_leaf, -- int type, char *buf) --{ -- ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf; -- int n = 0; -- -- if (len > 1) { -- const struct cpumask *mask; -- -- mask = to_cpumask(this_leaf->shared_cpu_map); -- n = type ? -- cpulist_scnprintf(buf, len-2, mask) : -- cpumask_scnprintf(buf, len-2, mask); -- buf[n++] = '\n'; -- buf[n] = '\0'; -- } -- return n; --} -- --static inline ssize_t show_shared_cpu_map(struct _cpuid4_info *leaf, char *buf, -- unsigned int cpu) --{ -- return show_shared_cpu_map_func(leaf, 0, buf); --} -- --static inline ssize_t show_shared_cpu_list(struct _cpuid4_info *leaf, char *buf, -- unsigned int cpu) --{ -- return show_shared_cpu_map_func(leaf, 1, buf); --} -- --static ssize_t show_type(struct _cpuid4_info *this_leaf, char *buf, -- unsigned int cpu) --{ -- switch (this_leaf->base.eax.split.type) { -- case CACHE_TYPE_DATA: -- return sprintf(buf, "Data\n"); -- case CACHE_TYPE_INST: -- return sprintf(buf, "Instruction\n"); -- case CACHE_TYPE_UNIFIED: -- return sprintf(buf, "Unified\n"); -- default: -- return sprintf(buf, "Unknown\n"); -- } --} -- --#define to_object(k) container_of(k, struct _index_kobject, kobj) --#define to_attr(a) container_of(a, struct _cache_attr, attr) -- --#define define_one_ro(_name) \ --static struct _cache_attr _name = \ -- __ATTR(_name, 0444, show_##_name, NULL) -- --define_one_ro(id); --define_one_ro(level); --define_one_ro(type); --define_one_ro(coherency_line_size); --define_one_ro(physical_line_partition); --define_one_ro(ways_of_associativity); --define_one_ro(number_of_sets); --define_one_ro(size); --define_one_ro(shared_cpu_map); --define_one_ro(shared_cpu_list); -- --static struct attribute *default_attrs[] = { -- &id.attr, -- &type.attr, -- &level.attr, -- &coherency_line_size.attr, -- &physical_line_partition.attr, -- &ways_of_associativity.attr, -- &number_of_sets.attr, -- &size.attr, -- &shared_cpu_map.attr, -- &shared_cpu_list.attr, -- NULL --}; -- --#ifdef CONFIG_AMD_NB --static struct attribute **amd_l3_attrs(void) --{ -- static struct attribute **attrs; -- int n; -- -- if (attrs) -- return attrs; -- -- n = ARRAY_SIZE(default_attrs); -- -- if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -- n += 2; -- -- if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -- n += 1; -- -- attrs = kzalloc(n * sizeof (struct attribute *), GFP_KERNEL); -- if (attrs == NULL) -- return attrs = default_attrs; -- -- for (n = 0; default_attrs[n]; n++) -- attrs[n] = default_attrs[n]; -- -- if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) { -- attrs[n++] = &cache_disable_0.attr; -- attrs[n++] = &cache_disable_1.attr; -- } -- -- if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -- attrs[n++] = &subcaches.attr; -- -- return attrs; --} --#endif -- --static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf) --{ -- struct _cache_attr *fattr = to_attr(attr); -- struct _index_kobject *this_leaf = to_object(kobj); -- ssize_t ret; -- -- ret = fattr->show ? -- fattr->show(CPUID4_INFO_IDX(this_leaf->cpu, this_leaf->index), -- buf, this_leaf->cpu) : -- 0; -- return ret; --} -- --static ssize_t store(struct kobject *kobj, struct attribute *attr, -- const char *buf, size_t count) --{ -- struct _cache_attr *fattr = to_attr(attr); -- struct _index_kobject *this_leaf = to_object(kobj); -- ssize_t ret; -- -- ret = fattr->store ? -- fattr->store(CPUID4_INFO_IDX(this_leaf->cpu, this_leaf->index), -- buf, count, this_leaf->cpu) : -- 0; -- return ret; --} -- --static const struct sysfs_ops sysfs_ops = { -- .show = show, -- .store = store, --}; -- --static struct kobj_type ktype_cache = { -- .sysfs_ops = &sysfs_ops, -- .default_attrs = default_attrs, --}; -- --static struct kobj_type ktype_percpu_entry = { -- .sysfs_ops = &sysfs_ops, --}; -- --static void cpuid4_cache_sysfs_exit(unsigned int cpu) --{ -- kfree(per_cpu(ici_cache_kobject, cpu)); -- kfree(per_cpu(ici_index_kobject, cpu)); -- per_cpu(ici_cache_kobject, cpu) = NULL; -- per_cpu(ici_index_kobject, cpu) = NULL; -- free_cache_attributes(cpu); --} -- --static int cpuid4_cache_sysfs_init(unsigned int cpu) --{ -- int err; -- -- if (num_cache_leaves == 0) -- return -ENOENT; -- -- err = detect_cache_attributes(cpu); -- if (err) -- return err; -- -- /* Allocate all required memory */ -- per_cpu(ici_cache_kobject, cpu) = -- kzalloc(sizeof(struct kobject), GFP_KERNEL); -- if (unlikely(per_cpu(ici_cache_kobject, cpu) == NULL)) -- goto err_out; -- -- per_cpu(ici_index_kobject, cpu) = kzalloc( -- sizeof(struct _index_kobject) * num_cache_leaves, GFP_KERNEL); -- if (unlikely(per_cpu(ici_index_kobject, cpu) == NULL)) -- goto err_out; -- -- return 0; -- --err_out: -- cpuid4_cache_sysfs_exit(cpu); -- return -ENOMEM; --} -- --static DECLARE_BITMAP(cache_dev_map, NR_CPUS); -- --/* Add/Remove cache interface for CPU device */ --static int cache_add_dev(struct device *dev) --{ -- unsigned int cpu = dev->id; -- unsigned long i, j; -- struct _index_kobject *this_object; -- struct _cpuid4_info *this_leaf; -- int retval; -- -- retval = cpuid4_cache_sysfs_init(cpu); -- if (unlikely(retval < 0)) -- return retval; -- -- retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu), -- &ktype_percpu_entry, -- &dev->kobj, "%s", "cache"); -- if (retval < 0) { -- cpuid4_cache_sysfs_exit(cpu); -- return retval; -- } -- -- for (i = 0; i < num_cache_leaves; i++) { -- this_object = INDEX_KOBJECT_PTR(cpu, i); -- this_object->cpu = cpu; -- this_object->index = i; -- -- this_leaf = CPUID4_INFO_IDX(cpu, i); -- -- ktype_cache.default_attrs = default_attrs; --#ifdef CONFIG_AMD_NB -- if (this_leaf->base.nb) -- ktype_cache.default_attrs = amd_l3_attrs(); --#endif -- retval = kobject_init_and_add(&(this_object->kobj), -- &ktype_cache, -- per_cpu(ici_cache_kobject, cpu), -- "index%1lu", i); -- if (unlikely(retval)) { -- for (j = 0; j < i; j++) -- kobject_put(&(INDEX_KOBJECT_PTR(cpu, j)->kobj)); -- kobject_put(per_cpu(ici_cache_kobject, cpu)); -- cpuid4_cache_sysfs_exit(cpu); -- return retval; -- } -- kobject_uevent(&(this_object->kobj), KOBJ_ADD); -- } -- cpumask_set_cpu(cpu, to_cpumask(cache_dev_map)); -- -- kobject_uevent(per_cpu(ici_cache_kobject, cpu), KOBJ_ADD); - return 0; - } - --static void cache_remove_dev(struct device *dev) --{ -- unsigned int cpu = dev->id; -- unsigned long i; -- -- if (per_cpu(ici_cpuid4_info, cpu) == NULL) -- return; -- if (!cpumask_test_cpu(cpu, to_cpumask(cache_dev_map))) -- return; -- cpumask_clear_cpu(cpu, to_cpumask(cache_dev_map)); -- -- for (i = 0; i < num_cache_leaves; i++) -- kobject_put(&(INDEX_KOBJECT_PTR(cpu, i)->kobj)); -- kobject_put(per_cpu(ici_cache_kobject, cpu)); -- cpuid4_cache_sysfs_exit(cpu); --} -- --static int cacheinfo_cpu_callback(struct notifier_block *nfb, -- unsigned long action, void *hcpu) --{ -- unsigned int cpu = (unsigned long)hcpu; -- struct device *dev; -- -- dev = get_cpu_device(cpu); -- switch (action) { -- case CPU_ONLINE: -- case CPU_ONLINE_FROZEN: -- cache_add_dev(dev); -- break; -- case CPU_DEAD: -- case CPU_DEAD_FROZEN: -- cache_remove_dev(dev); -- break; -- } -- return NOTIFY_OK; --} -- --static struct notifier_block cacheinfo_cpu_notifier = { -- .notifier_call = cacheinfo_cpu_callback, --}; -- --static int __init cache_sysfs_init(void) --{ -- int i, err = 0; -- -- if (num_cache_leaves == 0) -- return 0; -- -- cpu_notifier_register_begin(); -- for_each_online_cpu(i) { -- struct device *dev = get_cpu_device(i); -- -- err = cache_add_dev(dev); -- if (err) -- goto out; -- } -- __register_hotcpu_notifier(&cacheinfo_cpu_notifier); -- --out: -- cpu_notifier_register_done(); -- return err; --} -- --device_initcall(cache_sysfs_init); -- --#endif -+DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level) -+DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves) -diff --git a/drivers/base/Makefile b/drivers/base/Makefile -index 53c3fe1..527d291 100644 ---- a/drivers/base/Makefile -+++ b/drivers/base/Makefile -@@ -4,7 +4,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \ - driver.o class.o platform.o \ - cpu.o firmware.o init.o map.o devres.o \ - attribute_container.o transport_class.o \ -- topology.o container.o property.o devcon.o -+ topology.o container.o property.o devcon.o cacheinfo.o - obj-$(CONFIG_DEVTMPFS) += devtmpfs.o - obj-$(CONFIG_DMA_CMA) += dma-contiguous.o - obj-y += power/ -diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c -new file mode 100644 -index 0000000..eb3af27 ---- /dev/null -+++ b/drivers/base/cacheinfo.c -@@ -0,0 +1,662 @@ -+/* -+ * cacheinfo support - processor cache information via sysfs -+ * -+ * Based on arch/x86/kernel/cpu/intel_cacheinfo.c -+ * Author: Sudeep Holla -+ * -+ * 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 "as is" WITHOUT ANY WARRANTY of any -+ * kind, whether express or implied; 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, see . -+ */ -+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* pointer to per cpu cacheinfo */ -+static DEFINE_PER_CPU(struct cpu_cacheinfo, ci_cpu_cacheinfo); -+#define ci_cacheinfo(cpu) (&per_cpu(ci_cpu_cacheinfo, cpu)) -+#define cache_leaves(cpu) (ci_cacheinfo(cpu)->num_leaves) -+#define per_cpu_cacheinfo(cpu) (ci_cacheinfo(cpu)->info_list) -+ -+struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu) -+{ -+ return ci_cacheinfo(cpu); -+} -+ -+#ifdef CONFIG_OF -+static int cache_setup_of_node(unsigned int cpu) -+{ -+ struct device_node *np; -+ struct cacheinfo *this_leaf; -+ struct device *cpu_dev = get_cpu_device(cpu); -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ unsigned int index = 0; -+ -+ /* skip if of_node is already populated */ -+ if (this_cpu_ci->info_list->of_node) -+ return 0; -+ -+ if (!cpu_dev) { -+ pr_err("No cpu device for CPU %d\n", cpu); -+ return -ENODEV; -+ } -+ np = cpu_dev->of_node; -+ if (!np) { -+ pr_err("Failed to find cpu%d device node\n", cpu); -+ return -ENOENT; -+ } -+ -+ while (index < cache_leaves(cpu)) { -+ this_leaf = this_cpu_ci->info_list + index; -+ if (this_leaf->level != 1) -+ np = of_find_next_cache_node(np); -+ else -+ np = of_node_get(np);/* cpu node itself */ -+ if (!np) -+ break; -+ this_leaf->of_node = np; -+ index++; -+ } -+ -+ if (index != cache_leaves(cpu)) /* not all OF nodes populated */ -+ return -ENOENT; -+ -+ return 0; -+} -+ -+static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, -+ struct cacheinfo *sib_leaf) -+{ -+ return sib_leaf->of_node == this_leaf->of_node; -+} -+ -+/* OF properties to query for a given cache type */ -+struct cache_type_info { -+ const char *size_prop; -+ const char *line_size_props[2]; -+ const char *nr_sets_prop; -+}; -+ -+static const struct cache_type_info cache_type_info[] = { -+ { -+ .size_prop = "cache-size", -+ .line_size_props = { "cache-line-size", -+ "cache-block-size", }, -+ .nr_sets_prop = "cache-sets", -+ }, { -+ .size_prop = "i-cache-size", -+ .line_size_props = { "i-cache-line-size", -+ "i-cache-block-size", }, -+ .nr_sets_prop = "i-cache-sets", -+ }, { -+ .size_prop = "d-cache-size", -+ .line_size_props = { "d-cache-line-size", -+ "d-cache-block-size", }, -+ .nr_sets_prop = "d-cache-sets", -+ }, -+}; -+ -+static inline int get_cacheinfo_idx(enum cache_type type) -+{ -+ if (type == CACHE_TYPE_UNIFIED) -+ return 0; -+ return type; -+} -+ -+static void cache_size(struct cacheinfo *this_leaf) -+{ -+ const char *propname; -+ const __be32 *cache_size; -+ int ct_idx; -+ -+ ct_idx = get_cacheinfo_idx(this_leaf->type); -+ propname = cache_type_info[ct_idx].size_prop; -+ -+ cache_size = of_get_property(this_leaf->of_node, propname, NULL); -+ if (cache_size) -+ this_leaf->size = of_read_number(cache_size, 1); -+} -+ -+/* not cache_line_size() because that's a macro in include/linux/cache.h */ -+static void cache_get_line_size(struct cacheinfo *this_leaf) -+{ -+ const __be32 *line_size; -+ int i, lim, ct_idx; -+ -+ ct_idx = get_cacheinfo_idx(this_leaf->type); -+ lim = ARRAY_SIZE(cache_type_info[ct_idx].line_size_props); -+ -+ for (i = 0; i < lim; i++) { -+ const char *propname; -+ -+ propname = cache_type_info[ct_idx].line_size_props[i]; -+ line_size = of_get_property(this_leaf->of_node, propname, NULL); -+ if (line_size) -+ break; -+ } -+ -+ if (line_size) -+ this_leaf->coherency_line_size = of_read_number(line_size, 1); -+} -+ -+static void cache_nr_sets(struct cacheinfo *this_leaf) -+{ -+ const char *propname; -+ const __be32 *nr_sets; -+ int ct_idx; -+ -+ ct_idx = get_cacheinfo_idx(this_leaf->type); -+ propname = cache_type_info[ct_idx].nr_sets_prop; -+ -+ nr_sets = of_get_property(this_leaf->of_node, propname, NULL); -+ if (nr_sets) -+ this_leaf->number_of_sets = of_read_number(nr_sets, 1); -+} -+ -+static void cache_associativity(struct cacheinfo *this_leaf) -+{ -+ unsigned int line_size = this_leaf->coherency_line_size; -+ unsigned int nr_sets = this_leaf->number_of_sets; -+ unsigned int size = this_leaf->size; -+ -+ /* -+ * If the cache is fully associative, there is no need to -+ * check the other properties. -+ */ -+ if (!(nr_sets == 1) && (nr_sets > 0 && size > 0 && line_size > 0)) -+ this_leaf->ways_of_associativity = (size / nr_sets) / line_size; -+} -+ -+static void cache_of_override_properties(unsigned int cpu) -+{ -+ int index; -+ struct cacheinfo *this_leaf; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ -+ for (index = 0; index < cache_leaves(cpu); index++) { -+ this_leaf = this_cpu_ci->info_list + index; -+ cache_size(this_leaf); -+ cache_get_line_size(this_leaf); -+ cache_nr_sets(this_leaf); -+ cache_associativity(this_leaf); -+ } -+} -+#else -+static void cache_of_override_properties(unsigned int cpu) { } -+static inline int cache_setup_of_node(unsigned int cpu) { return 0; } -+static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, -+ struct cacheinfo *sib_leaf) -+{ -+ /* -+ * For non-DT systems, assume unique level 1 cache, system-wide -+ * shared caches for all other levels. This will be used only if -+ * arch specific code has not populated shared_cpu_map -+ */ -+ return !(this_leaf->level == 1); -+} -+#endif -+ -+static int cache_shared_cpu_map_setup(unsigned int cpu) -+{ -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf, *sib_leaf; -+ unsigned int index; -+ int ret = 0; -+ -+ if (this_cpu_ci->cpu_map_populated) -+ return 0; -+ -+ if (of_have_populated_dt()) -+ ret = cache_setup_of_node(cpu); -+ else if (!acpi_disabled) -+ /* No cache property/hierarchy support yet in ACPI */ -+ ret = -ENOTSUPP; -+ if (ret) -+ return ret; -+ -+ for (index = 0; index < cache_leaves(cpu); index++) { -+ unsigned int i; -+ -+ this_leaf = this_cpu_ci->info_list + index; -+ /* skip if shared_cpu_map is already populated */ -+ if (!cpumask_empty(&this_leaf->shared_cpu_map)) -+ continue; -+ -+ cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); -+ for_each_online_cpu(i) { -+ struct cpu_cacheinfo *sib_cpu_ci = get_cpu_cacheinfo(i); -+ -+ if (i == cpu || !sib_cpu_ci->info_list) -+ continue;/* skip if itself or no cacheinfo */ -+ sib_leaf = sib_cpu_ci->info_list + index; -+ if (cache_leaves_are_shared(this_leaf, sib_leaf)) { -+ cpumask_set_cpu(cpu, &sib_leaf->shared_cpu_map); -+ cpumask_set_cpu(i, &this_leaf->shared_cpu_map); -+ } -+ } -+ } -+ -+ return 0; -+} -+ -+static void cache_shared_cpu_map_remove(unsigned int cpu) -+{ -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf, *sib_leaf; -+ unsigned int sibling, index; -+ -+ for (index = 0; index < cache_leaves(cpu); index++) { -+ this_leaf = this_cpu_ci->info_list + index; -+ for_each_cpu(sibling, &this_leaf->shared_cpu_map) { -+ struct cpu_cacheinfo *sib_cpu_ci; -+ -+ if (sibling == cpu) /* skip itself */ -+ continue; -+ -+ sib_cpu_ci = get_cpu_cacheinfo(sibling); -+ if (!sib_cpu_ci->info_list) -+ continue; -+ -+ sib_leaf = sib_cpu_ci->info_list + index; -+ cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map); -+ cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); -+ } -+ of_node_put(this_leaf->of_node); -+ } -+} -+ -+static void cache_override_properties(unsigned int cpu) -+{ -+ if (of_have_populated_dt()) -+ return cache_of_override_properties(cpu); -+} -+ -+static void free_cache_attributes(unsigned int cpu) -+{ -+ if (!per_cpu_cacheinfo(cpu)) -+ return; -+ -+ cache_shared_cpu_map_remove(cpu); -+ -+ kfree(per_cpu_cacheinfo(cpu)); -+ per_cpu_cacheinfo(cpu) = NULL; -+} -+ -+int __weak init_cache_level(unsigned int cpu) -+{ -+ return -ENOENT; -+} -+ -+int __weak populate_cache_leaves(unsigned int cpu) -+{ -+ return -ENOENT; -+} -+ -+static int detect_cache_attributes(unsigned int cpu) -+{ -+ int ret; -+ -+ if (init_cache_level(cpu) || !cache_leaves(cpu)) -+ return -ENOENT; -+ -+ per_cpu_cacheinfo(cpu) = kcalloc(cache_leaves(cpu), -+ sizeof(struct cacheinfo), GFP_KERNEL); -+ if (per_cpu_cacheinfo(cpu) == NULL) -+ return -ENOMEM; -+ -+ ret = populate_cache_leaves(cpu); -+ if (ret) -+ goto free_ci; -+ /* -+ * For systems using DT for cache hierarchy, of_node and shared_cpu_map -+ * will be set up here only if they are not populated already -+ */ -+ ret = cache_shared_cpu_map_setup(cpu); -+ if (ret) { -+ pr_warn("Unable to detect cache hierarchy for CPU %d\n", cpu); -+ goto free_ci; -+ } -+ -+ cache_override_properties(cpu); -+ return 0; -+ -+free_ci: -+ free_cache_attributes(cpu); -+ return ret; -+} -+ -+/* pointer to cpuX/cache device */ -+static DEFINE_PER_CPU(struct device *, ci_cache_dev); -+#define per_cpu_cache_dev(cpu) (per_cpu(ci_cache_dev, cpu)) -+ -+static cpumask_t cache_dev_map; -+ -+/* pointer to array of devices for cpuX/cache/indexY */ -+static DEFINE_PER_CPU(struct device **, ci_index_dev); -+#define per_cpu_index_dev(cpu) (per_cpu(ci_index_dev, cpu)) -+#define per_cache_index_dev(cpu, idx) ((per_cpu_index_dev(cpu))[idx]) -+ -+#define show_one(file_name, object) \ -+static ssize_t file_name##_show(struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); \ -+ return sprintf(buf, "%u\n", this_leaf->object); \ -+} -+ -+show_one(id, id); -+show_one(level, level); -+show_one(coherency_line_size, coherency_line_size); -+show_one(number_of_sets, number_of_sets); -+show_one(physical_line_partition, physical_line_partition); -+show_one(ways_of_associativity, ways_of_associativity); -+ -+static ssize_t size_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ -+ return sprintf(buf, "%uK\n", this_leaf->size >> 10); -+} -+ -+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); -+} -+ -+static ssize_t shared_cpu_map_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ return shared_cpumap_show_func(dev, false, buf); -+} -+ -+static ssize_t shared_cpu_list_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ return shared_cpumap_show_func(dev, true, buf); -+} -+ -+static ssize_t type_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ -+ switch (this_leaf->type) { -+ case CACHE_TYPE_DATA: -+ return sprintf(buf, "Data\n"); -+ case CACHE_TYPE_INST: -+ return sprintf(buf, "Instruction\n"); -+ case CACHE_TYPE_UNIFIED: -+ return sprintf(buf, "Unified\n"); -+ default: -+ return -EINVAL; -+ } -+} -+ -+static ssize_t allocation_policy_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ unsigned int ci_attr = this_leaf->attributes; -+ int n = 0; -+ -+ if ((ci_attr & CACHE_READ_ALLOCATE) && (ci_attr & CACHE_WRITE_ALLOCATE)) -+ n = sprintf(buf, "ReadWriteAllocate\n"); -+ else if (ci_attr & CACHE_READ_ALLOCATE) -+ n = sprintf(buf, "ReadAllocate\n"); -+ else if (ci_attr & CACHE_WRITE_ALLOCATE) -+ n = sprintf(buf, "WriteAllocate\n"); -+ return n; -+} -+ -+static ssize_t write_policy_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ unsigned int ci_attr = this_leaf->attributes; -+ int n = 0; -+ -+ if (ci_attr & CACHE_WRITE_THROUGH) -+ n = sprintf(buf, "WriteThrough\n"); -+ else if (ci_attr & CACHE_WRITE_BACK) -+ n = sprintf(buf, "WriteBack\n"); -+ return n; -+} -+ -+static DEVICE_ATTR_RO(id); -+static DEVICE_ATTR_RO(level); -+static DEVICE_ATTR_RO(type); -+static DEVICE_ATTR_RO(coherency_line_size); -+static DEVICE_ATTR_RO(ways_of_associativity); -+static DEVICE_ATTR_RO(number_of_sets); -+static DEVICE_ATTR_RO(size); -+static DEVICE_ATTR_RO(allocation_policy); -+static DEVICE_ATTR_RO(write_policy); -+static DEVICE_ATTR_RO(shared_cpu_map); -+static DEVICE_ATTR_RO(shared_cpu_list); -+static DEVICE_ATTR_RO(physical_line_partition); -+ -+static struct attribute *cache_default_attrs[] = { -+ &dev_attr_id.attr, -+ &dev_attr_type.attr, -+ &dev_attr_level.attr, -+ &dev_attr_shared_cpu_map.attr, -+ &dev_attr_shared_cpu_list.attr, -+ &dev_attr_coherency_line_size.attr, -+ &dev_attr_ways_of_associativity.attr, -+ &dev_attr_number_of_sets.attr, -+ &dev_attr_size.attr, -+ &dev_attr_allocation_policy.attr, -+ &dev_attr_write_policy.attr, -+ &dev_attr_physical_line_partition.attr, -+ NULL -+}; -+ -+static umode_t -+cache_default_attrs_is_visible(struct kobject *kobj, -+ struct attribute *attr, int unused) -+{ -+ struct device *dev = kobj_to_dev(kobj); -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ const struct cpumask *mask = &this_leaf->shared_cpu_map; -+ umode_t mode = attr->mode; -+ -+ if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID)) -+ return mode; -+ if ((attr == &dev_attr_type.attr) && this_leaf->type) -+ return mode; -+ if ((attr == &dev_attr_level.attr) && this_leaf->level) -+ return mode; -+ if ((attr == &dev_attr_shared_cpu_map.attr) && !cpumask_empty(mask)) -+ return mode; -+ if ((attr == &dev_attr_shared_cpu_list.attr) && !cpumask_empty(mask)) -+ return mode; -+ if ((attr == &dev_attr_coherency_line_size.attr) && -+ this_leaf->coherency_line_size) -+ return mode; -+ if ((attr == &dev_attr_ways_of_associativity.attr) && -+ this_leaf->size) /* allow 0 = full associativity */ -+ return mode; -+ if ((attr == &dev_attr_number_of_sets.attr) && -+ this_leaf->number_of_sets) -+ return mode; -+ if ((attr == &dev_attr_size.attr) && this_leaf->size) -+ return mode; -+ if ((attr == &dev_attr_write_policy.attr) && -+ (this_leaf->attributes & CACHE_WRITE_POLICY_MASK)) -+ return mode; -+ if ((attr == &dev_attr_allocation_policy.attr) && -+ (this_leaf->attributes & CACHE_ALLOCATE_POLICY_MASK)) -+ return mode; -+ if ((attr == &dev_attr_physical_line_partition.attr) && -+ this_leaf->physical_line_partition) -+ return mode; -+ -+ return 0; -+} -+ -+static const struct attribute_group cache_default_group = { -+ .attrs = cache_default_attrs, -+ .is_visible = cache_default_attrs_is_visible, -+}; -+ -+static const struct attribute_group *cache_default_groups[] = { -+ &cache_default_group, -+ NULL, -+}; -+ -+static const struct attribute_group *cache_private_groups[] = { -+ &cache_default_group, -+ NULL, /* Place holder for private group */ -+ NULL, -+}; -+ -+const struct attribute_group * -+__weak cache_get_priv_group(struct cacheinfo *this_leaf) -+{ -+ return NULL; -+} -+ -+static const struct attribute_group ** -+cache_get_attribute_groups(struct cacheinfo *this_leaf) -+{ -+ const struct attribute_group *priv_group = -+ cache_get_priv_group(this_leaf); -+ -+ if (!priv_group) -+ return cache_default_groups; -+ -+ if (!cache_private_groups[1]) -+ cache_private_groups[1] = priv_group; -+ -+ return cache_private_groups; -+} -+ -+/* Add/Remove cache interface for CPU device */ -+static void cpu_cache_sysfs_exit(unsigned int cpu) -+{ -+ int i; -+ struct device *ci_dev; -+ -+ if (per_cpu_index_dev(cpu)) { -+ for (i = 0; i < cache_leaves(cpu); i++) { -+ ci_dev = per_cache_index_dev(cpu, i); -+ if (!ci_dev) -+ continue; -+ device_unregister(ci_dev); -+ } -+ kfree(per_cpu_index_dev(cpu)); -+ per_cpu_index_dev(cpu) = NULL; -+ } -+ device_unregister(per_cpu_cache_dev(cpu)); -+ per_cpu_cache_dev(cpu) = NULL; -+} -+ -+static int cpu_cache_sysfs_init(unsigned int cpu) -+{ -+ struct device *dev = get_cpu_device(cpu); -+ -+ if (per_cpu_cacheinfo(cpu) == NULL) -+ return -ENOENT; -+ -+ per_cpu_cache_dev(cpu) = cpu_device_create(dev, NULL, NULL, "cache"); -+ if (IS_ERR(per_cpu_cache_dev(cpu))) -+ return PTR_ERR(per_cpu_cache_dev(cpu)); -+ -+ /* Allocate all required memory */ -+ per_cpu_index_dev(cpu) = kcalloc(cache_leaves(cpu), -+ sizeof(struct device *), GFP_KERNEL); -+ if (unlikely(per_cpu_index_dev(cpu) == NULL)) -+ goto err_out; -+ -+ return 0; -+ -+err_out: -+ cpu_cache_sysfs_exit(cpu); -+ return -ENOMEM; -+} -+ -+static int cache_add_dev(unsigned int cpu) -+{ -+ unsigned int i; -+ int rc; -+ struct device *ci_dev, *parent; -+ struct cacheinfo *this_leaf; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ const struct attribute_group **cache_groups; -+ -+ rc = cpu_cache_sysfs_init(cpu); -+ if (unlikely(rc < 0)) -+ return rc; -+ -+ parent = per_cpu_cache_dev(cpu); -+ for (i = 0; i < cache_leaves(cpu); i++) { -+ this_leaf = this_cpu_ci->info_list + i; -+ if (this_leaf->disable_sysfs) -+ continue; -+ cache_groups = cache_get_attribute_groups(this_leaf); -+ ci_dev = cpu_device_create(parent, this_leaf, cache_groups, -+ "index%1u", i); -+ if (IS_ERR(ci_dev)) { -+ rc = PTR_ERR(ci_dev); -+ goto err; -+ } -+ per_cache_index_dev(cpu, i) = ci_dev; -+ } -+ cpumask_set_cpu(cpu, &cache_dev_map); -+ -+ return 0; -+err: -+ cpu_cache_sysfs_exit(cpu); -+ return rc; -+} -+ -+static int cacheinfo_cpu_online(unsigned int cpu) -+{ -+ int rc = detect_cache_attributes(cpu); -+ -+ if (rc) -+ return rc; -+ rc = cache_add_dev(cpu); -+ if (rc) -+ free_cache_attributes(cpu); -+ return rc; -+} -+ -+static int cacheinfo_cpu_pre_down(unsigned int cpu) -+{ -+ if (cpumask_test_and_clear_cpu(cpu, &cache_dev_map)) -+ cpu_cache_sysfs_exit(cpu); -+ -+ free_cache_attributes(cpu); -+ return 0; -+} -+ -+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); -+} -+device_initcall(cacheinfo_sysfs_init); -diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c -index 290609b..65e786d 100644 ---- a/drivers/base/cpu.c -+++ b/drivers/base/cpu.c -@@ -338,6 +338,60 @@ struct device *get_cpu_device(unsigned cpu) - } - EXPORT_SYMBOL_GPL(get_cpu_device); - -+static void device_create_release(struct device *dev) -+{ -+ kfree(dev); -+} -+ -+static struct device * -+__cpu_device_create(struct device *parent, void *drvdata, -+ const struct attribute_group **groups, -+ const char *fmt, va_list args) -+{ -+ struct device *dev = NULL; -+ int retval = -ENODEV; -+ -+ dev = kzalloc(sizeof(*dev), GFP_KERNEL); -+ if (!dev) { -+ retval = -ENOMEM; -+ goto error; -+ } -+ -+ device_initialize(dev); -+ dev->parent = parent; -+ dev->groups = groups; -+ dev->release = device_create_release; -+ dev_set_drvdata(dev, drvdata); -+ -+ retval = kobject_set_name_vargs(&dev->kobj, fmt, args); -+ if (retval) -+ goto error; -+ -+ retval = device_add(dev); -+ if (retval) -+ goto error; -+ -+ return dev; -+ -+error: -+ put_device(dev); -+ return ERR_PTR(retval); -+} -+ -+struct device *cpu_device_create(struct device *parent, void *drvdata, -+ const struct attribute_group **groups, -+ const char *fmt, ...) -+{ -+ va_list vargs; -+ struct device *dev; -+ -+ va_start(vargs, fmt); -+ dev = __cpu_device_create(parent, drvdata, groups, fmt, vargs); -+ va_end(vargs); -+ return dev; -+} -+EXPORT_SYMBOL_GPL(cpu_device_create); -+ - #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE - static DEVICE_ATTR(modalias, 0444, arch_print_cpu_modalias, NULL); - #endif -diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h -new file mode 100644 -index 0000000..6a524bf ---- /dev/null -+++ b/include/linux/cacheinfo.h -@@ -0,0 +1,104 @@ -+#ifndef _LINUX_CACHEINFO_H -+#define _LINUX_CACHEINFO_H -+ -+#include -+#include -+#include -+ -+struct device_node; -+struct attribute; -+ -+enum cache_type { -+ CACHE_TYPE_NOCACHE = 0, -+ CACHE_TYPE_INST = BIT(0), -+ CACHE_TYPE_DATA = BIT(1), -+ CACHE_TYPE_SEPARATE = CACHE_TYPE_INST | CACHE_TYPE_DATA, -+ CACHE_TYPE_UNIFIED = BIT(2), -+}; -+ -+/** -+ * struct cacheinfo - represent a cache leaf node -+ * @id: This cache's id. It is unique among caches with the same (type, level). -+ * @type: type of the cache - data, inst or unified -+ * @level: represents the hierarchy in the multi-level cache -+ * @coherency_line_size: size of each cache line usually representing -+ * the minimum amount of data that gets transferred from memory -+ * @number_of_sets: total number of sets, a set is a collection of cache -+ * lines sharing the same index -+ * @ways_of_associativity: number of ways in which a particular memory -+ * block can be placed in the cache -+ * @physical_line_partition: number of physical cache lines sharing the -+ * same cachetag -+ * @size: Total size of the cache -+ * @shared_cpu_map: logical cpumask representing all the cpus sharing -+ * this cache node -+ * @attributes: bitfield representing various cache attributes -+ * @of_node: if devicetree is used, this represents either the cpu node in -+ * case there's no explicit cache node or the cache node itself in the -+ * device tree -+ * @disable_sysfs: indicates whether this node is visible to the user via -+ * sysfs or not -+ * @priv: pointer to any private data structure specific to particular -+ * cache design -+ * -+ * While @of_node, @disable_sysfs and @priv are used for internal book -+ * keeping, the remaining members form the core properties of the cache -+ */ -+struct cacheinfo { -+ unsigned int id; -+ enum cache_type type; -+ unsigned int level; -+ unsigned int coherency_line_size; -+ unsigned int number_of_sets; -+ unsigned int ways_of_associativity; -+ unsigned int physical_line_partition; -+ unsigned int size; -+ cpumask_t shared_cpu_map; -+ unsigned int attributes; -+#define CACHE_WRITE_THROUGH BIT(0) -+#define CACHE_WRITE_BACK BIT(1) -+#define CACHE_WRITE_POLICY_MASK \ -+ (CACHE_WRITE_THROUGH | CACHE_WRITE_BACK) -+#define CACHE_READ_ALLOCATE BIT(2) -+#define CACHE_WRITE_ALLOCATE BIT(3) -+#define CACHE_ALLOCATE_POLICY_MASK \ -+ (CACHE_READ_ALLOCATE | CACHE_WRITE_ALLOCATE) -+#define CACHE_ID BIT(4) -+ -+ struct device_node *of_node; -+ bool disable_sysfs; -+ void *priv; -+}; -+ -+struct cpu_cacheinfo { -+ struct cacheinfo *info_list; -+ unsigned int num_levels; -+ unsigned int num_leaves; -+ bool cpu_map_populated; -+}; -+ -+/* -+ * Helpers to make sure "func" is executed on the cpu whose cache -+ * attributes are being detected -+ */ -+#define DEFINE_SMP_CALL_CACHE_FUNCTION(func) \ -+static inline void _##func(void *ret) \ -+{ \ -+ int cpu = smp_processor_id(); \ -+ *(int *)ret = __##func(cpu); \ -+} \ -+ \ -+int func(unsigned int cpu) \ -+{ \ -+ int ret; \ -+ smp_call_function_single(cpu, _##func, &ret, true); \ -+ return ret; \ -+} -+ -+struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu); -+int init_cache_level(unsigned int cpu); -+int populate_cache_leaves(unsigned int cpu); -+ -+const struct attribute_group *cache_get_priv_group(struct cacheinfo *this_leaf); -+ -+#endif /* _LINUX_CACHEINFO_H */ -diff --git a/include/linux/cpu.h b/include/linux/cpu.h -index a5dd694..ceaa393 100644 ---- a/include/linux/cpu.h -+++ b/include/linux/cpu.h -@@ -51,6 +51,9 @@ extern ssize_t cpu_show_l1tf(struct device *dev, - extern ssize_t cpu_show_mds(struct device *dev, - struct device_attribute *attr, char *buf); - -+extern struct device *cpu_device_create(struct device *parent, void *drvdata, -+ const struct attribute_group **groups, -+ const char *fmt, ...); - #ifdef CONFIG_HOTPLUG_CPU - extern void unregister_cpu(struct cpu *cpu); - extern ssize_t arch_cpu_probe(const char *, size_t); --- -2.7.4 - diff --git a/kernel/kernel-rt/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch b/kernel/kernel-rt/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch deleted file mode 100644 index d7e3692b8..000000000 --- a/kernel/kernel-rt/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch +++ /dev/null @@ -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: -References: -From: Kam Nasim -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 -Signed-off-by: Robin Lu ---- - 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 - 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 - diff --git a/kernel/kernel-rt/centos/patches/US103091-IMA-System-Configuration.patch b/kernel/kernel-rt/centos/patches/US103091-IMA-System-Configuration.patch deleted file mode 100644 index 9e8ada317..000000000 --- a/kernel/kernel-rt/centos/patches/US103091-IMA-System-Configuration.patch +++ /dev/null @@ -1,236 +0,0 @@ -From d84a5bd81b7ef68f35c3bbd845e71aee10e4e9b7 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Kam Nasim -Date: Wed, 4 Oct 2017 14:02:10 -0400 -Subject: [PATCH 26/32] US103091: IMA: System Configuration - -Normally (if trusted integrity keyring is disabled), the _ima keyring -needs to be created by user space (specifically systemd), but that has -the added disadvantage of requiring the IMA public key to reside on the -file system as opposed to being compiled in. Somebody could render some -serious Grade A damage by corrupting this public key on the FS. -Crippling the system if IMA 'enforce' action is enabled. - -We will therefore create the IMA keyring inside the kernel and load the -IMA public key as a compiled data blob, similar to how the Kernel loads -trusted X509 keys into the system truststore (.system_keyring) - -Signed-off-by: Jim Somerville ---- - include/keys/system_keyring.h | 2 ++ - kernel/Makefile | 42 ++++++++++++++++++++-- - kernel/ima_certificate.S | 20 +++++++++++ - kernel/system_keyring.c | 82 +++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 144 insertions(+), 2 deletions(-) - create mode 100644 kernel/ima_certificate.S - -diff --git a/include/keys/system_keyring.h b/include/keys/system_keyring.h -index 0e49b3c..6b2da90 100644 ---- a/include/keys/system_keyring.h -+++ b/include/keys/system_keyring.h -@@ -34,4 +34,6 @@ static inline struct key *get_system_trusted_keyring(void) - - #endif /* CONFIG_SYSTEM_TRUSTED_KEYRING */ - -+extern struct key *ima_keyring; -+ - #endif /* _KEYS_SYSTEM_KEYRING_H */ -diff --git a/kernel/Makefile b/kernel/Makefile -index d357e7d..f333b29 100644 ---- a/kernel/Makefile -+++ b/kernel/Makefile -@@ -62,7 +62,7 @@ obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o - obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o - obj-$(CONFIG_LOCK_SPIN_ON_OWNER) += osq_lock.o - obj-$(CONFIG_UID16) += uid16.o --obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o -+obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o ima_certificate.o - obj-$(CONFIG_MODULES) += module.o - obj-$(CONFIG_MODULE_SIG) += module_signing.o - obj-$(CONFIG_MODULE_SIG_UEFI) += modsign_uefi.o -@@ -206,7 +206,45 @@ targets += $(obj)/.x509.list - $(obj)/.x509.list: - @echo $(X509_CERTIFICATES) >$@ - --clean-files := x509_certificate_list .x509.list -+ -+############################################################################### -+# -+# We will roll in the IMA X.509 certificate and pull it in the kernel -+# so that it gets loaded into the _ima keyring during boot. -+# -+# Ideally, this should have been treated similar to other .x509 certificates -+# (X509_CERTIFICATES), but those all get loaded into the system trusted keyring -+# and since the canonical pathnames are not available in the x509_certificate_list -+# compiled data blob, there is no way to isolate the IMA certificate from the -+# rest. Therefore we treat the IMA certificate as a seperate blob all together. -+# -+# We look in the source root for the IMA certificate, of name "ima_signing_key.pub" -+# -+############################################################################### -+IMA_X509_CERTIFICATE := $(srctree)/ima_signing_key.pub -+ -+ifneq ($(wildcard $(obj)/.x509.ima),) -+ifneq ($(shell cat $(obj)/.x509.ima),$(IMA_X509_CERTIFICATE)) -+$(info IMA: X.509 certificate changed) -+$(shell rm $(obj)/.x509.ima) -+endif -+endif -+ -+kernel/ima_certificate.o: $(obj)/ima_x509_certificate -+ -+quiet_cmd_imacert = CERTS $@ -+ cmd_imacert = cat $(IMA_X509_CERTIFICATE) >$@ $(foreach IMA_X509,$(IMA_X509_CERTIFICATE),; echo " - Including cert $(IMA_X509)") -+ -+targets += $(obj)/ima_x509_certificate -+$(obj)/ima_x509_certificate: $(IMA_X509_CERTIFICATE) $(obj)/.x509.ima -+ $(call if_changed,imacert) -+ -+targets += $(obj)/.x509.ima -+$(obj)/.x509.ima: -+ @echo $(IMA_X509_CERTIFICATE) >$@ -+ -+ -+clean-files := x509_certificate_list .x509.list ima_x509_certificate .x509.ima - endif - - ifeq ($(CONFIG_MODULE_SIG),y) -diff --git a/kernel/ima_certificate.S b/kernel/ima_certificate.S -new file mode 100644 -index 0000000..0c665dd ---- /dev/null -+++ b/kernel/ima_certificate.S -@@ -0,0 +1,20 @@ -+#include -+#include -+ -+ __INITRODATA -+ -+ .align 8 -+ .globl VMLINUX_SYMBOL(ima_system_certificate) -+VMLINUX_SYMBOL(ima_system_certificate): -+__cert_list_start: -+ .incbin "kernel/ima_x509_certificate" -+__cert_list_end: -+ -+ .align 8 -+ .globl VMLINUX_SYMBOL(ima_system_certificate_size) -+VMLINUX_SYMBOL(ima_system_certificate_size): -+#ifdef CONFIG_64BIT -+ .quad __cert_list_end - __cert_list_start -+#else -+ .long __cert_list_end - __cert_list_start -+#endif -diff --git a/kernel/system_keyring.c b/kernel/system_keyring.c -index c15e93f..92beb15 100644 ---- a/kernel/system_keyring.c -+++ b/kernel/system_keyring.c -@@ -23,10 +23,15 @@ EXPORT_SYMBOL_GPL(system_trusted_keyring); - #ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING - struct key *system_blacklist_keyring; - #endif -+struct key *ima_keyring; -+EXPORT_SYMBOL_GPL(ima_keyring); - - extern __initconst const u8 system_certificate_list[]; - extern __initconst const unsigned long system_certificate_list_size; - -+extern __initconst const u8 ima_system_certificate[]; -+extern __initconst const unsigned long ima_system_certificate_size; -+ - /* - * Load the compiled-in keys - */ -@@ -57,6 +62,27 @@ static __init int system_trusted_keyring_init(void) - - set_bit(KEY_FLAG_TRUSTED_ONLY, &system_blacklist_keyring->flags); - #endif -+ /* Normally (if trusted integrity keyring is disabled), the _ima -+ * keyring needs to be created by user space but that has the -+ * added disadvantage of requiring the IMA public key to reside on -+ * the file system as opposed to being compiled in. -+ * We will therefore form a _ima keyring here and load build -+ * the IMA X.509 certificate -+ * -+ * N.B: The IMA keyring only allows root userspace view & read ops -+ */ -+ pr_notice("Initializing system IMA keyring\n"); -+ -+ ima_keyring = keyring_alloc("_ima", -+ KUIDT_INIT(0), KGIDT_INIT(0), -+ current_cred(), -+ ((KEY_POS_ALL & ~KEY_POS_SETATTR) | -+ KEY_USR_VIEW | KEY_USR_READ | KEY_USR_SEARCH), -+ KEY_ALLOC_NOT_IN_QUOTA, NULL); -+ if (IS_ERR(ima_keyring)) -+ panic("Can't allocate system IMA keyring\n"); -+ -+ set_bit(KEY_FLAG_TRUSTED_ONLY, &ima_keyring->flags); - - return 0; - } -@@ -121,3 +147,59 @@ dodgy_cert: - return 0; - } - late_initcall(load_system_certificate_list); -+ -+/* -+ * Load the compiled-in IMA certificate. -+ */ -+static __init int load_ima_system_certificate(void) -+{ -+ key_ref_t key; -+ const u8 *p, *end; -+ size_t plen; -+ -+ pr_notice("Loading compiled-in X.509 IMA certificate\n"); -+ -+ p = ima_system_certificate; -+ end = p + ima_system_certificate_size; -+ while (p < end) { -+ /* Each cert begins with an ASN.1 SEQUENCE tag and must be more -+ * than 256 bytes in size. -+ */ -+ if (end - p < 4) -+ goto dodgy_cert; -+ if (p[0] != 0x30 && -+ p[1] != 0x82) -+ goto dodgy_cert; -+ plen = (p[2] << 8) | p[3]; -+ plen += 4; -+ if (plen > end - p) -+ goto dodgy_cert; -+ -+ key = key_create_or_update(make_key_ref(ima_keyring, 1), -+ "asymmetric", -+ NULL, -+ p, -+ plen, -+ ((KEY_POS_ALL & ~KEY_POS_SETATTR) | -+ KEY_USR_VIEW | KEY_USR_READ), -+ KEY_ALLOC_NOT_IN_QUOTA | -+ KEY_ALLOC_TRUSTED); -+ if (IS_ERR(key)) { -+ pr_err("Problem loading in-kernel X.509 certificate (%ld)\n", -+ PTR_ERR(key)); -+ } else { -+ set_bit(KEY_FLAG_BUILTIN, &key_ref_to_ptr(key)->flags); -+ pr_notice("Loaded X.509 cert '%s'\n", -+ key_ref_to_ptr(key)->description); -+ key_ref_put(key); -+ } -+ p += plen; -+ } -+ -+ return 0; -+ -+dodgy_cert: -+ pr_err("Problem parsing in-kernel X.509 IMA certificate\n"); -+ return 0; -+} -+late_initcall(load_ima_system_certificate); --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/affine-compute-kernel-threads.patch b/kernel/kernel-rt/centos/patches/affine-compute-kernel-threads.patch deleted file mode 100644 index 59ae34b23..000000000 --- a/kernel/kernel-rt/centos/patches/affine-compute-kernel-threads.patch +++ /dev/null @@ -1,168 +0,0 @@ -From a15588101329965ad3974bd571a9207d6a5e154a Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Chris Friesen -Date: Tue, 24 Nov 2015 16:27:28 -0500 -Subject: [PATCH 04/32] affine compute kernel threads - -This is a kernel enhancement to configure the cpu affinity of kernel -threads via kernel boot option kthread_cpus=. The compute -kickstart file and compute-huge.sh scripts will update grub with the -new option. - -With kthread_cpus specified, the cpumask is immediately applied upon -thread launch. This does not affect kernel threads that specify cpu -and node. - -Note: this is based off of Christoph Lameter's patch at -https://lwn.net/Articles/565932/ with the only difference being -the kernel parameter changed from kthread to kthread_cpus. - -Signed-off-by: Christoph Lameter -Signed-off-by: Chris Friesen -[VT: The existing "isolcpus" - kernel bootarg, cgroup/cpuset, and taskset might provide the some - way to have cpu isolation. However none of them satisfies the requirements. - Replacing spaces with tabs. Combine two calls of set_cpus_allowed_ptr() - in kernel_init_freeable() in init/main.c into one. Performed tests] -Signed-off-by: Vu Tran - -Signed-off-by: Jim Somerville ---- - Documentation/kernel-parameters.txt | 10 ++++++++++ - include/linux/cpumask.h | 2 ++ - init/main.c | 6 ++---- - kernel/cpu.c | 13 +++++++++++++ - kernel/kmod.c | 3 +++ - kernel/kthread.c | 4 ++-- - 6 files changed, 32 insertions(+), 6 deletions(-) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 02cfdf6..4eeda61 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -1551,6 +1551,16 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - - kpti [X86-64] Enable kernel page table isolation. - -+ kthread_cpus= [KNL, SMP] Only run kernel threads on the specified -+ list of processors. The kernel will start threads -+ on the indicated processors only (unless there -+ are specific reasons to run a thread with -+ different affinities). This can be used to make -+ init start on certain processors and also to -+ control where kmod and other user space threads -+ are being spawned. Allows to keep kernel threads -+ away from certain cores unless absoluteluy necessary. -+ - kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs. - Default is 0 (don't ignore, but inject #GP) - -diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h -index ee335c6..46ae77a 100644 ---- a/include/linux/cpumask.h -+++ b/include/linux/cpumask.h -@@ -52,6 +52,7 @@ extern int nr_cpu_ids; - * cpu_present_mask - has bit 'cpu' set iff cpu is populated - * cpu_online_mask - has bit 'cpu' set iff cpu available to scheduler - * cpu_active_mask - has bit 'cpu' set iff cpu available to migration -+ * cpu_kthread_mask - has bit 'cpu' set iff general kernel threads allowed - * - * If !CONFIG_HOTPLUG_CPU, present == possible, and active == online. - * -@@ -88,6 +89,7 @@ extern const struct cpumask *const cpu_possible_mask; - extern const struct cpumask *const cpu_online_mask; - extern const struct cpumask *const cpu_present_mask; - extern const struct cpumask *const cpu_active_mask; -+extern const struct cpumask *const cpu_kthread_mask; - - #if NR_CPUS > 1 - #define num_online_cpus() cpumask_weight(cpu_online_mask) -diff --git a/init/main.c b/init/main.c -index 2e4ecd4..6e265d0 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -961,10 +961,6 @@ static noinline void __init kernel_init_freeable(void) - * init can allocate pages on any node - */ - set_mems_allowed(node_states[N_MEMORY]); -- /* -- * init can run on any cpu. -- */ -- set_cpus_allowed_ptr(current, cpu_all_mask); - - cad_pid = task_pid(current); - -@@ -980,6 +976,8 @@ static noinline void __init kernel_init_freeable(void) - - do_basic_setup(); - -+ set_cpus_allowed_ptr(current, cpu_kthread_mask); -+ - /* Open the /dev/console on the rootfs, this should never fail */ - if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) - pr_err("Warning: unable to open an initial console.\n"); -diff --git a/kernel/cpu.c b/kernel/cpu.c -index 6fe84e4..325a47a 100644 ---- a/kernel/cpu.c -+++ b/kernel/cpu.c -@@ -1329,6 +1329,19 @@ static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly; - const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits); - EXPORT_SYMBOL(cpu_active_mask); - -+static DECLARE_BITMAP(cpu_kthread_bits, CONFIG_NR_CPUS) __read_mostly -+ = CPU_BITS_ALL; -+const struct cpumask *const cpu_kthread_mask = to_cpumask(cpu_kthread_bits); -+EXPORT_SYMBOL(cpu_kthread_mask); -+ -+static int __init kthread_setup(char *str) -+{ -+ cpulist_parse(str, (struct cpumask *)&cpu_kthread_bits); -+ return 1; -+} -+__setup("kthread_cpus=", kthread_setup); -+ -+ - void set_cpu_possible(unsigned int cpu, bool possible) - { - if (possible) -diff --git a/kernel/kmod.c b/kernel/kmod.c -index 86ab754..4bf584b 100644 ---- a/kernel/kmod.c -+++ b/kernel/kmod.c -@@ -204,6 +204,9 @@ static int ____call_usermodehelper(void *data) - flush_signal_handlers(current, 1); - spin_unlock_irq(¤t->sighand->siglock); - -+ /* We can run only where init is allowed to run. */ -+ set_cpus_allowed_ptr(current, cpu_kthread_mask); -+ - /* - * Our parent is keventd, which runs with elevated scheduling priority. - * Avoid propagating that into the userspace child. -diff --git a/kernel/kthread.c b/kernel/kthread.c -index 703d910..7ea32eb 100644 ---- a/kernel/kthread.c -+++ b/kernel/kthread.c -@@ -284,7 +284,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), - * The kernel thread should not inherit these properties. - */ - sched_setscheduler_nocheck(create.result, SCHED_NORMAL, ¶m); -- set_cpus_allowed_ptr(create.result, cpu_all_mask); -+ set_cpus_allowed_ptr(create.result, cpu_kthread_mask); - } - return create.result; - } -@@ -454,7 +454,7 @@ int kthreadd(void *unused) - /* Setup a clean context for our children to inherit. */ - set_task_comm(tsk, "kthreadd"); - ignore_signals(tsk); -- set_cpus_allowed_ptr(tsk, cpu_all_mask); -+ set_cpus_allowed_ptr(tsk, cpu_kthread_mask); - set_mems_allowed(node_states[N_MEMORY]); - - current->flags |= PF_NOFREEZE; --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch b/kernel/kernel-rt/centos/patches/aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch deleted file mode 100644 index d35ed03db..000000000 --- a/kernel/kernel-rt/centos/patches/aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 1b9b21d80f85665b29dda49dd52d80058111d811 Mon Sep 17 00:00:00 2001 -Message-Id: <1b9b21d80f85665b29dda49dd52d80058111d811.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Hannes Reinecke -Date: Mon, 6 Jul 2015 13:07:58 +0200 -Subject: [PATCH 29/32] aic94xx: Skip reading user settings if flash is not - found - -If no user settings are found it's pointless trying to -read them from flash. So skip that step. -This also fixes a compilation warning about uninitialized variables in -aic94xx. - -Signed-off-by: Hannes Reinecke -Reviewed-by: Christoph Hellwig -Signed-off-by: James Bottomley -Signed-off-by: Jim Somerville ---- - drivers/scsi/aic94xx/aic94xx_sds.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c -index edb43fd..c831e30 100644 ---- a/drivers/scsi/aic94xx/aic94xx_sds.c -+++ b/drivers/scsi/aic94xx/aic94xx_sds.c -@@ -983,7 +983,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, - { - int err, i; - u32 offs, size; -- struct asd_ll_el *el; -+ struct asd_ll_el *el = NULL; - struct asd_ctrla_phy_settings *ps; - struct asd_ctrla_phy_settings dflt_ps; - -@@ -1004,6 +1004,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, - - size = sizeof(struct asd_ctrla_phy_settings); - ps = &dflt_ps; -+ goto out_process; - } - - if (size == 0) -@@ -1028,7 +1029,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, - ASD_DPRINTK("couldn't find ctrla phy settings struct\n"); - goto out2; - } -- -+out_process: - err = asd_process_ctrla_phy_settings(asd_ha, ps); - if (err) { - ASD_DPRINTK("couldn't process ctrla phy settings\n"); --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch b/kernel/kernel-rt/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch deleted file mode 100644 index c320990c9..000000000 --- a/kernel/kernel-rt/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 0bce5a8a5158d690f232873efa3379bd00dfa9f5 Mon Sep 17 00:00:00 2001 -Message-Id: <0bce5a8a5158d690f232873efa3379bd00dfa9f5.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Akinobu Mita -Date: Tue, 31 May 2016 16:09:04 -0400 -Subject: [PATCH 07/32] cma: add placement specifier for "cma=" kernel - parameter - -Commit 5ea3b1b2f8ad9162684431ce6188102ca4c64b7a upstream -Backported-by: Nam Ninh - -Currently, "cma=" kernel parameter is used to specify the size of CMA, -but we can't specify where it is located. We want to locate CMA below -4GB for devices only supporting 32-bit addressing on 64-bit systems -without iommu. - -This enables to specify the placement of CMA by extending "cma=" kernel -parameter. - -Examples: - 1. locate 64MB CMA below 4GB by "cma=64M@0-4G" - 2. locate 64MB CMA exact at 512MB by "cma=64M@512M" - -Note that the DMA contiguous memory allocator on x86 assumes that -page_address() works for the pages to allocate. So this change requires -to limit end address of contiguous memory area upto max_pfn_mapped to -prevent from locating it on highmem area by the argument of -dma_contiguous_reserve(). - -Signed-off-by: Akinobu Mita -Cc: Marek Szyprowski -Cc: Konrad Rzeszutek Wilk -Cc: David Woodhouse -Cc: Don Dutile -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: Andi Kleen -Cc: Yinghai Lu -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Jim Somerville ---- - Documentation/kernel-parameters.txt | 7 +++++-- - arch/x86/kernel/setup.c | 2 +- - drivers/base/dma-contiguous.c | 42 ++++++++++++++++++++++++++++--------- - include/linux/dma-contiguous.h | 9 +++++--- - 4 files changed, 44 insertions(+), 16 deletions(-) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 4eeda61..685554b 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -580,8 +580,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - Also note the kernel might malfunction if you disable - some critical bits. - -- cma=nn[MG] [ARM,KNL] -- Sets the size of kernel global memory area for contiguous -+ cma=nn[MG]@[start[MG][-end[MG]]] -+ [ARM,X86,KNL] -+ Sets the size of kernel global memory area for -+ contiguous memory allocations and optionally the -+ placement constraint by the physical address range of - memory allocations. For more information, see - include/linux/dma-contiguous.h - -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index 9eca4ac..4e39287 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -1298,7 +1298,7 @@ void __init setup_arch(char **cmdline_p) - setup_real_mode(); - - memblock_set_current_limit(get_max_mapped()); -- dma_contiguous_reserve(0); -+ dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT); - - /* - * NOTE: On x86-32, only from this point on, fixmaps are ready for use. -diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c -index a0f89fc..a7d5bda 100644 ---- a/drivers/base/dma-contiguous.c -+++ b/drivers/base/dma-contiguous.c -@@ -59,11 +59,22 @@ struct cma *dma_contiguous_default_area; - */ - static const phys_addr_t size_bytes = CMA_SIZE_MBYTES * SZ_1M; - static phys_addr_t size_cmdline = -1; -+static phys_addr_t base_cmdline; -+static phys_addr_t limit_cmdline; - - static int __init early_cma(char *p) - { - pr_debug("%s(%s)\n", __func__, p); - size_cmdline = memparse(p, &p); -+ if (*p != '@') -+ return 0; -+ base_cmdline = memparse(p + 1, &p); -+ if (*p != '-') { -+ limit_cmdline = base_cmdline + size_cmdline; -+ return 0; -+ } -+ limit_cmdline = memparse(p + 1, &p); -+ - return 0; - } - early_param("cma", early_cma); -@@ -107,11 +118,18 @@ static inline __maybe_unused phys_addr_t cma_early_percent_memory(void) - void __init dma_contiguous_reserve(phys_addr_t limit) - { - phys_addr_t selected_size = 0; -+ phys_addr_t selected_base = 0; -+ phys_addr_t selected_limit = limit; -+ bool fixed = false; - - pr_debug("%s(limit %08lx)\n", __func__, (unsigned long)limit); - - if (size_cmdline != -1) { - selected_size = size_cmdline; -+ selected_base = base_cmdline; -+ selected_limit = min_not_zero(limit_cmdline, limit); -+ if (base_cmdline + size_cmdline == limit_cmdline) -+ fixed = true; - } else { - #ifdef CONFIG_CMA_SIZE_SEL_MBYTES - selected_size = size_bytes; -@@ -128,10 +146,12 @@ void __init dma_contiguous_reserve(phys_addr_t limit) - pr_debug("%s: reserving %ld MiB for global area\n", __func__, - (unsigned long)selected_size / SZ_1M); - -- dma_contiguous_reserve_area(selected_size, 0, limit, -- &dma_contiguous_default_area); -+ dma_contiguous_reserve_area(selected_size, selected_base, -+ selected_limit, -+ &dma_contiguous_default_area, -+ fixed); - } --}; -+} - - static DEFINE_MUTEX(cma_mutex); - -@@ -187,15 +207,20 @@ core_initcall(cma_init_reserved_areas); - * @base: Base address of the reserved area optional, use 0 for any - * @limit: End address of the reserved memory (optional, 0 for any). - * @res_cma: Pointer to store the created cma region. -+ * @fixed: hint about where to place the reserved area - * - * This function reserves memory from early allocator. It should be - * called by arch specific code once the early allocator (memblock or bootmem) - * has been activated and all other subsystems have already allocated/reserved - * memory. This function allows to create custom reserved areas for specific - * devices. -+ * -+ * If @fixed is true, reserve contiguous area at exactly @base. If false, -+ * reserve in range from @base to @limit. - */ - int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, -- phys_addr_t limit, struct cma **res_cma) -+ phys_addr_t limit, struct cma **res_cma, -+ bool fixed) - { - struct cma *cma = &cma_areas[cma_area_count]; - phys_addr_t alignment; -@@ -221,18 +246,15 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, - limit &= ~(alignment - 1); - - /* Reserve memory */ -- if (base) { -+ if (base && fixed) { - if (memblock_is_region_reserved(base, size) || - memblock_reserve(base, size) < 0) { - ret = -EBUSY; - goto err; - } - } else { -- /* -- * Use __memblock_alloc_base() since -- * memblock_alloc_base() panic()s. -- */ -- phys_addr_t addr = __memblock_alloc_base(size, alignment, limit); -+ phys_addr_t addr = memblock_alloc_range(size, alignment, base, -+ limit); - if (!addr) { - ret = -ENOMEM; - goto err; -diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h -index 1421a95..5e3f586 100644 ---- a/include/linux/dma-contiguous.h -+++ b/include/linux/dma-contiguous.h -@@ -88,7 +88,8 @@ static inline void dma_contiguous_set_default(struct cma *cma) - void dma_contiguous_reserve(phys_addr_t addr_limit); - - int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, -- phys_addr_t limit, struct cma **res_cma); -+ phys_addr_t limit, struct cma **res_cma, -+ bool fixed); - - /** - * dma_declare_contiguous() - reserve area for contiguous memory handling -@@ -108,7 +109,7 @@ static inline int dma_declare_contiguous(struct device *dev, phys_addr_t size, - { - struct cma *cma; - int ret; -- ret = dma_contiguous_reserve_area(size, base, limit, &cma); -+ ret = dma_contiguous_reserve_area(size, base, limit, &cma, true); - if (ret == 0) - dev_set_cma_area(dev, cma); - -@@ -136,7 +137,9 @@ static inline void dma_contiguous_set_default(struct cma *cma) { } - static inline void dma_contiguous_reserve(phys_addr_t limit) { } - - static inline int dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, -- phys_addr_t limit, struct cma **res_cma) { -+ phys_addr_t limit, struct cma **res_cma, -+ bool fixed) -+{ - return -ENOSYS; - } - --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch b/kernel/kernel-rt/centos/patches/compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch deleted file mode 100644 index ea9a32932..000000000 --- a/kernel/kernel-rt/centos/patches/compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch +++ /dev/null @@ -1,35 +0,0 @@ -From a209e9637eacb353adb97f29dd059e63084d30df Mon Sep 17 00:00:00 2001 -From: Bart Wensley -Date: Tue, 9 Jul 2019 07:25:32 -0500 -Subject: [PATCH 1/1] compile fix for disabling CONFIG_MEMCG_KMEM - -Signed-off-by: Bart Wensley ---- - mm/memcontrol.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index da97e2c..68fd46b 100644 ---- a/mm/memcontrol.c -+++ b/mm/memcontrol.c -@@ -2998,6 +2998,8 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg, - memcg_check_events(memcg, page); - } - -+static DEFINE_MUTEX(memcg_limit_mutex); -+ - #ifdef CONFIG_MEMCG_KMEM - /* - * The memcg_slab_mutex is held whenever a per memcg kmem cache is created or -@@ -3378,8 +3380,6 @@ static inline void memcg_resume_kmem_account(void) - current->memcg_kmem_skip_account--; - } - --static DEFINE_MUTEX(memcg_limit_mutex); -- - int __kmem_cache_destroy_memcg_children(struct kmem_cache *s) - { - struct kmem_cache *c; --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch b/kernel/kernel-rt/centos/patches/cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch deleted file mode 100644 index 8e6ae4722..000000000 --- a/kernel/kernel-rt/centos/patches/cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 5d7f38974c3279339c7d12d13980471fb50cf6c6 Mon Sep 17 00:00:00 2001 -Message-Id: <5d7f38974c3279339c7d12d13980471fb50cf6c6.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: "Rafael J. Wysocki" -Date: Fri, 24 Feb 2017 13:25:14 +0100 -Subject: [PATCH 24/32] cpuidle: menu: Avoid taking spinlock for accessing QoS - values - -[commit 6dbf5cea05a7098a69f294c96b6d76f08562cae5 from linux-stable ] - -After commit 9908859acaa9 (cpuidle/menu: add per CPU PM QoS resume -latency consideration) the cpuidle menu governor calls -dev_pm_qos_read_value() on CPU devices to read the current resume latency QoS -constraint values for them. That function takes a spinlock to prevent the -device's power.qos pointer from becoming NULL during the access which is a -problem for the RT patchset where spinlocks are converted into mutexes and -the idle loop stops working. - -However, it is not even necessary for the menu governor to take -that spinlock, because the power.qos pointer accessed under it -cannot be modified during the access anyway. - -For this reason, introduce a "raw" routine for accessing device -QoS resume latency constraints without locking and use it in the -menu governor. - -Fixes: 9908859acaa9 (cpuidle/menu: add per CPU PM QoS resume latency consideration) -Acked-by: Alex Shi -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Alex Kozyrev -Signed-off-by: Jim Somerville ---- - drivers/base/power/qos.c | 3 +-- - drivers/cpuidle/governors/menu.c | 2 +- - include/linux/pm_qos.h | 6 ++++++ - 3 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c -index b2ca302..0cc2a13 100644 ---- a/drivers/base/power/qos.c -+++ b/drivers/base/power/qos.c -@@ -104,8 +104,7 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_flags); - */ - s32 __dev_pm_qos_read_value(struct device *dev) - { -- return IS_ERR_OR_NULL(dev->power.qos) ? -- 0 : pm_qos_read_value(&dev->power.qos->latency); -+ return dev_pm_qos_raw_read_value(dev); - } - - /** -diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c -index fe2dcb8..f9861fd 100644 ---- a/drivers/cpuidle/governors/menu.c -+++ b/drivers/cpuidle/governors/menu.c -@@ -265,7 +265,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) - int i; - int multiplier; - struct timespec t; -- int resume_latency = dev_pm_qos_read_value(device); -+ int resume_latency = dev_pm_qos_raw_read_value(device); - - if (data->needs_update) { - menu_update(drv, dev); -diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h -index 5281e7f..1d8b629 100644 ---- a/include/linux/pm_qos.h -+++ b/include/linux/pm_qos.h -@@ -217,6 +217,11 @@ static inline s32 dev_pm_qos_requested_flags(struct device *dev) - { - return dev->power.qos->flags_req->data.flr.flags; - } -+static inline s32 dev_pm_qos_raw_read_value(struct device *dev) -+{ -+ return IS_ERR_OR_NULL(dev->power.qos) ? -+ 0 : pm_qos_read_value(&dev->power.qos->latency); -+} - #else - static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) - { return 0; } -@@ -236,6 +241,7 @@ static inline void dev_pm_qos_hide_latency_tolerance(struct device *dev) {} - - static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return 0; } - static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; } -+static inline s32 dev_pm_qos_raw_read_value(struct device *dev) { return 0; } - #endif - - #endif --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch b/kernel/kernel-rt/centos/patches/cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch deleted file mode 100644 index c066990bd..000000000 --- a/kernel/kernel-rt/centos/patches/cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch +++ /dev/null @@ -1,71 +0,0 @@ -From f5020c58583d04f0c6f8df1cbbd7d2e747fcb537 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Alex Shi -Date: Thu, 12 Jan 2017 21:27:04 +0800 -Subject: [PATCH 22/32] cpuidle/menu: add per CPU PM QoS resume latency - consideration - -[ commit 9908859acaa95640d4a07991a93f7cd5bfc18e02 from linux-stable ] - -There may be special requirements on CPU response time, like if -a interrupt is pinned to a CPU, that CPU should not go into excessively deep -idle states. For this reason, add a mechanism for adding PM QoS resume -latency constraints for individual CPUs and modify the menu governor to take -them into account. - -To that end, extend the device PM QoS pm_qos_resume_latency attribute -to CPUs, which is possible, because the exit latency for CPUs is -effectively equivalent to the resume latency for devices. - -Signed-off-by: Alex Shi -Acked-by: Rik van Riel -[ rjw : Subject & changelog ] -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Alex Kozyrev - -Signed-off-by: Jim Somerville ---- - drivers/cpuidle/governors/menu.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c -index eb9fb0e..fe2dcb8 100644 ---- a/drivers/cpuidle/governors/menu.c -+++ b/drivers/cpuidle/governors/menu.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - - #define BUCKETS 12 -@@ -259,10 +260,12 @@ again: - static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) - { - struct menu_device *data = &__get_cpu_var(menu_devices); -+ struct device *device = get_cpu_device(dev->cpu); - int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); - int i; - int multiplier; - struct timespec t; -+ int resume_latency = dev_pm_qos_read_value(device); - - if (data->needs_update) { - menu_update(drv, dev); -@@ -271,6 +274,10 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) - - data->exit_us = 0; - -+ /* resume_latency is 0 means no restriction */ -+ if (resume_latency && resume_latency < latency_req) -+ latency_req = resume_latency; -+ - /* Special case when user has set very strict latency requirement */ - if (unlikely(latency_req == 0)) - return 0; --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch b/kernel/kernel-rt/centos/patches/cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch deleted file mode 100644 index bd3bb72ce..000000000 --- a/kernel/kernel-rt/centos/patches/cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 9218064183a57581be8b7b980ce4b8ac9821555b Mon Sep 17 00:00:00 2001 -Message-Id: <9218064183a57581be8b7b980ce4b8ac9821555b.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Alex Shi -Date: Thu, 12 Jan 2017 21:27:02 +0800 -Subject: [PATCH 21/32] cpuidle/menu: stop seeking deeper idle if current state - is deep enough - -[ commit 8e37e1a2a3295f5d99e6dbe99eca24eca7a034ef from linux-stable ] - -Obsolete commit 71abbbf856a0 (cpuidle: extend cpuidle and menu -governor to handle dynamic states) wanted to introduce dynamic C-states, but -that idea was dropped long ago. The nonsense deeper C-state checking -remained, though. - -Since both target_residency and exit_latency are longer for deeper -idle state, there's no need to waste CPU time on useless checks. - -Signed-off-by: Alex Shi -Acked-by: Rik van Riel -[ rjw: Subject & changelog ] -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Alex Kozyrev - -Signed-off-by: Jim Somerville ---- - drivers/cpuidle/governors/menu.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c -index c99fee9..eb9fb0e 100644 ---- a/drivers/cpuidle/governors/menu.c -+++ b/drivers/cpuidle/governors/menu.c -@@ -323,11 +323,11 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) - if (s->disabled || su->disable) - continue; - if (s->target_residency > data->predicted_us) -- continue; -+ break; - if (s->exit_latency > latency_req) -- continue; -+ break; - if (s->exit_latency * multiplier > data->predicted_us) -- continue; -+ break; - - data->last_state_idx = i; - data->exit_us = s->exit_latency; --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/cpupower.config b/kernel/kernel-rt/centos/patches/cpupower.config deleted file mode 100644 index 8629a4a3e..000000000 --- a/kernel/kernel-rt/centos/patches/cpupower.config +++ /dev/null @@ -1,3 +0,0 @@ -# See 'cpupower help' and cpupower(1) for more info -CPUPOWER_START_OPTS="frequency-set -g performance" -CPUPOWER_STOP_OPTS="frequency-set -g ondemand" diff --git a/kernel/kernel-rt/centos/patches/cpupower.service b/kernel/kernel-rt/centos/patches/cpupower.service deleted file mode 100644 index 5f10ab7ee..000000000 --- a/kernel/kernel-rt/centos/patches/cpupower.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Configure CPU power related settings -After=syslog.target - -[Service] -Type=oneshot -RemainAfterExit=yes -EnvironmentFile=/etc/sysconfig/cpupower -ExecStart=/usr/bin/cpupower $CPUPOWER_START_OPTS -ExecStop=/usr/bin/cpupower $CPUPOWER_STOP_OPTS - -[Install] -WantedBy=multi-user.target diff --git a/kernel/kernel-rt/centos/patches/debrand-rh-i686-cpu.patch b/kernel/kernel-rt/centos/patches/debrand-rh-i686-cpu.patch deleted file mode 100644 index 930fdb7ca..000000000 --- a/kernel/kernel-rt/centos/patches/debrand-rh-i686-cpu.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 7d1684c010cbbc13b80056d53932ef62d280dc3f Mon Sep 17 00:00:00 2001 -Message-Id: <7d1684c010cbbc13b80056d53932ef62d280dc3f.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Jim Somerville -Date: Tue, 3 Apr 2018 18:07:37 -0400 -Subject: [PATCH 03/32] debrand rh i686 cpu - -Signed-off-by: Jim Somerville ---- - arch/x86/boot/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c -index 0d12b19..99dcb04 100644 ---- a/arch/x86/boot/main.c -+++ b/arch/x86/boot/main.c -@@ -147,7 +147,7 @@ void main(void) - - /* Make sure we have all the proper CPU support */ - if (validate_cpu()) { -- puts("This processor is unsupported in RHEL7.\n"); -+ puts("This processor is unsupported in CentOS 7.\n"); - die(); - } - --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/debrand-rh_taint.patch b/kernel/kernel-rt/centos/patches/debrand-rh_taint.patch deleted file mode 100644 index e86a6b9e0..000000000 --- a/kernel/kernel-rt/centos/patches/debrand-rh_taint.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 71f6d30a1acd723dfbb721fb690efb082d9fc2e0 Mon Sep 17 00:00:00 2001 -Message-Id: <71f6d30a1acd723dfbb721fb690efb082d9fc2e0.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Jim Perrin -Date: Thu, 19 Jun 2014 10:05:12 -0500 -Subject: [PATCH 02/32] debrand rh_taint - -Signed-off-by: Jim Somerville ---- - kernel/rh_taint.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/rh_taint.c b/kernel/rh_taint.c -index 22f0324..28c369f 100644 ---- a/kernel/rh_taint.c -+++ b/kernel/rh_taint.c -@@ -24,7 +24,7 @@ - void mark_hardware_unsupported(const char *msg) - { - /* Print one single message */ -- pr_crit("Warning: %s - this hardware has not undergone testing by Red Hat and might not be certified. Please consult https://hardware.redhat.com for certified hardware.\n", msg); -+ pr_crit("Warning: %s - this hardware has not undergone upstream testing. Please consult http://wiki.centos.org/FAQ for more information\n", msg); - } - EXPORT_SYMBOL(mark_hardware_unsupported); - --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/debrand-single-cpu.patch b/kernel/kernel-rt/centos/patches/debrand-single-cpu.patch deleted file mode 100644 index 80c7d71fd..000000000 --- a/kernel/kernel-rt/centos/patches/debrand-single-cpu.patch +++ /dev/null @@ -1,27 +0,0 @@ -From c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jim Perrin -Date: Thu, 19 Jun 2014 09:53:13 -0500 -Subject: [PATCH 01/32] debrand single cpu - -Signed-off-by: Jim Somerville ---- - arch/x86/kernel/setup.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index f27ca00..9eca4ac 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -964,7 +964,7 @@ static void rh_check_supported(void) - if (((boot_cpu_data.x86_max_cores * smp_num_siblings) == 1) && - !guest && !is_kdump_kernel()) { - pr_crit("Detected single cpu native boot.\n"); -- pr_crit("Important: In Red Hat Enterprise Linux 7, single threaded, single CPU 64-bit physical systems are unsupported by Red Hat. Please contact your Red Hat support representative for a list of certified and supported systems."); -+ pr_crit("Important: In CentOS 7, single threaded, single CPU 64-bit physical systems are unsupported. Please see http://wiki.centos.org/FAQ for more information"); - } - - /* The RHEL7 kernel does not support this hardware. The kernel will --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/dpt_i2o-fix-build-warning.patch b/kernel/kernel-rt/centos/patches/dpt_i2o-fix-build-warning.patch deleted file mode 100644 index ac1b75227..000000000 --- a/kernel/kernel-rt/centos/patches/dpt_i2o-fix-build-warning.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 143c2720aaa898f6e4cd53598808ff1230c33cd8 Mon Sep 17 00:00:00 2001 -Message-Id: <143c2720aaa898f6e4cd53598808ff1230c33cd8.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Sudip Mukherjee -Date: Thu, 18 Feb 2016 13:59:13 +0530 -Subject: [PATCH 30/32] dpt_i2o: fix build warning - -We were getting build warning about: -drivers/scsi/dpt_i2o.c:183:29: warning: 'dptids' defined but not used - -dptids[] is only used in the MODULE_DEVICE_TABLE so when MODULE is not -defined then dptids[] becomes unused. - -Signed-off-by: Sudip Mukherjee -Reviewed-by: Johannes Thumshirn -Signed-off-by: Martin K. Petersen -Signed-off-by: Jim Somerville ---- - drivers/scsi/dpt_i2o.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c -index 2bce881..cb62223 100644 ---- a/drivers/scsi/dpt_i2o.c -+++ b/drivers/scsi/dpt_i2o.c -@@ -180,11 +180,14 @@ static u8 adpt_read_blink_led(adpt_hba* host) - *============================================================================ - */ - -+#ifdef MODULE - static struct pci_device_id dptids[] = { - { PCI_DPT_VENDOR_ID, PCI_DPT_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, - { PCI_DPT_VENDOR_ID, PCI_DPT_RAPTOR_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, - { 0, } - }; -+#endif -+ - MODULE_DEVICE_TABLE(pci,dptids); - - static int adpt_detect(struct scsi_host_template* sht) --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/epoll-fix-use-after-free-in-eventpoll_release_file.patch b/kernel/kernel-rt/centos/patches/epoll-fix-use-after-free-in-eventpoll_release_file.patch deleted file mode 100644 index ddfd114b2..000000000 --- a/kernel/kernel-rt/centos/patches/epoll-fix-use-after-free-in-eventpoll_release_file.patch +++ /dev/null @@ -1,52 +0,0 @@ -From ebe06187bf2aec10d537ce4595e416035367d703 Mon Sep 17 00:00:00 2001 -From: Konstantin Khlebnikov -Date: Tue, 17 Jun 2014 06:58:05 +0400 -Subject: [PATCH] epoll: fix use-after-free in eventpoll_release_file - -This fixes use-after-free of epi->fllink.next inside list loop macro. -This loop actually releases elements in the body. The list is -rcu-protected but here we cannot hold rcu_read_lock because we need to -lock mutex inside. - -The obvious solution is to use list_for_each_entry_safe(). RCU-ness -isn't essential because nobody can change this list under us, it's final -fput for this file. - -The bug was introduced by ae10b2b4eb01 ("epoll: optimize EPOLL_CTL_DEL -using rcu") - -Signed-off-by: Konstantin Khlebnikov -Reported-by: Cyrill Gorcunov -Cc: Stable # 3.13+ -Cc: Sasha Levin -Cc: Jason Baron -Signed-off-by: Linus Torvalds ---- - fs/eventpoll.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/fs/eventpoll.c b/fs/eventpoll.c -index b73e062..b10b48c 100644 ---- a/fs/eventpoll.c -+++ b/fs/eventpoll.c -@@ -910,7 +910,7 @@ static const struct file_operations eventpoll_fops = { - void eventpoll_release_file(struct file *file) - { - struct eventpoll *ep; -- struct epitem *epi; -+ struct epitem *epi, *next; - - /* - * We don't want to get "file->f_lock" because it is not -@@ -926,7 +926,7 @@ void eventpoll_release_file(struct file *file) - * Besides, ep_remove() acquires the lock, so we can't hold it here. - */ - mutex_lock(&epmutex); -- list_for_each_entry_rcu(epi, &file->f_ep_links, fllink) { -+ list_for_each_entry_safe(epi, next, &file->f_ep_links, fllink) { - ep = epi->ep; - mutex_lock_nested(&ep->mtx, 0); - ep_remove(ep, epi); --- -2.7.4 - diff --git a/kernel/kernel-rt/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch b/kernel/kernel-rt/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch deleted file mode 100644 index e940109cb..000000000 --- a/kernel/kernel-rt/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch +++ /dev/null @@ -1,66 +0,0 @@ -From c48d3f2683c28939b3c11bdfa67e4446cd11beee Mon Sep 17 00:00:00 2001 -From: "Martin, Chen" -Date: Mon, 14 Jan 2019 17:59:03 +0000 -Subject: [PATCH] fix CentOS 7.6 upgrade compile error - -1, fix improper call of part_round_stats and part_inc_in_flight -in drbd_req.c, as CONFIG_BLK_DEV_DRBD=m defined in -kernel-3.10.0-x86_64.config.tis_extra - -2, add explicit declaration for trace_bpf_int_jit_compile, -trace_bpf_jit_compile, trace_bpf_jit_free, if pmd_read_atomic not -defined - -Signed-off-by: Martin, Chen ---- - drivers/block/drbd/drbd_req.c | 8 ++++---- - include/linux/filter.h | 3 +++ - 2 files changed, 7 insertions(+), 4 deletions(-) - -diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c -index a6f13f7..cbd0a49 100644 ---- a/drivers/block/drbd/drbd_req.c -+++ b/drivers/block/drbd/drbd_req.c -@@ -39,12 +39,12 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req - const int rw = bio_data_dir(req->master_bio); - int cpu; - cpu = part_stat_lock(); -- part_round_stats(cpu, &mdev->vdisk->part0); -+ part_round_stats(mdev->rq_queue, cpu, &mdev->vdisk->part0); - part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]); - part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], req->i.size >> 9); - (void) cpu; /* The macro invocations above want the cpu argument, I do not like - the compiler warning about cpu only assigned but never used... */ -- part_inc_in_flight(&mdev->vdisk->part0, rw); -+ part_inc_in_flight(mdev->rq_queue, &mdev->vdisk->part0, rw); - part_stat_unlock(); - } - -@@ -56,8 +56,8 @@ static void _drbd_end_io_acct(struct drbd_conf *mdev, struct drbd_request *req) - int cpu; - cpu = part_stat_lock(); - part_stat_add(cpu, &mdev->vdisk->part0, ticks[rw], duration); -- part_round_stats(cpu, &mdev->vdisk->part0); -- part_dec_in_flight(&mdev->vdisk->part0, rw); -+ part_round_stats(mdev->rq_queue, cpu, &mdev->vdisk->part0); -+ part_dec_in_flight(mdev->rq_queue, &mdev->vdisk->part0, rw); - part_stat_unlock(); - } - -diff --git a/include/linux/filter.h b/include/linux/filter.h -index cddbb31..15ce55f 100644 ---- a/include/linux/filter.h -+++ b/include/linux/filter.h -@@ -763,6 +763,9 @@ void bpf_prog_kallsyms_add(struct bpf_prog *fp); - void bpf_prog_kallsyms_del(struct bpf_prog *fp); - - #else /* CONFIG_BPF_JIT */ -+struct bpf_prog * __weak trace_bpf_int_jit_compile(struct bpf_prog *prog); -+void __weak trace_bpf_jit_compile(struct bpf_prog *prog); -+void __weak trace_bpf_jit_free(struct bpf_prog *fp); - - static inline bool bpf_prog_ebpf_jited(const struct bpf_prog *fp) - { --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/fix-compilation-issues.patch b/kernel/kernel-rt/centos/patches/fix-compilation-issues.patch deleted file mode 100644 index 11b15ce36..000000000 --- a/kernel/kernel-rt/centos/patches/fix-compilation-issues.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 8b830ee6b0abaae23ca437b0f37e640f9b64582a Mon Sep 17 00:00:00 2001 -Message-Id: <8b830ee6b0abaae23ca437b0f37e640f9b64582a.1528231742.git.Jim.Somerville@windriver.com> -From: Jim Somerville -Date: Wed, 30 May 2018 13:06:58 -0400 -Subject: [PATCH 1/1] fix compilation issues - -Signed-off-by: Jim Somerville ---- - drivers/base/dma-contiguous.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c -index a7d5bda..403101d 100644 ---- a/drivers/base/dma-contiguous.c -+++ b/drivers/base/dma-contiguous.c -@@ -309,7 +309,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, - if (align > CONFIG_CMA_ALIGNMENT) - align = CONFIG_CMA_ALIGNMENT; - -- pr_debug("%s(cma %p, count %d, align %d)\n", __func__, (void *)cma, -+ pr_debug("%s(cma %p, count %zu, align %d)\n", __func__, (void *)cma, - count, align); - - if (!count) --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch b/kernel/kernel-rt/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch deleted file mode 100644 index 8458f5748..000000000 --- a/kernel/kernel-rt/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 02f7bfe8cb36d7903bd7904b05071a2c91bc02a1 Mon Sep 17 00:00:00 2001 -Message-Id: <02f7bfe8cb36d7903bd7904b05071a2c91bc02a1.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Matt Peters -Date: Mon, 30 May 2016 10:51:02 -0400 -Subject: [PATCH 08/32] intel-iommu: allow ignoring Ethernet device RMRR with - IOMMU passthrough - -Some BIOS's are reporting DMAR RMRR entries for Ethernet devices -which is causing problems when PCI passthrough is enabled. These -devices should be able to use the static identity map since the -host should not be enforcing specific address ranges when IOMMU -passthrough is enabled. - -Originally-by: Matt Peters -[PG: Added bootarg wrapper and documentation entries.] -Signed-off-by: Paul Gortmaker -Signed-off-by: Nam Ninh - -Signed-off-by: Nam Ninh -Signed-off-by: Jim Somerville ---- - Documentation/Intel-IOMMU.txt | 18 ++++++++++++++++++ - Documentation/kernel-parameters.txt | 5 +++++ - drivers/iommu/intel-iommu.c | 19 +++++++++++++++++++ - 3 files changed, 42 insertions(+) - -diff --git a/Documentation/Intel-IOMMU.txt b/Documentation/Intel-IOMMU.txt -index cf9431d..1dcc349 100644 ---- a/Documentation/Intel-IOMMU.txt -+++ b/Documentation/Intel-IOMMU.txt -@@ -32,6 +32,24 @@ regions will fail. Hence BIOS uses RMRR to specify these regions along with - devices that need to access these regions. OS is expected to setup - unity mappings for these regions for these devices to access these regions. - -+RMRR for other devices? -+----------------------- -+ -+There are reports of BIOS out there that indicate RMRR regions for things -+like ethernet devices. As per mainline commit c875d2c1b8083 ("iommu/vt-d: -+ Exclude devices using RMRRs from IOMMU API domains") such a device is -+"fundamentally incompatible" with the IOMMU API and "we must prevent such -+devices from being used by the IOMMU API." However, in the event that -+the RMRR indicated by the BIOS is assumed to be just a reporting error, -+there is an additional iommu boot arg that can be used to ignore RMRR -+settings for ethernet, i.e. "intel_iommu=on,eth_no_rmrr iommu=pt". -+Note that iommu=pt is required in order to eth_no_rmrr to have effect. -+ -+If you use this setting, you should consult with your hardware vendor to -+confirm that it is just a reporting error, and that it truly is not -+actively using any DMA to/from RMRR, as otherwise system instability -+may result. -+ - How is IOVA generated? - --------------------- - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 685554b..0ca635a 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -1318,6 +1318,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - than 32-bit addressing. The default is to look - for translation below 32-bit and if not available - then look in the higher range. -+ eth_no_rmrr [Default Off] -+ With this option provided, the kernel will ignore -+ any specified RMRR regions specified by the BIOS -+ for PCI ethernet devices. Confirm with your hardware -+ vendor the RMRR regions are indeed invalid first. - strict [Default Off] - With this option on every unmap_single operation will - result in a hardware IOTLB flush operation as opposed -diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c -index 05b0971..d6f4723 100644 ---- a/drivers/iommu/intel-iommu.c -+++ b/drivers/iommu/intel-iommu.c -@@ -480,6 +480,7 @@ static int dmar_forcedac; - static int intel_iommu_strict; - static int intel_iommu_superpage = 1; - static int intel_iommu_ecs = 1; -+static int intel_iommu_ethrmrr = 1; - - /* We only actually use ECS when PASID support (on the new bit 40) - * is also advertised. Some early implementations — the ones with -@@ -539,6 +540,15 @@ static int __init intel_iommu_setup(char *str) - } else if (!strncmp(str, "forcedac", 8)) { - pr_info("Forcing DAC for PCI devices\n"); - dmar_forcedac = 1; -+ } else if (!strncmp(str, "eth_no_rmrr", 11)) { -+ if (!iommu_pass_through) { -+ printk(KERN_WARNING -+ "Intel-IOMMU: error - eth_no_rmrr requires iommu=pt\n"); -+ } else { -+ printk(KERN_INFO -+ "Intel-IOMMU: ignoring ethernet RMRR values\n"); -+ intel_iommu_ethrmrr = 0; -+ } - } else if (!strncmp(str, "strict", 6)) { - pr_info("Disable batched IOTLB flush\n"); - intel_iommu_strict = 1; -@@ -2820,6 +2830,15 @@ static bool device_is_rmrr_locked(struct device *dev) - - if (IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev)) - return false; -+ /* As a temporary workaround for issues seen on ProLiant DL380p, -+ * allow the operator to ignore the RMRR settings for ethernet -+ * devices. Ideally the end user should contact their vendor -+ * regarding why there are RMRR, as per mainline c875d2c1b8083 -+ * ("iommu/vt-d: Exclude devices using RMRRs from IOMMU API domains") -+ * it seems that these make no sense at all. -+ */ -+ if ((pdev->class >> 8) == PCI_CLASS_NETWORK_ETHERNET && !intel_iommu_ethrmrr) -+ return false; - } - - return true; --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch b/kernel/kernel-rt/centos/patches/ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch deleted file mode 100644 index 63d1c4854..000000000 --- a/kernel/kernel-rt/centos/patches/ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch +++ /dev/null @@ -1,57 +0,0 @@ -From fdb837fb87ff4907436dfab16709b64d6c3488fd Mon Sep 17 00:00:00 2001 -Message-Id: -From: Tommi Rantala -Date: Thu, 7 May 2015 15:12:21 +0300 -Subject: [PATCH 1/3] ipvs: fix memory leak in ip_vs_ctl.c - -[ commit f30bf2a5cac6c60ab366c4bc6db913597bf4d6ab in Linus' repo ] - -Fix memory leak introduced in commit a0840e2e165a ("IPVS: netns, -ip_vs_ctl local vars moved to ipvs struct."): - -unreferenced object 0xffff88005785b800 (size 2048): - comm "(-localed)", pid 1434, jiffies 4294755650 (age 1421.089s) - hex dump (first 32 bytes): - bb 89 0b 83 ff ff ff ff b0 78 f0 4e 00 88 ff ff .........x.N.... - 04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00 ................ - backtrace: - [] kmemleak_alloc+0x4e/0xb0 - [] __kmalloc_track_caller+0x244/0x430 - [] kmemdup+0x20/0x50 - [] ip_vs_control_net_init+0x1f7/0x510 - [] __ip_vs_init+0x100/0x250 - [] ops_init+0x41/0x190 - [] setup_net+0x93/0x150 - [] copy_net_ns+0x82/0x140 - [] create_new_namespaces+0xfd/0x190 - [] unshare_nsproxy_namespaces+0x5a/0xc0 - [] SyS_unshare+0x173/0x310 - [] system_call_fastpath+0x12/0x6f - [] 0xffffffffffffffff - -Fixes: a0840e2e165a ("IPVS: netns, ip_vs_ctl local vars moved to ipvs struct.") -Signed-off-by: Tommi Rantala -Acked-by: Julian Anastasov -Signed-off-by: Simon Horman -Signed-off-by: Jim Somerville ---- - net/netfilter/ipvs/ip_vs_ctl.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c -index 02409f3..3738b84 100644 ---- a/net/netfilter/ipvs/ip_vs_ctl.c -+++ b/net/netfilter/ipvs/ip_vs_ctl.c -@@ -3843,6 +3843,9 @@ static void __net_exit ip_vs_control_net_cleanup_sysctl(struct net *net) - cancel_delayed_work_sync(&ipvs->defense_work); - cancel_work_sync(&ipvs->defense_work.work); - unregister_net_sysctl_table(ipvs->sysctl_hdr); -+ -+ if (!net_eq(net, &init_net)) -+ kfree(ipvs->sysctl_tbl); - } - - #else --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt-debug.config.tis_extra b/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt-debug.config.tis_extra deleted file mode 100644 index d6ec97cac..000000000 --- a/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt-debug.config.tis_extra +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_SIGEXIT=y -CONFIG_DMA_CMA=y -CONFIG_CMA_SIZE_MBYTES=16 -CONFIG_CMA_SIZE_SEL_MBYTES=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 diff --git a/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt-trace.config.tis_extra b/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt-trace.config.tis_extra deleted file mode 100644 index d6ec97cac..000000000 --- a/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt-trace.config.tis_extra +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_SIGEXIT=y -CONFIG_DMA_CMA=y -CONFIG_CMA_SIZE_MBYTES=16 -CONFIG_CMA_SIZE_SEL_MBYTES=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 diff --git a/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt.config.tis_extra b/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt.config.tis_extra deleted file mode 100644 index eade7c017..000000000 --- a/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt.config.tis_extra +++ /dev/null @@ -1,965 +0,0 @@ -# Add builtin -CONFIG_MAXSMP=n -CONFIG_NR_CPUS=256 -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_SR=y -CONFIG_SCSI_SAS_ATTRS=y -CONFIG_ISCSI_TCP=y -# SCSI Related Drivers -# Let's enable lots of them, pretty much anything RAID capable -CONFIG_ATA=y -CONFIG_SCSI_SAS_LIBSAS=y -CONFIG_SCSI_SAS_ATA=y -CONFIG_BLK_DEV_3W_XXXX_RAID=y -CONFIG_SCSI_3W_9XXX=y -CONFIG_SCSI_3W_SAS=y -CONFIG_SCSI_AACRAID=y -CONFIG_SCSI_DPT_I2O=y -CONFIG_SCSI_ARCMSR=y -CONFIG_SCSI_HPTIOP=y -CONFIG_SCSI_GDTH=y -CONFIG_SCSI_IPS=y -CONFIG_SCSI_STEX=y -CONFIG_SCSI_PMCRAID=y -CONFIG_SCSI_HPSA=y -CONFIG_MEGARAID_SAS=y -CONFIG_SCSI_SMARTPQI=y -# These two will only build as modules -CONFIG_SCSI_MPT2SAS=m -CONFIG_SCSI_MPT3SAS=m -CONFIG_SCSI_VIRTIO=y -CONFIG_FUSION_SAS=y -CONFIG_SCSI_AIC94XX=y -CONFIG_SCSI_MVSAS=y -# -CONFIG_SOFT_WATCHDOG=y -CONFIG_VIRTIO=y -CONFIG_VIRTIO_PCI=y -CONFIG_VIRTIO_MMIO=y -CONFIG_ISO9660_FS=y -CONFIG_VFAT_FS=y -CONFIG_NLS_ISO8859_1=y -#CONFIG_MCORE2=y -CONFIG_SIGEXIT=y -CONFIG_SCHEDSTATS=y - -# Enable runtime Huge TLB support -CONFIG_DMA_CMA=y -CONFIG_CMA_SIZE_MBYTES=16 -CONFIG_CMA_SIZE_SEL_MBYTES=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 - -# Turn on Intel IOMMU -CONFIG_INTEL_IOMMU_DEFAULT_ON=y - -# Turn off network drivers that we want -# to build out-of-tree -CONFIG_I40E=n -CONFIG_I40EVF=n -CONFIG_IXGB=n -CONFIG_IXGBE=n -CONFIG_IXGBEVF=n -CONFIG_MLX4_EN=n -CONFIG_MLX4_CORE=n -CONFIG_MLX5_EN=n -CONFIG_MLX5_CORE=n - -# Turn off TPM drivers that we want -# to build out-of-tree. This will -# disable the TPM HW-RandomNUmberGenerator(RNG) -# and TrustedKeys modules as well, since -# they require the in-kernel TPM driver. -# Both these modules will also need to be -# built out-of-tree when needed. -CONFIG_TCG_TPM=n -CONFIG_TCG_TIS=n -CONFIG_HW_RANDOM_TPM=n -CONFIG_TRUSTED_KEYS=n -CONFIG_TCG_TIS_I2C_ATMEL=n -CONFIG_TCG_TIS_I2C_INFINEON=n -CONFIG_TCG_TIS_I2C_NUVOTON=n -CONFIG_TCG_NSC=n -CONFIG_TCG_ATMEL=n -CONFIG_TCG_INFINEON=n -CONFIG_TCG_CRB=n -CONFIG_TCG_TIS_ST33ZP24=n -CONFIG_TCG_TIS_ST33ZP24_I2C=n - -# Also disable TPM Integrity Measurement Architecture -# (IMA), as this will be built out of tree but ensure -# that all their dependencies (that comes from the base kernel) -# that are marked as "select" within the Integrity / IMA -# Kconfigs are still enabled -CONFIG_INTEGRITY=n -CONFIG_IMA=n -CONFIG_EVM=n -CONFIG_SIGNATURE=y -CONFIG_KEYS=y -CONFIG_ASYMMETRIC_KEY_TYPE=y -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y -CONFIG_PUBLIC_KEY_ALGO_RSA=y -CONFIG_X509_CERTIFICATE_PARSER=y -CONFIG_SECURITYFS=y -CONFIG_CRYPTO=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_SHA1=y - -#Enable Intel RDT -CONFIG_KERNFS=y -CONFIG_INTEL_RDT_A=y - -#Enable PTP clock support -CONFIG_PPS=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PTP_1588_CLOCK_PCH=y -CONFIG_PTP_1588_CLOCK_KVM=y -CONFIG_DP83640_PHY=y - -# Remove unneeded stuff (including stuff exposed -# by saying y to new options above. -CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=n -CONFIG_PANIC_ON_OOPS=n -CONFIG_SOUND=n -CONFIG_FIREWIRE=n -CONFIG_KPROBES=n -CONFIG_XEN=n -CONFIG_BT=n -CONFIG_INTEL_MEI=n -CONFIG_USB_USBNET=n -CONFIG_RTL8187=n -CONFIG_MWL8K=n -CONFIG_CFG80211=n -CONFIG_WAN=n -CONFIG_ISDN=n -CONFIG_INPUT_TOUCHSCREEN=n -CONFIG_SSB=n -CONFIG_BCMA=n -CONFIG_MEDIA_SUPPORT=n -CONFIG_ACPI_PROCESSOR_AGGREGATOR=n -CONFIG_ACPI_EXTLOG=n -CONFIG_NET_FOU=n -CONFIG_NET_FOU_IP_TUNNELS=n -CONFIG_GENEVE=n -CONFIG_IPV6_VTI=n -CONFIG_NETFILTER_XT_TARGET_TPROXY=n -CONFIG_NETFILTER_XT_MATCH_CGROUP=n -CONFIG_NETFILTER_XT_MATCH_SOCKET=n -CONFIG_NET_SCH_FQ=n -CONFIG_NET_CLS_BPF=n -CONFIG_BLK_DEV_NULL_BLK=n -CONFIG_GENWQE=n -CONFIG_CXL_BASE=n -CONFIG_DM_ERA=n -CONFIG_DM_RAID=n -CONFIG_DM_SWITCH=n -CONFIG_NLMON=n -CONFIG_FM10K=n -CONFIG_CRASH=n -CONFIG_IPMI_SSIF=n -CONFIG_POWERCAP=n -CONFIG_DRM_BOCHS=n -CONFIG_HID_RMI=n -CONFIG_NET_DMA_RH_KABI=n -CONFIG_HP_WIRELESS=n -CONFIG_NFSD_V4_SECURITY_LABEL=n -CONFIG_DEBUG_SHIRQ=n -CONFIG_PERSISTENT_KEYRINGS=n -CONFIG_BIG_KEYS=n -CONFIG_SECURITY_SECURELEVEL=n -CONFIG_CRYPTO_MCRYPTD=n -CONFIG_CRYPTO_SHA1_MB=n -CONFIG_CRYPTO_DRBG_MENU=n -CONFIG_CRYPTO_DEV_QAT=n -CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=n -CONFIG_CRYPTO_DEV_QAT_DH895xCC=n -CONFIG_CRYPTO_DEV_QAT_C3XXX=n -CONFIG_CRYPTO_DEV_QAT_C62X=n -CONFIG_CRYPTO_DEV_QAT_C3XXXVF=n -CONFIG_CRYPTO_DEV_QAT_C62XVF=n -CONFIG_BPF_JIT=n -CONFIG_PARPORT=n -CONFIG_CDROM_PKTCDVD=n -CONFIG_SENSORS_LIS3LV02D=n -CONFIG_SGI_IOC4=n -CONFIG_TIFM_CORE=n -CONFIG_ENCLOSURE_SERVICES=n -CONFIG_APDS9802ALS=n -CONFIG_ISL29003=n -CONFIG_ISL29020=n -CONFIG_SENSORS_TSL2550=n -CONFIG_SENSORS_BH1770=n -CONFIG_SENSORS_APDS990X=n -CONFIG_PCH_PHUB=n -CONFIG_EEPROM_AT24=n -CONFIG_EEPROM_MAX6875=n -CONFIG_EEPROM_93CX6=n -CONFIG_CB710_CORE=n -CONFIG_SENSORS_LIS3_I2C=n -CONFIG_ALTERA_STAPL=n -CONFIG_VMWARE_VMCI=n -CONFIG_CHR_DEV_ST=n -CONFIG_CHR_DEV_OSST=n -CONFIG_CHR_DEV_SG=n -CONFIG_CHR_DEV_SCH=n -CONFIG_SCSI_CONSTANTS=n -CONFIG_SCSI_LOGGING=n -CONFIG_SCSI_CXGB3_ISCSI=n -CONFIG_SCSI_CXGB4_ISCSI=n -CONFIG_SCSI_AIC79XX=n -CONFIG_SCSI_MVUMI=n -CONFIG_SCSI_MPT2SAS_LOGGING=n -CONFIG_SCSI_MPT3SAS_LOGGING=n -CONFIG_SCSI_UFSHCD=n -CONFIG_VMWARE_PVSCSI=n -CONFIG_FCOE=n -CONFIG_FCOE_FNIC=n -CONFIG_SCSI_INITIO=n -CONFIG_SCSI_PM8001=n -CONFIG_SCSI_SRP=n -CONFIG_SATA_ACARD_AHCI=n -CONFIG_SATA_SIL24=n -CONFIG_PDC_ADMA=n -CONFIG_SATA_QSTOR=n -CONFIG_SATA_SX4=n -CONFIG_SATA_MV=n -CONFIG_SATA_NV=n -CONFIG_SATA_PROMISE=n -CONFIG_SATA_SIL=n -CONFIG_SATA_SIS=n -CONFIG_SATA_SVW=n -CONFIG_SATA_ULI=n -CONFIG_SATA_VIA=n -CONFIG_SATA_VITESSE=n -CONFIG_PATA_ALI=n -CONFIG_PATA_AMD=n -CONFIG_PATA_ARASAN_CF=n -CONFIG_PATA_ARTOP=n -CONFIG_PATA_ATIIXP=n -CONFIG_PATA_ATP867X=n -CONFIG_PATA_CMD64X=n -CONFIG_PATA_CS5536=n -CONFIG_PATA_HPT366=n -CONFIG_PATA_HPT37X=n -CONFIG_PATA_HPT3X2N=n -CONFIG_PATA_HPT3X3=n -CONFIG_PATA_IT8213=n -CONFIG_PATA_IT821X=n -CONFIG_PATA_JMICRON=n -CONFIG_PATA_MARVELL=n -CONFIG_PATA_NETCELL=n -CONFIG_PATA_NINJA32=n -CONFIG_PATA_OLDPIIX=n -CONFIG_PATA_PDC2027X=n -CONFIG_PATA_PDC_OLD=n -CONFIG_PATA_RDC=n -CONFIG_PATA_SCH=n -CONFIG_PATA_SERVERWORKS=n -CONFIG_PATA_SIL680=n -CONFIG_PATA_SIS=n -CONFIG_PATA_TOSHIBA=n -CONFIG_PATA_VIA=n -CONFIG_DM_DEBUG=n -CONFIG_MACINTOSH_DRIVERS=n -CONFIG_NET_FC=n -CONFIG_NET_TEAM=n -CONFIG_ATL2=n -CONFIG_ATL1=n -CONFIG_ATL1E=n -CONFIG_ATL1C=n -CONFIG_ALX=n -CONFIG_ARM_AT91_ETHER=n -CONFIG_MACB=n -CONFIG_B44=n -CONFIG_BNA=n -CONFIG_NET_CALXEDA_XGMAC=n -CONFIG_CHELSIO_T3=n -CONFIG_CHELSIO_T4=n -CONFIG_CHELSIO_T4VF=n -CONFIG_NET_TULIP=n -CONFIG_IP1000=n -CONFIG_JME=n -CONFIG_MVMDIO=n -CONFIG_SKGE=n -CONFIG_SKY2=n -CONFIG_MYRI10GE=n -CONFIG_PCH_GBE=n -CONFIG_ETHOC=n -CONFIG_QLCNIC=n -CONFIG_QLGE=n -CONFIG_NETXEN_NIC=n -CONFIG_SFC=n -CONFIG_EPIC100=n -CONFIG_SMSC9420=n -CONFIG_AT803X_PHY=n -CONFIG_DAVICOM_PHY=n -CONFIG_QSEMI_PHY=n -CONFIG_LXT_PHY=n -CONFIG_CICADA_PHY=n -CONFIG_VITESSE_PHY=n -CONFIG_SMSC_PHY=n -CONFIG_BCM87XX_PHY=n -CONFIG_ICPLUS_PHY=n -CONFIG_REALTEK_PHY=n -CONFIG_NATIONAL_PHY=n -CONFIG_STE10XP=n -CONFIG_LSI_ET1011C_PHY=n -CONFIG_MICREL_PHY=n -CONFIG_MDIO_BITBANG=n -CONFIG_RT_GROUP_SCHED=n -CONFIG_OPROFILE=n -CONFIG_SYSTEM_BLACKLIST_KEYRING=n -CONFIG_OSF_PARTITION=n -CONFIG_AMIGA_PARTITION=n -CONFIG_MAC_PARTITION=n -CONFIG_BSD_DISKLABEL=n -CONFIG_MINIX_SUBPARTITION=n -CONFIG_SOLARIS_X86_PARTITION=n -CONFIG_UNIXWARE_DISKLABEL=n -CONFIG_SGI_PARTITION=n -CONFIG_SUN_PARTITION=n -CONFIG_KARMA_PARTITION=n -CONFIG_X86_UV=n -CONFIG_I8K=n -CONFIG_MICROCODE_AMD=n -CONFIG_MICROCODE_AMD_EARLY=n -CONFIG_MOVABLE_NODE=n -CONFIG_MEMORY_HOTPLUG=n -CONFIG_BOOTPARAM_HOTPLUG_CPU0=n -CONFIG_X86_POWERNOW_K8=n -CONFIG_X86_AMD_FREQ_SENSITIVITY=n -CONFIG_X86_P4_CLOCKMOD=n -CONFIG_PCIE_ECRC=n -CONFIG_PCIEAER_INJECT=n -CONFIG_PCCARD=n -CONFIG_HOTPLUG_PCI_ACPI_IBM=n -CONFIG_HOTPLUG_PCI_SHPC=n -CONFIG_XFRM_STATISTICS=n -CONFIG_IP_FIB_TRIE_STATS=n -CONFIG_PPP_MPPE=n -CONFIG_USB_CATC=n -CONFIG_USB_KAWETH=n -CONFIG_USB_PEGASUS=n -CONFIG_USB_RTL8150=n -CONFIG_USB_RTL8152=n -CONFIG_USB_HSO=n -CONFIG_USB_IPHETH=n -CONFIG_INPUT_FF_MEMLESS=n -CONFIG_INPUT_POLLDEV=n -CONFIG_INPUT_SPARSEKMAP=n -CONFIG_MOUSE_PS2_ELANTECH=n -CONFIG_MOUSE_PS2_SENTELIC=n -CONFIG_MOUSE_APPLETOUCH=n -CONFIG_MOUSE_BCM5974=n -CONFIG_MOUSE_CYAPA=n -CONFIG_MOUSE_VSXXXAA=n -CONFIG_MOUSE_SYNAPTICS_I2C=n -CONFIG_MOUSE_SYNAPTICS_USB=n -CONFIG_INPUT_TABLET=n -CONFIG_INPUT_PCSPKR=n -CONFIG_INPUT_APANEL=n -CONFIG_INPUT_ATLAS_BTNS=n -CONFIG_INPUT_ATI_REMOTE2=n -CONFIG_INPUT_KEYSPAN_REMOTE=n -CONFIG_INPUT_POWERMATE=n -CONFIG_INPUT_YEALINK=n -CONFIG_INPUT_CM109=n -CONFIG_INPUT_UINPUT=n -CONFIG_SERIO_ALTERA_PS2=n -CONFIG_SERIO_ARC_PS2=n -CONFIG_NOZOMI=n -CONFIG_N_GSM=n -CONFIG_SERIAL_JSM=n -CONFIG_SERIAL_ARC=n -CONFIG_HANGCHECK_TIMER=n -CONFIG_TELCLOCK=n -CONFIG_I2C_AMD756=n -CONFIG_I2C_AMD8111=n -CONFIG_I2C_PIIX4=n -CONFIG_I2C_NFORCE2=n -CONFIG_I2C_SIS96X=n -CONFIG_I2C_VIA=n -CONFIG_I2C_VIAPRO=n -CONFIG_I2C_PCA_PLATFORM=n -CONFIG_I2C_SIMTEC=n -CONFIG_I2C_DIOLAN_U2C=n -CONFIG_I2C_PARPORT_LIGHT=n -CONFIG_PPS_CLIENT_LDISC=n -CONFIG_PPS_CLIENT_GPIO=n -CONFIG_CHARGER_SMB347=n -CONFIG_SENSORS_ABITUGURU=n -CONFIG_SENSORS_ABITUGURU3=n -CONFIG_SENSORS_AD7414=n -CONFIG_SENSORS_AD7418=n -CONFIG_SENSORS_ADM1021=n -CONFIG_SENSORS_ADM1025=n -CONFIG_SENSORS_ADM1026=n -CONFIG_SENSORS_ADM1029=n -CONFIG_SENSORS_ADM1031=n -CONFIG_SENSORS_ADM9240=n -CONFIG_SENSORS_ADT7410=n -CONFIG_SENSORS_ADT7411=n -CONFIG_SENSORS_ADT7462=n -CONFIG_SENSORS_ADT7470=n -CONFIG_SENSORS_ADT7475=n -CONFIG_SENSORS_ASC7621=n -CONFIG_SENSORS_K8TEMP=n -CONFIG_SENSORS_K10TEMP=n -CONFIG_SENSORS_FAM15H_POWER=n -CONFIG_SENSORS_ASB100=n -CONFIG_SENSORS_ATXP1=n -CONFIG_SENSORS_DS620=n -CONFIG_SENSORS_DS1621=n -CONFIG_SENSORS_I5K_AMB=n -CONFIG_SENSORS_F71805F=n -CONFIG_SENSORS_F71882FG=n -CONFIG_SENSORS_F75375S=n -CONFIG_SENSORS_FSCHMD=n -CONFIG_SENSORS_G760A=n -CONFIG_SENSORS_GL518SM=n -CONFIG_SENSORS_GL520SM=n -CONFIG_SENSORS_IBMAEM=n -CONFIG_SENSORS_IBMPEX=n -CONFIG_SENSORS_IT87=n -CONFIG_SENSORS_LINEAGE=n -CONFIG_SENSORS_LM63=n -CONFIG_SENSORS_LM73=n -CONFIG_SENSORS_LM75=n -CONFIG_SENSORS_LM77=n -CONFIG_SENSORS_LM78=n -CONFIG_SENSORS_LM80=n -CONFIG_SENSORS_LM83=n -CONFIG_SENSORS_LM85=n -CONFIG_SENSORS_LM87=n -CONFIG_SENSORS_LM90=n -CONFIG_SENSORS_LM92=n -CONFIG_SENSORS_LM93=n -CONFIG_SENSORS_LTC4151=n -CONFIG_SENSORS_LTC4215=n -CONFIG_SENSORS_LTC4245=n -CONFIG_SENSORS_LTC4261=n -CONFIG_SENSORS_LM95234=n -CONFIG_SENSORS_LM95241=n -CONFIG_SENSORS_LM95245=n -CONFIG_SENSORS_MAX16065=n -CONFIG_SENSORS_MAX1619=n -CONFIG_SENSORS_MAX1668=n -CONFIG_SENSORS_MAX197=n -CONFIG_SENSORS_MAX6639=n -CONFIG_SENSORS_MAX6642=n -CONFIG_SENSORS_MAX6650=n -CONFIG_SENSORS_MAX6697=n -CONFIG_SENSORS_MCP3021=n -CONFIG_SENSORS_NCT6775=n -CONFIG_SENSORS_NTC_THERMISTOR=n -CONFIG_SENSORS_PC87360=n -CONFIG_SENSORS_PC87427=n -CONFIG_SENSORS_PCF8591=n -CONFIG_SENSORS_PMBUS=n -CONFIG_SENSORS_ADM1275=n -CONFIG_SENSORS_LM25066=n -CONFIG_SENSORS_LTC2978=n -CONFIG_SENSORS_MAX16064=n -CONFIG_SENSORS_MAX34440=n -CONFIG_SENSORS_MAX8688=n -CONFIG_SENSORS_UCD9000=n -CONFIG_SENSORS_UCD9200=n -CONFIG_SENSORS_ZL6100=n -CONFIG_SENSORS_SHT21=n -CONFIG_SENSORS_SIS5595=n -CONFIG_SENSORS_DME1737=n -CONFIG_SENSORS_EMC1403=n -CONFIG_SENSORS_EMC6W201=n -CONFIG_SENSORS_SMSC47M1=n -CONFIG_SENSORS_SMSC47M192=n -CONFIG_SENSORS_SMSC47B397=n -CONFIG_SENSORS_SCH56XX_COMMON=n -CONFIG_SENSORS_SCH5627=n -CONFIG_SENSORS_SCH5636=n -CONFIG_SENSORS_ADS1015=n -CONFIG_SENSORS_ADS7828=n -CONFIG_SENSORS_AMC6821=n -CONFIG_SENSORS_INA209=n -CONFIG_SENSORS_INA2XX=n -CONFIG_SENSORS_THMC50=n -CONFIG_SENSORS_TMP102=n -CONFIG_SENSORS_TMP401=n -CONFIG_SENSORS_TMP421=n -CONFIG_SENSORS_VIA_CPUTEMP=n -CONFIG_SENSORS_VIA686A=n -CONFIG_SENSORS_VT1211=n -CONFIG_SENSORS_VT8231=n -CONFIG_SENSORS_W83781D=n -CONFIG_SENSORS_W83791D=n -CONFIG_SENSORS_W83792D=n -CONFIG_SENSORS_W83793=n -CONFIG_SENSORS_W83795=n -CONFIG_SENSORS_W83L785TS=n -CONFIG_SENSORS_W83L786NG=n -CONFIG_SENSORS_W83627HF=n -CONFIG_SENSORS_W83627EHF=n -CONFIG_SENSORS_APPLESMC=n -CONFIG_SENSORS_ATK0110=n -CONFIG_ALIM1535_WDT=n -CONFIG_ALIM7101_WDT=n -CONFIG_F71808E_WDT=n -CONFIG_SP5100_TCO=n -CONFIG_SBC_FITPC2_WATCHDOG=n -CONFIG_IB700_WDT=n -CONFIG_IBMASR=n -CONFIG_IT8712F_WDT=n -CONFIG_IT87_WDT=n -CONFIG_NV_TCO=n -CONFIG_SMSC_SCH311X_WDT=n -CONFIG_VIA_WDT=n -CONFIG_W83627HF_WDT=n -CONFIG_W83697HF_WDT=n -CONFIG_W83697UG_WDT=n -CONFIG_W83877F_WDT=n -CONFIG_W83977F_WDT=n -CONFIG_MACHZ_WDT=n -CONFIG_PCIPCWATCHDOG=n -CONFIG_WDTPCI=n -CONFIG_USBPCWATCHDOG=n -CONFIG_MFD_VIPERBOARD=n -CONFIG_MFD_SM501=n -CONFIG_MFD_VX855=n -CONFIG_AGP_AMD64=n -CONFIG_AGP_SIS=n -CONFIG_AGP_VIA=n -CONFIG_VGA_SWITCHEROO=n -CONFIG_DRM_LOAD_EDID_FIRMWARE=n -CONFIG_DRM_I2C_CH7006=n -CONFIG_DRM_I2C_SIL164=n -CONFIG_DRM_I2C_NXP_TDA998X=n -CONFIG_DRM_RADEON=n -CONFIG_DRM_NOUVEAU=n -CONFIG_DRM_VMWGFX=n -CONFIG_DRM_GMA500=n -CONFIG_DRM_GMA600=n -CONFIG_DRM_GMA3600=n -CONFIG_DRM_UDL=n -CONFIG_DRM_AST=n -CONFIG_DRM_MGAG200=n -CONFIG_DRM_CIRRUS_QEMU=n -CONFIG_DRM_QXL=n -CONFIG_FB_SYS_FILLRECT=n -CONFIG_FB_SYS_COPYAREA=n -CONFIG_FB_SYS_IMAGEBLIT=n -CONFIG_FB_SYS_FOPS=n -CONFIG_FB_BACKLIGHT=n -CONFIG_LCD_PLATFORM=n -CONFIG_BACKLIGHT_APPLE=n -CONFIG_BACKLIGHT_LP855X=n -CONFIG_VGACON_SOFT_SCROLLBACK=n -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=n -CONFIG_LOGO=n -CONFIG_HID_BATTERY_STRENGTH=n -CONFIG_HIDRAW=n -CONFIG_UHID=n -CONFIG_HID_ACRUX=n -CONFIG_HID_APPLEIR=n -CONFIG_HID_AUREAL=n -CONFIG_HID_DRAGONRISE=n -CONFIG_HID_ELECOM=n -CONFIG_HID_HOLTEK=n -CONFIG_HID_KEYTOUCH=n -CONFIG_HID_KYE=n -CONFIG_HID_UCLOGIC=n -CONFIG_HID_WALTOP=n -CONFIG_HID_GYRATION=n -CONFIG_HID_ICADE=n -CONFIG_HID_TWINHAN=n -CONFIG_HID_LCPOWER=n -CONFIG_HID_LENOVO_TPKBD=n -CONFIG_HID_MAGICMOUSE=n -CONFIG_HID_NTRIG=n -CONFIG_HID_ORTEK=n -CONFIG_HID_PANTHERLORD=n -CONFIG_HID_PETALYNX=n -CONFIG_HID_PICOLCD=n -CONFIG_HID_PRIMAX=n -CONFIG_HID_PS3REMOTE=n -CONFIG_HID_ROCCAT=n -CONFIG_HID_SAITEK=n -CONFIG_HID_SAMSUNG=n -CONFIG_HID_SONY=n -CONFIG_HID_SPEEDLINK=n -CONFIG_HID_STEELSERIES=n -CONFIG_HID_SUNPLUS=n -CONFIG_HID_GREENASIA=n -CONFIG_HID_SMARTJOYPLUS=n -CONFIG_HID_TIVO=n -CONFIG_HID_TOPSEED=n -CONFIG_HID_THINGM=n -CONFIG_HID_THRUSTMASTER=n -CONFIG_HID_WACOM=n -CONFIG_HID_WIIMOTE=n -CONFIG_HID_ZEROPLUS=n -CONFIG_HID_ZYDACRON=n -CONFIG_HID_PID=n -CONFIG_USB_HIDDEV=n -CONFIG_USB_ANNOUNCE_NEW_DEVICES=n -CONFIG_USB_MON=n -CONFIG_USB_WUSB_CBAF=n -CONFIG_USB_OHCI_HCD=n -CONFIG_USB_ACM=n -CONFIG_USB_PRINTER=n -CONFIG_USB_WDM=n -CONFIG_USB_TMC=n -CONFIG_USB_STORAGE_REALTEK=n -CONFIG_USB_STORAGE_DATAFAB=n -CONFIG_USB_STORAGE_FREECOM=n -CONFIG_USB_STORAGE_ISD200=n -CONFIG_USB_STORAGE_USBAT=n -CONFIG_USB_STORAGE_SDDR09=n -CONFIG_USB_STORAGE_SDDR55=n -CONFIG_USB_STORAGE_JUMPSHOT=n -CONFIG_USB_STORAGE_ALAUDA=n -CONFIG_USB_STORAGE_ONETOUCH=n -CONFIG_USB_STORAGE_KARMA=n -CONFIG_USB_STORAGE_CYPRESS_ATACB=n -CONFIG_USB_STORAGE_ENE_UB6250=n -CONFIG_USB_MDC800=n -CONFIG_USB_MICROTEK=n -CONFIG_USB_SERIAL_AIRCABLE=n -CONFIG_USB_SERIAL_ARK3116=n -CONFIG_USB_SERIAL_BELKIN=n -CONFIG_USB_SERIAL_WHITEHEAT=n -CONFIG_USB_SERIAL_DIGI_ACCELEPORT=n -CONFIG_USB_SERIAL_CYPRESS_M8=n -CONFIG_USB_SERIAL_EMPEG=n -CONFIG_USB_SERIAL_VISOR=n -CONFIG_USB_SERIAL_IPAQ=n -CONFIG_USB_SERIAL_IR=n -CONFIG_USB_SERIAL_EDGEPORT=n -CONFIG_USB_SERIAL_EDGEPORT_TI=n -CONFIG_USB_SERIAL_GARMIN=n -CONFIG_USB_SERIAL_IPW=n -CONFIG_USB_SERIAL_IUU=n -CONFIG_USB_SERIAL_KEYSPAN_PDA=n -CONFIG_USB_SERIAL_KEYSPAN=n -CONFIG_USB_SERIAL_KLSI=n -CONFIG_USB_SERIAL_KOBIL_SCT=n -CONFIG_USB_SERIAL_MCT_U232=n -CONFIG_USB_SERIAL_MOS7720=n -CONFIG_USB_SERIAL_MOS7840=n -CONFIG_USB_SERIAL_NAVMAN=n -CONFIG_USB_SERIAL_OTI6858=n -CONFIG_USB_SERIAL_QCAUX=n -CONFIG_USB_SERIAL_QUALCOMM=n -CONFIG_USB_SERIAL_SPCP8X5=n -CONFIG_USB_SERIAL_SAFE=n -CONFIG_USB_SERIAL_SIERRAWIRELESS=n -CONFIG_USB_SERIAL_SYMBOL=n -CONFIG_USB_SERIAL_TI=n -CONFIG_USB_SERIAL_CYBERJACK=n -CONFIG_USB_SERIAL_XIRCOM=n -CONFIG_USB_SERIAL_OPTION=n -CONFIG_USB_SERIAL_OMNINET=n -CONFIG_USB_SERIAL_OPTICON=n -CONFIG_USB_SERIAL_XSENS_MT=n -CONFIG_USB_SERIAL_SSU100=n -CONFIG_USB_SERIAL_QT2=n -CONFIG_USB_SERIAL_DEBUG=n -CONFIG_USB_EMI62=n -CONFIG_USB_EMI26=n -CONFIG_USB_ADUTUX=n -CONFIG_USB_SEVSEG=n -CONFIG_USB_LEGOTOWER=n -CONFIG_USB_LCD=n -CONFIG_USB_LED=n -CONFIG_USB_IDMOUSE=n -CONFIG_USB_FTDI_ELAN=n -CONFIG_USB_APPLEDISPLAY=n -CONFIG_USB_SISUSBVGA=n -CONFIG_USB_LD=n -CONFIG_USB_IOWARRIOR=n -CONFIG_USB_ISIGHTFW=n -CONFIG_USB_EZUSB_FX2=n -CONFIG_USB_HSIC_USB3503=n -CONFIG_USB_ATM=n -CONFIG_UWB=n -CONFIG_MMC_RICOH_MMC=n -CONFIG_MMC_TIFM_SD=n -CONFIG_MMC_CB710=n -CONFIG_MMC_VIA_SDMMC=n -CONFIG_MMC_VUB300=n -CONFIG_MMC_USHC=n -CONFIG_MEMSTICK=n -CONFIG_LEDS_LM3530=n -CONFIG_LEDS_LP3944=n -CONFIG_LEDS_LP5521=n -CONFIG_LEDS_LP5523=n -CONFIG_LEDS_LP5562=n -CONFIG_LEDS_CLEVO_MAIL=n -CONFIG_LEDS_INTEL_SS4200=n -CONFIG_LEDS_BLINKM=n -CONFIG_LEDS_TRIGGER_TIMER=n -CONFIG_LEDS_TRIGGER_ONESHOT=n -CONFIG_LEDS_TRIGGER_HEARTBEAT=n -CONFIG_LEDS_TRIGGER_BACKLIGHT=n -CONFIG_LEDS_TRIGGER_TRANSIENT=n -CONFIG_LEDS_TRIGGER_CAMERA=n -CONFIG_INFINIBAND=n -CONFIG_EDAC=n -CONFIG_UIO_CIF=n -CONFIG_UIO_AEC=n -CONFIG_UIO_SERCOS3=n -CONFIG_STAGING=n -CONFIG_ACERHDF=n -CONFIG_ASUS_LAPTOP=n -CONFIG_CHROMEOS_LAPTOP=n -CONFIG_FUJITSU_LAPTOP=n -CONFIG_FUJITSU_TABLET=n -CONFIG_AMILO_RFKILL=n -CONFIG_HP_ACCEL=n -CONFIG_MSI_LAPTOP=n -CONFIG_PANASONIC_LAPTOP=n -CONFIG_COMPAL_LAPTOP=n -CONFIG_SONY_LAPTOP=n -CONFIG_IDEAPAD_LAPTOP=n -CONFIG_THINKPAD_ACPI=n -CONFIG_SENSORS_HDAPS=n -CONFIG_EEEPC_LAPTOP=n -CONFIG_ACPI_WMI=n -CONFIG_TOPSTAR_LAPTOP=n -CONFIG_TOSHIBA_BT_RFKILL=n -CONFIG_ACPI_CMPC=n -CONFIG_SAMSUNG_LAPTOP=n -CONFIG_INTEL_OAKTRAIL=n -CONFIG_SAMSUNG_Q10=n -CONFIG_APPLE_GMUX=n -CONFIG_PVPANIC=n -CONFIG_EDD=n -CONFIG_DELL_RBU=n -CONFIG_DCDBAS=n -CONFIG_JBD_DEBUG=n -CONFIG_FANOTIFY=n -CONFIG_JOLIET=n -CONFIG_UDF_FS=n -CONFIG_CRAMFS=n -CONFIG_SQUASHFS=n -CONFIG_EFIVAR_FS=n -CONFIG_SUNRPC_DEBUG=n -CONFIG_NLS_MAC_ROMAN=n -CONFIG_NLS_MAC_CELTIC=n -CONFIG_NLS_MAC_CENTEURO=n -CONFIG_NLS_MAC_CROATIAN=n -CONFIG_NLS_MAC_CYRILLIC=n -CONFIG_NLS_MAC_GAELIC=n -CONFIG_NLS_MAC_GREEK=n -CONFIG_NLS_MAC_ICELAND=n -CONFIG_NLS_MAC_INUIT=n -CONFIG_NLS_MAC_ROMANIAN=n -CONFIG_NLS_MAC_TURKISH=n -CONFIG_SCHED_TRACER=n -CONFIG_TRACER_SNAPSHOT=n -CONFIG_UPROBE_EVENT=n -CONFIG_PROBE_EVENTS=n -CONFIG_FUNCTION_PROFILER=n -CONFIG_RING_BUFFER_BENCHMARK=n -CONFIG_ATOMIC64_SELFTEST=n -CONFIG_ASYNC_RAID6_TEST=n -CONFIG_KGDB=n -CONFIG_TEST_KSTRTOX=n -CONFIG_STRICT_DEVMEM=n -CONFIG_DEBUG_SET_MODULE_RONX=n -CONFIG_DEBUG_NX_TEST=n -CONFIG_CRYPTO_BLOWFISH_X86_64=n -CONFIG_CRYPTO_CAMELLIA_X86_64=n -CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=n -CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=n -CONFIG_CRYPTO_CAST5_AVX_X86_64=n -CONFIG_CRYPTO_CAST6_AVX_X86_64=n -CONFIG_CRYPTO_SALSA20=n -CONFIG_CRYPTO_SALSA20_X86_64=n -CONFIG_CRYPTO_SERPENT_SSE2_X86_64=n -CONFIG_CRYPTO_SERPENT_AVX_X86_64=n -CONFIG_CRYPTO_SERPENT_AVX2_X86_64=n -CONFIG_CRYPTO_TWOFISH_X86_64=n -CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=n -CONFIG_CRYPTO_TWOFISH_AVX_X86_64=n -CONFIG_CRYPTO_USER_API_HASH=n -CONFIG_CRYPTO_USER_API_SKCIPHER=n -CONFIG_CRYPTO_DEV_PADLOCK=n - -#Disable unused options from rt kernel -CONFIG_WIRELESS_EXT=n -CONFIG_DLCI=n -CONFIG_IPPP_FILTER=n -CONFIG_HISAX_EURO=n -CONFIG_DE_AOC=n -CONFIG_HISAX_NO_SENDCOMPLETE=n -CONFIG_HISAX_NO_LLC=n -CONFIG_HISAX_NO_KEYPAD=n -CONFIG_HISAX_1TR6=n -CONFIG_HISAX_NI1=n -CONFIG_HISAX_16_3=n -CONFIG_HISAX_TELESPCI=n -CONFIG_HISAX_S0BOX=n -CONFIG_HISAX_FRITZPCI=n -CONFIG_HISAX_AVM_A1_PCMCIA=n -CONFIG_HISAX_ELSA=n -CONFIG_HISAX_DIEHLDIVA=n -CONFIG_HISAX_SEDLBAUER=n -CONFIG_HISAX_NETJET=n -CONFIG_HISAX_NETJET_U=n -CONFIG_HISAX_NICCY=n -CONFIG_HISAX_BKM_A4T=n -CONFIG_HISAX_SCT_QUADRO=n -CONFIG_HISAX_GAZEL=n -CONFIG_HISAX_HFC_PCI=n -CONFIG_HISAX_W6692=n -CONFIG_HISAX_HFC_SX=n -CONFIG_HISAX_ENTERNOW_PCI=n -CONFIG_HISAX_ST5481=n -CONFIG_HISAX_HFC4S8S=n -CONFIG_HISAX_FRITZ_PCIPNP=n -CONFIG_CAPI_AVM=n -CONFIG_GIGASET_CAPI=n -CONFIG_GIGASET_BASE=n -CONFIG_GIGASET_M105=n -CONFIG_GIGASET_M101=n -CONFIG_HYSDN=n -CONFIG_HYSDN_CAPI=n -CONFIG_MISDN=n -CONFIG_MISDN_DSP=n -CONFIG_MISDN_L1OIP=n -CONFIG_MISDN_HFCPCI=n -CONFIG_MISDN_HFCMULTI=n -CONFIG_MISDN_HFCUSB=n -CONFIG_MISDN_AVMFRITZ=n -CONFIG_MISDN_SPEEDFAX=n -CONFIG_MISDN_INFINEON=n -CONFIG_MISDN_W6692=n -CONFIG_MISDN_NETJET=n -CONFIG_MISDN_IPAC=n -CONFIG_MISDN_ISAR=n -CONFIG_MEDIA_CAMERA_SUPPORT=n -CONFIG_MEDIA_ANALOG_TV_SUPPORT=n -CONFIG_MEDIA_DIGITAL_TV_SUPPORT=n -CONFIG_MEDIA_RADIO_SUPPORT=n -CONFIG_MEDIA_RC_SUPPORT=n -CONFIG_VIDEO_DEV=n -CONFIG_VIDEO_V4L2=n -CONFIG_VIDEO_TUNER=n -CONFIG_VIDEOBUF_GEN=n -CONFIG_VIDEOBUF_DMA_SG=n -CONFIG_VIDEOBUF_VMALLOC=n -CONFIG_VIDEOBUF_DVB=n -CONFIG_VIDEOBUF2_CORE=n -CONFIG_VIDEOBUF2_MEMOPS=n -CONFIG_VIDEOBUF2_VMALLOC=n -CONFIG_DVB=n -CONFIG_DVB_CORE=n -CONFIG_DVB_NET=n -CONFIG_TTPCI_EEPROM=n -CONFIG_DVB_DYNAMIC_MINORS=n -CONFIG_RC_CORE=n -CONFIG_RC_MAP=n -CONFIG_RC_DECODERS=n -CONFIG_LIRC=n -CONFIG_IR_LIRC_CODEC=n -CONFIG_IR_NEC_DECODER=n -CONFIG_IR_RC5_DECODER=n -CONFIG_IR_RC6_DECODER=n -CONFIG_IR_JVC_DECODER=n -CONFIG_IR_SONY_DECODER=n -CONFIG_IR_RC5_SZ_DECODER=n -CONFIG_IR_SANYO_DECODER=n -CONFIG_IR_MCE_KBD_DECODER=n -CONFIG_RC_DEVICES=n -CONFIG_RC_ATI_REMOTE=n -CONFIG_IR_ENE=n -CONFIG_IR_IMON=n -CONFIG_IR_MCEUSB=n -CONFIG_IR_ITE_CIR=n -CONFIG_IR_FINTEK=n -CONFIG_IR_NUVOTON=n -CONFIG_IR_REDRAT3=n -CONFIG_IR_STREAMZAP=n -CONFIG_IR_WINBOND_CIR=n -CONFIG_IR_IGUANA=n -CONFIG_IR_TTUSBIR=n -CONFIG_VIDEO_EM28XX=n -CONFIG_VIDEO_EM28XX_ALSA=n -CONFIG_VIDEO_EM28XX_DVB=n -CONFIG_VIDEO_EM28XX_RC=n -CONFIG_MEDIA_PCI_SUPPORT=n -CONFIG_VIDEO_IVTV=n -CONFIG_VIDEO_FB_IVTV=n -CONFIG_VIDEO_CX18=n -CONFIG_VIDEO_CX18_ALSA=n -CONFIG_VIDEO_CX23885=n -CONFIG_MEDIA_ALTERA_CI=n -CONFIG_VIDEO_CX88=n -CONFIG_VIDEO_CX88_ALSA=n -CONFIG_VIDEO_CX88_BLACKBIRD=n -CONFIG_VIDEO_CX88_DVB=n -CONFIG_VIDEO_CX88_VP3054=n -CONFIG_VIDEO_CX88_MPEG=n -CONFIG_VIDEO_BT848=n -CONFIG_VIDEO_SAA7134=n -CONFIG_VIDEO_SAA7134_ALSA=n -CONFIG_VIDEO_SAA7134_RC=n -CONFIG_VIDEO_SAA7134_DVB=n -CONFIG_VIDEO_SAA7164=n -CONFIG_MANTIS_CORE=n -CONFIG_SMS_SDIO_DRV=n -CONFIG_MEDIA_COMMON_OPTIONS=n -CONFIG_VIDEO_CX2341X=n -CONFIG_VIDEO_BTCX=n -CONFIG_VIDEO_TVEEPROM=n -CONFIG_CYPRESS_FIRMWARE=n -CONFIG_VIDEO_SAA7146=n -CONFIG_VIDEO_SAA7146_VV=n -CONFIG_SMS_SIANO_MDTV=n -CONFIG_SMS_SIANO_RC=n -CONFIG_MEDIA_SUBDRV_AUTOSELECT=n -CONFIG_MEDIA_ATTACH=n -CONFIG_VIDEO_IR_I2C=n -CONFIG_VIDEO_TVAUDIO=n -CONFIG_VIDEO_TDA7432=n -CONFIG_VIDEO_MSP3400=n -CONFIG_VIDEO_CS5345=n -CONFIG_VIDEO_CS53L32A=n -CONFIG_VIDEO_WM8775=n -CONFIG_VIDEO_WM8739=n -CONFIG_VIDEO_VP27SMPX=n -CONFIG_VIDEO_SAA6588=n -CONFIG_VIDEO_SAA711X=n -CONFIG_VIDEO_TVP5150=n -CONFIG_VIDEO_SAA717X=n -CONFIG_VIDEO_CX25840=n -CONFIG_VIDEO_SAA7127=n -CONFIG_VIDEO_MT9V011=n -CONFIG_VIDEO_UPD64031A=n -CONFIG_VIDEO_UPD64083=n -CONFIG_VIDEO_M52790=n -CONFIG_MEDIA_TUNER=n -CONFIG_SND=n -CONFIG_IR_GPIO_CIR=n -CONFIG_BLK_DEV_NBD=m -CONFIG_AIC94XX_DEBUG=n -CONFIG_GPIO_BT8XX=n - -# Disable transparent huge pages -CONFIG_TRANSPARENT_HUGEPAGE=n -CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=n - -# Make performance default governor -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=n -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y - -CONFIG_TORTURE_TEST=n -CONFIG_RCU_TORTURE_TEST=n -CONFIG_LOCK_TORTURE_TEST=n - -# Disable kernel memory accounting, which is broken -CONFIG_MEMCG_KMEM=n - -# Needed for opae fpga kernel module -# as it turns on hidden option REGMAP_MMIO -CONFIG_MFD_SYSCON=y diff --git a/kernel/kernel-rt/centos/patches/memblock-introduce-memblock_alloc_range.patch b/kernel/kernel-rt/centos/patches/memblock-introduce-memblock_alloc_range.patch deleted file mode 100644 index a30ef9e1e..000000000 --- a/kernel/kernel-rt/centos/patches/memblock-introduce-memblock_alloc_range.patch +++ /dev/null @@ -1,96 +0,0 @@ -From ea38fcef34645b2220eadad6c862d5884c48026d Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Akinobu Mita -Date: Tue, 31 May 2016 16:07:55 -0400 -Subject: [PATCH 10/32] memblock: introduce memblock_alloc_range() - -Commit 2bfc2862c4fe38379a2fb2cfba33fad32ccb4ff4 upstream -Backported-by: Nam Ninh - -This introduces memblock_alloc_range() which allocates memblock from the -specified range of physical address. I would like to use this function -to specify the location of CMA. - -Signed-off-by: Akinobu Mita -Cc: Marek Szyprowski -Cc: Konrad Rzeszutek Wilk -Cc: David Woodhouse -Cc: Don Dutile -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: Andi Kleen -Cc: Yinghai Lu -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Jim Somerville ---- - include/linux/memblock.h | 2 ++ - mm/memblock.c | 22 ++++++++++++++++++---- - 2 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/include/linux/memblock.h b/include/linux/memblock.h -index 5a439c9..d6bcbef 100644 ---- a/include/linux/memblock.h -+++ b/include/linux/memblock.h -@@ -306,6 +306,8 @@ static inline bool memblock_bottom_up(void) { return false; } - #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) - #define MEMBLOCK_ALLOC_ACCESSIBLE 0 - -+phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, -+ phys_addr_t start, phys_addr_t end); - phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align, - phys_addr_t max_addr); - phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, -diff --git a/mm/memblock.c b/mm/memblock.c -index fbc8071..ff910a4 100644 ---- a/mm/memblock.c -+++ b/mm/memblock.c -@@ -1120,9 +1120,9 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size, - } - #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ - --static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, -- phys_addr_t align, phys_addr_t max_addr, -- int nid, ulong flags) -+static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, -+ phys_addr_t align, phys_addr_t start, -+ phys_addr_t end, int nid, ulong flags) - { - phys_addr_t found; - -@@ -1132,7 +1132,7 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, - /* align @size to avoid excessive fragmentation on reserved array */ - size = round_up(size, align); - -- found = memblock_find_in_range_node(size, align, 0, max_addr, nid, -+ found = memblock_find_in_range_node(size, align, start, end, nid, - flags); - if (found && !memblock_reserve(found, size)) - return found; -@@ -1140,6 +1140,20 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, - return 0; - } - -+phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, -+ phys_addr_t start, phys_addr_t end) -+{ -+ ulong flags = choose_memblock_flags(); -+ return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE, flags); -+} -+ -+static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, -+ phys_addr_t align, phys_addr_t max_addr, -+ int nid, ulong flags) -+{ -+ return memblock_alloc_range_nid(size, align, 0, max_addr, nid, flags); -+} -+ - phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid) - { - ulong flags = choose_memblock_flags(); --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch b/kernel/kernel-rt/centos/patches/restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch deleted file mode 100644 index 6b5315def..000000000 --- a/kernel/kernel-rt/centos/patches/restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch +++ /dev/null @@ -1,47 +0,0 @@ -From d692cbb183b38e030c7c1221b67c9389bdeaf7f3 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Alex Kozyrev -Date: Fri, 16 Mar 2018 15:50:57 -0400 -Subject: [PATCH 32/32] restrict iSCSI kthreads to CPUs in cpu_kthread_mask - -Do not allow them to run on other CPUs to prevent interference with VMs. - -Signed-off-by: Alex Kozyrev -Signed-off-by: Jim Somerville ---- - drivers/target/iscsi/iscsi_target.c | 4 ++-- - include/linux/cpumask.h | 1 + - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c -index d8f587e..17b08b7 100644 ---- a/drivers/target/iscsi/iscsi_target.c -+++ b/drivers/target/iscsi/iscsi_target.c -@@ -3575,8 +3575,8 @@ void iscsit_thread_get_cpumask(struct iscsi_conn *conn) - * iSCSI connection's RX/TX threads will be scheduled to - * execute upon. - */ -- ord = conn->bitmap_id % cpumask_weight(cpu_online_mask); -- for_each_online_cpu(cpu) { -+ ord = conn->bitmap_id % cpumask_weight(cpu_kthread_mask); -+ for_each_kthread_cpu(cpu) { - if (ord-- == 0) { - cpumask_set_cpu(cpu, conn->conn_cpumask); - return; -diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h -index 46ae77a..42b6c63 100644 ---- a/include/linux/cpumask.h -+++ b/include/linux/cpumask.h -@@ -754,6 +754,7 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS); - #define for_each_possible_cpu(cpu) for_each_cpu((cpu), cpu_possible_mask) - #define for_each_online_cpu(cpu) for_each_cpu((cpu), cpu_online_mask) - #define for_each_present_cpu(cpu) for_each_cpu((cpu), cpu_present_mask) -+#define for_each_kthread_cpu(cpu) for_each_cpu((cpu), cpu_kthread_mask) - - /* Wrappers for arch boot code to manipulate normally-constant masks */ - void set_cpu_possible(unsigned int cpu, bool possible); --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch b/kernel/kernel-rt/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch deleted file mode 100644 index 812fe67b5..000000000 --- a/kernel/kernel-rt/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch +++ /dev/null @@ -1,67 +0,0 @@ -From a16765613c5cb9b6cb86bc92d21030be124b2dde Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Stanislav Kinsburskiy -Date: Fri, 9 Feb 2018 11:52:14 +0300 -Subject: [PATCH 2/3] rh/ext4: release leaked posix acl in ext4_acl_chmod - -[ commit b85d6be0b743a1768b8456d36b52960858fbaa67 in OpenVZ's vzkernel repo ] - -Note: only rh7-3.10.0-693.17.1.el7-based kernels are affected. -I.e. starting from rh7-3.10.0-693.17.1.vz7.43.1. - -Posix acl is used to convert of an extended attribute, provided by user to ext4 -attributes. In particular to i_mode in case of ACL_TYPE_ACCESS request. -IOW, this object is allocated, used for convertion, not stored anywhere and -must be freed. - -However posix_acl_update_mode() can zerofy the pointer to support -ext4_set_acl() logic, but then the object is leaked. So, fix it by releasing -new temporary pointer with the same value instead of acl pointer. - -In scope of https://jira.sw.ru/browse/PSBM-81384 - -RHEL bug URL: https://bugzilla.redhat.com/show_bug.cgi?id=1543020 - -Signed-off-by: Stanislav Kinsburskiy -Acked-by: Dmitry Monakhov -Signed-off-by: Jim Somerville ---- - fs/ext4/acl.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c -index 917e819..fce029f 100644 ---- a/fs/ext4/acl.c -+++ b/fs/ext4/acl.c -@@ -297,7 +297,7 @@ cleanup: - int - ext4_acl_chmod(struct inode *inode) - { -- struct posix_acl *acl; -+ struct posix_acl *acl, *real_acl; - handle_t *handle; - int retries = 0; - int error; -@@ -315,6 +315,8 @@ ext4_acl_chmod(struct inode *inode) - error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); - if (error) - return error; -+ -+ real_acl = acl; - retry: - handle = ext4_journal_start(inode, EXT4_HT_XATTR, - ext4_jbd2_credits_xattr(inode)); -@@ -341,7 +343,7 @@ out_stop: - ext4_should_retry_alloc(inode->i_sb, &retries)) - goto retry; - out: -- posix_acl_release(acl); -+ posix_acl_release(real_acl); - return error; - } - --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch b/kernel/kernel-rt/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch deleted file mode 100644 index 40a28df1e..000000000 --- a/kernel/kernel-rt/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 916c45d11310d03a4a76bd80a40f0c6a767ba39e Mon Sep 17 00:00:00 2001 -Message-Id: <916c45d11310d03a4a76bd80a40f0c6a767ba39e.1566590430.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Stanislav Kinsburskiy -Date: Fri, 9 Feb 2018 11:52:15 +0300 -Subject: [PATCH 3/3] rh/ext4: release leaked posix acl in ext4_xattr_set_acl - -[ commit b762d904ada70f239f1c2d2d70c4a64cd04c8ade in OpenVZ's vzkernel repo ] - -Note: only rh7-3.10.0-693.17.1.el7-based kernels are affcted. -I.e. starting from rh7-3.10.0-693.17.1.vz7.43.1. - -Posix acl is used to convert of an extended attribute, provided by user to ext4 -attributes. In particular to i_mode in case of ACL_TYPE_ACCESS request. - -IOW, this object is allocated, used for convertion, not stored anywhere and -must be freed. - -However posix_acl_update_mode() can zerofy the pointer to support -ext4_set_acl() logic, but then the object is leaked. So, fix it by releasing -new temporary pointer with the same value instead of acl pointer. - -https://jira.sw.ru/browse/PSBM-81384 - -RHEL bug URL: https://bugzilla.redhat.com/show_bug.cgi?id=1543020 - -v2: Added affected kernel version + RHEL bug URL - -Signed-off-by: Stanislav Kinsburskiy -Acked-by: Dmitry Monakhov -Signed-off-by: Jim Somerville ---- - fs/ext4/acl.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c -index fce029f..046b338 100644 ---- a/fs/ext4/acl.c -+++ b/fs/ext4/acl.c -@@ -405,7 +405,7 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, - { - struct inode *inode = dentry->d_inode; - handle_t *handle; -- struct posix_acl *acl; -+ struct posix_acl *acl, *real_acl; - int error, retries = 0; - int update_mode = 0; - umode_t mode = inode->i_mode; -@@ -418,7 +418,7 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, - return -EPERM; - - if (value) { -- acl = posix_acl_from_xattr(&init_user_ns, value, size); -+ acl = real_acl = posix_acl_from_xattr(&init_user_ns, value, size); - if (IS_ERR(acl)) - return PTR_ERR(acl); - else if (acl) { -@@ -427,7 +427,7 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, - goto release_and_out; - } - } else -- acl = NULL; -+ acl = real_acl = NULL; - - retry: - handle = ext4_journal_start(inode, EXT4_HT_XATTR, -@@ -454,7 +454,7 @@ out_stop: - goto retry; - - release_and_out: -- posix_acl_release(acl); -+ posix_acl_release(real_acl); - return error; - } - --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/robustify-CFS-bandwidth-timer-locking.patch b/kernel/kernel-rt/centos/patches/robustify-CFS-bandwidth-timer-locking.patch deleted file mode 100644 index 0c475c0fd..000000000 --- a/kernel/kernel-rt/centos/patches/robustify-CFS-bandwidth-timer-locking.patch +++ /dev/null @@ -1,167 +0,0 @@ -From c0ad4aa4d8416a39ad262a2bd68b30acd951bf0e Mon Sep 17 00:00:00 2001 -From: Peter Zijlstra -Date: Mon, 7 Jan 2019 13:52:31 +0100 -Subject: sched/fair: Robustify CFS-bandwidth timer locking - -Traditionally hrtimer callbacks were run with IRQs disabled, but with -the introduction of HRTIMER_MODE_SOFT it is possible they run from -SoftIRQ context, which does _NOT_ have IRQs disabled. - -Allow for the CFS bandwidth timers (period_timer and slack_timer) to -be ran from SoftIRQ context; this entails removing the assumption that -IRQs are already disabled from the locking. - -While mainline doesn't strictly need this, -RT forces all timers not -explicitly marked with MODE_HARD into MODE_SOFT and trips over this. -And marking these timers as MODE_HARD doesn't make sense as they're -not required for RT operation and can potentially be quite expensive. - -Reported-by: Tom Putzeys -Tested-by: Mike Galbraith -Signed-off-by: Peter Zijlstra (Intel) -Cc: Linus Torvalds -Cc: Peter Zijlstra -Cc: Sebastian Andrzej Siewior -Cc: Thomas Gleixner -Link: https://lkml.kernel.org/r/20190107125231.GE14122@hirez.programming.kicks-ass.net -Signed-off-by: Ingo Molnar -Signed-off-by: Alex Kozyrev - ---- - kernel/sched/fair.c | 33 ++++++++++++++++++--------------- - 1 file changed, 18 insertions(+), 15 deletions(-) - -diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index d3d746b..e9a8d95 100644 ---- a/kernel/sched/fair.c -+++ b/kernel/sched/fair.c -@@ -3490,13 +3490,14 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, - struct cfs_rq *cfs_rq; - u64 runtime; - u64 starting_runtime = remaining; -+ unsigned long flags; - - rcu_read_lock(); - list_for_each_entry_rcu(cfs_rq, &cfs_b->throttled_cfs_rq, - throttled_list) { - struct rq *rq = rq_of(cfs_rq); - -- raw_spin_lock(&rq->lock); -+ raw_spin_lock_irqsave(&rq->lock, flags); - if (!cfs_rq_throttled(cfs_rq)) - goto next; - -@@ -3513,7 +3514,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, - unthrottle_cfs_rq(cfs_rq); - - next: -- raw_spin_unlock(&rq->lock); -+ raw_spin_unlock_irqrestore(&rq->lock, flags); - - if (!remaining) - break; -@@ -3529,7 +3530,7 @@ next: - * period the timer is deactivated until scheduling resumes; cfs_b->idle is - * used to track this state. - */ --static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun) -+static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun, unsigned long flags) - { - u64 runtime, runtime_expires; - int throttled; -@@ -3578,11 +3579,11 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun) - while (throttled && cfs_b->runtime > 0 && !cfs_b->distribute_running) { - runtime = cfs_b->runtime; - cfs_b->distribute_running = 1; -- raw_spin_unlock(&cfs_b->lock); -+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags); - /* we can't nest cfs_b->lock while distributing bandwidth */ - runtime = distribute_cfs_runtime(cfs_b, runtime, - runtime_expires); -- raw_spin_lock(&cfs_b->lock); -+ raw_spin_lock_irqsave(&cfs_b->lock, flags); - - cfs_b->distribute_running = 0; - throttled = !list_empty(&cfs_b->throttled_cfs_rq); -@@ -3691,17 +3692,18 @@ static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq) - static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) - { - u64 runtime = 0, slice = sched_cfs_bandwidth_slice(); -+ unsigned long flags; - u64 expires; - - /* confirm we're still not at a refresh boundary */ -- raw_spin_lock(&cfs_b->lock); -+ raw_spin_lock_irqsave(&cfs_b->lock, flags); - if (cfs_b->distribute_running) { -- raw_spin_unlock(&cfs_b->lock); -+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags); - return; - } - - if (runtime_refresh_within(cfs_b, min_bandwidth_expiration)) { -- raw_spin_unlock(&cfs_b->lock); -+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags); - return; - } - -@@ -3712,18 +3714,18 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) - if (runtime) - cfs_b->distribute_running = 1; - -- raw_spin_unlock(&cfs_b->lock); -+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags); - - if (!runtime) - return; - - runtime = distribute_cfs_runtime(cfs_b, runtime, expires); - -- raw_spin_lock(&cfs_b->lock); -+ raw_spin_lock_irqsave(&cfs_b->lock, flags); - if (expires == cfs_b->runtime_expires) - cfs_b->runtime -= min(runtime, cfs_b->runtime); - cfs_b->distribute_running = 0; -- raw_spin_unlock(&cfs_b->lock); -+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags); - } - - /* -@@ -3787,7 +3789,7 @@ static void check_cfs_rq_runtime(struct cfs_rq *cfs_rq) - } - - static inline u64 default_cfs_period(void); --static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun); -+static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrunn, unsigned long flags); - static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b); - - static enum hrtimer_restart sched_cfs_slack_timer(struct hrtimer *timer) -@@ -3806,11 +3808,12 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) - struct cfs_bandwidth *cfs_b = - container_of(timer, struct cfs_bandwidth, period_timer); - ktime_t now; -+ unsigned long flags; - int overrun; - int idle = 0; - int count = 0; - -- raw_spin_lock(&cfs_b->lock); -+ raw_spin_lock_irqsave(&cfs_b->lock, flags); - for (;;) { - now = hrtimer_cb_get_time(timer); - overrun = hrtimer_forward(timer, now, cfs_b->period); -@@ -3840,9 +3843,9 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) - count = 0; - } - -- idle = do_sched_cfs_period_timer(cfs_b, overrun); -+ idle = do_sched_cfs_period_timer(cfs_b, overrun, flags); - } -- raw_spin_unlock(&cfs_b->lock); -+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags); - - return idle ? HRTIMER_NORESTART : HRTIMER_RESTART; - } --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/turn-off-write-same-in-smartqpi-driver.patch b/kernel/kernel-rt/centos/patches/turn-off-write-same-in-smartqpi-driver.patch deleted file mode 100644 index 5e18fa8d7..000000000 --- a/kernel/kernel-rt/centos/patches/turn-off-write-same-in-smartqpi-driver.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 81371b5453a5a08d8d03d37aa993b41a7169b342 Mon Sep 17 00:00:00 2001 -Message-Id: <81371b5453a5a08d8d03d37aa993b41a7169b342.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Jim Somerville -Date: Tue, 6 Mar 2018 12:54:40 -0500 -Subject: [PATCH 31/32] turn off write same in smartqpi driver - -Signed-off-by: Jim Somerville ---- - drivers/scsi/smartpqi/smartpqi_init.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c -index 2c6b546..6968c48 100644 ---- a/drivers/scsi/smartpqi/smartpqi_init.c -+++ b/drivers/scsi/smartpqi/smartpqi_init.c -@@ -5814,6 +5814,7 @@ static struct scsi_host_template pqi_driver_template = { - .slave_alloc = pqi_slave_alloc, - .sdev_attrs = pqi_sdev_attrs, - .shost_attrs = pqi_shost_attrs, -+ .no_write_same = 1, - }; - - static int pqi_register_scsi(struct pqi_ctrl_info *ctrl_info) --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch b/kernel/kernel-rt/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch deleted file mode 100644 index e10aadfa0..000000000 --- a/kernel/kernel-rt/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 37680a25caeba0ee4e5f26cb524ff8b4faa5c0f5 Mon Sep 17 00:00:00 2001 -Message-Id: <37680a25caeba0ee4e5f26cb524ff8b4faa5c0f5.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Akinobu Mita -Date: Wed, 4 Jun 2014 16:06:50 -0700 -Subject: [PATCH 13/32] x86: enable DMA CMA with swiotlb - -commit 9c5a3621427da68afe6a078cadf807d2c8cc1d12 upstream. -Ported-by: Nam Ninh - -The DMA Contiguous Memory Allocator support on x86 is disabled when -swiotlb config option is enabled. So DMA CMA is always disabled on -x86_64 because swiotlb is always enabled. This attempts to support for -DMA CMA with enabling swiotlb config option. - -The contiguous memory allocator on x86 is integrated in the function -dma_generic_alloc_coherent() which is .alloc callback in nommu_dma_ops -for dma_alloc_coherent(). - -x86_swiotlb_alloc_coherent() which is .alloc callback in swiotlb_dma_ops -tries to allocate with dma_generic_alloc_coherent() firstly and then -swiotlb_alloc_coherent() is called as a fallback. - -The main part of supporting DMA CMA with swiotlb is that changing -x86_swiotlb_free_coherent() which is .free callback in swiotlb_dma_ops -for dma_free_coherent() so that it can distinguish memory allocated by -dma_generic_alloc_coherent() from one allocated by -swiotlb_alloc_coherent() and release it with dma_generic_free_coherent() -which can handle contiguous memory. This change requires making -is_swiotlb_buffer() global function. - -This also needs to change .free callback in the dma_map_ops for amd_gart -and sta2x11, because these dma_ops are also using -dma_generic_alloc_coherent(). - -Signed-off-by: Akinobu Mita -Acked-by: Marek Szyprowski -Acked-by: Konrad Rzeszutek Wilk -Cc: David Woodhouse -Cc: Don Dutile -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: Andi Kleen -Cc: Yinghai Lu -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Jim Somerville ---- - arch/x86/Kconfig | 2 +- - arch/x86/include/asm/swiotlb.h | 7 +++++++ - arch/x86/kernel/amd_gart_64.c | 2 +- - arch/x86/kernel/pci-swiotlb.c | 9 ++++++--- - arch/x86/pci/sta2x11-fixup.c | 6 ++---- - 5 files changed, 17 insertions(+), 9 deletions(-) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index bdcca71..f67aa39 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -47,7 +47,7 @@ config X86 - select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH if SMP - select ARCH_WANT_OPTIONAL_GPIOLIB - select ARCH_WANT_FRAME_POINTERS -- select HAVE_DMA_CONTIGUOUS if !SWIOTLB -+ select HAVE_DMA_CONTIGUOUS - select HAVE_KRETPROBES - select HAVE_OPTPROBES - select HAVE_KPROBES_ON_FTRACE -diff --git a/arch/x86/include/asm/swiotlb.h b/arch/x86/include/asm/swiotlb.h -index 977f176..ab05d73 100644 ---- a/arch/x86/include/asm/swiotlb.h -+++ b/arch/x86/include/asm/swiotlb.h -@@ -29,4 +29,11 @@ static inline void pci_swiotlb_late_init(void) - - static inline void dma_mark_clean(void *addr, size_t size) {} - -+extern void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, -+ dma_addr_t *dma_handle, gfp_t flags, -+ struct dma_attrs *attrs); -+extern void x86_swiotlb_free_coherent(struct device *dev, size_t size, -+ void *vaddr, dma_addr_t dma_addr, -+ struct dma_attrs *attrs); -+ - #endif /* _ASM_X86_SWIOTLB_H */ -diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c -index b574b29..8e3842f 100644 ---- a/arch/x86/kernel/amd_gart_64.c -+++ b/arch/x86/kernel/amd_gart_64.c -@@ -512,7 +512,7 @@ gart_free_coherent(struct device *dev, size_t size, void *vaddr, - dma_addr_t dma_addr, struct dma_attrs *attrs) - { - gart_unmap_page(dev, dma_addr, size, DMA_BIDIRECTIONAL, NULL); -- free_pages((unsigned long)vaddr, get_order(size)); -+ dma_generic_free_coherent(dev, size, vaddr, dma_addr, attrs); - } - - static int gart_mapping_error(struct device *dev, dma_addr_t dma_addr) -diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c -index 4853440..284d506 100644 ---- a/arch/x86/kernel/pci-swiotlb.c -+++ b/arch/x86/kernel/pci-swiotlb.c -@@ -16,7 +16,7 @@ - - int swiotlb __read_mostly; - --static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, -+void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, - dma_addr_t *dma_handle, gfp_t flags, - struct dma_attrs *attrs) - { -@@ -30,11 +30,14 @@ static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, - return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); - } - --static void x86_swiotlb_free_coherent(struct device *dev, size_t size, -+void x86_swiotlb_free_coherent(struct device *dev, size_t size, - void *vaddr, dma_addr_t dma_addr, - struct dma_attrs *attrs) - { -- swiotlb_free_coherent(dev, size, vaddr, dma_addr); -+ if (is_swiotlb_buffer(dma_to_phys(dev, dma_addr))) -+ swiotlb_free_coherent(dev, size, vaddr, dma_addr); -+ else -+ dma_generic_free_coherent(dev, size, vaddr, dma_addr, attrs); - } - - static struct dma_map_ops swiotlb_dma_ops = { -diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c -index 9d8a509..5ceda85 100644 ---- a/arch/x86/pci/sta2x11-fixup.c -+++ b/arch/x86/pci/sta2x11-fixup.c -@@ -173,9 +173,7 @@ static void *sta2x11_swiotlb_alloc_coherent(struct device *dev, - { - void *vaddr; - -- vaddr = dma_generic_alloc_coherent(dev, size, dma_handle, flags, attrs); -- if (!vaddr) -- vaddr = swiotlb_alloc_coherent(dev, size, dma_handle, flags); -+ vaddr = x86_swiotlb_alloc_coherent(dev, size, dma_handle, flags, attrs); - *dma_handle = p2a(*dma_handle, to_pci_dev(dev)); - return vaddr; - } -@@ -183,7 +181,7 @@ static void *sta2x11_swiotlb_alloc_coherent(struct device *dev, - /* We have our own dma_ops: the same as swiotlb but from alloc (above) */ - static struct dma_map_ops sta2x11_dma_ops = { - .alloc = sta2x11_swiotlb_alloc_coherent, -- .free = swiotlb_free_coherent, -+ .free = x86_swiotlb_free_coherent, - .map_page = swiotlb_map_page, - .unmap_page = swiotlb_unmap_page, - .map_sg = swiotlb_map_sg_attrs, --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch b/kernel/kernel-rt/centos/patches/x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch deleted file mode 100644 index d87c8a91f..000000000 --- a/kernel/kernel-rt/centos/patches/x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 78743472402604dc4fc3304aed9634ae9fe845dd Mon Sep 17 00:00:00 2001 -Message-Id: <78743472402604dc4fc3304aed9634ae9fe845dd.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Akinobu Mita -Date: Wed, 4 Jun 2014 16:06:48 -0700 -Subject: [PATCH 17/32] x86: make dma_alloc_coherent() return zeroed memory if - CMA is enabled - -This patchset enhances the DMA Contiguous Memory Allocator on x86. - -Currently the DMA CMA is only supported with pci-nommu dma_map_ops and -furthermore it can't be enabled on x86_64. But I would like to allocate -big contiguous memory with dma_alloc_coherent() and tell it to the device -that requires it, regardless of which dma mapping implementation is -actually used in the system. - -So this makes it work with swiotlb and intel-iommu dma_map_ops, too. And -this also extends "cma=" kernel parameter to specify placement constraint -by the physical address range of memory allocations. For example, CMA -allocates memory below 4GB by "cma=64M@0-4G", it is required for the -devices only supporting 32-bit addressing on 64-bit systems without iommu. - -This patch (of 5): - -Calling dma_alloc_coherent() with __GFP_ZERO must return zeroed memory. - -But when the contiguous memory allocator (CMA) is enabled on x86 and the -memory region is allocated by dma_alloc_from_contiguous(), it doesn't -return zeroed memory. Because dma_generic_alloc_coherent() forgot to fill -the memory region with zero if it was allocated by -dma_alloc_from_contiguous() - -Most implementations of dma_alloc_coherent() return zeroed memory -regardless of whether __GFP_ZERO is specified. So this fixes it by -unconditionally zeroing the allocated memory region. - -Alternatively, we could fix dma_alloc_from_contiguous() to return zeroed -out memory and remove memset() from all caller of it. But we can't simply -remove the memset on arm because __dma_clear_buffer() is used there for -ensuring cache flushing and it is used in many places. Of course we can -do redundant memset in dma_alloc_from_contiguous(), but I think this patch -is less impact for fixing this problem. - -Signed-off-by: Akinobu Mita -Cc: Marek Szyprowski -Cc: Konrad Rzeszutek Wilk -Cc: David Woodhouse -Cc: Don Dutile -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: Andi Kleen -Cc: Yinghai Lu -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -(cherry picked from commit d92ef66c4f8fdf7a24736b1ab6c48d32de9bfc07) -Signed-off-by: Jim Somerville ---- - arch/x86/kernel/pci-dma.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c -index 77a4e62..c84ffe7 100644 ---- a/arch/x86/kernel/pci-dma.c -+++ b/arch/x86/kernel/pci-dma.c -@@ -99,7 +99,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, - - dma_mask = dma_alloc_coherent_mask(dev, flag); - -- flag |= __GFP_ZERO; -+ flag &= ~__GFP_ZERO; - again: - page = NULL; - /* CMA can be used only in the context which permits sleeping */ -@@ -130,7 +130,7 @@ again: - - return NULL; - } -- -+ memset(page_address(page), 0, size); - *dma_addr = addr; - return page_address(page); - } --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/srpm_path b/kernel/kernel-rt/centos/srpm_path deleted file mode 100644 index a65085bc0..000000000 --- a/kernel/kernel-rt/centos/srpm_path +++ /dev/null @@ -1 +0,0 @@ -mirror:Source/kernel-rt-3.10.0-1062.1.2.rt56.1025.el7.src.rpm diff --git a/kernel/kernel-rt/files/centos.cer b/kernel/kernel-rt/files/centos.cer deleted file mode 100644 index 00a55801930e1c918da263aac17ec14511a06e91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1500 zcma)6Yfw~W7~b!kv&&_dn`c1@kR8F~GQfA1%Z|vX%d*NXAqY@vtkbgY9$a>pvnNp` z!Ub3OQHVAIL9#%Mh2b!0F;s&KkwBvng|a_g=r}y*w{8 z^T(kXvsqCDAc#9MUh?#M%CO6P$5T0;Qo8YMPNG=~aX`T+6A2xO-7iQFtC}Qn99Rm7#zLg~6N&#Wy^UP-aUM zhCH<-lhWuZy+)#tOM)^J<g~x<6~7CuelT zU3VF1Mk`T}v_VJdN&7zzxI+f1Q&Sr4idJT*^CXGnQYXXhY7`f(R6{e^uyQnj&qK|? zjmPSp5i%{h(u^#!}uVOvC$x}1aQ!PYxU*+7-%EB`f zr%mKSVw1R}v^;67p4n+hZM$5NLs=G%<`35Fi_h$AD^_LvQrJB6_aosW$~0SEm)v|P zwyxeyzQ(`yaEm<%K;X!(6QA$kh+5g{itwz=umokQ zJV&0P3|rorr5*Bf17H!uP{g5Zi6nj-F%fjON24e_%q8{57)V2zHQE|!A+!u*jE#s; z(YnZ0q=`^wa|BuD2S<%C4H3?|{Wmb`e+I^LpG&YUa5Iz%oZhe`0?Sh!iog&UWQT|V zFJBIkiG}oU8b>J7GhwOS699~cMi^+9A+W4luEn4-8COAqiO;?8bg*=R_pDmtQ;+-GPbs2%Ym26-S70U*|qZ{u$NQpf1?(a_meD()Bng=Pv!WV+u z{le|<-z{$JvJU#ZB31p=ZW}dt%NN>qM29{2B<1bS243SwGv|}k9$haz`}k7R{Y@uL zH~-izeq7x=+PBwXYP_}yb3FyFIj=j5Jv+O-zWmO`6Si{Wi^&Q7VWa2py@z(c_Vrb* zF-VTwsw#;Oj2S2v1kMlSTKeQEzcu(y{wVC;JcK?as;p_P?FIQE_d-N1lMCKt&pS2S zcK-D}Xe^rcpHSshTnTzo6!_=tSfghu`c0cIV}7Kw?{RO*VC9-ir?2?G@Un4gwRyCC=VfH%W@RvFY&7IH;ACSC zWnmL$a&|NnFyI4mIC$9o^GXtnGV=}jfm(nf>^yA#B_)aFiH6b!k{|&t9-;8eycC6? z%(B!Xh2YBKlGNN{LvaI9kR&$`Ur1(2VqRuxu7Yz;erbxKq=7g{f|*AEF5&6xsF0mn zX&@)gYiMp@X=q_+Zfa^^93{?c0^%A%xr4%uO^iy&LC46-z}&>h&tTBR$i>ve$jGp4 z`@?;Kq7JR5UTs_~1$R$a_9SOaESx<#Rw(YtzV&;J7hUu!tW=r)S;|&oWmlt^mdAyx zlLZAoW*FCSZGQMm&?QT6TFD#Zy8FF7??0Ky>)dMH%+ z&1Zo~mHqDnMimZ+i*814UcK?wSN|Nls0@}%$4e&IDcflUZ&{>!ZlCj=#4Ki_JGp*nUQtcV4^I`NXqX%g$Iz7reQq5SaO0W|r{0 z1iPHQ%o7`%>a{~A%_}{1PSV|XQwQ^-ggu3E{d|QwlP7#@-=>we(eq@e$MK>P>5aN^ zYSo|-$@M3?b#x1)GOYYY-1SRkMm?$Mu`m(;4*Z;xtmp`70gztGaFKf5GO7Wu5 z|Lbd?#M-1N{kq$hzGZupZ}IcM<1haQaes}9%r7jO!M3k -Date: Fri, 20 Apr 2018 14:51:56 -0400 -Subject: [PATCH] Build logic and sources for TiC - -Signed-off-by: Jim Somerville -Signed-off-by: zhao.shuai -Signed-off-by: Robin Lu ---- - SPECS/kernel.spec | 73 ++++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 60 insertions(+), 13 deletions(-) - -diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec -index 852fd10..e42177e 100644 ---- a/SPECS/kernel.spec -+++ b/SPECS/kernel.spec -@@ -5,7 +5,8 @@ Summary: The Linux kernel - - %define dist .el7 - --# % define buildid .local -+# This is the STX patch release -+%define buildid .%{tis_patch_ver}.tis - - # For a kernel released for public testing, released_kernel should be 1. - # For internal testing builds during development, it should be 0. -@@ -14,12 +15,14 @@ Summary: The Linux kernel - %global distro_build 1062 - - %define rpmversion 3.10.0 --%define pkgrelease 1062.1.2.el7 -+%define _pkgrelease 1062.1.2 -+%define pkgrelease %{_pkgrelease}.el7 -+ - - # allow pkg_release to have configurable %%{?dist} tag - %define specrelease 1062.1.2%{?dist} - --%define pkg_release %{specrelease}%{?buildid} -+%define pkg_release %{specrelease}%{buildid} - - # The kernel tarball/base version - %define rheltarball %{rpmversion}-%{pkgrelease} -@@ -69,7 +72,7 @@ Summary: The Linux kernel - %define with_dbgonly %{?_with_dbgonly: 1} %{?!_with_dbgonly: 0} - - # Control whether we perform a compat. check against published ABI. --%define with_kabichk %{?_without_kabichk: 0} %{?!_without_kabichk: 1} -+%define with_kabichk 0 - - # Control whether we perform a compat. check against DUP ABI. - %define with_kabidupchk %{?_with_kabidupchk: 1} %{?!_with_kabidupchk: 0} -@@ -92,7 +95,7 @@ Summary: The Linux kernel - # Set debugbuildsenabled to 1 for production (build separate debug kernels) - # and 0 for rawhide (all kernels are debug kernels). - # See also 'make debug' and 'make release'. RHEL only ever does 1. --%define debugbuildsenabled 1 -+%define debugbuildsenabled 0 - - %define with_gcov %{?_with_gcov: 1} %{?!_with_gcov: 0} - -@@ -386,6 +389,7 @@ BuildRequires: bison flex - # required for zfcpdump - BuildRequires: glibc-static - %endif -+BuildRequires: util-linux - - Source0: linux-%{rpmversion}-%{pkgrelease}.tar.xz - -@@ -453,6 +457,12 @@ Patch1000: debrand-single-cpu.patch - Patch1001: debrand-rh_taint.patch - Patch1002: debrand-rh-i686-cpu.patch - -+# StarlingX Cloud sources here. -+# Not sure if we need to worry about numerical collisions between -+# SourceX and PatchX, so let's not risk it -+Source30000: kernel-3.10.0-x86_64.config.tis_extra -+Source30001: ima_signing_key.pub -+ - BuildRoot: %{_tmppath}/kernel-%{KVRA}-root - - %description -@@ -626,6 +636,13 @@ This package provides debug information for the bpftool package. - - %endif # with_bpftool - -+%ifarch x86_64 -+%package unsigned -+Summary: Unsigned build of the Linux kernel -+%description unsigned -+Contains an unsigned version of the Linux kernel -+%endif # x86_64 -+ - %if %{with_gcov} - %package gcov - Summary: gcov graph and source files for coverage data collection. -@@ -791,6 +808,9 @@ cd linux-%{KVRA} - # Drop some necessary files from the source dir into the buildroot - cp $RPM_SOURCE_DIR/kernel-%{version}-*.config . - -+# Copy any TiS-specific config changes -+cp $RPM_SOURCE_DIR/kernel-%{version}-*.config.tis_extra . -+ - ApplyOptionalPatch linux-kernel-test.patch - ApplyOptionalPatch debrand-single-cpu.patch - ApplyOptionalPatch debrand-rh_taint.patch -@@ -835,6 +855,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 -@@ -908,12 +937,13 @@ BuildKernel() { - - # and now to start the build process - -- make %{?cross_opts} -s mrproper -+ make -j"%(nproc)" %{?cross_opts} -s mrproper - - cp %{SOURCE11} . # x509.genkey - cp %{SOURCE12} . # extra_certificates - cp %{SOURCE15} . # rheldup3.x509 - cp %{SOURCE16} . # rhelkpatch1.x509 -+ cp %{SOURCE30001} . # ima_signing_key.pub - - cp configs/$Config .config - -@@ -928,8 +958,8 @@ BuildKernel() { - fi - %endif - -- make -s %{?cross_opts} ARCH=$Arch oldnoconfig >/dev/null -- make -s %{?cross_opts} ARCH=$Arch V=1 %{?_smp_mflags} KCFLAGS="%{?kcflags}" WITH_GCOV="%{?with_gcov}" $MakeTarget %{?sparse_mflags} -+ make -s -j"%(nproc)" %{?cross_opts} ARCH=$Arch oldnoconfig >/dev/null -+ make -s -j"%(nproc)" %{?cross_opts} ARCH=$Arch V=1 %{?_smp_mflags} KCFLAGS="%{?kcflags}" WITH_GCOV="%{?with_gcov}" $MakeTarget %{?sparse_mflags} - - if [ "$Flavour" != "kdump" ]; then - make -s %{?cross_opts} ARCH=$Arch V=1 %{?_smp_mflags} KCFLAGS="%{?kcflags}" WITH_GCOV="%{?with_gcov}" modules %{?sparse_mflags} || exit 1 -@@ -953,6 +983,8 @@ BuildKernel() { - fi - # EFI SecureBoot signing, x86_64-only - %ifarch x86_64 -+ cp $KernelImage vmlinuz.unsigned -+ $CopyKernel vmlinuz.unsigned $RPM_BUILD_ROOT/%{image_install_path}/vmlinuz.unsigned - %pesign -s -i $KernelImage -o $KernelImage.signed -a %{SOURCE13} -c %{SOURCE14} -n %{pesign_name} - mv $KernelImage.signed $KernelImage - %endif -@@ -969,7 +1001,7 @@ BuildKernel() { - if [ "$Flavour" != "kdump" ]; then - # Override $(mod-fw) because we don't want it to install any firmware - # we'll get it from the linux-firmware package and we don't want conflicts -- make -s %{?cross_opts} %{?_smp_mflags} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw= -+ make -s -j"%(nproc)" %{?cross_opts} %{?_smp_mflags} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw= - %if %{with_gcov} - # install gcov-needed files to $BUILDROOT/$BUILD/...: - # gcov_info->filename is absolute path -@@ -979,7 +1011,7 @@ BuildKernel() { - %endif - fi - %ifarch %{vdso_arches} -- make -s %{?cross_opts} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer -+ make -s -j"%(nproc)" %{?cross_opts} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer - if [ ! -s ldconfig-kernel.conf ]; then - echo > ldconfig-kernel.conf "\ - # Placeholder file, no vDSO hwcap entries used in this kernel." -@@ -1188,6 +1220,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 -@@ -1248,15 +1286,15 @@ make %{?cross_opts} %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false - %endif - %ifarch x86_64 - pushd tools/power/x86/x86_energy_perf_policy/ -- make -+ make -j"%(nproc)" - popd - pushd tools/power/x86/turbostat -- make -+ make -j"%(nproc)" - popd - %endif #turbostat/x86_energy_perf_policy - %endif - pushd tools --make tmon -+make -j"%(nproc)" tmon - popd - %endif - -@@ -1550,6 +1588,10 @@ fi}\ - %{expand:\ - %{_sbindir}/new-kernel-pkg --package kernel%{?-v:-%{-v*}} --install %{KVRA}%{?-v:.%{-v*}} || exit $?\ - }\ -+# If this is a pkg upgrade (ie installed as a patch), set the reboot flag\ -+if [ $1 -gt 1 ] ; then\ -+ touch /var/run/node_is_patched_rr\ -+fi\ - %{nil} - - # -@@ -1775,6 +1817,11 @@ fi - %kernel_variant_files %{with_debug} debug - %kernel_variant_files %{with_kdump} kdump - -+%ifarch x86_64 -+%files unsigned -+/boot/vmlinuz.unsigned -+%endif -+ - %changelog - * Fri Sep 20 2019 CentOS Sources - 3.10.0-1062.1.2.el7 - - Apply debranding changes --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/meta_patches/Compile-issues.patch b/kernel/kernel-std/centos/meta_patches/Compile-issues.patch deleted file mode 100644 index 8a748dc6d..000000000 --- a/kernel/kernel-std/centos/meta_patches/Compile-issues.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 3073ab68b8a27cdaf31213778d029669f50e2632 Mon Sep 17 00:00:00 2001 -Message-Id: <3073ab68b8a27cdaf31213778d029669f50e2632.1584644494.git.Jim.Somerville@windriver.com> -In-Reply-To: <55a6b125fab32183cbabee1e436197242f926c0c.1584644493.git.Jim.Somerville@windriver.com> -References: <55a6b125fab32183cbabee1e436197242f926c0c.1584644493.git.Jim.Somerville@windriver.com> -From: "zhao.shuai" -Date: Tue, 6 Aug 2019 16:18:04 +0800 -Subject: [PATCH 2/2] Compile issues - -Signed-off-by: zhao.shuai -Signed-off-by: Jim Somerville ---- - SPECS/kernel.spec | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec -index 5f23982..640f872 100644 ---- a/SPECS/kernel.spec -+++ b/SPECS/kernel.spec -@@ -498,6 +498,12 @@ Patch40029: rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch - Patch40030: rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch - # Workaround for broken bios causing IOMMU issues - Patch40031: Allow-dmar-quirks-for-broken-bioses.patch -+# Fix assorted compilation issues -+Patch40100: fix-compilation-issues.patch -+# Fix CentOS 7.6 upgrade compile error -+Patch40101: fix-CentOS-7.6-upgrade-compile-error.patch -+# Compile fix for disabling CONFIG_MEMCG_KMEM -+Patch40102: compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch - - BuildRoot: %{_tmppath}/kernel-%{KVRA}-root - -@@ -882,6 +888,9 @@ ApplyOptionalPatch ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch - ApplyOptionalPatch rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch - ApplyOptionalPatch rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch - ApplyOptionalPatch Allow-dmar-quirks-for-broken-bioses.patch -+ApplyOptionalPatch fix-compilation-issues.patch -+ApplyOptionalPatch fix-CentOS-7.6-upgrade-compile-error.patch -+ApplyOptionalPatch compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch - - # Any further pre-build tree manipulations happen here. - --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/meta_patches/Kernel-source-patches-for-TiC.patch b/kernel/kernel-std/centos/meta_patches/Kernel-source-patches-for-TiC.patch deleted file mode 100644 index f3642b30f..000000000 --- a/kernel/kernel-std/centos/meta_patches/Kernel-source-patches-for-TiC.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 55a6b125fab32183cbabee1e436197242f926c0c Mon Sep 17 00:00:00 2001 -Message-Id: <55a6b125fab32183cbabee1e436197242f926c0c.1584644493.git.Jim.Somerville@windriver.com> -From: "zhao.shuai" -Date: Mon, 5 Aug 2019 17:55:01 +0800 -Subject: [PATCH 1/2] Kernel source patches for TiC - -Signed-off-by: zhao.shuai -Signed-off-by: Jim Somerville -Signed-off-by: Robin Lu ---- - SPECS/kernel.spec | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 67 insertions(+) - -diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec -index 0b2ff2e..5f23982 100644 ---- a/SPECS/kernel.spec -+++ b/SPECS/kernel.spec -@@ -463,6 +463,42 @@ Patch1002: debrand-rh-i686-cpu.patch - Source30000: kernel-3.10.0-x86_64.config.tis_extra - Source30001: ima_signing_key.pub - -+# StarlingX Cloud patches here. -+Patch40001: Fix-compile-issue-when-transparent-hugepages-are-off.patch -+Patch40002: Notification-of-death-of-arbitrary-processes.patch -+Patch40003: CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch -+Patch40004: PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch -+Patch40005: affine-compute-kernel-threads.patch -+Patch40006: Affine-irqs-and-workqueues-with-kthread_cpus.patch -+Patch40007: Make-kernel-start-eth-devices-at-offset.patch -+Patch40008: intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch -+Patch40009: memblock-introduce-memblock_alloc_range.patch -+Patch40010: cma-add-placement-specifier-for-cma-kernel-parameter.patch -+Patch40011: x86-enable-DMA-CMA-with-swiotlb.patch -+Patch40013: Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch -+Patch40014: x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch -+Patch40016: Porting-Cacheinfo-from-Kernel-4.10.17.patch -+Patch40017: Fix-cacheinfo-compilation-issues-for-3.10.patch -+Patch40018: cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch -+Patch40019: cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch -+Patch40020: CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch -+Patch40021: cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch -+Patch40022: US101216-IMA-support-in-Titanium-kernel.patch -+Patch40023: US103091-IMA-System-Configuration.patch -+# Fix compile warnings that break the build -+Patch40024: aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch -+Patch40025: dpt_i2o-fix-build-warning.patch -+# DRBD was choking on write same -+Patch40026: turn-off-write-same-in-smartqpi-driver.patch -+# Fix use-after-free in eventpoll_release_file -+Patch40027: epoll-fix-use-after-free-in-eventpoll_release_file.patch -+# Fix three potential kernel memory leaks -+Patch40028: ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch -+Patch40029: rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch -+Patch40030: rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch -+# Workaround for broken bios causing IOMMU issues -+Patch40031: Allow-dmar-quirks-for-broken-bioses.patch -+ - BuildRoot: %{_tmppath}/kernel-%{KVRA}-root - - %description -@@ -816,6 +852,37 @@ ApplyOptionalPatch debrand-single-cpu.patch - ApplyOptionalPatch debrand-rh_taint.patch - ApplyOptionalPatch debrand-rh-i686-cpu.patch - -+# StarlingX Cloud patches here. -+ApplyOptionalPatch Fix-compile-issue-when-transparent-hugepages-are-off.patch -+ApplyOptionalPatch Notification-of-death-of-arbitrary-processes.patch -+ApplyOptionalPatch CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch -+ApplyOptionalPatch PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch -+ApplyOptionalPatch affine-compute-kernel-threads.patch -+ApplyOptionalPatch Affine-irqs-and-workqueues-with-kthread_cpus.patch -+ApplyOptionalPatch Make-kernel-start-eth-devices-at-offset.patch -+ApplyOptionalPatch intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch -+ApplyOptionalPatch memblock-introduce-memblock_alloc_range.patch -+ApplyOptionalPatch cma-add-placement-specifier-for-cma-kernel-parameter.patch -+ApplyOptionalPatch x86-enable-DMA-CMA-with-swiotlb.patch -+ApplyOptionalPatch Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch -+ApplyOptionalPatch x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch -+ApplyOptionalPatch Porting-Cacheinfo-from-Kernel-4.10.17.patch -+ApplyOptionalPatch Fix-cacheinfo-compilation-issues-for-3.10.patch -+ApplyOptionalPatch cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch -+ApplyOptionalPatch cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch -+ApplyOptionalPatch CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch -+ApplyOptionalPatch cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch -+ApplyOptionalPatch US101216-IMA-support-in-Titanium-kernel.patch -+ApplyOptionalPatch US103091-IMA-System-Configuration.patch -+ApplyOptionalPatch aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch -+ApplyOptionalPatch dpt_i2o-fix-build-warning.patch -+ApplyOptionalPatch turn-off-write-same-in-smartqpi-driver.patch -+ApplyOptionalPatch epoll-fix-use-after-free-in-eventpoll_release_file.patch -+ApplyOptionalPatch ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch -+ApplyOptionalPatch rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch -+ApplyOptionalPatch rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch -+ApplyOptionalPatch Allow-dmar-quirks-for-broken-bioses.patch -+ - # Any further pre-build tree manipulations happen here. - - chmod +x scripts/checkpatch.pl --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/meta_patches/PATCH_ORDER b/kernel/kernel-std/centos/meta_patches/PATCH_ORDER deleted file mode 100644 index 8eab5dd84..000000000 --- a/kernel/kernel-std/centos/meta_patches/PATCH_ORDER +++ /dev/null @@ -1,3 +0,0 @@ -Build-logic-and-sources-for-TiC.patch -Kernel-source-patches-for-TiC.patch -Compile-issues.patch diff --git a/kernel/kernel-std/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch b/kernel/kernel-std/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch deleted file mode 100644 index ede67a3d0..000000000 --- a/kernel/kernel-std/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch +++ /dev/null @@ -1,73 +0,0 @@ -From e223cda3a8edd8fd935d589231c8e19a66bd8947 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Chris Friesen -Date: Tue, 24 Nov 2015 16:27:29 -0500 -Subject: [PATCH 06/26] 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 -[VT: replacing spaces with tabs. Performed tests] -Signed-off-by: Vu Tran - -Signed-off-by: Jim Somerville ---- - 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 e639145..be46349 100644 ---- a/kernel/irq/manage.c -+++ b/kernel/irq/manage.c -@@ -372,6 +372,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 179cbb2..9524a6f 100644 ---- a/kernel/workqueue.c -+++ b/kernel/workqueue.c -@@ -5441,6 +5441,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; - - /* -@@ -5451,6 +5453,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 - diff --git a/kernel/kernel-std/centos/patches/Allow-dmar-quirks-for-broken-bioses.patch b/kernel/kernel-std/centos/patches/Allow-dmar-quirks-for-broken-bioses.patch deleted file mode 100644 index 71268720e..000000000 --- a/kernel/kernel-std/centos/patches/Allow-dmar-quirks-for-broken-bioses.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 3ea9b69ea4e791797b42d73b609b2e1f4fdb9882 Mon Sep 17 00:00:00 2001 -Message-Id: <3ea9b69ea4e791797b42d73b609b2e1f4fdb9882.1584647338.git.Jim.Somerville@windriver.com> -From: Jim Somerville -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 ---- - 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 - diff --git a/kernel/kernel-std/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch b/kernel/kernel-std/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch deleted file mode 100644 index f477475c0..000000000 --- a/kernel/kernel-std/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 049ff2fee2c00370ddc9c9bb598fe1e89aaced2d Mon Sep 17 00:00:00 2001 -Message-Id: <049ff2fee2c00370ddc9c9bb598fe1e89aaced2d.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Allain Legacy -Date: Fri, 29 Jan 2016 12:13:40 -0500 -Subject: [PATCH 03/26] 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 -Signed-off-by: Jim Somerville ---- - 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 - diff --git a/kernel/kernel-std/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch b/kernel/kernel-std/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch deleted file mode 100644 index 693adabf5..000000000 --- a/kernel/kernel-std/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 648072810b35e6251c6503a8e6693deeb6d0a89d Mon Sep 17 00:00:00 2001 -From: Alex Shi -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 -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Alex Kozyrev -Signed-off-by: Jim Somerville ---- - 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 - #include - #include -+#include - - #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 - diff --git a/kernel/kernel-std/centos/patches/Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch b/kernel/kernel-std/centos/patches/Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch deleted file mode 100644 index d520d85f6..000000000 --- a/kernel/kernel-std/centos/patches/Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch +++ /dev/null @@ -1,36 +0,0 @@ -From aeefa74788f568a9c3b49e18a17fc3d59657bbe0 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Chris Friesen -Date: Wed, 11 Jan 2017 13:38:37 -0500 -Subject: [PATCH 13/26] 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 ---- - 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 - diff --git a/kernel/kernel-std/centos/patches/Fix-cacheinfo-compilation-issues-for-3.10.patch b/kernel/kernel-std/centos/patches/Fix-cacheinfo-compilation-issues-for-3.10.patch deleted file mode 100644 index cbd98714a..000000000 --- a/kernel/kernel-std/centos/patches/Fix-cacheinfo-compilation-issues-for-3.10.patch +++ /dev/null @@ -1,114 +0,0 @@ -From f49689ec7d42e30014e2aebd57bff050b187ef22 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Alex Kozyrev -Date: Wed, 19 Jul 2017 02:25:15 -0500 -Subject: [PATCH 17/26] 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 ---- - 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 - diff --git a/kernel/kernel-std/centos/patches/Fix-compile-issue-when-transparent-hugepages-are-off.patch b/kernel/kernel-std/centos/patches/Fix-compile-issue-when-transparent-hugepages-are-off.patch deleted file mode 100644 index a1b5c69d2..000000000 --- a/kernel/kernel-std/centos/patches/Fix-compile-issue-when-transparent-hugepages-are-off.patch +++ /dev/null @@ -1,68 +0,0 @@ -From b6ceef1c915827b50ce3f76da4dc47f3eb768b44 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jim Somerville -Date: Thu, 15 Dec 2016 14:27:48 -0500 -Subject: [PATCH 01/26] Fix compile issue when transparent hugepages are off - -Signed-off-by: Jim Somerville -Signed-off-by: Robin Lu ---- - drivers/gpu/drm/i915/i915_gemfs.c | 4 ++-- - fs/proc/task_mmu.c | 2 ++ - mm/swap.c | 2 ++ - 3 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/i915/i915_gemfs.c b/drivers/gpu/drm/i915/i915_gemfs.c -index 888b7d3f..efe915c7 100644 ---- a/drivers/gpu/drm/i915/i915_gemfs.c -+++ b/drivers/gpu/drm/i915/i915_gemfs.c -@@ -49,7 +49,7 @@ int i915_gemfs_init(struct drm_i915_private *i915) - * memory pressure shmem should split any huge-pages which can be - * shrunk. - */ -- -+#ifdef CONFIG_TRANSPARENT_HUGEPAGE - if (has_transparent_hugepage()) { - struct super_block *sb = gemfs->mnt_sb; - /* FIXME: Disabled until we get W/A for read BW issue. */ -@@ -63,7 +63,7 @@ int i915_gemfs_init(struct drm_i915_private *i915) - return err; - } - } -- -+#endif - i915->mm.gemfs = gemfs; - - return 0; -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index e27a1d42..e8a8ba9d 100644 ---- a/fs/proc/task_mmu.c -+++ b/fs/proc/task_mmu.c -@@ -1116,7 +1116,9 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end, - { - struct vm_area_struct *vma; - struct pagemapread *pm = walk->private; -+#ifdef CONFIG_TRANSPARENT_HUGEPAGE - spinlock_t *ptl; -+#endif - pte_t *pte; - int err = 0; - -diff --git a/mm/swap.c b/mm/swap.c -index 0982a35..6dcf38c 100644 ---- a/mm/swap.c -+++ b/mm/swap.c -@@ -1043,8 +1043,10 @@ void release_pages(struct page **pages, int nr, bool cold) - if (!put_page_testzero(page)) - continue; - -+#ifdef CONFIG_TRANSPARENT_HUGEPAGE - VM_BUG_ON_PAGE(check_mmu_gather && - trans_huge_mmu_gather_count(page), page); -+#endif - - if (PageLRU(page)) { - if (!was_thp) --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/Make-kernel-start-eth-devices-at-offset.patch b/kernel/kernel-std/centos/patches/Make-kernel-start-eth-devices-at-offset.patch deleted file mode 100644 index ec1460636..000000000 --- a/kernel/kernel-std/centos/patches/Make-kernel-start-eth-devices-at-offset.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 0e86f726ba6e46ee206ecc7e09ce049ed4145f6c Mon Sep 17 00:00:00 2001 -Message-Id: <0e86f726ba6e46ee206ecc7e09ce049ed4145f6c.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Chris Friesen -Date: Thu, 12 May 2016 18:00:00 -0400 -Subject: [PATCH 07/26] 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 ---- - net/core/dev.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 92d6c59..238c90d 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -1090,6 +1090,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 - diff --git a/kernel/kernel-std/centos/patches/Notification-of-death-of-arbitrary-processes.patch b/kernel/kernel-std/centos/patches/Notification-of-death-of-arbitrary-processes.patch deleted file mode 100644 index 59e9e69f3..000000000 --- a/kernel/kernel-std/centos/patches/Notification-of-death-of-arbitrary-processes.patch +++ /dev/null @@ -1,536 +0,0 @@ -From 36270456f8d6e274791fbf846ad03249759eafa6 Mon Sep 17 00:00:00 2001 -From: Chris Friesen -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 ---- - 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 a05294b..cfb7197 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 { \ -@@ -224,6 +232,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 */ \ - .pids = { \ -diff --git a/include/linux/sched.h b/include/linux/sched.h -index d184652..ba6ae5c 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -1653,6 +1653,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 6ec689c..550cea4 100644 ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -1580,6 +1580,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 2fb90fa..44a82c1 100644 ---- a/kernel/Makefile -+++ b/kernel/Makefile -@@ -113,6 +113,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..889b929 ---- /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 -+#include -+#include -+#include -+#include -+ -+#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, ¤t->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(). -+ */ -+ qwrite_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: -+ qwrite_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 1afa799..a2ea26b 100644 ---- a/kernel/exit.c -+++ b/kernel/exit.c -@@ -59,6 +59,9 @@ - #include - #include - #include -+#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 c75422b..30dee92 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -1477,6 +1477,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 35133a7..3f72ac0 100644 ---- a/kernel/signal.c -+++ b/kernel/signal.c -@@ -46,6 +46,9 @@ - #include - #include - #include "audit.h" /* audit_signal_info() */ -+#ifdef CONFIG_SIGEXIT -+#include "death_notify.h" -+#endif - - /* - * SLAB caches for signal bits. -@@ -1740,6 +1743,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; - } - -@@ -1811,6 +1818,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 1fbf388..0bc6b02 100644 ---- a/kernel/sys.c -+++ b/kernel/sys.c -@@ -67,6 +67,10 @@ - /* Hardening for Spectre-v1 */ - #include - -+#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 - diff --git a/kernel/kernel-std/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch b/kernel/kernel-std/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch deleted file mode 100644 index 2bc689905..000000000 --- a/kernel/kernel-std/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 98f7b9d926abbe0bb60ab0a14a306516fa36b9d8 Mon Sep 17 00:00:00 2001 -Message-Id: <98f7b9d926abbe0bb60ab0a14a306516fa36b9d8.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Dahir Osman -Date: Wed, 13 Jan 2016 10:01:11 -0500 -Subject: [PATCH 04/26] 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 ---- - 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 - diff --git a/kernel/kernel-std/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch b/kernel/kernel-std/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch deleted file mode 100644 index f0345cf2c..000000000 --- a/kernel/kernel-std/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch +++ /dev/null @@ -1,2125 +0,0 @@ -From ee927a1ebf0c981030adcf75c2cebf6d32ccf617 Mon Sep 17 00:00:00 2001 -From: Alex Kozyrev -Date: Wed, 19 Jul 2017 02:21:59 -0500 -Subject: [PATCH] Porting Cacheinfo from Kernel 4.10.17 - -Original source code from tag v4.10.17 in Linux stable tree for: -intel_cacheinfo.c, cacheinfo.c and cacheinfo.h. -Main commit that we are interested for is 246246cbde5e840012f853e27630ebb59f409486: -This patch adds initial support for providing processor cache information -to userspace through sysfs interface. This is based on already existing -implementations(x86, ia64, s390 and powerpc) and hence the interface is -intended to be fully compatible. - -The main purpose of this generic support is to avoid further code -duplication to support new architectures and also to unify all the existing -different implementations. - -This implementation maintains the hierarchy of cache objects which reflects -the system's cache topology. Cache devices are instantiated as needed as -CPUs come online. The cache information is replicated per-cpu even if they are -shared. A per-cpu array of cache information maintained is used mainly for -sysfs-related book keeping. - -It also implements the shared_cpu_map attribute, which is essential for -enabling both kernel and user-space to discover the system's overall cache -topology. - -This patch also add the missing ABI documentation for the cacheinfo sysfs -interface already, which is well defined and widely used. - -sysfs-devices-system-cpu was nodified by taking commit 1d78dc59f5ab6f467e49882518453adc7e4caa44: -Add an ABI document entry for /sys/devices/system/cpu/cpu*/cache/index*/id. - -cpu.h and cpu.c was enhanced with commit 3d52943b3a51497a777e6d7d840a38596a92cee9: -This patch adds a new function to create per-cpu devices. -This helps in: -1. reusing the device infrastructure to create any cpu related - attributes and corresponding sysfs instead of creating and - dealing with raw kobjects directly -2. retaining the legacy path(/sys/devices/system/cpu/..) to support - existing sysfs ABI -3. avoiding to create links in the bus directory pointing to the - device as there would be per-cpu instance of these devices with - the same name since dev->bus is not populated to cpu_sysbus on - purpose - -Signed-off-by: Jim Somerville ---- - Documentation/ABI/testing/sysfs-devices-system-cpu | 65 ++ - arch/x86/kernel/cpu/cacheinfo.c | 833 +++++++-------------- - drivers/base/Makefile | 2 +- - drivers/base/cacheinfo.c | 662 ++++++++++++++++ - drivers/base/cpu.c | 54 ++ - include/linux/cacheinfo.h | 104 +++ - include/linux/cpu.h | 3 + - 7 files changed, 1147 insertions(+), 576 deletions(-) - create mode 100644 drivers/base/cacheinfo.c - create mode 100644 include/linux/cacheinfo.h - -diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu -index ff65f15..7521be8 100644 ---- a/Documentation/ABI/testing/sysfs-devices-system-cpu -+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu -@@ -201,6 +201,71 @@ Description: address and size of the percpu note. - - crash_notes_size: size of the note of cpu#. - -+ -+What: /sys/devices/system/cpu/cpu*/cache/index*/ -+Date: July 2014(documented, existed before August 2008) -+Contact: Sudeep Holla -+ Linux kernel mailing list -+Description: Parameters for the CPU cache attributes -+ -+ allocation_policy: -+ - WriteAllocate: allocate a memory location to a cache line -+ on a cache miss because of a write -+ - ReadAllocate: allocate a memory location to a cache line -+ on a cache miss because of a read -+ - ReadWriteAllocate: both writeallocate and readallocate -+ -+ attributes: LEGACY used only on IA64 and is same as write_policy -+ -+ coherency_line_size: the minimum amount of data in bytes that gets -+ transferred from memory to cache -+ -+ level: the cache hierarchy in the multi-level cache configuration -+ -+ number_of_sets: total number of sets in the cache, a set is a -+ collection of cache lines with the same cache index -+ -+ physical_line_partition: number of physical cache line per cache tag -+ -+ shared_cpu_list: the list of logical cpus sharing the cache -+ -+ shared_cpu_map: logical cpu mask containing the list of cpus sharing -+ the cache -+ -+ size: the total cache size in kB -+ -+ type: -+ - Instruction: cache that only holds instructions -+ - Data: cache that only caches data -+ - Unified: cache that holds both data and instructions -+ -+ ways_of_associativity: degree of freedom in placing a particular block -+ of memory in the cache -+ -+ write_policy: -+ - WriteThrough: data is written to both the cache line -+ and to the block in the lower-level memory -+ - WriteBack: data is written only to the cache line and -+ the modified cache line is written to main -+ memory only when it is replaced -+ -+ -+What: /sys/devices/system/cpu/cpu*/cache/index*/id -+Date: September 2016 -+Contact: Linux kernel mailing list -+Description: Cache id -+ -+ The id provides a unique number for a specific instance of -+ a cache of a particular type. E.g. there may be a level -+ 3 unified cache on each socket in a server and we may -+ assign them ids 0, 1, 2, ... -+ -+ Note that id value can be non-contiguous. E.g. level 1 -+ caches typically exist per core, but there may not be a -+ power of two cores on a socket, so these caches may be -+ numbered 0, 1, 2, 3, 4, 5, 8, 9, 10, ... -+ -+ - What: /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats - /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/turbo_stat - /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/sub_turbo_stat -diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c -index d529019..bf23bd2 100644 ---- a/arch/x86/kernel/cpu/cacheinfo.c -+++ b/arch/x86/kernel/cpu/cacheinfo.c -@@ -1,5 +1,5 @@ - /* -- * Routines to indentify caches on Intel CPU. -+ * Routines to identify caches on Intel CPU. - * - * Changes: - * Venkatesh Pallipadi : Adding cache identification through cpuid(4) -@@ -7,16 +7,14 @@ - * Andi Kleen / Andreas Herrmann : CPUID4 emulation on AMD. - */ - --#include - #include --#include --#include -+#include - #include - #include -+#include - #include - - #include --#include - #include - #include - -@@ -116,10 +114,10 @@ static const struct _cache_table cache_table[] = - - - enum _cache_type { -- CACHE_TYPE_NULL = 0, -- CACHE_TYPE_DATA = 1, -- CACHE_TYPE_INST = 2, -- CACHE_TYPE_UNIFIED = 3 -+ CTYPE_NULL = 0, -+ CTYPE_DATA = 1, -+ CTYPE_INST = 2, -+ CTYPE_UNIFIED = 3 - }; - - union _cpuid4_leaf_eax { -@@ -160,12 +158,7 @@ struct _cpuid4_info_regs { - struct amd_northbridge *nb; - }; - --struct _cpuid4_info { -- struct _cpuid4_info_regs base; -- DECLARE_BITMAP(shared_cpu_map, NR_CPUS); --}; -- --unsigned short num_cache_leaves; -+static unsigned short num_cache_leaves; - - /* AMD doesn't have CPUID4. Emulate it here to report the same - information to the user. This makes some assumptions about the machine: -@@ -221,6 +214,13 @@ static const unsigned short assocs[] = { - static const unsigned char levels[] = { 1, 1, 2, 3 }; - static const unsigned char types[] = { 1, 2, 3, 3 }; - -+static const enum cache_type cache_type_map[] = { -+ [CTYPE_NULL] = CACHE_TYPE_NOCACHE, -+ [CTYPE_DATA] = CACHE_TYPE_DATA, -+ [CTYPE_INST] = CACHE_TYPE_INST, -+ [CTYPE_UNIFIED] = CACHE_TYPE_UNIFIED, -+}; -+ - static void - amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, - union _cpuid4_leaf_ebx *ebx, -@@ -292,14 +292,8 @@ amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, - (ebx->split.ways_of_associativity + 1) - 1; - } - --struct _cache_attr { -- struct attribute attr; -- ssize_t (*show)(struct _cpuid4_info *, char *, unsigned int); -- ssize_t (*store)(struct _cpuid4_info *, const char *, size_t count, -- unsigned int); --}; -- - #if defined(CONFIG_AMD_NB) && defined(CONFIG_SYSFS) -+ - /* - * L3 cache descriptors - */ -@@ -326,20 +320,6 @@ static void amd_calc_l3_indices(struct amd_northbridge *nb) - l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1; - } - --static void amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) --{ -- int node; -- -- /* only for L3, and not in virtualized environments */ -- if (index < 3) -- return; -- -- node = amd_get_nb_id(smp_processor_id()); -- this_leaf->nb = node_to_amd_nb(node); -- if (this_leaf->nb && !this_leaf->nb->l3_cache.indices) -- amd_calc_l3_indices(this_leaf->nb); --} -- - /* - * check whether a slot used for disabling an L3 index is occupied. - * @l3: L3 cache descriptor -@@ -347,7 +327,7 @@ static void amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) - * - * @returns: the disabled index if used or negative value if slot free. - */ --int amd_get_l3_disable_slot(struct amd_northbridge *nb, unsigned slot) -+static int amd_get_l3_disable_slot(struct amd_northbridge *nb, unsigned slot) - { - unsigned int reg = 0; - -@@ -360,15 +340,13 @@ int amd_get_l3_disable_slot(struct amd_northbridge *nb, unsigned slot) - return -1; - } - --static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf, -+static ssize_t show_cache_disable(struct cacheinfo *this_leaf, char *buf, - unsigned int slot) - { - int index; -+ struct amd_northbridge *nb = this_leaf->priv; - -- if (!this_leaf->base.nb || !amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -- return -EINVAL; -- -- index = amd_get_l3_disable_slot(this_leaf->base.nb, slot); -+ index = amd_get_l3_disable_slot(nb, slot); - if (index >= 0) - return sprintf(buf, "%d\n", index); - -@@ -377,9 +355,10 @@ static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf, - - #define SHOW_CACHE_DISABLE(slot) \ - static ssize_t \ --show_cache_disable_##slot(struct _cpuid4_info *this_leaf, char *buf, \ -- unsigned int cpu) \ -+cache_disable_##slot##_show(struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ - { \ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); \ - return show_cache_disable(this_leaf, buf, slot); \ - } - SHOW_CACHE_DISABLE(0) -@@ -425,8 +404,8 @@ static void amd_l3_disable_index(struct amd_northbridge *nb, int cpu, - * - * @return: 0 on success, error status on failure - */ --int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, unsigned slot, -- unsigned long index) -+static int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, -+ unsigned slot, unsigned long index) - { - int ret = 0; - -@@ -447,28 +426,26 @@ int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, unsigned slot, - return 0; - } - --static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf, -- const char *buf, size_t count, -- unsigned int slot) -+static ssize_t store_cache_disable(struct cacheinfo *this_leaf, -+ const char *buf, size_t count, -+ unsigned int slot) - { - unsigned long val = 0; - int cpu, err = 0; -+ struct amd_northbridge *nb = this_leaf->priv; - - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - -- if (!this_leaf->base.nb || !amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -- return -EINVAL; -- -- cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map)); -+ cpu = cpumask_first(&this_leaf->shared_cpu_map); - - if (kstrtoul(buf, 10, &val) < 0) - return -EINVAL; - -- err = amd_set_l3_disable_slot(this_leaf->base.nb, cpu, slot, val); -+ err = amd_set_l3_disable_slot(nb, cpu, slot, val); - if (err) { - if (err == -EEXIST) -- pr_warning("L3 slot %d in use/index already disabled!\n", -+ pr_warn("L3 slot %d in use/index already disabled!\n", - slot); - return err; - } -@@ -477,41 +454,36 @@ static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf, - - #define STORE_CACHE_DISABLE(slot) \ - static ssize_t \ --store_cache_disable_##slot(struct _cpuid4_info *this_leaf, \ -- const char *buf, size_t count, \ -- unsigned int cpu) \ -+cache_disable_##slot##_store(struct device *dev, \ -+ struct device_attribute *attr, \ -+ const char *buf, size_t count) \ - { \ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); \ - return store_cache_disable(this_leaf, buf, count, slot); \ - } - STORE_CACHE_DISABLE(0) - STORE_CACHE_DISABLE(1) - --static struct _cache_attr cache_disable_0 = __ATTR(cache_disable_0, 0644, -- show_cache_disable_0, store_cache_disable_0); --static struct _cache_attr cache_disable_1 = __ATTR(cache_disable_1, 0644, -- show_cache_disable_1, store_cache_disable_1); -- --static ssize_t --show_subcaches(struct _cpuid4_info *this_leaf, char *buf, unsigned int cpu) -+static ssize_t subcaches_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { -- if (!this_leaf->base.nb || !amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -- return -EINVAL; -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ int cpu = cpumask_first(&this_leaf->shared_cpu_map); - - return sprintf(buf, "%x\n", amd_get_subcaches(cpu)); - } - --static ssize_t --store_subcaches(struct _cpuid4_info *this_leaf, const char *buf, size_t count, -- unsigned int cpu) -+static ssize_t subcaches_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) - { -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ int cpu = cpumask_first(&this_leaf->shared_cpu_map); - unsigned long val; - - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - -- if (!this_leaf->base.nb || !amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -- return -EINVAL; -- - if (kstrtoul(buf, 16, &val) < 0) - return -EINVAL; - -@@ -521,9 +493,92 @@ store_subcaches(struct _cpuid4_info *this_leaf, const char *buf, size_t count, - return count; - } - --static struct _cache_attr subcaches = -- __ATTR(subcaches, 0644, show_subcaches, store_subcaches); -+static DEVICE_ATTR_RW(cache_disable_0); -+static DEVICE_ATTR_RW(cache_disable_1); -+static DEVICE_ATTR_RW(subcaches); -+ -+static umode_t -+cache_private_attrs_is_visible(struct kobject *kobj, -+ struct attribute *attr, int unused) -+{ -+ struct device *dev = kobj_to_dev(kobj); -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ umode_t mode = attr->mode; -+ -+ if (!this_leaf->priv) -+ return 0; -+ -+ if ((attr == &dev_attr_subcaches.attr) && -+ amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -+ return mode; -+ -+ if ((attr == &dev_attr_cache_disable_0.attr || -+ attr == &dev_attr_cache_disable_1.attr) && -+ amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -+ return mode; -+ -+ return 0; -+} -+ -+static struct attribute_group cache_private_group = { -+ .is_visible = cache_private_attrs_is_visible, -+}; -+ -+static void init_amd_l3_attrs(void) -+{ -+ int n = 1; -+ static struct attribute **amd_l3_attrs; -+ -+ if (amd_l3_attrs) /* already initialized */ -+ return; -+ -+ if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -+ n += 2; -+ if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -+ n += 1; -+ -+ amd_l3_attrs = kcalloc(n, sizeof(*amd_l3_attrs), GFP_KERNEL); -+ if (!amd_l3_attrs) -+ return; -+ -+ n = 0; -+ if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) { -+ amd_l3_attrs[n++] = &dev_attr_cache_disable_0.attr; -+ amd_l3_attrs[n++] = &dev_attr_cache_disable_1.attr; -+ } -+ if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -+ amd_l3_attrs[n++] = &dev_attr_subcaches.attr; -+ -+ cache_private_group.attrs = amd_l3_attrs; -+} -+ -+const struct attribute_group * -+cache_get_priv_group(struct cacheinfo *this_leaf) -+{ -+ struct amd_northbridge *nb = this_leaf->priv; -+ -+ if (this_leaf->level < 3 || !nb) -+ return NULL; -+ -+ if (nb && nb->l3_cache.indices) -+ init_amd_l3_attrs(); - -+ return &cache_private_group; -+} -+ -+static void amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) -+{ -+ int node; -+ -+ /* only for L3, and not in virtualized environments */ -+ if (index < 3) -+ return; -+ -+ node = amd_get_nb_id(smp_processor_id()); -+ this_leaf->nb = node_to_amd_nb(node); -+ if (this_leaf->nb && !this_leaf->nb->l3_cache.indices) -+ amd_calc_l3_indices(this_leaf->nb); -+} - #else - #define amd_init_l3_cache(x, y) - #endif /* CONFIG_AMD_NB && CONFIG_SYSFS */ -@@ -537,7 +592,7 @@ cpuid4_cache_lookup_regs(int index, struct _cpuid4_info_regs *this_leaf) - unsigned edx; - - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { -- if (cpu_has_topoext) -+ if (boot_cpu_has(X86_FEATURE_TOPOEXT)) - cpuid_count(0x8000001d, index, &eax.full, - &ebx.full, &ecx.full, &edx); - else -@@ -547,7 +602,7 @@ cpuid4_cache_lookup_regs(int index, struct _cpuid4_info_regs *this_leaf) - cpuid_count(4, index, &eax.full, &ebx.full, &ecx.full, &edx); - } - -- if (eax.split.type == CACHE_TYPE_NULL) -+ if (eax.split.type == CTYPE_NULL) - return -EIO; /* better error ? */ - - this_leaf->eax = eax; -@@ -576,7 +631,7 @@ static int find_num_cache_leaves(struct cpuinfo_x86 *c) - /* Do cpuid(op) loop to find out num_cache_leaves */ - cpuid_count(op, i, &eax, &ebx, &ecx, &edx); - cache_eax.full = eax; -- } while (cache_eax.split.type != CACHE_TYPE_NULL); -+ } while (cache_eax.split.type != CTYPE_NULL); - return i; - } - -@@ -622,7 +677,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id) - void init_amd_cacheinfo(struct cpuinfo_x86 *c) - { - -- if (cpu_has_topoext) { -+ if (boot_cpu_has(X86_FEATURE_TOPOEXT)) { - num_cache_leaves = find_num_cache_leaves(c); - } else if (c->extended_cpuid_level >= 0x80000006) { - if (cpuid_edx(0x80000006) & 0xf000) -@@ -639,7 +694,7 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) - unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */ - unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */ - unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb; --#ifdef CONFIG_X86_HT -+#ifdef CONFIG_SMP - unsigned int cpu = c->cpu_index; - #endif - -@@ -657,36 +712,34 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) - * parameters cpuid leaf to find the cache details - */ - for (i = 0; i < num_cache_leaves; i++) { -- struct _cpuid4_info_regs this_leaf; -+ struct _cpuid4_info_regs this_leaf = {}; - int retval; - - retval = cpuid4_cache_lookup_regs(i, &this_leaf); -- if (retval >= 0) { -- switch (this_leaf.eax.split.level) { -- case 1: -- if (this_leaf.eax.split.type == -- CACHE_TYPE_DATA) -- new_l1d = this_leaf.size/1024; -- else if (this_leaf.eax.split.type == -- CACHE_TYPE_INST) -- new_l1i = this_leaf.size/1024; -- break; -- case 2: -- new_l2 = this_leaf.size/1024; -- num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; -- index_msb = get_count_order(num_threads_sharing); -- l2_id = c->apicid & ~((1 << index_msb) - 1); -- break; -- case 3: -- new_l3 = this_leaf.size/1024; -- num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; -- index_msb = get_count_order( -- num_threads_sharing); -- l3_id = c->apicid & ~((1 << index_msb) - 1); -- break; -- default: -- break; -- } -+ if (retval < 0) -+ continue; -+ -+ switch (this_leaf.eax.split.level) { -+ case 1: -+ if (this_leaf.eax.split.type == CTYPE_DATA) -+ new_l1d = this_leaf.size/1024; -+ else if (this_leaf.eax.split.type == CTYPE_INST) -+ new_l1i = this_leaf.size/1024; -+ break; -+ case 2: -+ new_l2 = this_leaf.size/1024; -+ num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; -+ index_msb = get_count_order(num_threads_sharing); -+ l2_id = c->apicid & ~((1 << index_msb) - 1); -+ break; -+ case 3: -+ new_l3 = this_leaf.size/1024; -+ num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; -+ index_msb = get_count_order(num_threads_sharing); -+ l3_id = c->apicid & ~((1 << index_msb) - 1); -+ break; -+ default: -+ break; - } - } - } -@@ -760,34 +813,40 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) - - if (new_l2) { - l2 = new_l2; --#ifdef CONFIG_X86_HT -+#ifdef CONFIG_SMP - per_cpu(cpu_llc_id, cpu) = l2_id; - #endif - } - - if (new_l3) { - l3 = new_l3; --#ifdef CONFIG_X86_HT -+#ifdef CONFIG_SMP - per_cpu(cpu_llc_id, cpu) = l3_id; - #endif - } - -+#ifdef CONFIG_SMP -+ /* -+ * If cpu_llc_id is not yet set, this means cpuid_level < 4 which in -+ * turns means that the only possibility is SMT (as indicated in -+ * cpuid1). Since cpuid2 doesn't specify shared caches, and we know -+ * that SMT shares all caches, we can unconditionally set cpu_llc_id to -+ * c->phys_proc_id. -+ */ -+ if (per_cpu(cpu_llc_id, cpu) == BAD_APICID) -+ per_cpu(cpu_llc_id, cpu) = c->phys_proc_id; -+#endif -+ - c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d)); - - return l2; - } - --#ifdef CONFIG_SYSFS -- --/* pointer to _cpuid4_info array (for each cache leaf) */ --static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info); --#define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y])) -- --#ifdef CONFIG_SMP -- --static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) -+static int __cache_amd_cpumap_setup(unsigned int cpu, int index, -+ struct _cpuid4_info_regs *base) - { -- struct _cpuid4_info *this_leaf; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf; - int i, sibling; - - /* -@@ -796,40 +855,43 @@ static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) - */ - if (index == 3) { - for_each_cpu(i, cpu_llc_shared_mask(cpu)) { -- if (!per_cpu(ici_cpuid4_info, i)) -+ this_cpu_ci = get_cpu_cacheinfo(i); -+ if (!this_cpu_ci->info_list) - continue; -- this_leaf = CPUID4_INFO_IDX(i, index); -+ this_leaf = this_cpu_ci->info_list + index; - for_each_cpu(sibling, cpu_llc_shared_mask(cpu)) { - if (!cpu_online(sibling)) - continue; -- set_bit(sibling, this_leaf->shared_cpu_map); -+ cpumask_set_cpu(sibling, -+ &this_leaf->shared_cpu_map); - } - } -- } else if (cpu_has_topoext) { -+ } else if (boot_cpu_has(X86_FEATURE_TOPOEXT)) { - unsigned int apicid, nshared, first, last; - -- if (!per_cpu(ici_cpuid4_info, cpu)) -- return 0; -- -- this_leaf = CPUID4_INFO_IDX(cpu, index); -- nshared = this_leaf->base.eax.split.num_threads_sharing + 1; -+ this_leaf = this_cpu_ci->info_list + index; -+ nshared = base->eax.split.num_threads_sharing + 1; - apicid = cpu_data(cpu).apicid; - first = apicid - (apicid % nshared); - last = first + nshared - 1; - - for_each_online_cpu(i) { -+ this_cpu_ci = get_cpu_cacheinfo(i); -+ if (!this_cpu_ci->info_list) -+ continue; -+ - apicid = cpu_data(i).apicid; - if ((apicid < first) || (apicid > last)) - continue; -- if (!per_cpu(ici_cpuid4_info, i)) -- continue; -- this_leaf = CPUID4_INFO_IDX(i, index); -+ -+ this_leaf = this_cpu_ci->info_list + index; - - for_each_online_cpu(sibling) { - apicid = cpu_data(sibling).apicid; - if ((apicid < first) || (apicid > last)) - continue; -- set_bit(sibling, this_leaf->shared_cpu_map); -+ cpumask_set_cpu(sibling, -+ &this_leaf->shared_cpu_map); - } - } - } else -@@ -838,72 +900,70 @@ static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) - return 1; - } - --static void cache_shared_cpu_map_setup(unsigned int cpu, int index) -+static void __cache_cpumap_setup(unsigned int cpu, int index, -+ struct _cpuid4_info_regs *base) - { -- struct _cpuid4_info *this_leaf, *sibling_leaf; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf, *sibling_leaf; - unsigned long num_threads_sharing; - int index_msb, i; - struct cpuinfo_x86 *c = &cpu_data(cpu); - - if (c->x86_vendor == X86_VENDOR_AMD) { -- if (cache_shared_amd_cpu_map_setup(cpu, index)) -+ if (__cache_amd_cpumap_setup(cpu, index, base)) - return; - } - -- this_leaf = CPUID4_INFO_IDX(cpu, index); -- num_threads_sharing = 1 + this_leaf->base.eax.split.num_threads_sharing; -+ this_leaf = this_cpu_ci->info_list + index; -+ num_threads_sharing = 1 + base->eax.split.num_threads_sharing; - -+ cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); - if (num_threads_sharing == 1) -- cpumask_set_cpu(cpu, to_cpumask(this_leaf->shared_cpu_map)); -- else { -- index_msb = get_count_order(num_threads_sharing); -+ return; - -- for_each_online_cpu(i) { -- if (cpu_data(i).apicid >> index_msb == -- c->apicid >> index_msb) { -- cpumask_set_cpu(i, -- to_cpumask(this_leaf->shared_cpu_map)); -- if (i != cpu && per_cpu(ici_cpuid4_info, i)) { -- sibling_leaf = -- CPUID4_INFO_IDX(i, index); -- cpumask_set_cpu(cpu, to_cpumask( -- sibling_leaf->shared_cpu_map)); -- } -- } -+ index_msb = get_count_order(num_threads_sharing); -+ -+ for_each_online_cpu(i) -+ if (cpu_data(i).apicid >> index_msb == c->apicid >> index_msb) { -+ struct cpu_cacheinfo *sib_cpu_ci = get_cpu_cacheinfo(i); -+ -+ if (i == cpu || !sib_cpu_ci->info_list) -+ continue;/* skip if itself or no cacheinfo */ -+ sibling_leaf = sib_cpu_ci->info_list + index; -+ cpumask_set_cpu(i, &this_leaf->shared_cpu_map); -+ cpumask_set_cpu(cpu, &sibling_leaf->shared_cpu_map); - } -- } --} --static void cache_remove_shared_cpu_map(unsigned int cpu, int index) --{ -- struct _cpuid4_info *this_leaf, *sibling_leaf; -- int sibling; -- -- this_leaf = CPUID4_INFO_IDX(cpu, index); -- for_each_cpu(sibling, to_cpumask(this_leaf->shared_cpu_map)) { -- sibling_leaf = CPUID4_INFO_IDX(sibling, index); -- cpumask_clear_cpu(cpu, -- to_cpumask(sibling_leaf->shared_cpu_map)); -- } --} --#else --static void cache_shared_cpu_map_setup(unsigned int cpu, int index) --{ - } - --static void cache_remove_shared_cpu_map(unsigned int cpu, int index) -+static void ci_leaf_init(struct cacheinfo *this_leaf, -+ struct _cpuid4_info_regs *base) - { -+ this_leaf->id = base->id; -+ this_leaf->attributes = CACHE_ID; -+ this_leaf->level = base->eax.split.level; -+ this_leaf->type = cache_type_map[base->eax.split.type]; -+ this_leaf->coherency_line_size = -+ base->ebx.split.coherency_line_size + 1; -+ this_leaf->ways_of_associativity = -+ base->ebx.split.ways_of_associativity + 1; -+ this_leaf->size = base->size; -+ this_leaf->number_of_sets = base->ecx.split.number_of_sets + 1; -+ this_leaf->physical_line_partition = -+ base->ebx.split.physical_line_partition + 1; -+ this_leaf->priv = base->nb; - } --#endif - --static void free_cache_attributes(unsigned int cpu) -+static int __init_cache_level(unsigned int cpu) - { -- int i; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); - -- for (i = 0; i < num_cache_leaves; i++) -- cache_remove_shared_cpu_map(cpu, i); -- -- kfree(per_cpu(ici_cpuid4_info, cpu)); -- per_cpu(ici_cpuid4_info, cpu) = NULL; -+ if (!num_cache_leaves) -+ return -ENOENT; -+ if (!this_cpu_ci) -+ return -EINVAL; -+ this_cpu_ci->num_levels = 3; -+ this_cpu_ci->num_leaves = num_cache_leaves; -+ return 0; - } - - /* -@@ -925,414 +985,37 @@ static void get_cache_id(int cpu, struct _cpuid4_info_regs *id4_regs) - int get_cpu_cache_id(int cpu, int level) - { - int i; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); - -- if (!per_cpu(ici_cpuid4_info, cpu)) -- return -1; -+ for (i = 0; i < this_cpu_ci->num_leaves; i++) { -+ struct cacheinfo *this_leaf = this_cpu_ci->info_list + i; - -- for (i = 0; i < num_cache_leaves; i++) { -- struct _cpuid4_info *this_leaf = CPUID4_INFO_IDX(cpu, i); -- -- if (this_leaf->base.eax.split.level == level) -- return this_leaf->base.id; -+ if (this_leaf->level == level) -+ return this_leaf->id; - } - - return -1; - } - --static void get_cpu_leaves(void *_retval) -+static int __populate_cache_leaves(unsigned int cpu) - { -- int j, *retval = _retval, cpu = smp_processor_id(); -- -- /* Do cpuid and store the results */ -- for (j = 0; j < num_cache_leaves; j++) { -- struct _cpuid4_info *this_leaf = CPUID4_INFO_IDX(cpu, j); -+ unsigned int idx, ret; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf = this_cpu_ci->info_list; -+ struct _cpuid4_info_regs id4_regs = {}; - -- *retval = cpuid4_cache_lookup_regs(j, &this_leaf->base); -- if (unlikely(*retval < 0)) { -- int i; -- -- for (i = 0; i < j; i++) -- cache_remove_shared_cpu_map(cpu, i); -- break; -- } -- cache_shared_cpu_map_setup(cpu, j); -- get_cache_id(cpu, &this_leaf->base); -+ for (idx = 0; idx < this_cpu_ci->num_leaves; idx++) { -+ ret = cpuid4_cache_lookup_regs(idx, &id4_regs); -+ if (ret) -+ return ret; -+ get_cache_id(cpu, &id4_regs); -+ ci_leaf_init(this_leaf++, &id4_regs); -+ __cache_cpumap_setup(cpu, idx, &id4_regs); - } --} -- --static int detect_cache_attributes(unsigned int cpu) --{ -- int retval; -+ this_cpu_ci->cpu_map_populated = true; - -- if (num_cache_leaves == 0) -- return -ENOENT; -- -- per_cpu(ici_cpuid4_info, cpu) = kzalloc( -- sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); -- if (per_cpu(ici_cpuid4_info, cpu) == NULL) -- return -ENOMEM; -- -- smp_call_function_single(cpu, get_cpu_leaves, &retval, true); -- if (retval) { -- kfree(per_cpu(ici_cpuid4_info, cpu)); -- per_cpu(ici_cpuid4_info, cpu) = NULL; -- } -- -- return retval; --} -- --#include --#include --#include -- --/* pointer to kobject for cpuX/cache */ --static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject); -- --struct _index_kobject { -- struct kobject kobj; -- unsigned int cpu; -- unsigned short index; --}; -- --/* pointer to array of kobjects for cpuX/cache/indexY */ --static DEFINE_PER_CPU(struct _index_kobject *, ici_index_kobject); --#define INDEX_KOBJECT_PTR(x, y) (&((per_cpu(ici_index_kobject, x))[y])) -- --#define show_one_plus(file_name, object, val) \ --static ssize_t show_##file_name(struct _cpuid4_info *this_leaf, char *buf, \ -- unsigned int cpu) \ --{ \ -- return sprintf(buf, "%lu\n", (unsigned long)this_leaf->object + val); \ --} -- --show_one_plus(level, base.eax.split.level, 0); --show_one_plus(coherency_line_size, base.ebx.split.coherency_line_size, 1); --show_one_plus(physical_line_partition, base.ebx.split.physical_line_partition, 1); --show_one_plus(ways_of_associativity, base.ebx.split.ways_of_associativity, 1); --show_one_plus(number_of_sets, base.ecx.split.number_of_sets, 1); -- --static ssize_t show_id(struct _cpuid4_info *this_leaf, char *buf, -- unsigned int cpu) --{ -- return sprintf(buf, "%u\n", this_leaf->base.id); --} -- --static ssize_t show_size(struct _cpuid4_info *this_leaf, char *buf, -- unsigned int cpu) --{ -- return sprintf(buf, "%luK\n", this_leaf->base.size / 1024); --} -- --static ssize_t show_shared_cpu_map_func(struct _cpuid4_info *this_leaf, -- int type, char *buf) --{ -- ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf; -- int n = 0; -- -- if (len > 1) { -- const struct cpumask *mask; -- -- mask = to_cpumask(this_leaf->shared_cpu_map); -- n = type ? -- cpulist_scnprintf(buf, len-2, mask) : -- cpumask_scnprintf(buf, len-2, mask); -- buf[n++] = '\n'; -- buf[n] = '\0'; -- } -- return n; --} -- --static inline ssize_t show_shared_cpu_map(struct _cpuid4_info *leaf, char *buf, -- unsigned int cpu) --{ -- return show_shared_cpu_map_func(leaf, 0, buf); --} -- --static inline ssize_t show_shared_cpu_list(struct _cpuid4_info *leaf, char *buf, -- unsigned int cpu) --{ -- return show_shared_cpu_map_func(leaf, 1, buf); --} -- --static ssize_t show_type(struct _cpuid4_info *this_leaf, char *buf, -- unsigned int cpu) --{ -- switch (this_leaf->base.eax.split.type) { -- case CACHE_TYPE_DATA: -- return sprintf(buf, "Data\n"); -- case CACHE_TYPE_INST: -- return sprintf(buf, "Instruction\n"); -- case CACHE_TYPE_UNIFIED: -- return sprintf(buf, "Unified\n"); -- default: -- return sprintf(buf, "Unknown\n"); -- } --} -- --#define to_object(k) container_of(k, struct _index_kobject, kobj) --#define to_attr(a) container_of(a, struct _cache_attr, attr) -- --#define define_one_ro(_name) \ --static struct _cache_attr _name = \ -- __ATTR(_name, 0444, show_##_name, NULL) -- --define_one_ro(id); --define_one_ro(level); --define_one_ro(type); --define_one_ro(coherency_line_size); --define_one_ro(physical_line_partition); --define_one_ro(ways_of_associativity); --define_one_ro(number_of_sets); --define_one_ro(size); --define_one_ro(shared_cpu_map); --define_one_ro(shared_cpu_list); -- --static struct attribute *default_attrs[] = { -- &id.attr, -- &type.attr, -- &level.attr, -- &coherency_line_size.attr, -- &physical_line_partition.attr, -- &ways_of_associativity.attr, -- &number_of_sets.attr, -- &size.attr, -- &shared_cpu_map.attr, -- &shared_cpu_list.attr, -- NULL --}; -- --#ifdef CONFIG_AMD_NB --static struct attribute **amd_l3_attrs(void) --{ -- static struct attribute **attrs; -- int n; -- -- if (attrs) -- return attrs; -- -- n = ARRAY_SIZE(default_attrs); -- -- if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) -- n += 2; -- -- if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -- n += 1; -- -- attrs = kzalloc(n * sizeof (struct attribute *), GFP_KERNEL); -- if (attrs == NULL) -- return attrs = default_attrs; -- -- for (n = 0; default_attrs[n]; n++) -- attrs[n] = default_attrs[n]; -- -- if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) { -- attrs[n++] = &cache_disable_0.attr; -- attrs[n++] = &cache_disable_1.attr; -- } -- -- if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) -- attrs[n++] = &subcaches.attr; -- -- return attrs; --} --#endif -- --static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf) --{ -- struct _cache_attr *fattr = to_attr(attr); -- struct _index_kobject *this_leaf = to_object(kobj); -- ssize_t ret; -- -- ret = fattr->show ? -- fattr->show(CPUID4_INFO_IDX(this_leaf->cpu, this_leaf->index), -- buf, this_leaf->cpu) : -- 0; -- return ret; --} -- --static ssize_t store(struct kobject *kobj, struct attribute *attr, -- const char *buf, size_t count) --{ -- struct _cache_attr *fattr = to_attr(attr); -- struct _index_kobject *this_leaf = to_object(kobj); -- ssize_t ret; -- -- ret = fattr->store ? -- fattr->store(CPUID4_INFO_IDX(this_leaf->cpu, this_leaf->index), -- buf, count, this_leaf->cpu) : -- 0; -- return ret; --} -- --static const struct sysfs_ops sysfs_ops = { -- .show = show, -- .store = store, --}; -- --static struct kobj_type ktype_cache = { -- .sysfs_ops = &sysfs_ops, -- .default_attrs = default_attrs, --}; -- --static struct kobj_type ktype_percpu_entry = { -- .sysfs_ops = &sysfs_ops, --}; -- --static void cpuid4_cache_sysfs_exit(unsigned int cpu) --{ -- kfree(per_cpu(ici_cache_kobject, cpu)); -- kfree(per_cpu(ici_index_kobject, cpu)); -- per_cpu(ici_cache_kobject, cpu) = NULL; -- per_cpu(ici_index_kobject, cpu) = NULL; -- free_cache_attributes(cpu); --} -- --static int cpuid4_cache_sysfs_init(unsigned int cpu) --{ -- int err; -- -- if (num_cache_leaves == 0) -- return -ENOENT; -- -- err = detect_cache_attributes(cpu); -- if (err) -- return err; -- -- /* Allocate all required memory */ -- per_cpu(ici_cache_kobject, cpu) = -- kzalloc(sizeof(struct kobject), GFP_KERNEL); -- if (unlikely(per_cpu(ici_cache_kobject, cpu) == NULL)) -- goto err_out; -- -- per_cpu(ici_index_kobject, cpu) = kzalloc( -- sizeof(struct _index_kobject) * num_cache_leaves, GFP_KERNEL); -- if (unlikely(per_cpu(ici_index_kobject, cpu) == NULL)) -- goto err_out; -- -- return 0; -- --err_out: -- cpuid4_cache_sysfs_exit(cpu); -- return -ENOMEM; --} -- --static DECLARE_BITMAP(cache_dev_map, NR_CPUS); -- --/* Add/Remove cache interface for CPU device */ --static int cache_add_dev(struct device *dev) --{ -- unsigned int cpu = dev->id; -- unsigned long i, j; -- struct _index_kobject *this_object; -- struct _cpuid4_info *this_leaf; -- int retval; -- -- retval = cpuid4_cache_sysfs_init(cpu); -- if (unlikely(retval < 0)) -- return retval; -- -- retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu), -- &ktype_percpu_entry, -- &dev->kobj, "%s", "cache"); -- if (retval < 0) { -- cpuid4_cache_sysfs_exit(cpu); -- return retval; -- } -- -- for (i = 0; i < num_cache_leaves; i++) { -- this_object = INDEX_KOBJECT_PTR(cpu, i); -- this_object->cpu = cpu; -- this_object->index = i; -- -- this_leaf = CPUID4_INFO_IDX(cpu, i); -- -- ktype_cache.default_attrs = default_attrs; --#ifdef CONFIG_AMD_NB -- if (this_leaf->base.nb) -- ktype_cache.default_attrs = amd_l3_attrs(); --#endif -- retval = kobject_init_and_add(&(this_object->kobj), -- &ktype_cache, -- per_cpu(ici_cache_kobject, cpu), -- "index%1lu", i); -- if (unlikely(retval)) { -- for (j = 0; j < i; j++) -- kobject_put(&(INDEX_KOBJECT_PTR(cpu, j)->kobj)); -- kobject_put(per_cpu(ici_cache_kobject, cpu)); -- cpuid4_cache_sysfs_exit(cpu); -- return retval; -- } -- kobject_uevent(&(this_object->kobj), KOBJ_ADD); -- } -- cpumask_set_cpu(cpu, to_cpumask(cache_dev_map)); -- -- kobject_uevent(per_cpu(ici_cache_kobject, cpu), KOBJ_ADD); - return 0; - } - --static void cache_remove_dev(struct device *dev) --{ -- unsigned int cpu = dev->id; -- unsigned long i; -- -- if (per_cpu(ici_cpuid4_info, cpu) == NULL) -- return; -- if (!cpumask_test_cpu(cpu, to_cpumask(cache_dev_map))) -- return; -- cpumask_clear_cpu(cpu, to_cpumask(cache_dev_map)); -- -- for (i = 0; i < num_cache_leaves; i++) -- kobject_put(&(INDEX_KOBJECT_PTR(cpu, i)->kobj)); -- kobject_put(per_cpu(ici_cache_kobject, cpu)); -- cpuid4_cache_sysfs_exit(cpu); --} -- --static int cacheinfo_cpu_callback(struct notifier_block *nfb, -- unsigned long action, void *hcpu) --{ -- unsigned int cpu = (unsigned long)hcpu; -- struct device *dev; -- -- dev = get_cpu_device(cpu); -- switch (action) { -- case CPU_ONLINE: -- case CPU_ONLINE_FROZEN: -- cache_add_dev(dev); -- break; -- case CPU_DEAD: -- case CPU_DEAD_FROZEN: -- cache_remove_dev(dev); -- break; -- } -- return NOTIFY_OK; --} -- --static struct notifier_block cacheinfo_cpu_notifier = { -- .notifier_call = cacheinfo_cpu_callback, --}; -- --static int __init cache_sysfs_init(void) --{ -- int i, err = 0; -- -- if (num_cache_leaves == 0) -- return 0; -- -- cpu_notifier_register_begin(); -- for_each_online_cpu(i) { -- struct device *dev = get_cpu_device(i); -- -- err = cache_add_dev(dev); -- if (err) -- goto out; -- } -- __register_hotcpu_notifier(&cacheinfo_cpu_notifier); -- --out: -- cpu_notifier_register_done(); -- return err; --} -- --device_initcall(cache_sysfs_init); -- --#endif -+DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level) -+DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves) -diff --git a/drivers/base/Makefile b/drivers/base/Makefile -index 53c3fe1..527d291 100644 ---- a/drivers/base/Makefile -+++ b/drivers/base/Makefile -@@ -4,7 +4,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \ - driver.o class.o platform.o \ - cpu.o firmware.o init.o map.o devres.o \ - attribute_container.o transport_class.o \ -- topology.o container.o property.o devcon.o -+ topology.o container.o property.o devcon.o cacheinfo.o - obj-$(CONFIG_DEVTMPFS) += devtmpfs.o - obj-$(CONFIG_DMA_CMA) += dma-contiguous.o - obj-y += power/ -diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c -new file mode 100644 -index 0000000..eb3af27 ---- /dev/null -+++ b/drivers/base/cacheinfo.c -@@ -0,0 +1,662 @@ -+/* -+ * cacheinfo support - processor cache information via sysfs -+ * -+ * Based on arch/x86/kernel/cpu/intel_cacheinfo.c -+ * Author: Sudeep Holla -+ * -+ * 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 "as is" WITHOUT ANY WARRANTY of any -+ * kind, whether express or implied; 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, see . -+ */ -+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* pointer to per cpu cacheinfo */ -+static DEFINE_PER_CPU(struct cpu_cacheinfo, ci_cpu_cacheinfo); -+#define ci_cacheinfo(cpu) (&per_cpu(ci_cpu_cacheinfo, cpu)) -+#define cache_leaves(cpu) (ci_cacheinfo(cpu)->num_leaves) -+#define per_cpu_cacheinfo(cpu) (ci_cacheinfo(cpu)->info_list) -+ -+struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu) -+{ -+ return ci_cacheinfo(cpu); -+} -+ -+#ifdef CONFIG_OF -+static int cache_setup_of_node(unsigned int cpu) -+{ -+ struct device_node *np; -+ struct cacheinfo *this_leaf; -+ struct device *cpu_dev = get_cpu_device(cpu); -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ unsigned int index = 0; -+ -+ /* skip if of_node is already populated */ -+ if (this_cpu_ci->info_list->of_node) -+ return 0; -+ -+ if (!cpu_dev) { -+ pr_err("No cpu device for CPU %d\n", cpu); -+ return -ENODEV; -+ } -+ np = cpu_dev->of_node; -+ if (!np) { -+ pr_err("Failed to find cpu%d device node\n", cpu); -+ return -ENOENT; -+ } -+ -+ while (index < cache_leaves(cpu)) { -+ this_leaf = this_cpu_ci->info_list + index; -+ if (this_leaf->level != 1) -+ np = of_find_next_cache_node(np); -+ else -+ np = of_node_get(np);/* cpu node itself */ -+ if (!np) -+ break; -+ this_leaf->of_node = np; -+ index++; -+ } -+ -+ if (index != cache_leaves(cpu)) /* not all OF nodes populated */ -+ return -ENOENT; -+ -+ return 0; -+} -+ -+static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, -+ struct cacheinfo *sib_leaf) -+{ -+ return sib_leaf->of_node == this_leaf->of_node; -+} -+ -+/* OF properties to query for a given cache type */ -+struct cache_type_info { -+ const char *size_prop; -+ const char *line_size_props[2]; -+ const char *nr_sets_prop; -+}; -+ -+static const struct cache_type_info cache_type_info[] = { -+ { -+ .size_prop = "cache-size", -+ .line_size_props = { "cache-line-size", -+ "cache-block-size", }, -+ .nr_sets_prop = "cache-sets", -+ }, { -+ .size_prop = "i-cache-size", -+ .line_size_props = { "i-cache-line-size", -+ "i-cache-block-size", }, -+ .nr_sets_prop = "i-cache-sets", -+ }, { -+ .size_prop = "d-cache-size", -+ .line_size_props = { "d-cache-line-size", -+ "d-cache-block-size", }, -+ .nr_sets_prop = "d-cache-sets", -+ }, -+}; -+ -+static inline int get_cacheinfo_idx(enum cache_type type) -+{ -+ if (type == CACHE_TYPE_UNIFIED) -+ return 0; -+ return type; -+} -+ -+static void cache_size(struct cacheinfo *this_leaf) -+{ -+ const char *propname; -+ const __be32 *cache_size; -+ int ct_idx; -+ -+ ct_idx = get_cacheinfo_idx(this_leaf->type); -+ propname = cache_type_info[ct_idx].size_prop; -+ -+ cache_size = of_get_property(this_leaf->of_node, propname, NULL); -+ if (cache_size) -+ this_leaf->size = of_read_number(cache_size, 1); -+} -+ -+/* not cache_line_size() because that's a macro in include/linux/cache.h */ -+static void cache_get_line_size(struct cacheinfo *this_leaf) -+{ -+ const __be32 *line_size; -+ int i, lim, ct_idx; -+ -+ ct_idx = get_cacheinfo_idx(this_leaf->type); -+ lim = ARRAY_SIZE(cache_type_info[ct_idx].line_size_props); -+ -+ for (i = 0; i < lim; i++) { -+ const char *propname; -+ -+ propname = cache_type_info[ct_idx].line_size_props[i]; -+ line_size = of_get_property(this_leaf->of_node, propname, NULL); -+ if (line_size) -+ break; -+ } -+ -+ if (line_size) -+ this_leaf->coherency_line_size = of_read_number(line_size, 1); -+} -+ -+static void cache_nr_sets(struct cacheinfo *this_leaf) -+{ -+ const char *propname; -+ const __be32 *nr_sets; -+ int ct_idx; -+ -+ ct_idx = get_cacheinfo_idx(this_leaf->type); -+ propname = cache_type_info[ct_idx].nr_sets_prop; -+ -+ nr_sets = of_get_property(this_leaf->of_node, propname, NULL); -+ if (nr_sets) -+ this_leaf->number_of_sets = of_read_number(nr_sets, 1); -+} -+ -+static void cache_associativity(struct cacheinfo *this_leaf) -+{ -+ unsigned int line_size = this_leaf->coherency_line_size; -+ unsigned int nr_sets = this_leaf->number_of_sets; -+ unsigned int size = this_leaf->size; -+ -+ /* -+ * If the cache is fully associative, there is no need to -+ * check the other properties. -+ */ -+ if (!(nr_sets == 1) && (nr_sets > 0 && size > 0 && line_size > 0)) -+ this_leaf->ways_of_associativity = (size / nr_sets) / line_size; -+} -+ -+static void cache_of_override_properties(unsigned int cpu) -+{ -+ int index; -+ struct cacheinfo *this_leaf; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ -+ for (index = 0; index < cache_leaves(cpu); index++) { -+ this_leaf = this_cpu_ci->info_list + index; -+ cache_size(this_leaf); -+ cache_get_line_size(this_leaf); -+ cache_nr_sets(this_leaf); -+ cache_associativity(this_leaf); -+ } -+} -+#else -+static void cache_of_override_properties(unsigned int cpu) { } -+static inline int cache_setup_of_node(unsigned int cpu) { return 0; } -+static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, -+ struct cacheinfo *sib_leaf) -+{ -+ /* -+ * For non-DT systems, assume unique level 1 cache, system-wide -+ * shared caches for all other levels. This will be used only if -+ * arch specific code has not populated shared_cpu_map -+ */ -+ return !(this_leaf->level == 1); -+} -+#endif -+ -+static int cache_shared_cpu_map_setup(unsigned int cpu) -+{ -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf, *sib_leaf; -+ unsigned int index; -+ int ret = 0; -+ -+ if (this_cpu_ci->cpu_map_populated) -+ return 0; -+ -+ if (of_have_populated_dt()) -+ ret = cache_setup_of_node(cpu); -+ else if (!acpi_disabled) -+ /* No cache property/hierarchy support yet in ACPI */ -+ ret = -ENOTSUPP; -+ if (ret) -+ return ret; -+ -+ for (index = 0; index < cache_leaves(cpu); index++) { -+ unsigned int i; -+ -+ this_leaf = this_cpu_ci->info_list + index; -+ /* skip if shared_cpu_map is already populated */ -+ if (!cpumask_empty(&this_leaf->shared_cpu_map)) -+ continue; -+ -+ cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); -+ for_each_online_cpu(i) { -+ struct cpu_cacheinfo *sib_cpu_ci = get_cpu_cacheinfo(i); -+ -+ if (i == cpu || !sib_cpu_ci->info_list) -+ continue;/* skip if itself or no cacheinfo */ -+ sib_leaf = sib_cpu_ci->info_list + index; -+ if (cache_leaves_are_shared(this_leaf, sib_leaf)) { -+ cpumask_set_cpu(cpu, &sib_leaf->shared_cpu_map); -+ cpumask_set_cpu(i, &this_leaf->shared_cpu_map); -+ } -+ } -+ } -+ -+ return 0; -+} -+ -+static void cache_shared_cpu_map_remove(unsigned int cpu) -+{ -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf, *sib_leaf; -+ unsigned int sibling, index; -+ -+ for (index = 0; index < cache_leaves(cpu); index++) { -+ this_leaf = this_cpu_ci->info_list + index; -+ for_each_cpu(sibling, &this_leaf->shared_cpu_map) { -+ struct cpu_cacheinfo *sib_cpu_ci; -+ -+ if (sibling == cpu) /* skip itself */ -+ continue; -+ -+ sib_cpu_ci = get_cpu_cacheinfo(sibling); -+ if (!sib_cpu_ci->info_list) -+ continue; -+ -+ sib_leaf = sib_cpu_ci->info_list + index; -+ cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map); -+ cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); -+ } -+ of_node_put(this_leaf->of_node); -+ } -+} -+ -+static void cache_override_properties(unsigned int cpu) -+{ -+ if (of_have_populated_dt()) -+ return cache_of_override_properties(cpu); -+} -+ -+static void free_cache_attributes(unsigned int cpu) -+{ -+ if (!per_cpu_cacheinfo(cpu)) -+ return; -+ -+ cache_shared_cpu_map_remove(cpu); -+ -+ kfree(per_cpu_cacheinfo(cpu)); -+ per_cpu_cacheinfo(cpu) = NULL; -+} -+ -+int __weak init_cache_level(unsigned int cpu) -+{ -+ return -ENOENT; -+} -+ -+int __weak populate_cache_leaves(unsigned int cpu) -+{ -+ return -ENOENT; -+} -+ -+static int detect_cache_attributes(unsigned int cpu) -+{ -+ int ret; -+ -+ if (init_cache_level(cpu) || !cache_leaves(cpu)) -+ return -ENOENT; -+ -+ per_cpu_cacheinfo(cpu) = kcalloc(cache_leaves(cpu), -+ sizeof(struct cacheinfo), GFP_KERNEL); -+ if (per_cpu_cacheinfo(cpu) == NULL) -+ return -ENOMEM; -+ -+ ret = populate_cache_leaves(cpu); -+ if (ret) -+ goto free_ci; -+ /* -+ * For systems using DT for cache hierarchy, of_node and shared_cpu_map -+ * will be set up here only if they are not populated already -+ */ -+ ret = cache_shared_cpu_map_setup(cpu); -+ if (ret) { -+ pr_warn("Unable to detect cache hierarchy for CPU %d\n", cpu); -+ goto free_ci; -+ } -+ -+ cache_override_properties(cpu); -+ return 0; -+ -+free_ci: -+ free_cache_attributes(cpu); -+ return ret; -+} -+ -+/* pointer to cpuX/cache device */ -+static DEFINE_PER_CPU(struct device *, ci_cache_dev); -+#define per_cpu_cache_dev(cpu) (per_cpu(ci_cache_dev, cpu)) -+ -+static cpumask_t cache_dev_map; -+ -+/* pointer to array of devices for cpuX/cache/indexY */ -+static DEFINE_PER_CPU(struct device **, ci_index_dev); -+#define per_cpu_index_dev(cpu) (per_cpu(ci_index_dev, cpu)) -+#define per_cache_index_dev(cpu, idx) ((per_cpu_index_dev(cpu))[idx]) -+ -+#define show_one(file_name, object) \ -+static ssize_t file_name##_show(struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); \ -+ return sprintf(buf, "%u\n", this_leaf->object); \ -+} -+ -+show_one(id, id); -+show_one(level, level); -+show_one(coherency_line_size, coherency_line_size); -+show_one(number_of_sets, number_of_sets); -+show_one(physical_line_partition, physical_line_partition); -+show_one(ways_of_associativity, ways_of_associativity); -+ -+static ssize_t size_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ -+ return sprintf(buf, "%uK\n", this_leaf->size >> 10); -+} -+ -+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); -+} -+ -+static ssize_t shared_cpu_map_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ return shared_cpumap_show_func(dev, false, buf); -+} -+ -+static ssize_t shared_cpu_list_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ return shared_cpumap_show_func(dev, true, buf); -+} -+ -+static ssize_t type_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ -+ switch (this_leaf->type) { -+ case CACHE_TYPE_DATA: -+ return sprintf(buf, "Data\n"); -+ case CACHE_TYPE_INST: -+ return sprintf(buf, "Instruction\n"); -+ case CACHE_TYPE_UNIFIED: -+ return sprintf(buf, "Unified\n"); -+ default: -+ return -EINVAL; -+ } -+} -+ -+static ssize_t allocation_policy_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ unsigned int ci_attr = this_leaf->attributes; -+ int n = 0; -+ -+ if ((ci_attr & CACHE_READ_ALLOCATE) && (ci_attr & CACHE_WRITE_ALLOCATE)) -+ n = sprintf(buf, "ReadWriteAllocate\n"); -+ else if (ci_attr & CACHE_READ_ALLOCATE) -+ n = sprintf(buf, "ReadAllocate\n"); -+ else if (ci_attr & CACHE_WRITE_ALLOCATE) -+ n = sprintf(buf, "WriteAllocate\n"); -+ return n; -+} -+ -+static ssize_t write_policy_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ unsigned int ci_attr = this_leaf->attributes; -+ int n = 0; -+ -+ if (ci_attr & CACHE_WRITE_THROUGH) -+ n = sprintf(buf, "WriteThrough\n"); -+ else if (ci_attr & CACHE_WRITE_BACK) -+ n = sprintf(buf, "WriteBack\n"); -+ return n; -+} -+ -+static DEVICE_ATTR_RO(id); -+static DEVICE_ATTR_RO(level); -+static DEVICE_ATTR_RO(type); -+static DEVICE_ATTR_RO(coherency_line_size); -+static DEVICE_ATTR_RO(ways_of_associativity); -+static DEVICE_ATTR_RO(number_of_sets); -+static DEVICE_ATTR_RO(size); -+static DEVICE_ATTR_RO(allocation_policy); -+static DEVICE_ATTR_RO(write_policy); -+static DEVICE_ATTR_RO(shared_cpu_map); -+static DEVICE_ATTR_RO(shared_cpu_list); -+static DEVICE_ATTR_RO(physical_line_partition); -+ -+static struct attribute *cache_default_attrs[] = { -+ &dev_attr_id.attr, -+ &dev_attr_type.attr, -+ &dev_attr_level.attr, -+ &dev_attr_shared_cpu_map.attr, -+ &dev_attr_shared_cpu_list.attr, -+ &dev_attr_coherency_line_size.attr, -+ &dev_attr_ways_of_associativity.attr, -+ &dev_attr_number_of_sets.attr, -+ &dev_attr_size.attr, -+ &dev_attr_allocation_policy.attr, -+ &dev_attr_write_policy.attr, -+ &dev_attr_physical_line_partition.attr, -+ NULL -+}; -+ -+static umode_t -+cache_default_attrs_is_visible(struct kobject *kobj, -+ struct attribute *attr, int unused) -+{ -+ struct device *dev = kobj_to_dev(kobj); -+ struct cacheinfo *this_leaf = dev_get_drvdata(dev); -+ const struct cpumask *mask = &this_leaf->shared_cpu_map; -+ umode_t mode = attr->mode; -+ -+ if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID)) -+ return mode; -+ if ((attr == &dev_attr_type.attr) && this_leaf->type) -+ return mode; -+ if ((attr == &dev_attr_level.attr) && this_leaf->level) -+ return mode; -+ if ((attr == &dev_attr_shared_cpu_map.attr) && !cpumask_empty(mask)) -+ return mode; -+ if ((attr == &dev_attr_shared_cpu_list.attr) && !cpumask_empty(mask)) -+ return mode; -+ if ((attr == &dev_attr_coherency_line_size.attr) && -+ this_leaf->coherency_line_size) -+ return mode; -+ if ((attr == &dev_attr_ways_of_associativity.attr) && -+ this_leaf->size) /* allow 0 = full associativity */ -+ return mode; -+ if ((attr == &dev_attr_number_of_sets.attr) && -+ this_leaf->number_of_sets) -+ return mode; -+ if ((attr == &dev_attr_size.attr) && this_leaf->size) -+ return mode; -+ if ((attr == &dev_attr_write_policy.attr) && -+ (this_leaf->attributes & CACHE_WRITE_POLICY_MASK)) -+ return mode; -+ if ((attr == &dev_attr_allocation_policy.attr) && -+ (this_leaf->attributes & CACHE_ALLOCATE_POLICY_MASK)) -+ return mode; -+ if ((attr == &dev_attr_physical_line_partition.attr) && -+ this_leaf->physical_line_partition) -+ return mode; -+ -+ return 0; -+} -+ -+static const struct attribute_group cache_default_group = { -+ .attrs = cache_default_attrs, -+ .is_visible = cache_default_attrs_is_visible, -+}; -+ -+static const struct attribute_group *cache_default_groups[] = { -+ &cache_default_group, -+ NULL, -+}; -+ -+static const struct attribute_group *cache_private_groups[] = { -+ &cache_default_group, -+ NULL, /* Place holder for private group */ -+ NULL, -+}; -+ -+const struct attribute_group * -+__weak cache_get_priv_group(struct cacheinfo *this_leaf) -+{ -+ return NULL; -+} -+ -+static const struct attribute_group ** -+cache_get_attribute_groups(struct cacheinfo *this_leaf) -+{ -+ const struct attribute_group *priv_group = -+ cache_get_priv_group(this_leaf); -+ -+ if (!priv_group) -+ return cache_default_groups; -+ -+ if (!cache_private_groups[1]) -+ cache_private_groups[1] = priv_group; -+ -+ return cache_private_groups; -+} -+ -+/* Add/Remove cache interface for CPU device */ -+static void cpu_cache_sysfs_exit(unsigned int cpu) -+{ -+ int i; -+ struct device *ci_dev; -+ -+ if (per_cpu_index_dev(cpu)) { -+ for (i = 0; i < cache_leaves(cpu); i++) { -+ ci_dev = per_cache_index_dev(cpu, i); -+ if (!ci_dev) -+ continue; -+ device_unregister(ci_dev); -+ } -+ kfree(per_cpu_index_dev(cpu)); -+ per_cpu_index_dev(cpu) = NULL; -+ } -+ device_unregister(per_cpu_cache_dev(cpu)); -+ per_cpu_cache_dev(cpu) = NULL; -+} -+ -+static int cpu_cache_sysfs_init(unsigned int cpu) -+{ -+ struct device *dev = get_cpu_device(cpu); -+ -+ if (per_cpu_cacheinfo(cpu) == NULL) -+ return -ENOENT; -+ -+ per_cpu_cache_dev(cpu) = cpu_device_create(dev, NULL, NULL, "cache"); -+ if (IS_ERR(per_cpu_cache_dev(cpu))) -+ return PTR_ERR(per_cpu_cache_dev(cpu)); -+ -+ /* Allocate all required memory */ -+ per_cpu_index_dev(cpu) = kcalloc(cache_leaves(cpu), -+ sizeof(struct device *), GFP_KERNEL); -+ if (unlikely(per_cpu_index_dev(cpu) == NULL)) -+ goto err_out; -+ -+ return 0; -+ -+err_out: -+ cpu_cache_sysfs_exit(cpu); -+ return -ENOMEM; -+} -+ -+static int cache_add_dev(unsigned int cpu) -+{ -+ unsigned int i; -+ int rc; -+ struct device *ci_dev, *parent; -+ struct cacheinfo *this_leaf; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ const struct attribute_group **cache_groups; -+ -+ rc = cpu_cache_sysfs_init(cpu); -+ if (unlikely(rc < 0)) -+ return rc; -+ -+ parent = per_cpu_cache_dev(cpu); -+ for (i = 0; i < cache_leaves(cpu); i++) { -+ this_leaf = this_cpu_ci->info_list + i; -+ if (this_leaf->disable_sysfs) -+ continue; -+ cache_groups = cache_get_attribute_groups(this_leaf); -+ ci_dev = cpu_device_create(parent, this_leaf, cache_groups, -+ "index%1u", i); -+ if (IS_ERR(ci_dev)) { -+ rc = PTR_ERR(ci_dev); -+ goto err; -+ } -+ per_cache_index_dev(cpu, i) = ci_dev; -+ } -+ cpumask_set_cpu(cpu, &cache_dev_map); -+ -+ return 0; -+err: -+ cpu_cache_sysfs_exit(cpu); -+ return rc; -+} -+ -+static int cacheinfo_cpu_online(unsigned int cpu) -+{ -+ int rc = detect_cache_attributes(cpu); -+ -+ if (rc) -+ return rc; -+ rc = cache_add_dev(cpu); -+ if (rc) -+ free_cache_attributes(cpu); -+ return rc; -+} -+ -+static int cacheinfo_cpu_pre_down(unsigned int cpu) -+{ -+ if (cpumask_test_and_clear_cpu(cpu, &cache_dev_map)) -+ cpu_cache_sysfs_exit(cpu); -+ -+ free_cache_attributes(cpu); -+ return 0; -+} -+ -+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); -+} -+device_initcall(cacheinfo_sysfs_init); -diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c -index 290609b..65e786d 100644 ---- a/drivers/base/cpu.c -+++ b/drivers/base/cpu.c -@@ -338,6 +338,60 @@ struct device *get_cpu_device(unsigned cpu) - } - EXPORT_SYMBOL_GPL(get_cpu_device); - -+static void device_create_release(struct device *dev) -+{ -+ kfree(dev); -+} -+ -+static struct device * -+__cpu_device_create(struct device *parent, void *drvdata, -+ const struct attribute_group **groups, -+ const char *fmt, va_list args) -+{ -+ struct device *dev = NULL; -+ int retval = -ENODEV; -+ -+ dev = kzalloc(sizeof(*dev), GFP_KERNEL); -+ if (!dev) { -+ retval = -ENOMEM; -+ goto error; -+ } -+ -+ device_initialize(dev); -+ dev->parent = parent; -+ dev->groups = groups; -+ dev->release = device_create_release; -+ dev_set_drvdata(dev, drvdata); -+ -+ retval = kobject_set_name_vargs(&dev->kobj, fmt, args); -+ if (retval) -+ goto error; -+ -+ retval = device_add(dev); -+ if (retval) -+ goto error; -+ -+ return dev; -+ -+error: -+ put_device(dev); -+ return ERR_PTR(retval); -+} -+ -+struct device *cpu_device_create(struct device *parent, void *drvdata, -+ const struct attribute_group **groups, -+ const char *fmt, ...) -+{ -+ va_list vargs; -+ struct device *dev; -+ -+ va_start(vargs, fmt); -+ dev = __cpu_device_create(parent, drvdata, groups, fmt, vargs); -+ va_end(vargs); -+ return dev; -+} -+EXPORT_SYMBOL_GPL(cpu_device_create); -+ - #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE - static DEVICE_ATTR(modalias, 0444, arch_print_cpu_modalias, NULL); - #endif -diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h -new file mode 100644 -index 0000000..6a524bf ---- /dev/null -+++ b/include/linux/cacheinfo.h -@@ -0,0 +1,104 @@ -+#ifndef _LINUX_CACHEINFO_H -+#define _LINUX_CACHEINFO_H -+ -+#include -+#include -+#include -+ -+struct device_node; -+struct attribute; -+ -+enum cache_type { -+ CACHE_TYPE_NOCACHE = 0, -+ CACHE_TYPE_INST = BIT(0), -+ CACHE_TYPE_DATA = BIT(1), -+ CACHE_TYPE_SEPARATE = CACHE_TYPE_INST | CACHE_TYPE_DATA, -+ CACHE_TYPE_UNIFIED = BIT(2), -+}; -+ -+/** -+ * struct cacheinfo - represent a cache leaf node -+ * @id: This cache's id. It is unique among caches with the same (type, level). -+ * @type: type of the cache - data, inst or unified -+ * @level: represents the hierarchy in the multi-level cache -+ * @coherency_line_size: size of each cache line usually representing -+ * the minimum amount of data that gets transferred from memory -+ * @number_of_sets: total number of sets, a set is a collection of cache -+ * lines sharing the same index -+ * @ways_of_associativity: number of ways in which a particular memory -+ * block can be placed in the cache -+ * @physical_line_partition: number of physical cache lines sharing the -+ * same cachetag -+ * @size: Total size of the cache -+ * @shared_cpu_map: logical cpumask representing all the cpus sharing -+ * this cache node -+ * @attributes: bitfield representing various cache attributes -+ * @of_node: if devicetree is used, this represents either the cpu node in -+ * case there's no explicit cache node or the cache node itself in the -+ * device tree -+ * @disable_sysfs: indicates whether this node is visible to the user via -+ * sysfs or not -+ * @priv: pointer to any private data structure specific to particular -+ * cache design -+ * -+ * While @of_node, @disable_sysfs and @priv are used for internal book -+ * keeping, the remaining members form the core properties of the cache -+ */ -+struct cacheinfo { -+ unsigned int id; -+ enum cache_type type; -+ unsigned int level; -+ unsigned int coherency_line_size; -+ unsigned int number_of_sets; -+ unsigned int ways_of_associativity; -+ unsigned int physical_line_partition; -+ unsigned int size; -+ cpumask_t shared_cpu_map; -+ unsigned int attributes; -+#define CACHE_WRITE_THROUGH BIT(0) -+#define CACHE_WRITE_BACK BIT(1) -+#define CACHE_WRITE_POLICY_MASK \ -+ (CACHE_WRITE_THROUGH | CACHE_WRITE_BACK) -+#define CACHE_READ_ALLOCATE BIT(2) -+#define CACHE_WRITE_ALLOCATE BIT(3) -+#define CACHE_ALLOCATE_POLICY_MASK \ -+ (CACHE_READ_ALLOCATE | CACHE_WRITE_ALLOCATE) -+#define CACHE_ID BIT(4) -+ -+ struct device_node *of_node; -+ bool disable_sysfs; -+ void *priv; -+}; -+ -+struct cpu_cacheinfo { -+ struct cacheinfo *info_list; -+ unsigned int num_levels; -+ unsigned int num_leaves; -+ bool cpu_map_populated; -+}; -+ -+/* -+ * Helpers to make sure "func" is executed on the cpu whose cache -+ * attributes are being detected -+ */ -+#define DEFINE_SMP_CALL_CACHE_FUNCTION(func) \ -+static inline void _##func(void *ret) \ -+{ \ -+ int cpu = smp_processor_id(); \ -+ *(int *)ret = __##func(cpu); \ -+} \ -+ \ -+int func(unsigned int cpu) \ -+{ \ -+ int ret; \ -+ smp_call_function_single(cpu, _##func, &ret, true); \ -+ return ret; \ -+} -+ -+struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu); -+int init_cache_level(unsigned int cpu); -+int populate_cache_leaves(unsigned int cpu); -+ -+const struct attribute_group *cache_get_priv_group(struct cacheinfo *this_leaf); -+ -+#endif /* _LINUX_CACHEINFO_H */ -diff --git a/include/linux/cpu.h b/include/linux/cpu.h -index 82180fe..434d92c 100644 ---- a/include/linux/cpu.h -+++ b/include/linux/cpu.h -@@ -51,6 +51,9 @@ extern ssize_t cpu_show_l1tf(struct device *dev, - extern ssize_t cpu_show_mds(struct device *dev, - struct device_attribute *attr, char *buf); - -+extern struct device *cpu_device_create(struct device *parent, void *drvdata, -+ const struct attribute_group **groups, -+ const char *fmt, ...); - #ifdef CONFIG_HOTPLUG_CPU - extern void unregister_cpu(struct cpu *cpu); - extern ssize_t arch_cpu_probe(const char *, size_t); --- -2.7.4 - diff --git a/kernel/kernel-std/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch b/kernel/kernel-std/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch deleted file mode 100644 index a9a9f4821..000000000 --- a/kernel/kernel-std/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch +++ /dev/null @@ -1,375 +0,0 @@ -From 1d197374f04642f9a5e71cc013d65d5438c35dc3 Mon Sep 17 00:00:00 2001 -Message-Id: <1d197374f04642f9a5e71cc013d65d5438c35dc3.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Kam Nasim -Date: Wed, 23 Aug 2017 17:58:12 -0400 -Subject: [PATCH 22/26] 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 -Signed-off-by: Robin Lu ---- - 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 - 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 - diff --git a/kernel/kernel-std/centos/patches/US103091-IMA-System-Configuration.patch b/kernel/kernel-std/centos/patches/US103091-IMA-System-Configuration.patch deleted file mode 100644 index c9fcdacb5..000000000 --- a/kernel/kernel-std/centos/patches/US103091-IMA-System-Configuration.patch +++ /dev/null @@ -1,246 +0,0 @@ -From 43dfb08aa6e053bcf1cf5696ea6bc3b9b2aa3d53 Mon Sep 17 00:00:00 2001 -Message-Id: <43dfb08aa6e053bcf1cf5696ea6bc3b9b2aa3d53.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Kam Nasim -Date: Wed, 4 Oct 2017 14:02:10 -0400 -Subject: [PATCH 23/26] US103091: IMA: System Configuration - -Normally (if trusted integrity keyring is disabled), the _ima keyring -needs to be created by user space (specifically systemd), but that has -the added disadvantage of requiring the IMA public key to reside on the -file system as opposed to being compiled in. Somebody could render some -serious Grade A damage by corrupting this public key on the FS. -Crippling the system if IMA 'enforce' action is enabled. - -We will therefore create the IMA keyring inside the kernel and load the -IMA public key as a compiled data blob, similar to how the Kernel loads -trusted X509 keys into the system truststore (.system_keyring) - -Signed-off-by: Jim Somerville ---- - .gitignore | 1 + - include/keys/system_keyring.h | 2 ++ - kernel/Makefile | 42 ++++++++++++++++++++-- - kernel/ima_certificate.S | 20 +++++++++++ - kernel/system_keyring.c | 82 +++++++++++++++++++++++++++++++++++++++++++ - 5 files changed, 145 insertions(+), 2 deletions(-) - create mode 100644 kernel/ima_certificate.S - -diff --git a/.gitignore b/.gitignore -index f73f35f..7148219 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -106,3 +106,4 @@ localversion - - # Red Hat key security - kernel/x509_certificate_list -+kernel/ima_x509_certificate -diff --git a/include/keys/system_keyring.h b/include/keys/system_keyring.h -index 0e49b3c..6b2da90 100644 ---- a/include/keys/system_keyring.h -+++ b/include/keys/system_keyring.h -@@ -34,4 +34,6 @@ static inline struct key *get_system_trusted_keyring(void) - - #endif /* CONFIG_SYSTEM_TRUSTED_KEYRING */ - -+extern struct key *ima_keyring; -+ - #endif /* _KEYS_SYSTEM_KEYRING_H */ -diff --git a/kernel/Makefile b/kernel/Makefile -index 44a82c1..000b9a8 100644 ---- a/kernel/Makefile -+++ b/kernel/Makefile -@@ -57,7 +57,7 @@ obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o - obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o qrwlock_gen.o - obj-$(CONFIG_LOCK_SPIN_ON_OWNER) += osq_lock.o - obj-$(CONFIG_UID16) += uid16.o --obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o -+obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o ima_certificate.o - obj-$(CONFIG_MODULES) += module.o - obj-$(CONFIG_MODULE_SIG) += module_signing.o - obj-$(CONFIG_MODULE_SIG_UEFI) += modsign_uefi.o -@@ -199,7 +199,45 @@ targets += $(obj)/.x509.list - $(obj)/.x509.list: - @echo $(X509_CERTIFICATES) >$@ - --clean-files := x509_certificate_list .x509.list -+ -+############################################################################### -+# -+# We will roll in the IMA X.509 certificate and pull it in the kernel -+# so that it gets loaded into the _ima keyring during boot. -+# -+# Ideally, this should have been treated similar to other .x509 certificates -+# (X509_CERTIFICATES), but those all get loaded into the system trusted keyring -+# and since the canonical pathnames are not available in the x509_certificate_list -+# compiled data blob, there is no way to isolate the IMA certificate from the -+# rest. Therefore we treat the IMA certificate as a seperate blob all together. -+# -+# We look in the source root for the IMA certificate, of name "ima_signing_key.pub" -+# -+############################################################################### -+IMA_X509_CERTIFICATE := $(srctree)/ima_signing_key.pub -+ -+ifneq ($(wildcard $(obj)/.x509.ima),) -+ifneq ($(shell cat $(obj)/.x509.ima),$(IMA_X509_CERTIFICATE)) -+$(info IMA: X.509 certificate changed) -+$(shell rm $(obj)/.x509.ima) -+endif -+endif -+ -+kernel/ima_certificate.o: $(obj)/ima_x509_certificate -+ -+quiet_cmd_imacert = CERTS $@ -+ cmd_imacert = cat $(IMA_X509_CERTIFICATE) >$@ $(foreach IMA_X509,$(IMA_X509_CERTIFICATE),; echo " - Including cert $(IMA_X509)") -+ -+targets += $(obj)/ima_x509_certificate -+$(obj)/ima_x509_certificate: $(IMA_X509_CERTIFICATE) $(obj)/.x509.ima -+ $(call if_changed,imacert) -+ -+targets += $(obj)/.x509.ima -+$(obj)/.x509.ima: -+ @echo $(IMA_X509_CERTIFICATE) >$@ -+ -+ -+clean-files := x509_certificate_list .x509.list ima_x509_certificate .x509.ima - endif - - ifeq ($(CONFIG_MODULE_SIG),y) -diff --git a/kernel/ima_certificate.S b/kernel/ima_certificate.S -new file mode 100644 -index 0000000..0c665dd ---- /dev/null -+++ b/kernel/ima_certificate.S -@@ -0,0 +1,20 @@ -+#include -+#include -+ -+ __INITRODATA -+ -+ .align 8 -+ .globl VMLINUX_SYMBOL(ima_system_certificate) -+VMLINUX_SYMBOL(ima_system_certificate): -+__cert_list_start: -+ .incbin "kernel/ima_x509_certificate" -+__cert_list_end: -+ -+ .align 8 -+ .globl VMLINUX_SYMBOL(ima_system_certificate_size) -+VMLINUX_SYMBOL(ima_system_certificate_size): -+#ifdef CONFIG_64BIT -+ .quad __cert_list_end - __cert_list_start -+#else -+ .long __cert_list_end - __cert_list_start -+#endif -diff --git a/kernel/system_keyring.c b/kernel/system_keyring.c -index c15e93f..92beb15 100644 ---- a/kernel/system_keyring.c -+++ b/kernel/system_keyring.c -@@ -23,10 +23,15 @@ EXPORT_SYMBOL_GPL(system_trusted_keyring); - #ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING - struct key *system_blacklist_keyring; - #endif -+struct key *ima_keyring; -+EXPORT_SYMBOL_GPL(ima_keyring); - - extern __initconst const u8 system_certificate_list[]; - extern __initconst const unsigned long system_certificate_list_size; - -+extern __initconst const u8 ima_system_certificate[]; -+extern __initconst const unsigned long ima_system_certificate_size; -+ - /* - * Load the compiled-in keys - */ -@@ -57,6 +62,27 @@ static __init int system_trusted_keyring_init(void) - - set_bit(KEY_FLAG_TRUSTED_ONLY, &system_blacklist_keyring->flags); - #endif -+ /* Normally (if trusted integrity keyring is disabled), the _ima -+ * keyring needs to be created by user space but that has the -+ * added disadvantage of requiring the IMA public key to reside on -+ * the file system as opposed to being compiled in. -+ * We will therefore form a _ima keyring here and load build -+ * the IMA X.509 certificate -+ * -+ * N.B: The IMA keyring only allows root userspace view & read ops -+ */ -+ pr_notice("Initializing system IMA keyring\n"); -+ -+ ima_keyring = keyring_alloc("_ima", -+ KUIDT_INIT(0), KGIDT_INIT(0), -+ current_cred(), -+ ((KEY_POS_ALL & ~KEY_POS_SETATTR) | -+ KEY_USR_VIEW | KEY_USR_READ | KEY_USR_SEARCH), -+ KEY_ALLOC_NOT_IN_QUOTA, NULL); -+ if (IS_ERR(ima_keyring)) -+ panic("Can't allocate system IMA keyring\n"); -+ -+ set_bit(KEY_FLAG_TRUSTED_ONLY, &ima_keyring->flags); - - return 0; - } -@@ -121,3 +147,59 @@ dodgy_cert: - return 0; - } - late_initcall(load_system_certificate_list); -+ -+/* -+ * Load the compiled-in IMA certificate. -+ */ -+static __init int load_ima_system_certificate(void) -+{ -+ key_ref_t key; -+ const u8 *p, *end; -+ size_t plen; -+ -+ pr_notice("Loading compiled-in X.509 IMA certificate\n"); -+ -+ p = ima_system_certificate; -+ end = p + ima_system_certificate_size; -+ while (p < end) { -+ /* Each cert begins with an ASN.1 SEQUENCE tag and must be more -+ * than 256 bytes in size. -+ */ -+ if (end - p < 4) -+ goto dodgy_cert; -+ if (p[0] != 0x30 && -+ p[1] != 0x82) -+ goto dodgy_cert; -+ plen = (p[2] << 8) | p[3]; -+ plen += 4; -+ if (plen > end - p) -+ goto dodgy_cert; -+ -+ key = key_create_or_update(make_key_ref(ima_keyring, 1), -+ "asymmetric", -+ NULL, -+ p, -+ plen, -+ ((KEY_POS_ALL & ~KEY_POS_SETATTR) | -+ KEY_USR_VIEW | KEY_USR_READ), -+ KEY_ALLOC_NOT_IN_QUOTA | -+ KEY_ALLOC_TRUSTED); -+ if (IS_ERR(key)) { -+ pr_err("Problem loading in-kernel X.509 certificate (%ld)\n", -+ PTR_ERR(key)); -+ } else { -+ set_bit(KEY_FLAG_BUILTIN, &key_ref_to_ptr(key)->flags); -+ pr_notice("Loaded X.509 cert '%s'\n", -+ key_ref_to_ptr(key)->description); -+ key_ref_put(key); -+ } -+ p += plen; -+ } -+ -+ return 0; -+ -+dodgy_cert: -+ pr_err("Problem parsing in-kernel X.509 IMA certificate\n"); -+ return 0; -+} -+late_initcall(load_ima_system_certificate); --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/affine-compute-kernel-threads.patch b/kernel/kernel-std/centos/patches/affine-compute-kernel-threads.patch deleted file mode 100644 index 597655266..000000000 --- a/kernel/kernel-std/centos/patches/affine-compute-kernel-threads.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 6b6edb5a389c03e208e6a123a7807af66283237d Mon Sep 17 00:00:00 2001 -Message-Id: <6b6edb5a389c03e208e6a123a7807af66283237d.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Chris Friesen -Date: Tue, 24 Nov 2015 16:27:28 -0500 -Subject: [PATCH 05/26] affine compute kernel threads - -This is a kernel enhancement to configure the cpu affinity of kernel -threads via kernel boot option kthread_cpus=. The compute -kickstart file and compute-huge.sh scripts will update grub with the -new option. - -With kthread_cpus specified, the cpumask is immediately applied upon -thread launch. This does not affect kernel threads that specify cpu -and node. - -Note: this is based off of Christoph Lameter's patch at -https://lwn.net/Articles/565932/ with the only difference being -the kernel parameter changed from kthread to kthread_cpus. - -Signed-off-by: Christoph Lameter -Signed-off-by: Chris Friesen -[VT: The existing "isolcpus" - kernel bootarg, cgroup/cpuset, and taskset might provide the some - way to have cpu isolation. However none of them satisfies the requirements. - Replacing spaces with tabs. Combine two calls of set_cpus_allowed_ptr() - in kernel_init_freeable() in init/main.c into one. Performed tests] -Signed-off-by: Vu Tran - -Signed-off-by: Jim Somerville ---- - Documentation/kernel-parameters.txt | 10 ++++++++++ - include/linux/cpumask.h | 2 ++ - init/main.c | 6 ++---- - kernel/cpu.c | 13 +++++++++++++ - kernel/kmod.c | 3 +++ - kernel/kthread.c | 4 ++-- - 6 files changed, 32 insertions(+), 6 deletions(-) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 1806170..2f7feb0 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -1551,6 +1551,16 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - - kpti [X86-64] Enable kernel page table isolation. - -+ kthread_cpus= [KNL, SMP] Only run kernel threads on the specified -+ list of processors. The kernel will start threads -+ on the indicated processors only (unless there -+ are specific reasons to run a thread with -+ different affinities). This can be used to make -+ init start on certain processors and also to -+ control where kmod and other user space threads -+ are being spawned. Allows to keep kernel threads -+ away from certain cores unless absoluteluy necessary. -+ - kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs. - Default is 0 (don't ignore, but inject #GP) - -diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h -index 14b4972..37a6adf 100644 ---- a/include/linux/cpumask.h -+++ b/include/linux/cpumask.h -@@ -52,6 +52,7 @@ extern int nr_cpu_ids; - * cpu_present_mask - has bit 'cpu' set iff cpu is populated - * cpu_online_mask - has bit 'cpu' set iff cpu available to scheduler - * cpu_active_mask - has bit 'cpu' set iff cpu available to migration -+ * cpu_kthread_mask - has bit 'cpu' set iff general kernel threads allowed - * - * If !CONFIG_HOTPLUG_CPU, present == possible, and active == online. - * -@@ -88,6 +89,7 @@ extern const struct cpumask *const cpu_possible_mask; - extern const struct cpumask *const cpu_online_mask; - extern const struct cpumask *const cpu_present_mask; - extern const struct cpumask *const cpu_active_mask; -+extern const struct cpumask *const cpu_kthread_mask; - - #if NR_CPUS > 1 - #define num_online_cpus() cpumask_weight(cpu_online_mask) -diff --git a/init/main.c b/init/main.c -index 085c9c5..089f83d 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -959,10 +959,6 @@ static noinline void __init kernel_init_freeable(void) - * init can allocate pages on any node - */ - set_mems_allowed(node_states[N_MEMORY]); -- /* -- * init can run on any cpu. -- */ -- set_cpus_allowed_ptr(current, cpu_all_mask); - - cad_pid = task_pid(current); - -@@ -978,6 +974,8 @@ static noinline void __init kernel_init_freeable(void) - - do_basic_setup(); - -+ set_cpus_allowed_ptr(current, cpu_kthread_mask); -+ - /* Open the /dev/console on the rootfs, this should never fail */ - if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) - pr_err("Warning: unable to open an initial console.\n"); -diff --git a/kernel/cpu.c b/kernel/cpu.c -index 0d9e250..6c156bd 100644 ---- a/kernel/cpu.c -+++ b/kernel/cpu.c -@@ -1012,6 +1012,19 @@ static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly; - const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits); - EXPORT_SYMBOL(cpu_active_mask); - -+static DECLARE_BITMAP(cpu_kthread_bits, CONFIG_NR_CPUS) __read_mostly -+ = CPU_BITS_ALL; -+const struct cpumask *const cpu_kthread_mask = to_cpumask(cpu_kthread_bits); -+EXPORT_SYMBOL(cpu_kthread_mask); -+ -+static int __init kthread_setup(char *str) -+{ -+ cpulist_parse(str, (struct cpumask *)&cpu_kthread_bits); -+ return 1; -+} -+__setup("kthread_cpus=", kthread_setup); -+ -+ - void set_cpu_possible(unsigned int cpu, bool possible) - { - if (possible) -diff --git a/kernel/kmod.c b/kernel/kmod.c -index 86ab754..4bf584b 100644 ---- a/kernel/kmod.c -+++ b/kernel/kmod.c -@@ -204,6 +204,9 @@ static int ____call_usermodehelper(void *data) - flush_signal_handlers(current, 1); - spin_unlock_irq(¤t->sighand->siglock); - -+ /* We can run only where init is allowed to run. */ -+ set_cpus_allowed_ptr(current, cpu_kthread_mask); -+ - /* - * Our parent is keventd, which runs with elevated scheduling priority. - * Avoid propagating that into the userspace child. -diff --git a/kernel/kthread.c b/kernel/kthread.c -index 703d910..7ea32eb 100644 ---- a/kernel/kthread.c -+++ b/kernel/kthread.c -@@ -284,7 +284,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), - * The kernel thread should not inherit these properties. - */ - sched_setscheduler_nocheck(create.result, SCHED_NORMAL, ¶m); -- set_cpus_allowed_ptr(create.result, cpu_all_mask); -+ set_cpus_allowed_ptr(create.result, cpu_kthread_mask); - } - return create.result; - } -@@ -454,7 +454,7 @@ int kthreadd(void *unused) - /* Setup a clean context for our children to inherit. */ - set_task_comm(tsk, "kthreadd"); - ignore_signals(tsk); -- set_cpus_allowed_ptr(tsk, cpu_all_mask); -+ set_cpus_allowed_ptr(tsk, cpu_kthread_mask); - set_mems_allowed(node_states[N_MEMORY]); - - current->flags |= PF_NOFREEZE; --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch b/kernel/kernel-std/centos/patches/aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch deleted file mode 100644 index 0bdea252f..000000000 --- a/kernel/kernel-std/centos/patches/aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 6771ec5b24042ea92c2a872d28b41e39c4445c68 Mon Sep 17 00:00:00 2001 -Message-Id: <6771ec5b24042ea92c2a872d28b41e39c4445c68.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Hannes Reinecke -Date: Mon, 6 Jul 2015 13:07:58 +0200 -Subject: [PATCH 24/26] aic94xx: Skip reading user settings if flash is not - found - -If no user settings are found it's pointless trying to -read them from flash. So skip that step. -This also fixes a compilation warning about uninitialized variables in -aic94xx. - -Signed-off-by: Hannes Reinecke -Reviewed-by: Christoph Hellwig -Signed-off-by: James Bottomley -Signed-off-by: Jim Somerville ---- - drivers/scsi/aic94xx/aic94xx_sds.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c -index edb43fd..c831e30 100644 ---- a/drivers/scsi/aic94xx/aic94xx_sds.c -+++ b/drivers/scsi/aic94xx/aic94xx_sds.c -@@ -983,7 +983,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, - { - int err, i; - u32 offs, size; -- struct asd_ll_el *el; -+ struct asd_ll_el *el = NULL; - struct asd_ctrla_phy_settings *ps; - struct asd_ctrla_phy_settings dflt_ps; - -@@ -1004,6 +1004,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, - - size = sizeof(struct asd_ctrla_phy_settings); - ps = &dflt_ps; -+ goto out_process; - } - - if (size == 0) -@@ -1028,7 +1029,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, - ASD_DPRINTK("couldn't find ctrla phy settings struct\n"); - goto out2; - } -- -+out_process: - err = asd_process_ctrla_phy_settings(asd_ha, ps); - if (err) { - ASD_DPRINTK("couldn't process ctrla phy settings\n"); --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch b/kernel/kernel-std/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch deleted file mode 100644 index ab7fd499e..000000000 --- a/kernel/kernel-std/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch +++ /dev/null @@ -1,224 +0,0 @@ -From b6eb39977df83c5ceca5b35c041bb2923e5a47d8 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Akinobu Mita -Date: Tue, 31 May 2016 16:09:04 -0400 -Subject: [PATCH 10/26] cma: add placement specifier for "cma=" kernel - parameter - -Commit 5ea3b1b2f8ad9162684431ce6188102ca4c64b7a upstream -Backported-by: Nam Ninh - -Currently, "cma=" kernel parameter is used to specify the size of CMA, -but we can't specify where it is located. We want to locate CMA below -4GB for devices only supporting 32-bit addressing on 64-bit systems -without iommu. - -This enables to specify the placement of CMA by extending "cma=" kernel -parameter. - -Examples: - 1. locate 64MB CMA below 4GB by "cma=64M@0-4G" - 2. locate 64MB CMA exact at 512MB by "cma=64M@512M" - -Note that the DMA contiguous memory allocator on x86 assumes that -page_address() works for the pages to allocate. So this change requires -to limit end address of contiguous memory area upto max_pfn_mapped to -prevent from locating it on highmem area by the argument of -dma_contiguous_reserve(). - -Signed-off-by: Akinobu Mita -Cc: Marek Szyprowski -Cc: Konrad Rzeszutek Wilk -Cc: David Woodhouse -Cc: Don Dutile -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: Andi Kleen -Cc: Yinghai Lu -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Jim Somerville ---- - Documentation/kernel-parameters.txt | 7 +++++-- - arch/x86/kernel/setup.c | 2 +- - drivers/base/dma-contiguous.c | 42 ++++++++++++++++++++++++++++--------- - include/linux/dma-contiguous.h | 9 +++++--- - 4 files changed, 44 insertions(+), 16 deletions(-) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 590c8c2..c8f8f82 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -580,8 +580,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - Also note the kernel might malfunction if you disable - some critical bits. - -- cma=nn[MG] [ARM,KNL] -- Sets the size of kernel global memory area for contiguous -+ cma=nn[MG]@[start[MG][-end[MG]]] -+ [ARM,X86,KNL] -+ Sets the size of kernel global memory area for -+ contiguous memory allocations and optionally the -+ placement constraint by the physical address range of - memory allocations. For more information, see - include/linux/dma-contiguous.h - -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index 9eca4ac..4e39287 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -1298,7 +1298,7 @@ void __init setup_arch(char **cmdline_p) - setup_real_mode(); - - memblock_set_current_limit(get_max_mapped()); -- dma_contiguous_reserve(0); -+ dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT); - - /* - * NOTE: On x86-32, only from this point on, fixmaps are ready for use. -diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c -index a0f89fc..a7d5bda 100644 ---- a/drivers/base/dma-contiguous.c -+++ b/drivers/base/dma-contiguous.c -@@ -59,11 +59,22 @@ struct cma *dma_contiguous_default_area; - */ - static const phys_addr_t size_bytes = CMA_SIZE_MBYTES * SZ_1M; - static phys_addr_t size_cmdline = -1; -+static phys_addr_t base_cmdline; -+static phys_addr_t limit_cmdline; - - static int __init early_cma(char *p) - { - pr_debug("%s(%s)\n", __func__, p); - size_cmdline = memparse(p, &p); -+ if (*p != '@') -+ return 0; -+ base_cmdline = memparse(p + 1, &p); -+ if (*p != '-') { -+ limit_cmdline = base_cmdline + size_cmdline; -+ return 0; -+ } -+ limit_cmdline = memparse(p + 1, &p); -+ - return 0; - } - early_param("cma", early_cma); -@@ -107,11 +118,18 @@ static inline __maybe_unused phys_addr_t cma_early_percent_memory(void) - void __init dma_contiguous_reserve(phys_addr_t limit) - { - phys_addr_t selected_size = 0; -+ phys_addr_t selected_base = 0; -+ phys_addr_t selected_limit = limit; -+ bool fixed = false; - - pr_debug("%s(limit %08lx)\n", __func__, (unsigned long)limit); - - if (size_cmdline != -1) { - selected_size = size_cmdline; -+ selected_base = base_cmdline; -+ selected_limit = min_not_zero(limit_cmdline, limit); -+ if (base_cmdline + size_cmdline == limit_cmdline) -+ fixed = true; - } else { - #ifdef CONFIG_CMA_SIZE_SEL_MBYTES - selected_size = size_bytes; -@@ -128,10 +146,12 @@ void __init dma_contiguous_reserve(phys_addr_t limit) - pr_debug("%s: reserving %ld MiB for global area\n", __func__, - (unsigned long)selected_size / SZ_1M); - -- dma_contiguous_reserve_area(selected_size, 0, limit, -- &dma_contiguous_default_area); -+ dma_contiguous_reserve_area(selected_size, selected_base, -+ selected_limit, -+ &dma_contiguous_default_area, -+ fixed); - } --}; -+} - - static DEFINE_MUTEX(cma_mutex); - -@@ -187,15 +207,20 @@ core_initcall(cma_init_reserved_areas); - * @base: Base address of the reserved area optional, use 0 for any - * @limit: End address of the reserved memory (optional, 0 for any). - * @res_cma: Pointer to store the created cma region. -+ * @fixed: hint about where to place the reserved area - * - * This function reserves memory from early allocator. It should be - * called by arch specific code once the early allocator (memblock or bootmem) - * has been activated and all other subsystems have already allocated/reserved - * memory. This function allows to create custom reserved areas for specific - * devices. -+ * -+ * If @fixed is true, reserve contiguous area at exactly @base. If false, -+ * reserve in range from @base to @limit. - */ - int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, -- phys_addr_t limit, struct cma **res_cma) -+ phys_addr_t limit, struct cma **res_cma, -+ bool fixed) - { - struct cma *cma = &cma_areas[cma_area_count]; - phys_addr_t alignment; -@@ -221,18 +246,15 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, - limit &= ~(alignment - 1); - - /* Reserve memory */ -- if (base) { -+ if (base && fixed) { - if (memblock_is_region_reserved(base, size) || - memblock_reserve(base, size) < 0) { - ret = -EBUSY; - goto err; - } - } else { -- /* -- * Use __memblock_alloc_base() since -- * memblock_alloc_base() panic()s. -- */ -- phys_addr_t addr = __memblock_alloc_base(size, alignment, limit); -+ phys_addr_t addr = memblock_alloc_range(size, alignment, base, -+ limit); - if (!addr) { - ret = -ENOMEM; - goto err; -diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h -index 1421a95..5e3f586 100644 ---- a/include/linux/dma-contiguous.h -+++ b/include/linux/dma-contiguous.h -@@ -88,7 +88,8 @@ static inline void dma_contiguous_set_default(struct cma *cma) - void dma_contiguous_reserve(phys_addr_t addr_limit); - - int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, -- phys_addr_t limit, struct cma **res_cma); -+ phys_addr_t limit, struct cma **res_cma, -+ bool fixed); - - /** - * dma_declare_contiguous() - reserve area for contiguous memory handling -@@ -108,7 +109,7 @@ static inline int dma_declare_contiguous(struct device *dev, phys_addr_t size, - { - struct cma *cma; - int ret; -- ret = dma_contiguous_reserve_area(size, base, limit, &cma); -+ ret = dma_contiguous_reserve_area(size, base, limit, &cma, true); - if (ret == 0) - dev_set_cma_area(dev, cma); - -@@ -136,7 +137,9 @@ static inline void dma_contiguous_set_default(struct cma *cma) { } - static inline void dma_contiguous_reserve(phys_addr_t limit) { } - - static inline int dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, -- phys_addr_t limit, struct cma **res_cma) { -+ phys_addr_t limit, struct cma **res_cma, -+ bool fixed) -+{ - return -ENOSYS; - } - --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch b/kernel/kernel-std/centos/patches/compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch deleted file mode 100644 index cd69c6852..000000000 --- a/kernel/kernel-std/centos/patches/compile-fix-for-disabling-CONFIG_MEMCG_KMEM.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 66936b9bfda2fa11019bf45298047c7365fdacb4 Mon Sep 17 00:00:00 2001 -From: Bart Wensley -Date: Mon, 8 Jul 2019 13:32:44 -0500 -Subject: [PATCH 1/1] compile fix for disabling CONFIG_MEMCG_KMEM - -Signed-off-by: Bart Wensley ---- - mm/memcontrol.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index 175fef9..e475427 100644 ---- a/mm/memcontrol.c -+++ b/mm/memcontrol.c -@@ -2995,6 +2995,8 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg, - memcg_check_events(memcg, page); - } - -+static DEFINE_MUTEX(memcg_limit_mutex); -+ - #ifdef CONFIG_MEMCG_KMEM - /* - * The memcg_slab_mutex is held whenever a per memcg kmem cache is created or -@@ -3375,8 +3377,6 @@ static inline void memcg_resume_kmem_account(void) - current->memcg_kmem_skip_account--; - } - --static DEFINE_MUTEX(memcg_limit_mutex); -- - int __kmem_cache_destroy_memcg_children(struct kmem_cache *s) - { - struct kmem_cache *c; --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch b/kernel/kernel-std/centos/patches/cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch deleted file mode 100644 index c16161080..000000000 --- a/kernel/kernel-std/centos/patches/cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch +++ /dev/null @@ -1,92 +0,0 @@ -From c900922b59bc9f2b680f9d1846bf7599d8410de8 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: "Rafael J. Wysocki" -Date: Fri, 24 Feb 2017 13:25:14 +0100 -Subject: [PATCH 21/26] cpuidle: menu: Avoid taking spinlock for accessing QoS - values - -[commit 6dbf5cea05a7098a69f294c96b6d76f08562cae5 from linux-stable ] - -After commit 9908859acaa9 (cpuidle/menu: add per CPU PM QoS resume -latency consideration) the cpuidle menu governor calls -dev_pm_qos_read_value() on CPU devices to read the current resume latency QoS -constraint values for them. That function takes a spinlock to prevent the -device's power.qos pointer from becoming NULL during the access which is a -problem for the RT patchset where spinlocks are converted into mutexes and -the idle loop stops working. - -However, it is not even necessary for the menu governor to take -that spinlock, because the power.qos pointer accessed under it -cannot be modified during the access anyway. - -For this reason, introduce a "raw" routine for accessing device -QoS resume latency constraints without locking and use it in the -menu governor. - -Fixes: 9908859acaa9 (cpuidle/menu: add per CPU PM QoS resume latency consideration) -Acked-by: Alex Shi -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Alex Kozyrev -Signed-off-by: Jim Somerville ---- - drivers/base/power/qos.c | 3 +-- - drivers/cpuidle/governors/menu.c | 2 +- - include/linux/pm_qos.h | 6 ++++++ - 3 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c -index b2ca302..0cc2a13 100644 ---- a/drivers/base/power/qos.c -+++ b/drivers/base/power/qos.c -@@ -104,8 +104,7 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_flags); - */ - s32 __dev_pm_qos_read_value(struct device *dev) - { -- return IS_ERR_OR_NULL(dev->power.qos) ? -- 0 : pm_qos_read_value(&dev->power.qos->latency); -+ return dev_pm_qos_raw_read_value(dev); - } - - /** -diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c -index fe2dcb8..f9861fd 100644 ---- a/drivers/cpuidle/governors/menu.c -+++ b/drivers/cpuidle/governors/menu.c -@@ -265,7 +265,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) - int i; - int multiplier; - struct timespec t; -- int resume_latency = dev_pm_qos_read_value(device); -+ int resume_latency = dev_pm_qos_raw_read_value(device); - - if (data->needs_update) { - menu_update(drv, dev); -diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h -index 5281e7f..1d8b629 100644 ---- a/include/linux/pm_qos.h -+++ b/include/linux/pm_qos.h -@@ -217,6 +217,11 @@ static inline s32 dev_pm_qos_requested_flags(struct device *dev) - { - return dev->power.qos->flags_req->data.flr.flags; - } -+static inline s32 dev_pm_qos_raw_read_value(struct device *dev) -+{ -+ return IS_ERR_OR_NULL(dev->power.qos) ? -+ 0 : pm_qos_read_value(&dev->power.qos->latency); -+} - #else - static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) - { return 0; } -@@ -236,6 +241,7 @@ static inline void dev_pm_qos_hide_latency_tolerance(struct device *dev) {} - - static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return 0; } - static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; } -+static inline s32 dev_pm_qos_raw_read_value(struct device *dev) { return 0; } - #endif - - #endif --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch b/kernel/kernel-std/centos/patches/cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch deleted file mode 100644 index 87e998973..000000000 --- a/kernel/kernel-std/centos/patches/cpuidle-menu-add-per-CPU-PM-QoS-resume-latency-consi.patch +++ /dev/null @@ -1,71 +0,0 @@ -From e3d73746230638fd50670d67843346ccaebb885b Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Alex Shi -Date: Thu, 12 Jan 2017 21:27:04 +0800 -Subject: [PATCH 19/26] cpuidle/menu: add per CPU PM QoS resume latency - consideration - -[ commit 9908859acaa95640d4a07991a93f7cd5bfc18e02 from linux-stable ] - -There may be special requirements on CPU response time, like if -a interrupt is pinned to a CPU, that CPU should not go into excessively deep -idle states. For this reason, add a mechanism for adding PM QoS resume -latency constraints for individual CPUs and modify the menu governor to take -them into account. - -To that end, extend the device PM QoS pm_qos_resume_latency attribute -to CPUs, which is possible, because the exit latency for CPUs is -effectively equivalent to the resume latency for devices. - -Signed-off-by: Alex Shi -Acked-by: Rik van Riel -[ rjw : Subject & changelog ] -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Alex Kozyrev - -Signed-off-by: Jim Somerville ---- - drivers/cpuidle/governors/menu.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c -index eb9fb0e..fe2dcb8 100644 ---- a/drivers/cpuidle/governors/menu.c -+++ b/drivers/cpuidle/governors/menu.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - - #define BUCKETS 12 -@@ -259,10 +260,12 @@ again: - static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) - { - struct menu_device *data = &__get_cpu_var(menu_devices); -+ struct device *device = get_cpu_device(dev->cpu); - int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); - int i; - int multiplier; - struct timespec t; -+ int resume_latency = dev_pm_qos_read_value(device); - - if (data->needs_update) { - menu_update(drv, dev); -@@ -271,6 +274,10 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) - - data->exit_us = 0; - -+ /* resume_latency is 0 means no restriction */ -+ if (resume_latency && resume_latency < latency_req) -+ latency_req = resume_latency; -+ - /* Special case when user has set very strict latency requirement */ - if (unlikely(latency_req == 0)) - return 0; --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch b/kernel/kernel-std/centos/patches/cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch deleted file mode 100644 index be34489bd..000000000 --- a/kernel/kernel-std/centos/patches/cpuidle-menu-stop-seeking-deeper-idle-if-current-sta.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 3735f7414216e00f72e08c5d85a98e3b649fc085 Mon Sep 17 00:00:00 2001 -Message-Id: <3735f7414216e00f72e08c5d85a98e3b649fc085.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Alex Shi -Date: Thu, 12 Jan 2017 21:27:02 +0800 -Subject: [PATCH 18/26] cpuidle/menu: stop seeking deeper idle if current state - is deep enough - -[ commit 8e37e1a2a3295f5d99e6dbe99eca24eca7a034ef from linux-stable ] - -Obsolete commit 71abbbf856a0 (cpuidle: extend cpuidle and menu -governor to handle dynamic states) wanted to introduce dynamic C-states, but -that idea was dropped long ago. The nonsense deeper C-state checking -remained, though. - -Since both target_residency and exit_latency are longer for deeper -idle state, there's no need to waste CPU time on useless checks. - -Signed-off-by: Alex Shi -Acked-by: Rik van Riel -[ rjw: Subject & changelog ] -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Alex Kozyrev - -Signed-off-by: Jim Somerville ---- - drivers/cpuidle/governors/menu.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c -index c99fee9..eb9fb0e 100644 ---- a/drivers/cpuidle/governors/menu.c -+++ b/drivers/cpuidle/governors/menu.c -@@ -323,11 +323,11 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) - if (s->disabled || su->disable) - continue; - if (s->target_residency > data->predicted_us) -- continue; -+ break; - if (s->exit_latency > latency_req) -- continue; -+ break; - if (s->exit_latency * multiplier > data->predicted_us) -- continue; -+ break; - - data->last_state_idx = i; - data->exit_us = s->exit_latency; --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/dpt_i2o-fix-build-warning.patch b/kernel/kernel-std/centos/patches/dpt_i2o-fix-build-warning.patch deleted file mode 100644 index e0777e7e5..000000000 --- a/kernel/kernel-std/centos/patches/dpt_i2o-fix-build-warning.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 47b0bf6b68f473392fe04755721f57990a4b111d Mon Sep 17 00:00:00 2001 -Message-Id: <47b0bf6b68f473392fe04755721f57990a4b111d.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Sudip Mukherjee -Date: Thu, 18 Feb 2016 13:59:13 +0530 -Subject: [PATCH 25/26] dpt_i2o: fix build warning - -We were getting build warning about: -drivers/scsi/dpt_i2o.c:183:29: warning: 'dptids' defined but not used - -dptids[] is only used in the MODULE_DEVICE_TABLE so when MODULE is not -defined then dptids[] becomes unused. - -Signed-off-by: Sudip Mukherjee -Reviewed-by: Johannes Thumshirn -Signed-off-by: Martin K. Petersen -Signed-off-by: Jim Somerville ---- - drivers/scsi/dpt_i2o.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c -index 2bce881..cb62223 100644 ---- a/drivers/scsi/dpt_i2o.c -+++ b/drivers/scsi/dpt_i2o.c -@@ -180,11 +180,14 @@ static u8 adpt_read_blink_led(adpt_hba* host) - *============================================================================ - */ - -+#ifdef MODULE - static struct pci_device_id dptids[] = { - { PCI_DPT_VENDOR_ID, PCI_DPT_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, - { PCI_DPT_VENDOR_ID, PCI_DPT_RAPTOR_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, - { 0, } - }; -+#endif -+ - MODULE_DEVICE_TABLE(pci,dptids); - - static int adpt_detect(struct scsi_host_template* sht) --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/epoll-fix-use-after-free-in-eventpoll_release_file.patch b/kernel/kernel-std/centos/patches/epoll-fix-use-after-free-in-eventpoll_release_file.patch deleted file mode 100644 index ddfd114b2..000000000 --- a/kernel/kernel-std/centos/patches/epoll-fix-use-after-free-in-eventpoll_release_file.patch +++ /dev/null @@ -1,52 +0,0 @@ -From ebe06187bf2aec10d537ce4595e416035367d703 Mon Sep 17 00:00:00 2001 -From: Konstantin Khlebnikov -Date: Tue, 17 Jun 2014 06:58:05 +0400 -Subject: [PATCH] epoll: fix use-after-free in eventpoll_release_file - -This fixes use-after-free of epi->fllink.next inside list loop macro. -This loop actually releases elements in the body. The list is -rcu-protected but here we cannot hold rcu_read_lock because we need to -lock mutex inside. - -The obvious solution is to use list_for_each_entry_safe(). RCU-ness -isn't essential because nobody can change this list under us, it's final -fput for this file. - -The bug was introduced by ae10b2b4eb01 ("epoll: optimize EPOLL_CTL_DEL -using rcu") - -Signed-off-by: Konstantin Khlebnikov -Reported-by: Cyrill Gorcunov -Cc: Stable # 3.13+ -Cc: Sasha Levin -Cc: Jason Baron -Signed-off-by: Linus Torvalds ---- - fs/eventpoll.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/fs/eventpoll.c b/fs/eventpoll.c -index b73e062..b10b48c 100644 ---- a/fs/eventpoll.c -+++ b/fs/eventpoll.c -@@ -910,7 +910,7 @@ static const struct file_operations eventpoll_fops = { - void eventpoll_release_file(struct file *file) - { - struct eventpoll *ep; -- struct epitem *epi; -+ struct epitem *epi, *next; - - /* - * We don't want to get "file->f_lock" because it is not -@@ -926,7 +926,7 @@ void eventpoll_release_file(struct file *file) - * Besides, ep_remove() acquires the lock, so we can't hold it here. - */ - mutex_lock(&epmutex); -- list_for_each_entry_rcu(epi, &file->f_ep_links, fllink) { -+ list_for_each_entry_safe(epi, next, &file->f_ep_links, fllink) { - ep = epi->ep; - mutex_lock_nested(&ep->mtx, 0); - ep_remove(ep, epi); --- -2.7.4 - diff --git a/kernel/kernel-std/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch b/kernel/kernel-std/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch deleted file mode 100644 index c66a27b37..000000000 --- a/kernel/kernel-std/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 84a6fef49cb58415d9790947e65c34b09d99d356 Mon Sep 17 00:00:00 2001 -From: "Martin, Chen" -Date: Mon, 14 Jan 2019 19:58:07 +0000 -Subject: [PATCH] fix CentOS 7.6 upgrade compile error - -1, fix improper call of part_round_stats and part_inc_in_flight -in drbd_req.c, as CONFIG_BLK_DEV_DRBD=m defined in -kernel-3.10.0-x86_64.config.tis_extra - -2, add explicit declaration for trace_bpf_int_jit_compile, -trace_bpf_jit_compile, trace_bpf_jit_free, if pmd_read_atomic not -defined - -Signed-off-by: Martin, Chen ---- - drivers/block/drbd/drbd_req.c | 8 ++++---- - include/linux/filter.h | 3 +++ - 2 files changed, 7 insertions(+), 4 deletions(-) - -diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c -index a6f13f7..cbd0a49 100644 ---- a/drivers/block/drbd/drbd_req.c -+++ b/drivers/block/drbd/drbd_req.c -@@ -39,12 +39,12 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req - const int rw = bio_data_dir(req->master_bio); - int cpu; - cpu = part_stat_lock(); -- part_round_stats(cpu, &mdev->vdisk->part0); -+ part_round_stats(mdev->rq_queue, cpu, &mdev->vdisk->part0); - part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]); - part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], req->i.size >> 9); - (void) cpu; /* The macro invocations above want the cpu argument, I do not like - the compiler warning about cpu only assigned but never used... */ -- part_inc_in_flight(&mdev->vdisk->part0, rw); -+ part_inc_in_flight(mdev->rq_queue, &mdev->vdisk->part0, rw); - part_stat_unlock(); - } - -@@ -56,8 +56,8 @@ static void _drbd_end_io_acct(struct drbd_conf *mdev, struct drbd_request *req) - int cpu; - cpu = part_stat_lock(); - part_stat_add(cpu, &mdev->vdisk->part0, ticks[rw], duration); -- part_round_stats(cpu, &mdev->vdisk->part0); -- part_dec_in_flight(&mdev->vdisk->part0, rw); -+ part_round_stats(mdev->rq_queue, cpu, &mdev->vdisk->part0); -+ part_dec_in_flight(mdev->rq_queue, &mdev->vdisk->part0, rw); - part_stat_unlock(); - } - -diff --git a/include/linux/filter.h b/include/linux/filter.h -index cddbb31..15ce55f 100644 ---- a/include/linux/filter.h -+++ b/include/linux/filter.h -@@ -763,6 +763,9 @@ void bpf_prog_kallsyms_add(struct bpf_prog *fp); - void bpf_prog_kallsyms_del(struct bpf_prog *fp); - - #else /* CONFIG_BPF_JIT */ -+struct bpf_prog * __weak trace_bpf_int_jit_compile(struct bpf_prog *prog); -+void __weak trace_bpf_jit_compile(struct bpf_prog *prog); -+void __weak trace_bpf_jit_free(struct bpf_prog *fp); - - static inline bool bpf_prog_ebpf_jited(const struct bpf_prog *fp) - { --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/fix-compilation-issues.patch b/kernel/kernel-std/centos/patches/fix-compilation-issues.patch deleted file mode 100644 index b72a77347..000000000 --- a/kernel/kernel-std/centos/patches/fix-compilation-issues.patch +++ /dev/null @@ -1,96 +0,0 @@ -From d4187124ed859c36b9055cc240cc0c8181e54725 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jim Somerville -Date: Thu, 31 May 2018 17:47:26 -0400 -Subject: [PATCH 1/1] fix compilation issues - -Signed-off-by: Jim Somerville ---- - arch/x86/mm/kaiser.c | 2 +- - drivers/base/dma-contiguous.c | 2 +- - include/asm-generic/pgtable.h | 20 -------------------- - include/linux/huge_mm.h | 2 +- - 4 files changed, 3 insertions(+), 23 deletions(-) - -diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c -index e233c88..5564c8d 100644 ---- a/arch/x86/mm/kaiser.c -+++ b/arch/x86/mm/kaiser.c -@@ -621,7 +621,7 @@ static const struct file_operations fops_kaiser_enabled = { - - static int __init create_kpti_enabled(void) - { -- if (!xen_pv_domain() && !sme_active()) -+ if (!is_xen_pv_domain() && !sme_active()) - debugfs_create_file("pti_enabled", S_IRUSR | S_IWUSR, - arch_debugfs_dir, NULL, &fops_kaiser_enabled); - return 0; -diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c -index a7d5bda..403101d 100644 ---- a/drivers/base/dma-contiguous.c -+++ b/drivers/base/dma-contiguous.c -@@ -287,7 +287,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, - if (align > CONFIG_CMA_ALIGNMENT) - align = CONFIG_CMA_ALIGNMENT; - -- pr_debug("%s(cma %p, count %d, align %d)\n", __func__, (void *)cma, -+ pr_debug("%s(cma %p, count %zu, align %d)\n", __func__, (void *)cma, - count, align); - - if (!count) -diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h -index 8aa445d..57e6b74 100644 ---- a/include/asm-generic/pgtable.h -+++ b/include/asm-generic/pgtable.h -@@ -629,10 +629,6 @@ static inline int pmd_trans_splitting(pmd_t pmd) - { - return 0; - } --static inline int pud_trans_huge(pud_t pud) --{ -- return 0; --} - static inline int pud_trans_splitting(pud_t pud) - { - return 0; -@@ -644,24 +640,8 @@ static inline int pmd_write(pmd_t pmd) - return 0; - } - #endif /* __HAVE_ARCH_PMD_WRITE */ --#ifndef __HAVE_ARCH_PUD_WRITE --static inline int pud_write(pud_t pud) --{ -- BUG(); -- return 0; --} --#endif /* __HAVE_ARCH_PUD_WRITE */ - #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ - --#if !defined(CONFIG_TRANSPARENT_HUGEPAGE) || \ -- (defined(CONFIG_TRANSPARENT_HUGEPAGE) && \ -- !defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) --static inline int pud_trans_huge(pud_t pud) --{ -- return 0; --} --#endif -- - #ifndef pmd_read_atomic - static inline pmd_t pmd_read_atomic(pmd_t *pmdp) - { -diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h -index 26ec982..45af11b 100644 ---- a/include/linux/huge_mm.h -+++ b/include/linux/huge_mm.h -@@ -362,7 +362,7 @@ static inline int pud_trans_huge_lock(pud_t *pud, struct vm_area_struct *vma, - return 0; - } - --static inline int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t orig_pmd); -+static inline int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t orig_pmd) - { - return 0; - } --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch b/kernel/kernel-std/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch deleted file mode 100644 index f05e5bc8e..000000000 --- a/kernel/kernel-std/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch +++ /dev/null @@ -1,120 +0,0 @@ -From c449e4c490ac85ccf04e8aab67c8120aa48f8ad0 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Matt Peters -Date: Mon, 30 May 2016 10:51:02 -0400 -Subject: [PATCH 08/26] intel-iommu: allow ignoring Ethernet device RMRR with - IOMMU passthrough - -Some BIOS's are reporting DMAR RMRR entries for Ethernet devices -which is causing problems when PCI passthrough is enabled. These -devices should be able to use the static identity map since the -host should not be enforcing specific address ranges when IOMMU -passthrough is enabled. - -Originally-by: Matt Peters -[PG: Added bootarg wrapper and documentation entries.] -Signed-off-by: Paul Gortmaker -Signed-off-by: Nam Ninh - -Signed-off-by: Nam Ninh -Signed-off-by: Jim Somerville ---- - Documentation/Intel-IOMMU.txt | 18 ++++++++++++++++++ - Documentation/kernel-parameters.txt | 5 +++++ - drivers/iommu/intel-iommu.c | 19 +++++++++++++++++++ - 3 files changed, 42 insertions(+) - -diff --git a/Documentation/Intel-IOMMU.txt b/Documentation/Intel-IOMMU.txt -index cf9431d..1dcc349 100644 ---- a/Documentation/Intel-IOMMU.txt -+++ b/Documentation/Intel-IOMMU.txt -@@ -32,6 +32,24 @@ regions will fail. Hence BIOS uses RMRR to specify these regions along with - devices that need to access these regions. OS is expected to setup - unity mappings for these regions for these devices to access these regions. - -+RMRR for other devices? -+----------------------- -+ -+There are reports of BIOS out there that indicate RMRR regions for things -+like ethernet devices. As per mainline commit c875d2c1b8083 ("iommu/vt-d: -+ Exclude devices using RMRRs from IOMMU API domains") such a device is -+"fundamentally incompatible" with the IOMMU API and "we must prevent such -+devices from being used by the IOMMU API." However, in the event that -+the RMRR indicated by the BIOS is assumed to be just a reporting error, -+there is an additional iommu boot arg that can be used to ignore RMRR -+settings for ethernet, i.e. "intel_iommu=on,eth_no_rmrr iommu=pt". -+Note that iommu=pt is required in order to eth_no_rmrr to have effect. -+ -+If you use this setting, you should consult with your hardware vendor to -+confirm that it is just a reporting error, and that it truly is not -+actively using any DMA to/from RMRR, as otherwise system instability -+may result. -+ - How is IOVA generated? - --------------------- - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 2f7feb0..590c8c2 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -1315,6 +1315,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - than 32-bit addressing. The default is to look - for translation below 32-bit and if not available - then look in the higher range. -+ eth_no_rmrr [Default Off] -+ With this option provided, the kernel will ignore -+ any specified RMRR regions specified by the BIOS -+ for PCI ethernet devices. Confirm with your hardware -+ vendor the RMRR regions are indeed invalid first. - strict [Default Off] - With this option on every unmap_single operation will - result in a hardware IOTLB flush operation as opposed -diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c -index 260597e..6c16b68 100644 ---- a/drivers/iommu/intel-iommu.c -+++ b/drivers/iommu/intel-iommu.c -@@ -480,6 +480,7 @@ static int dmar_forcedac; - static int intel_iommu_strict; - static int intel_iommu_superpage = 1; - static int intel_iommu_ecs = 1; -+static int intel_iommu_ethrmrr = 1; - - /* We only actually use ECS when PASID support (on the new bit 40) - * is also advertised. Some early implementations — the ones with -@@ -539,6 +540,15 @@ static int __init intel_iommu_setup(char *str) - } else if (!strncmp(str, "forcedac", 8)) { - pr_info("Forcing DAC for PCI devices\n"); - dmar_forcedac = 1; -+ } else if (!strncmp(str, "eth_no_rmrr", 11)) { -+ if (!iommu_pass_through) { -+ printk(KERN_WARNING -+ "Intel-IOMMU: error - eth_no_rmrr requires iommu=pt\n"); -+ } else { -+ printk(KERN_INFO -+ "Intel-IOMMU: ignoring ethernet RMRR values\n"); -+ intel_iommu_ethrmrr = 0; -+ } - } else if (!strncmp(str, "strict", 6)) { - pr_info("Disable batched IOTLB flush\n"); - intel_iommu_strict = 1; -@@ -2820,6 +2830,15 @@ static bool device_is_rmrr_locked(struct device *dev) - - if (IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev)) - return false; -+ /* As a temporary workaround for issues seen on ProLiant DL380p, -+ * allow the operator to ignore the RMRR settings for ethernet -+ * devices. Ideally the end user should contact their vendor -+ * regarding why there are RMRR, as per mainline c875d2c1b8083 -+ * ("iommu/vt-d: Exclude devices using RMRRs from IOMMU API domains") -+ * it seems that these make no sense at all. -+ */ -+ if ((pdev->class >> 8) == PCI_CLASS_NETWORK_ETHERNET && !intel_iommu_ethrmrr) -+ return false; - } - - return true; --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch b/kernel/kernel-std/centos/patches/ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch deleted file mode 100644 index a309355f8..000000000 --- a/kernel/kernel-std/centos/patches/ipvs-fix-memory-leak-in-ip_vs_ctl.c.patch +++ /dev/null @@ -1,57 +0,0 @@ -From e3887b1e84e274be02f992e034e0dba1f53925b6 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Tommi Rantala -Date: Thu, 7 May 2015 15:12:21 +0300 -Subject: [PATCH 1/3] ipvs: fix memory leak in ip_vs_ctl.c - -[ commit f30bf2a5cac6c60ab366c4bc6db913597bf4d6ab in Linus' repo ] - -Fix memory leak introduced in commit a0840e2e165a ("IPVS: netns, -ip_vs_ctl local vars moved to ipvs struct."): - -unreferenced object 0xffff88005785b800 (size 2048): - comm "(-localed)", pid 1434, jiffies 4294755650 (age 1421.089s) - hex dump (first 32 bytes): - bb 89 0b 83 ff ff ff ff b0 78 f0 4e 00 88 ff ff .........x.N.... - 04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00 ................ - backtrace: - [] kmemleak_alloc+0x4e/0xb0 - [] __kmalloc_track_caller+0x244/0x430 - [] kmemdup+0x20/0x50 - [] ip_vs_control_net_init+0x1f7/0x510 - [] __ip_vs_init+0x100/0x250 - [] ops_init+0x41/0x190 - [] setup_net+0x93/0x150 - [] copy_net_ns+0x82/0x140 - [] create_new_namespaces+0xfd/0x190 - [] unshare_nsproxy_namespaces+0x5a/0xc0 - [] SyS_unshare+0x173/0x310 - [] system_call_fastpath+0x12/0x6f - [] 0xffffffffffffffff - -Fixes: a0840e2e165a ("IPVS: netns, ip_vs_ctl local vars moved to ipvs struct.") -Signed-off-by: Tommi Rantala -Acked-by: Julian Anastasov -Signed-off-by: Simon Horman -Signed-off-by: Jim Somerville ---- - net/netfilter/ipvs/ip_vs_ctl.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c -index 02409f3..3738b84 100644 ---- a/net/netfilter/ipvs/ip_vs_ctl.c -+++ b/net/netfilter/ipvs/ip_vs_ctl.c -@@ -3843,6 +3843,9 @@ static void __net_exit ip_vs_control_net_cleanup_sysctl(struct net *net) - cancel_delayed_work_sync(&ipvs->defense_work); - cancel_work_sync(&ipvs->defense_work.work); - unregister_net_sysctl_table(ipvs->sysctl_hdr); -+ -+ if (!net_eq(net, &init_net)) -+ kfree(ipvs->sysctl_tbl); - } - - #else --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/kernel-3.10.0-x86_64.config.tis_extra b/kernel/kernel-std/centos/patches/kernel-3.10.0-x86_64.config.tis_extra deleted file mode 100644 index 254ca1b6c..000000000 --- a/kernel/kernel-std/centos/patches/kernel-3.10.0-x86_64.config.tis_extra +++ /dev/null @@ -1,821 +0,0 @@ -# Add builtin -CONFIG_MAXSMP=n -CONFIG_NR_CPUS=256 -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_SR=y -CONFIG_SCSI_SAS_ATTRS=y -CONFIG_ISCSI_TCP=y -# SCSI Related Drivers -# Let's enable lots of them, pretty much anything RAID capable -CONFIG_ATA=y -CONFIG_SCSI_SAS_LIBSAS=y -CONFIG_SCSI_SAS_ATA=y -CONFIG_BLK_DEV_3W_XXXX_RAID=y -CONFIG_SCSI_3W_9XXX=y -CONFIG_SCSI_3W_SAS=y -CONFIG_SCSI_AACRAID=y -CONFIG_SCSI_DPT_I2O=y -CONFIG_SCSI_ARCMSR=y -CONFIG_SCSI_HPTIOP=y -CONFIG_SCSI_GDTH=y -CONFIG_SCSI_IPS=y -CONFIG_SCSI_STEX=y -CONFIG_SCSI_PMCRAID=y -CONFIG_SCSI_HPSA=y -CONFIG_MEGARAID_SAS=y -CONFIG_SCSI_SMARTPQI=y -# These two will only build as modules -CONFIG_SCSI_MPT2SAS=m -CONFIG_SCSI_MPT3SAS=m -CONFIG_SCSI_VIRTIO=y -CONFIG_FUSION_SAS=y -CONFIG_SCSI_AIC94XX=y -CONFIG_SCSI_MVSAS=y -# -CONFIG_SOFT_WATCHDOG=y -CONFIG_VIRTIO=y -CONFIG_VIRTIO_PCI=y -CONFIG_VIRTIO_MMIO=y -CONFIG_ISO9660_FS=y -CONFIG_VFAT_FS=y -CONFIG_NLS_ISO8859_1=y -CONFIG_BLK_DEV_DRBD=m -CONFIG_DRBD_FAULT_INJECTION=y -CONFIG_MCORE2=y -CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0 -CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 -CONFIG_SIGEXIT=y -CONFIG_SCHEDSTATS=y - -# Enable runtime Huge TLB support -CONFIG_DMA_CMA=y -CONFIG_CMA_SIZE_MBYTES=16 -CONFIG_CMA_SIZE_SEL_MBYTES=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 - -# Turn on Intel IOMMU -CONFIG_INTEL_IOMMU_DEFAULT_ON=y - -# Turn off network drivers that we want -# to build out-of-tree -CONFIG_E1000E=n -CONFIG_I40E=n -CONFIG_I40EVF=n -CONFIG_IXGB=n -CONFIG_IXGBE=n -CONFIG_IXGBEVF=n - -# Turn off TPM drivers that we want -# to build out-of-tree. This will -# disable the TPM HW-RandomNUmberGenerator(RNG) -# and TrustedKeys modules as well, since -# they require the in-kernel TPM driver. -# Both these modules will also need to be -# built out-of-tree when needed. -CONFIG_TCG_TPM=n -CONFIG_TCG_TIS=n -CONFIG_HW_RANDOM_TPM=n -CONFIG_TRUSTED_KEYS=n -CONFIG_TCG_TIS_I2C_ATMEL=n -CONFIG_TCG_TIS_I2C_INFINEON=n -CONFIG_TCG_TIS_I2C_NUVOTON=n -CONFIG_TCG_NSC=n -CONFIG_TCG_ATMEL=n -CONFIG_TCG_INFINEON=n -CONFIG_TCG_CRB=n -CONFIG_TCG_TIS_ST33ZP24=n -CONFIG_TCG_TIS_ST33ZP24_I2C=n -# Also disable TPM Integrity Measurement Architecture -# (IMA), as this will be built out of tree but ensure -# that all their dependencies (that comes from the base kernel) -# that are marked as "select" within the Integrity / IMA -# Kconfigs are still enabled -CONFIG_INTEGRITY=n -CONFIG_IMA=n -CONFIG_EVM=n -CONFIG_SIGNATURE=y -CONFIG_KEYS=y -CONFIG_ASYMMETRIC_KEY_TYPE=y -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y -CONFIG_PUBLIC_KEY_ALGO_RSA=y -CONFIG_X509_CERTIFICATE_PARSER=y -CONFIG_SECURITYFS=y -CONFIG_CRYPTO=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_SHA1=y - -#Enable Intel RDT -CONFIG_KERNFS=y -CONFIG_INTEL_RDT_A=y - -#Enable PTP clock support -CONFIG_PPS=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PTP_1588_CLOCK_PCH=y -CONFIG_PTP_1588_CLOCK_KVM=y -CONFIG_DP83640_PHY=y - -# Remove unneeded stuff (including stuff exposed -# by saying y to new options above. -CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=n -CONFIG_PANIC_ON_OOPS=n -CONFIG_SOUND=n -CONFIG_FIREWIRE=n -CONFIG_KPROBES=n -CONFIG_XEN=n -CONFIG_BT=n -CONFIG_INTEL_MEI=n -CONFIG_USB_USBNET=n -CONFIG_MLX4_EN=n -CONFIG_MLX4_CORE=n -CONFIG_MLX5_EN=n -CONFIG_MLX5_CORE=n -CONFIG_RTL8187=n -CONFIG_MWL8K=n -CONFIG_CFG80211=n -CONFIG_WAN=n -CONFIG_ISDN=n -CONFIG_INPUT_TOUCHSCREEN=n -CONFIG_SSB=n -CONFIG_BCMA=n -CONFIG_MEDIA_SUPPORT=n -CONFIG_ACPI_PROCESSOR_AGGREGATOR=n -CONFIG_ACPI_EXTLOG=n -CONFIG_NET_FOU=n -CONFIG_NET_FOU_IP_TUNNELS=n -CONFIG_GENEVE=n -CONFIG_IPV6_VTI=n -CONFIG_NETFILTER_XT_TARGET_TPROXY=n -CONFIG_NETFILTER_XT_MATCH_CGROUP=n -CONFIG_NETFILTER_XT_MATCH_SOCKET=n -CONFIG_NET_SCH_FQ=n -CONFIG_NET_CLS_BPF=n -CONFIG_BLK_DEV_NULL_BLK=n -CONFIG_GENWQE=n -CONFIG_CXL_BASE=n -CONFIG_DM_ERA=n -CONFIG_DM_RAID=n -CONFIG_DM_SWITCH=n -CONFIG_NLMON=n -CONFIG_FM10K=n -CONFIG_CRASH=n -CONFIG_IPMI_SSIF=n -CONFIG_POWERCAP=n -CONFIG_DRM_BOCHS=n -CONFIG_HID_RMI=n -CONFIG_NET_DMA_RH_KABI=n -CONFIG_HP_WIRELESS=n -CONFIG_NFSD_V4_SECURITY_LABEL=n -CONFIG_DEBUG_SHIRQ=n -CONFIG_PERSISTENT_KEYRINGS=n -CONFIG_BIG_KEYS=n -CONFIG_SECURITY_SECURELEVEL=n -CONFIG_CRYPTO_MCRYPTD=n -CONFIG_CRYPTO_SHA1_MB=n -CONFIG_CRYPTO_DRBG_MENU=n -CONFIG_CRYPTO_DEV_QAT=n -CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=n -CONFIG_CRYPTO_DEV_QAT_DH895xCC=n -CONFIG_CRYPTO_DEV_QAT_C3XXX=n -CONFIG_CRYPTO_DEV_QAT_C62X=n -CONFIG_CRYPTO_DEV_QAT_C3XXXVF=n -CONFIG_CRYPTO_DEV_QAT_C62XVF=n -CONFIG_BPF_JIT=n -CONFIG_PARPORT=n -CONFIG_CDROM_PKTCDVD=n -CONFIG_SENSORS_LIS3LV02D=n -CONFIG_SGI_IOC4=n -CONFIG_TIFM_CORE=n -CONFIG_ENCLOSURE_SERVICES=n -CONFIG_APDS9802ALS=n -CONFIG_ISL29003=n -CONFIG_ISL29020=n -CONFIG_SENSORS_TSL2550=n -CONFIG_SENSORS_BH1770=n -CONFIG_SENSORS_APDS990X=n -CONFIG_PCH_PHUB=n -CONFIG_EEPROM_AT24=n -CONFIG_EEPROM_MAX6875=n -CONFIG_EEPROM_93CX6=n -CONFIG_CB710_CORE=n -CONFIG_SENSORS_LIS3_I2C=n -CONFIG_ALTERA_STAPL=n -CONFIG_VMWARE_VMCI=n -CONFIG_CHR_DEV_ST=n -CONFIG_CHR_DEV_OSST=n -CONFIG_CHR_DEV_SG=n -CONFIG_CHR_DEV_SCH=n -CONFIG_SCSI_CONSTANTS=n -CONFIG_SCSI_LOGGING=n -CONFIG_SCSI_CXGB3_ISCSI=n -CONFIG_SCSI_CXGB4_ISCSI=n -CONFIG_SCSI_AIC79XX=n -CONFIG_SCSI_MVUMI=n -CONFIG_SCSI_MPT2SAS_LOGGING=n -CONFIG_SCSI_MPT3SAS_LOGGING=n -CONFIG_SCSI_UFSHCD=n -CONFIG_VMWARE_PVSCSI=n -CONFIG_FCOE=n -CONFIG_FCOE_FNIC=n -CONFIG_SCSI_INITIO=n -CONFIG_SCSI_PM8001=n -CONFIG_SCSI_SRP=n -CONFIG_SATA_ACARD_AHCI=n -CONFIG_SATA_SIL24=n -CONFIG_PDC_ADMA=n -CONFIG_SATA_QSTOR=n -CONFIG_SATA_SX4=n -CONFIG_SATA_MV=n -CONFIG_SATA_NV=n -CONFIG_SATA_PROMISE=n -CONFIG_SATA_SIL=n -CONFIG_SATA_SIS=n -CONFIG_SATA_SVW=n -CONFIG_SATA_ULI=n -CONFIG_SATA_VIA=n -CONFIG_SATA_VITESSE=n -CONFIG_PATA_ALI=n -CONFIG_PATA_AMD=n -CONFIG_PATA_ARASAN_CF=n -CONFIG_PATA_ARTOP=n -CONFIG_PATA_ATIIXP=n -CONFIG_PATA_ATP867X=n -CONFIG_PATA_CMD64X=n -CONFIG_PATA_CS5536=n -CONFIG_PATA_HPT366=n -CONFIG_PATA_HPT37X=n -CONFIG_PATA_HPT3X2N=n -CONFIG_PATA_HPT3X3=n -CONFIG_PATA_IT8213=n -CONFIG_PATA_IT821X=n -CONFIG_PATA_JMICRON=n -CONFIG_PATA_MARVELL=n -CONFIG_PATA_NETCELL=n -CONFIG_PATA_NINJA32=n -CONFIG_PATA_OLDPIIX=n -CONFIG_PATA_PDC2027X=n -CONFIG_PATA_PDC_OLD=n -CONFIG_PATA_RDC=n -CONFIG_PATA_SCH=n -CONFIG_PATA_SERVERWORKS=n -CONFIG_PATA_SIL680=n -CONFIG_PATA_SIS=n -CONFIG_PATA_TOSHIBA=n -CONFIG_PATA_VIA=n -CONFIG_DM_DEBUG=n -CONFIG_MACINTOSH_DRIVERS=n -CONFIG_NET_FC=n -CONFIG_NET_TEAM=n -CONFIG_ATL2=n -CONFIG_ATL1=n -CONFIG_ATL1E=n -CONFIG_ATL1C=n -CONFIG_ALX=n -CONFIG_ARM_AT91_ETHER=n -CONFIG_MACB=n -CONFIG_B44=n -CONFIG_BNA=n -CONFIG_NET_CALXEDA_XGMAC=n -CONFIG_CHELSIO_T3=n -CONFIG_CHELSIO_T4=n -CONFIG_CHELSIO_T4VF=n -CONFIG_NET_TULIP=n -CONFIG_IP1000=n -CONFIG_JME=n -CONFIG_MVMDIO=n -CONFIG_SKGE=n -CONFIG_SKY2=n -CONFIG_MYRI10GE=n -CONFIG_PCH_GBE=n -CONFIG_ETHOC=n -CONFIG_QLCNIC=n -CONFIG_QLGE=n -CONFIG_NETXEN_NIC=n -CONFIG_SFC=n -CONFIG_EPIC100=n -CONFIG_SMSC9420=n -CONFIG_AT803X_PHY=n -CONFIG_DAVICOM_PHY=n -CONFIG_QSEMI_PHY=n -CONFIG_LXT_PHY=n -CONFIG_CICADA_PHY=n -CONFIG_VITESSE_PHY=n -CONFIG_SMSC_PHY=n -CONFIG_BCM87XX_PHY=n -CONFIG_ICPLUS_PHY=n -CONFIG_REALTEK_PHY=n -CONFIG_NATIONAL_PHY=n -CONFIG_STE10XP=n -CONFIG_LSI_ET1011C_PHY=n -CONFIG_MICREL_PHY=n -CONFIG_MDIO_BITBANG=n -CONFIG_RT_GROUP_SCHED=n -CONFIG_OPROFILE=n -CONFIG_SYSTEM_BLACKLIST_KEYRING=n -CONFIG_OSF_PARTITION=n -CONFIG_AMIGA_PARTITION=n -CONFIG_MAC_PARTITION=n -CONFIG_BSD_DISKLABEL=n -CONFIG_MINIX_SUBPARTITION=n -CONFIG_SOLARIS_X86_PARTITION=n -CONFIG_UNIXWARE_DISKLABEL=n -CONFIG_SGI_PARTITION=n -CONFIG_SUN_PARTITION=n -CONFIG_KARMA_PARTITION=n -CONFIG_X86_UV=n -CONFIG_I8K=n -CONFIG_MICROCODE_AMD=n -CONFIG_MICROCODE_AMD_EARLY=n -CONFIG_MOVABLE_NODE=n -CONFIG_MEMORY_HOTPLUG=n -CONFIG_BOOTPARAM_HOTPLUG_CPU0=n -CONFIG_X86_POWERNOW_K8=n -CONFIG_X86_AMD_FREQ_SENSITIVITY=n -CONFIG_X86_P4_CLOCKMOD=n -CONFIG_PCIE_ECRC=n -CONFIG_PCIEAER_INJECT=n -CONFIG_PCCARD=n -CONFIG_HOTPLUG_PCI_ACPI_IBM=n -CONFIG_HOTPLUG_PCI_SHPC=n -CONFIG_XFRM_STATISTICS=n -CONFIG_IP_FIB_TRIE_STATS=n -CONFIG_PPP_MPPE=n -CONFIG_USB_CATC=n -CONFIG_USB_KAWETH=n -CONFIG_USB_PEGASUS=n -CONFIG_USB_RTL8150=n -CONFIG_USB_RTL8152=n -CONFIG_USB_HSO=n -CONFIG_USB_IPHETH=n -CONFIG_INPUT_FF_MEMLESS=n -CONFIG_INPUT_POLLDEV=n -CONFIG_INPUT_SPARSEKMAP=n -CONFIG_MOUSE_PS2_ELANTECH=n -CONFIG_MOUSE_PS2_SENTELIC=n -CONFIG_MOUSE_APPLETOUCH=n -CONFIG_MOUSE_BCM5974=n -CONFIG_MOUSE_CYAPA=n -CONFIG_MOUSE_VSXXXAA=n -CONFIG_MOUSE_SYNAPTICS_I2C=n -CONFIG_MOUSE_SYNAPTICS_USB=n -CONFIG_INPUT_TABLET=n -CONFIG_INPUT_PCSPKR=n -CONFIG_INPUT_APANEL=n -CONFIG_INPUT_ATLAS_BTNS=n -CONFIG_INPUT_ATI_REMOTE2=n -CONFIG_INPUT_KEYSPAN_REMOTE=n -CONFIG_INPUT_POWERMATE=n -CONFIG_INPUT_YEALINK=n -CONFIG_INPUT_CM109=n -CONFIG_INPUT_UINPUT=n -CONFIG_SERIO_ALTERA_PS2=n -CONFIG_SERIO_ARC_PS2=n -CONFIG_NOZOMI=n -CONFIG_N_GSM=n -CONFIG_SERIAL_JSM=n -CONFIG_SERIAL_ARC=n -CONFIG_HANGCHECK_TIMER=n -CONFIG_TELCLOCK=n -CONFIG_I2C_AMD756=n -CONFIG_I2C_AMD8111=n -CONFIG_I2C_PIIX4=n -CONFIG_I2C_NFORCE2=n -CONFIG_I2C_SIS96X=n -CONFIG_I2C_VIA=n -CONFIG_I2C_VIAPRO=n -CONFIG_I2C_PCA_PLATFORM=n -CONFIG_I2C_SIMTEC=n -CONFIG_I2C_DIOLAN_U2C=n -CONFIG_I2C_PARPORT_LIGHT=n -CONFIG_PPS_CLIENT_LDISC=n -CONFIG_PPS_CLIENT_GPIO=n -CONFIG_CHARGER_SMB347=n -CONFIG_SENSORS_ABITUGURU=n -CONFIG_SENSORS_ABITUGURU3=n -CONFIG_SENSORS_AD7414=n -CONFIG_SENSORS_AD7418=n -CONFIG_SENSORS_ADM1021=n -CONFIG_SENSORS_ADM1025=n -CONFIG_SENSORS_ADM1026=n -CONFIG_SENSORS_ADM1029=n -CONFIG_SENSORS_ADM1031=n -CONFIG_SENSORS_ADM9240=n -CONFIG_SENSORS_ADT7410=n -CONFIG_SENSORS_ADT7411=n -CONFIG_SENSORS_ADT7462=n -CONFIG_SENSORS_ADT7470=n -CONFIG_SENSORS_ADT7475=n -CONFIG_SENSORS_ASC7621=n -CONFIG_SENSORS_K8TEMP=n -CONFIG_SENSORS_K10TEMP=n -CONFIG_SENSORS_FAM15H_POWER=n -CONFIG_SENSORS_ASB100=n -CONFIG_SENSORS_ATXP1=n -CONFIG_SENSORS_DS620=n -CONFIG_SENSORS_DS1621=n -CONFIG_SENSORS_I5K_AMB=n -CONFIG_SENSORS_F71805F=n -CONFIG_SENSORS_F71882FG=n -CONFIG_SENSORS_F75375S=n -CONFIG_SENSORS_FSCHMD=n -CONFIG_SENSORS_G760A=n -CONFIG_SENSORS_GL518SM=n -CONFIG_SENSORS_GL520SM=n -CONFIG_SENSORS_IBMAEM=n -CONFIG_SENSORS_IBMPEX=n -CONFIG_SENSORS_IT87=n -CONFIG_SENSORS_LINEAGE=n -CONFIG_SENSORS_LM63=n -CONFIG_SENSORS_LM73=n -CONFIG_SENSORS_LM75=n -CONFIG_SENSORS_LM77=n -CONFIG_SENSORS_LM78=n -CONFIG_SENSORS_LM80=n -CONFIG_SENSORS_LM83=n -CONFIG_SENSORS_LM85=n -CONFIG_SENSORS_LM87=n -CONFIG_SENSORS_LM90=n -CONFIG_SENSORS_LM92=n -CONFIG_SENSORS_LM93=n -CONFIG_SENSORS_LTC4151=n -CONFIG_SENSORS_LTC4215=n -CONFIG_SENSORS_LTC4245=n -CONFIG_SENSORS_LTC4261=n -CONFIG_SENSORS_LM95234=n -CONFIG_SENSORS_LM95241=n -CONFIG_SENSORS_LM95245=n -CONFIG_SENSORS_MAX16065=n -CONFIG_SENSORS_MAX1619=n -CONFIG_SENSORS_MAX1668=n -CONFIG_SENSORS_MAX197=n -CONFIG_SENSORS_MAX6639=n -CONFIG_SENSORS_MAX6642=n -CONFIG_SENSORS_MAX6650=n -CONFIG_SENSORS_MAX6697=n -CONFIG_SENSORS_MCP3021=n -CONFIG_SENSORS_NCT6775=n -CONFIG_SENSORS_NTC_THERMISTOR=n -CONFIG_SENSORS_PC87360=n -CONFIG_SENSORS_PC87427=n -CONFIG_SENSORS_PCF8591=n -CONFIG_SENSORS_PMBUS=n -CONFIG_SENSORS_ADM1275=n -CONFIG_SENSORS_LM25066=n -CONFIG_SENSORS_LTC2978=n -CONFIG_SENSORS_MAX16064=n -CONFIG_SENSORS_MAX34440=n -CONFIG_SENSORS_MAX8688=n -CONFIG_SENSORS_UCD9000=n -CONFIG_SENSORS_UCD9200=n -CONFIG_SENSORS_ZL6100=n -CONFIG_SENSORS_SHT21=n -CONFIG_SENSORS_SIS5595=n -CONFIG_SENSORS_DME1737=n -CONFIG_SENSORS_EMC1403=n -CONFIG_SENSORS_EMC6W201=n -CONFIG_SENSORS_SMSC47M1=n -CONFIG_SENSORS_SMSC47M192=n -CONFIG_SENSORS_SMSC47B397=n -CONFIG_SENSORS_SCH56XX_COMMON=n -CONFIG_SENSORS_SCH5627=n -CONFIG_SENSORS_SCH5636=n -CONFIG_SENSORS_ADS1015=n -CONFIG_SENSORS_ADS7828=n -CONFIG_SENSORS_AMC6821=n -CONFIG_SENSORS_INA209=n -CONFIG_SENSORS_INA2XX=n -CONFIG_SENSORS_THMC50=n -CONFIG_SENSORS_TMP102=n -CONFIG_SENSORS_TMP401=n -CONFIG_SENSORS_TMP421=n -CONFIG_SENSORS_VIA_CPUTEMP=n -CONFIG_SENSORS_VIA686A=n -CONFIG_SENSORS_VT1211=n -CONFIG_SENSORS_VT8231=n -CONFIG_SENSORS_W83781D=n -CONFIG_SENSORS_W83791D=n -CONFIG_SENSORS_W83792D=n -CONFIG_SENSORS_W83793=n -CONFIG_SENSORS_W83795=n -CONFIG_SENSORS_W83L785TS=n -CONFIG_SENSORS_W83L786NG=n -CONFIG_SENSORS_W83627HF=n -CONFIG_SENSORS_W83627EHF=n -CONFIG_SENSORS_APPLESMC=n -CONFIG_SENSORS_ATK0110=n -CONFIG_ALIM1535_WDT=n -CONFIG_ALIM7101_WDT=n -CONFIG_F71808E_WDT=n -CONFIG_SP5100_TCO=n -CONFIG_SBC_FITPC2_WATCHDOG=n -CONFIG_IB700_WDT=n -CONFIG_IBMASR=n -CONFIG_IT8712F_WDT=n -CONFIG_IT87_WDT=n -CONFIG_NV_TCO=n -CONFIG_SMSC_SCH311X_WDT=n -CONFIG_VIA_WDT=n -CONFIG_W83627HF_WDT=n -CONFIG_W83697HF_WDT=n -CONFIG_W83697UG_WDT=n -CONFIG_W83877F_WDT=n -CONFIG_W83977F_WDT=n -CONFIG_MACHZ_WDT=n -CONFIG_PCIPCWATCHDOG=n -CONFIG_WDTPCI=n -CONFIG_USBPCWATCHDOG=n -CONFIG_MFD_VIPERBOARD=n -CONFIG_MFD_SM501=n -CONFIG_MFD_VX855=n -CONFIG_AGP_AMD64=n -CONFIG_AGP_SIS=n -CONFIG_AGP_VIA=n -CONFIG_VGA_SWITCHEROO=n -CONFIG_DRM_LOAD_EDID_FIRMWARE=n -CONFIG_DRM_I2C_CH7006=n -CONFIG_DRM_I2C_SIL164=n -CONFIG_DRM_I2C_NXP_TDA998X=n -CONFIG_DRM_RADEON=n -CONFIG_DRM_NOUVEAU=n -CONFIG_DRM_VMWGFX=n -CONFIG_DRM_GMA500=n -CONFIG_DRM_GMA600=n -CONFIG_DRM_GMA3600=n -CONFIG_DRM_UDL=n -CONFIG_DRM_AST=n -CONFIG_DRM_MGAG200=n -CONFIG_DRM_CIRRUS_QEMU=n -CONFIG_DRM_QXL=n -CONFIG_DRM_BOCHS=n -CONFIG_FB_SYS_FILLRECT=n -CONFIG_FB_SYS_COPYAREA=n -CONFIG_FB_SYS_IMAGEBLIT=n -CONFIG_FB_SYS_FOPS=n -CONFIG_FB_BACKLIGHT=n -CONFIG_LCD_PLATFORM=n -CONFIG_BACKLIGHT_APPLE=n -CONFIG_BACKLIGHT_LP855X=n -CONFIG_VGACON_SOFT_SCROLLBACK=n -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=n -CONFIG_LOGO=n -CONFIG_HID_BATTERY_STRENGTH=n -CONFIG_HIDRAW=n -CONFIG_UHID=n -CONFIG_HID_ACRUX=n -CONFIG_HID_APPLEIR=n -CONFIG_HID_AUREAL=n -CONFIG_HID_DRAGONRISE=n -CONFIG_HID_ELECOM=n -CONFIG_HID_HOLTEK=n -CONFIG_HID_KEYTOUCH=n -CONFIG_HID_KYE=n -CONFIG_HID_UCLOGIC=n -CONFIG_HID_WALTOP=n -CONFIG_HID_GYRATION=n -CONFIG_HID_ICADE=n -CONFIG_HID_TWINHAN=n -CONFIG_HID_LCPOWER=n -CONFIG_HID_LENOVO_TPKBD=n -CONFIG_HID_MAGICMOUSE=n -CONFIG_HID_NTRIG=n -CONFIG_HID_ORTEK=n -CONFIG_HID_PANTHERLORD=n -CONFIG_HID_PETALYNX=n -CONFIG_HID_PICOLCD=n -CONFIG_HID_PRIMAX=n -CONFIG_HID_PS3REMOTE=n -CONFIG_HID_ROCCAT=n -CONFIG_HID_SAITEK=n -CONFIG_HID_SAMSUNG=n -CONFIG_HID_SONY=n -CONFIG_HID_SPEEDLINK=n -CONFIG_HID_STEELSERIES=n -CONFIG_HID_SUNPLUS=n -CONFIG_HID_RMI=n -CONFIG_HID_GREENASIA=n -CONFIG_HID_SMARTJOYPLUS=n -CONFIG_HID_TIVO=n -CONFIG_HID_TOPSEED=n -CONFIG_HID_THINGM=n -CONFIG_HID_THRUSTMASTER=n -CONFIG_HID_WACOM=n -CONFIG_HID_WIIMOTE=n -CONFIG_HID_ZEROPLUS=n -CONFIG_HID_ZYDACRON=n -CONFIG_HID_PID=n -CONFIG_USB_HIDDEV=n -CONFIG_USB_ANNOUNCE_NEW_DEVICES=n -CONFIG_USB_MON=n -CONFIG_USB_WUSB_CBAF=n -CONFIG_USB_OHCI_HCD=n -CONFIG_USB_ACM=n -CONFIG_USB_PRINTER=n -CONFIG_USB_WDM=n -CONFIG_USB_TMC=n -CONFIG_USB_STORAGE_REALTEK=n -CONFIG_USB_STORAGE_DATAFAB=n -CONFIG_USB_STORAGE_FREECOM=n -CONFIG_USB_STORAGE_ISD200=n -CONFIG_USB_STORAGE_USBAT=n -CONFIG_USB_STORAGE_SDDR09=n -CONFIG_USB_STORAGE_SDDR55=n -CONFIG_USB_STORAGE_JUMPSHOT=n -CONFIG_USB_STORAGE_ALAUDA=n -CONFIG_USB_STORAGE_ONETOUCH=n -CONFIG_USB_STORAGE_KARMA=n -CONFIG_USB_STORAGE_CYPRESS_ATACB=n -CONFIG_USB_STORAGE_ENE_UB6250=n -CONFIG_USB_MDC800=n -CONFIG_USB_MICROTEK=n -CONFIG_USB_SERIAL_AIRCABLE=n -CONFIG_USB_SERIAL_ARK3116=n -CONFIG_USB_SERIAL_BELKIN=n -CONFIG_USB_SERIAL_WHITEHEAT=n -CONFIG_USB_SERIAL_DIGI_ACCELEPORT=n -CONFIG_USB_SERIAL_CYPRESS_M8=n -CONFIG_USB_SERIAL_EMPEG=n -CONFIG_USB_SERIAL_VISOR=n -CONFIG_USB_SERIAL_IPAQ=n -CONFIG_USB_SERIAL_IR=n -CONFIG_USB_SERIAL_EDGEPORT=n -CONFIG_USB_SERIAL_EDGEPORT_TI=n -CONFIG_USB_SERIAL_GARMIN=n -CONFIG_USB_SERIAL_IPW=n -CONFIG_USB_SERIAL_IUU=n -CONFIG_USB_SERIAL_KEYSPAN_PDA=n -CONFIG_USB_SERIAL_KEYSPAN=n -CONFIG_USB_SERIAL_KLSI=n -CONFIG_USB_SERIAL_KOBIL_SCT=n -CONFIG_USB_SERIAL_MCT_U232=n -CONFIG_USB_SERIAL_MOS7720=n -CONFIG_USB_SERIAL_MOS7840=n -CONFIG_USB_SERIAL_NAVMAN=n -CONFIG_USB_SERIAL_OTI6858=n -CONFIG_USB_SERIAL_QCAUX=n -CONFIG_USB_SERIAL_QUALCOMM=n -CONFIG_USB_SERIAL_SPCP8X5=n -CONFIG_USB_SERIAL_SAFE=n -CONFIG_USB_SERIAL_SIERRAWIRELESS=n -CONFIG_USB_SERIAL_SYMBOL=n -CONFIG_USB_SERIAL_TI=n -CONFIG_USB_SERIAL_CYBERJACK=n -CONFIG_USB_SERIAL_XIRCOM=n -CONFIG_USB_SERIAL_OPTION=n -CONFIG_USB_SERIAL_OMNINET=n -CONFIG_USB_SERIAL_OPTICON=n -CONFIG_USB_SERIAL_XSENS_MT=n -CONFIG_USB_SERIAL_SSU100=n -CONFIG_USB_SERIAL_QT2=n -CONFIG_USB_SERIAL_DEBUG=n -CONFIG_USB_EMI62=n -CONFIG_USB_EMI26=n -CONFIG_USB_ADUTUX=n -CONFIG_USB_SEVSEG=n -CONFIG_USB_LEGOTOWER=n -CONFIG_USB_LCD=n -CONFIG_USB_LED=n -CONFIG_USB_IDMOUSE=n -CONFIG_USB_FTDI_ELAN=n -CONFIG_USB_APPLEDISPLAY=n -CONFIG_USB_SISUSBVGA=n -CONFIG_USB_LD=n -CONFIG_USB_IOWARRIOR=n -CONFIG_USB_ISIGHTFW=n -CONFIG_USB_EZUSB_FX2=n -CONFIG_USB_HSIC_USB3503=n -CONFIG_USB_ATM=n -CONFIG_UWB=n -CONFIG_MMC_RICOH_MMC=n -CONFIG_MMC_TIFM_SD=n -CONFIG_MMC_CB710=n -CONFIG_MMC_VIA_SDMMC=n -CONFIG_MMC_VUB300=n -CONFIG_MMC_USHC=n -CONFIG_MEMSTICK=n -CONFIG_LEDS_LM3530=n -CONFIG_LEDS_LP3944=n -CONFIG_LEDS_LP5521=n -CONFIG_LEDS_LP5523=n -CONFIG_LEDS_LP5562=n -CONFIG_LEDS_CLEVO_MAIL=n -CONFIG_LEDS_INTEL_SS4200=n -CONFIG_LEDS_BLINKM=n -CONFIG_LEDS_TRIGGER_TIMER=n -CONFIG_LEDS_TRIGGER_ONESHOT=n -CONFIG_LEDS_TRIGGER_HEARTBEAT=n -CONFIG_LEDS_TRIGGER_BACKLIGHT=n -CONFIG_LEDS_TRIGGER_TRANSIENT=n -CONFIG_LEDS_TRIGGER_CAMERA=n -CONFIG_INFINIBAND=n -CONFIG_EDAC=n -CONFIG_NET_DMA_RH_KABI=n -CONFIG_UIO_CIF=n -CONFIG_UIO_AEC=n -CONFIG_UIO_SERCOS3=n -CONFIG_STAGING=n -CONFIG_ACERHDF=n -CONFIG_ASUS_LAPTOP=n -CONFIG_CHROMEOS_LAPTOP=n -CONFIG_FUJITSU_LAPTOP=n -CONFIG_FUJITSU_TABLET=n -CONFIG_AMILO_RFKILL=n -CONFIG_HP_ACCEL=n -CONFIG_HP_WIRELESS=n -CONFIG_MSI_LAPTOP=n -CONFIG_PANASONIC_LAPTOP=n -CONFIG_COMPAL_LAPTOP=n -CONFIG_SONY_LAPTOP=n -CONFIG_IDEAPAD_LAPTOP=n -CONFIG_THINKPAD_ACPI=n -CONFIG_SENSORS_HDAPS=n -CONFIG_EEEPC_LAPTOP=n -CONFIG_ACPI_WMI=n -CONFIG_TOPSTAR_LAPTOP=n -CONFIG_TOSHIBA_BT_RFKILL=n -CONFIG_ACPI_CMPC=n -CONFIG_SAMSUNG_LAPTOP=n -CONFIG_INTEL_OAKTRAIL=n -CONFIG_SAMSUNG_Q10=n -CONFIG_APPLE_GMUX=n -CONFIG_PVPANIC=n -CONFIG_EDD=n -CONFIG_DELL_RBU=n -CONFIG_DCDBAS=n -CONFIG_JBD_DEBUG=n -CONFIG_FANOTIFY=n -CONFIG_JOLIET=n -CONFIG_UDF_FS=n -CONFIG_CRAMFS=n -CONFIG_SQUASHFS=y -CONFIG_EFIVAR_FS=n -CONFIG_SUNRPC_DEBUG=n -CONFIG_NLS_MAC_ROMAN=n -CONFIG_NLS_MAC_CELTIC=n -CONFIG_NLS_MAC_CENTEURO=n -CONFIG_NLS_MAC_CROATIAN=n -CONFIG_NLS_MAC_CYRILLIC=n -CONFIG_NLS_MAC_GAELIC=n -CONFIG_NLS_MAC_GREEK=n -CONFIG_NLS_MAC_ICELAND=n -CONFIG_NLS_MAC_INUIT=n -CONFIG_NLS_MAC_ROMANIAN=n -CONFIG_NLS_MAC_TURKISH=n -CONFIG_SCHED_TRACER=n -CONFIG_TRACER_SNAPSHOT=n -CONFIG_UPROBE_EVENT=n -CONFIG_PROBE_EVENTS=n -CONFIG_FUNCTION_PROFILER=n -CONFIG_RING_BUFFER_BENCHMARK=n -CONFIG_ATOMIC64_SELFTEST=n -CONFIG_ASYNC_RAID6_TEST=n -CONFIG_KGDB=n -CONFIG_TEST_KSTRTOX=n -CONFIG_STRICT_DEVMEM=n -CONFIG_DEBUG_SET_MODULE_RONX=n -CONFIG_DEBUG_NX_TEST=n -CONFIG_CRYPTO_BLOWFISH_X86_64=n -CONFIG_CRYPTO_CAMELLIA_X86_64=n -CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=n -CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=n -CONFIG_CRYPTO_CAST5_AVX_X86_64=n -CONFIG_CRYPTO_CAST6_AVX_X86_64=n -CONFIG_CRYPTO_SALSA20=n -CONFIG_CRYPTO_SALSA20_X86_64=n -CONFIG_CRYPTO_SERPENT_SSE2_X86_64=n -CONFIG_CRYPTO_SERPENT_AVX_X86_64=n -CONFIG_CRYPTO_SERPENT_AVX2_X86_64=n -CONFIG_CRYPTO_TWOFISH_X86_64=n -CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=n -CONFIG_CRYPTO_TWOFISH_AVX_X86_64=n -CONFIG_CRYPTO_DRBG_MENU=n -CONFIG_CRYPTO_USER_API_HASH=n -CONFIG_CRYPTO_USER_API_SKCIPHER=n -CONFIG_CRYPTO_DEV_PADLOCK=n -CONFIG_BLK_DEV_NBD=m -CONFIG_AIC94XX_DEBUG=n -CONFIG_GPIO_BT8XX=n - -# Turn on kernel preemption -CONFIG_PREEMPT=y -CONFIG_RCU_BOOST=n -CONFIG_DEBUG_PREEMPT=n -CONFIG_PROVE_RCU_DELAY=n -CONFIG_RCU_CPU_STALL_VERBOSE=n -CONFIG_PREEMPT_TRACER=n - -# Disable transparent huge pages -CONFIG_TRANSPARENT_HUGEPAGE=n -CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=n - -# Make performance default governor -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=n -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y - -# Disable kernel memory accounting, which is broken -CONFIG_MEMCG_KMEM=n - -# Needed for opae fpga kernel module -# as it turns on hidden option REGMAP_MMIO -CONFIG_MFD_SYSCON=y diff --git a/kernel/kernel-std/centos/patches/memblock-introduce-memblock_alloc_range.patch b/kernel/kernel-std/centos/patches/memblock-introduce-memblock_alloc_range.patch deleted file mode 100644 index c894da01f..000000000 --- a/kernel/kernel-std/centos/patches/memblock-introduce-memblock_alloc_range.patch +++ /dev/null @@ -1,96 +0,0 @@ -From b4007dff3d6d7fc27d8b3431213202fb9c34793d Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Akinobu Mita -Date: Tue, 31 May 2016 16:07:55 -0400 -Subject: [PATCH 09/26] memblock: introduce memblock_alloc_range() - -Commit 2bfc2862c4fe38379a2fb2cfba33fad32ccb4ff4 upstream -Backported-by: Nam Ninh - -This introduces memblock_alloc_range() which allocates memblock from the -specified range of physical address. I would like to use this function -to specify the location of CMA. - -Signed-off-by: Akinobu Mita -Cc: Marek Szyprowski -Cc: Konrad Rzeszutek Wilk -Cc: David Woodhouse -Cc: Don Dutile -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: Andi Kleen -Cc: Yinghai Lu -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Jim Somerville ---- - include/linux/memblock.h | 2 ++ - mm/memblock.c | 22 ++++++++++++++++++---- - 2 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/include/linux/memblock.h b/include/linux/memblock.h -index 5a439c9..d6bcbef 100644 ---- a/include/linux/memblock.h -+++ b/include/linux/memblock.h -@@ -306,6 +306,8 @@ static inline bool memblock_bottom_up(void) { return false; } - #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) - #define MEMBLOCK_ALLOC_ACCESSIBLE 0 - -+phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, -+ phys_addr_t start, phys_addr_t end); - phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align, - phys_addr_t max_addr); - phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, -diff --git a/mm/memblock.c b/mm/memblock.c -index fbc8071..ff910a4 100644 ---- a/mm/memblock.c -+++ b/mm/memblock.c -@@ -1120,9 +1120,9 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size, - } - #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ - --static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, -- phys_addr_t align, phys_addr_t max_addr, -- int nid, ulong flags) -+static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, -+ phys_addr_t align, phys_addr_t start, -+ phys_addr_t end, int nid, ulong flags) - { - phys_addr_t found; - -@@ -1132,7 +1132,7 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, - /* align @size to avoid excessive fragmentation on reserved array */ - size = round_up(size, align); - -- found = memblock_find_in_range_node(size, align, 0, max_addr, nid, -+ found = memblock_find_in_range_node(size, align, start, end, nid, - flags); - if (found && !memblock_reserve(found, size)) - return found; -@@ -1140,6 +1140,20 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, - return 0; - } - -+phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, -+ phys_addr_t start, phys_addr_t end) -+{ -+ ulong flags = choose_memblock_flags(); -+ return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE, flags); -+} -+ -+static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, -+ phys_addr_t align, phys_addr_t max_addr, -+ int nid, ulong flags) -+{ -+ return memblock_alloc_range_nid(size, align, 0, max_addr, nid, flags); -+} -+ - phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid) - { - ulong flags = choose_memblock_flags(); --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch b/kernel/kernel-std/centos/patches/rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch deleted file mode 100644 index d0991fa8b..000000000 --- a/kernel/kernel-std/centos/patches/rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch +++ /dev/null @@ -1,47 +0,0 @@ -From fe5869e78860a9150e24ea32c1a131da6af057c8 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: "Paul E. McKenney" -Date: Thu, 15 Dec 2016 15:37:47 -0800 -Subject: [PATCH 15/26] rcu: Don't wake rcuc/X kthreads on NOCB CPUs - -[ upstream 630c7ed9ca0608912fa7c8591d05dfc8742dc9e6 in tip repo ] - -Chris Friesen notice that rcuc/X kthreads were consuming CPU even on -NOCB CPUs. This makes no sense because the only purpose or these -kthreads is to invoke normal (non-offloaded) callbacks, of which there -will never be any on NOCB CPUs. This problem was due to a bug in -cpu_has_callbacks_ready_to_invoke(), which should have been checking -->nxttail[RCU_NEXT_TAIL] for NULL, but which was instead (incorrectly) -checking ->nxttail[RCU_DONE_TAIL]. Because ->nxttail[RCU_DONE_TAIL] is -never NULL, the only effect is to cause the rcuc/X kthread to execute -when it should not do so. - -This commit therefore checks ->nxttail[RCU_NEXT_TAIL], which is NULL -for NOCB CPUs. - -Reported-by: Chris Friesen -Signed-off-by: Paul E. McKenney -Reviewed-by: Josh Triplett -Signed-off-by: Jim Somerville ---- - kernel/rcutree.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/rcutree.c b/kernel/rcutree.c -index cd68fe3..3276ac1 100644 ---- a/kernel/rcutree.c -+++ b/kernel/rcutree.c -@@ -300,7 +300,7 @@ static int - cpu_has_callbacks_ready_to_invoke(struct rcu_data *rdp) - { - return &rdp->nxtlist != rdp->nxttail[RCU_DONE_TAIL] && -- rdp->nxttail[RCU_DONE_TAIL] != NULL; -+ rdp->nxttail[RCU_NEXT_TAIL] != NULL; - } - - /* --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch b/kernel/kernel-std/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch deleted file mode 100644 index e8a5e3a0c..000000000 --- a/kernel/kernel-std/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_acl_chmod.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 598c88638d4f46a38bf3d0669bc042c1ea1e4605 Mon Sep 17 00:00:00 2001 -Message-Id: <598c88638d4f46a38bf3d0669bc042c1ea1e4605.1566585829.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Stanislav Kinsburskiy -Date: Fri, 9 Feb 2018 11:52:14 +0300 -Subject: [PATCH 2/3] rh/ext4: release leaked posix acl in ext4_acl_chmod - -[ commit b85d6be0b743a1768b8456d36b52960858fbaa67 in OpenVZ's vzkernel repo ] - -Note: only rh7-3.10.0-693.17.1.el7-based kernels are affected. -I.e. starting from rh7-3.10.0-693.17.1.vz7.43.1. - -Posix acl is used to convert of an extended attribute, provided by user to ext4 -attributes. In particular to i_mode in case of ACL_TYPE_ACCESS request. -IOW, this object is allocated, used for convertion, not stored anywhere and -must be freed. - -However posix_acl_update_mode() can zerofy the pointer to support -ext4_set_acl() logic, but then the object is leaked. So, fix it by releasing -new temporary pointer with the same value instead of acl pointer. - -In scope of https://jira.sw.ru/browse/PSBM-81384 - -RHEL bug URL: https://bugzilla.redhat.com/show_bug.cgi?id=1543020 - -Signed-off-by: Stanislav Kinsburskiy -Acked-by: Dmitry Monakhov -Signed-off-by: Jim Somerville ---- - fs/ext4/acl.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c -index 917e819..fce029f 100644 ---- a/fs/ext4/acl.c -+++ b/fs/ext4/acl.c -@@ -297,7 +297,7 @@ cleanup: - int - ext4_acl_chmod(struct inode *inode) - { -- struct posix_acl *acl; -+ struct posix_acl *acl, *real_acl; - handle_t *handle; - int retries = 0; - int error; -@@ -315,6 +315,8 @@ ext4_acl_chmod(struct inode *inode) - error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); - if (error) - return error; -+ -+ real_acl = acl; - retry: - handle = ext4_journal_start(inode, EXT4_HT_XATTR, - ext4_jbd2_credits_xattr(inode)); -@@ -341,7 +343,7 @@ out_stop: - ext4_should_retry_alloc(inode->i_sb, &retries)) - goto retry; - out: -- posix_acl_release(acl); -+ posix_acl_release(real_acl); - return error; - } - --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch b/kernel/kernel-std/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch deleted file mode 100644 index 0e880f5ba..000000000 --- a/kernel/kernel-std/centos/patches/rh-ext4-release-leaked-posix-acl-in-ext4_xattr_set_a.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 190fe153e1def764a02d7cb3438f5bc7c0402e48 Mon Sep 17 00:00:00 2001 -Message-Id: <190fe153e1def764a02d7cb3438f5bc7c0402e48.1566585829.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Stanislav Kinsburskiy -Date: Fri, 9 Feb 2018 11:52:15 +0300 -Subject: [PATCH 3/3] rh/ext4: release leaked posix acl in ext4_xattr_set_acl - -[ commit b762d904ada70f239f1c2d2d70c4a64cd04c8ade in OpenVZ's vzkernel repo ] - -Note: only rh7-3.10.0-693.17.1.el7-based kernels are affcted. -I.e. starting from rh7-3.10.0-693.17.1.vz7.43.1. - -Posix acl is used to convert of an extended attribute, provided by user to ext4 -attributes. In particular to i_mode in case of ACL_TYPE_ACCESS request. - -IOW, this object is allocated, used for convertion, not stored anywhere and -must be freed. - -However posix_acl_update_mode() can zerofy the pointer to support -ext4_set_acl() logic, but then the object is leaked. So, fix it by releasing -new temporary pointer with the same value instead of acl pointer. - -https://jira.sw.ru/browse/PSBM-81384 - -RHEL bug URL: https://bugzilla.redhat.com/show_bug.cgi?id=1543020 - -v2: Added affected kernel version + RHEL bug URL - -Signed-off-by: Stanislav Kinsburskiy -Acked-by: Dmitry Monakhov -Signed-off-by: Jim Somerville ---- - fs/ext4/acl.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c -index fce029f..046b338 100644 ---- a/fs/ext4/acl.c -+++ b/fs/ext4/acl.c -@@ -405,7 +405,7 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, - { - struct inode *inode = dentry->d_inode; - handle_t *handle; -- struct posix_acl *acl; -+ struct posix_acl *acl, *real_acl; - int error, retries = 0; - int update_mode = 0; - umode_t mode = inode->i_mode; -@@ -418,7 +418,7 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, - return -EPERM; - - if (value) { -- acl = posix_acl_from_xattr(&init_user_ns, value, size); -+ acl = real_acl = posix_acl_from_xattr(&init_user_ns, value, size); - if (IS_ERR(acl)) - return PTR_ERR(acl); - else if (acl) { -@@ -427,7 +427,7 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, - goto release_and_out; - } - } else -- acl = NULL; -+ acl = real_acl = NULL; - - retry: - handle = ext4_journal_start(inode, EXT4_HT_XATTR, -@@ -454,7 +454,7 @@ out_stop: - goto retry; - - release_and_out: -- posix_acl_release(acl); -+ posix_acl_release(real_acl); - return error; - } - --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/turn-off-write-same-in-smartqpi-driver.patch b/kernel/kernel-std/centos/patches/turn-off-write-same-in-smartqpi-driver.patch deleted file mode 100644 index 7952c445a..000000000 --- a/kernel/kernel-std/centos/patches/turn-off-write-same-in-smartqpi-driver.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 533c1cd1909a81bd027435dd934a194983c9e9b8 Mon Sep 17 00:00:00 2001 -Message-Id: <533c1cd1909a81bd027435dd934a194983c9e9b8.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Jim Somerville -Date: Tue, 6 Mar 2018 12:54:40 -0500 -Subject: [PATCH 26/26] turn off write same in smartqpi driver - -Signed-off-by: Jim Somerville ---- - drivers/scsi/smartpqi/smartpqi_init.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c -index 2c6b546..6968c48 100644 ---- a/drivers/scsi/smartpqi/smartpqi_init.c -+++ b/drivers/scsi/smartpqi/smartpqi_init.c -@@ -5814,6 +5814,7 @@ static struct scsi_host_template pqi_driver_template = { - .slave_alloc = pqi_slave_alloc, - .sdev_attrs = pqi_sdev_attrs, - .shost_attrs = pqi_shost_attrs, -+ .no_write_same = 1, - }; - - static int pqi_register_scsi(struct pqi_ctrl_info *ctrl_info) --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch b/kernel/kernel-std/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch deleted file mode 100644 index e69391e28..000000000 --- a/kernel/kernel-std/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch +++ /dev/null @@ -1,156 +0,0 @@ -From e27598227a12485c787a57581b1797531941bf51 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Akinobu Mita -Date: Wed, 4 Jun 2014 16:06:50 -0700 -Subject: [PATCH 11/26] x86: enable DMA CMA with swiotlb - -commit 9c5a3621427da68afe6a078cadf807d2c8cc1d12 upstream. -Ported-by: Nam Ninh - -The DMA Contiguous Memory Allocator support on x86 is disabled when -swiotlb config option is enabled. So DMA CMA is always disabled on -x86_64 because swiotlb is always enabled. This attempts to support for -DMA CMA with enabling swiotlb config option. - -The contiguous memory allocator on x86 is integrated in the function -dma_generic_alloc_coherent() which is .alloc callback in nommu_dma_ops -for dma_alloc_coherent(). - -x86_swiotlb_alloc_coherent() which is .alloc callback in swiotlb_dma_ops -tries to allocate with dma_generic_alloc_coherent() firstly and then -swiotlb_alloc_coherent() is called as a fallback. - -The main part of supporting DMA CMA with swiotlb is that changing -x86_swiotlb_free_coherent() which is .free callback in swiotlb_dma_ops -for dma_free_coherent() so that it can distinguish memory allocated by -dma_generic_alloc_coherent() from one allocated by -swiotlb_alloc_coherent() and release it with dma_generic_free_coherent() -which can handle contiguous memory. This change requires making -is_swiotlb_buffer() global function. - -This also needs to change .free callback in the dma_map_ops for amd_gart -and sta2x11, because these dma_ops are also using -dma_generic_alloc_coherent(). - -Signed-off-by: Akinobu Mita -Acked-by: Marek Szyprowski -Acked-by: Konrad Rzeszutek Wilk -Cc: David Woodhouse -Cc: Don Dutile -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: Andi Kleen -Cc: Yinghai Lu -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Jim Somerville ---- - arch/x86/Kconfig | 2 +- - arch/x86/include/asm/swiotlb.h | 7 +++++++ - arch/x86/kernel/amd_gart_64.c | 2 +- - arch/x86/kernel/pci-swiotlb.c | 9 ++++++--- - arch/x86/pci/sta2x11-fixup.c | 6 ++---- - 5 files changed, 17 insertions(+), 9 deletions(-) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 48ae099..9e841a5 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -47,7 +47,7 @@ config X86 - select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH if SMP - select ARCH_WANT_OPTIONAL_GPIOLIB - select ARCH_WANT_FRAME_POINTERS -- select HAVE_DMA_CONTIGUOUS if !SWIOTLB -+ select HAVE_DMA_CONTIGUOUS - select HAVE_KRETPROBES - select HAVE_OPTPROBES - select HAVE_KPROBES_ON_FTRACE -diff --git a/arch/x86/include/asm/swiotlb.h b/arch/x86/include/asm/swiotlb.h -index 977f176..ab05d73 100644 ---- a/arch/x86/include/asm/swiotlb.h -+++ b/arch/x86/include/asm/swiotlb.h -@@ -29,4 +29,11 @@ static inline void pci_swiotlb_late_init(void) - - static inline void dma_mark_clean(void *addr, size_t size) {} - -+extern void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, -+ dma_addr_t *dma_handle, gfp_t flags, -+ struct dma_attrs *attrs); -+extern void x86_swiotlb_free_coherent(struct device *dev, size_t size, -+ void *vaddr, dma_addr_t dma_addr, -+ struct dma_attrs *attrs); -+ - #endif /* _ASM_X86_SWIOTLB_H */ -diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c -index b574b29..8e3842f 100644 ---- a/arch/x86/kernel/amd_gart_64.c -+++ b/arch/x86/kernel/amd_gart_64.c -@@ -512,7 +512,7 @@ gart_free_coherent(struct device *dev, size_t size, void *vaddr, - dma_addr_t dma_addr, struct dma_attrs *attrs) - { - gart_unmap_page(dev, dma_addr, size, DMA_BIDIRECTIONAL, NULL); -- free_pages((unsigned long)vaddr, get_order(size)); -+ dma_generic_free_coherent(dev, size, vaddr, dma_addr, attrs); - } - - static int gart_mapping_error(struct device *dev, dma_addr_t dma_addr) -diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c -index 4853440..284d506 100644 ---- a/arch/x86/kernel/pci-swiotlb.c -+++ b/arch/x86/kernel/pci-swiotlb.c -@@ -16,7 +16,7 @@ - - int swiotlb __read_mostly; - --static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, -+void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, - dma_addr_t *dma_handle, gfp_t flags, - struct dma_attrs *attrs) - { -@@ -30,11 +30,14 @@ static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, - return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); - } - --static void x86_swiotlb_free_coherent(struct device *dev, size_t size, -+void x86_swiotlb_free_coherent(struct device *dev, size_t size, - void *vaddr, dma_addr_t dma_addr, - struct dma_attrs *attrs) - { -- swiotlb_free_coherent(dev, size, vaddr, dma_addr); -+ if (is_swiotlb_buffer(dma_to_phys(dev, dma_addr))) -+ swiotlb_free_coherent(dev, size, vaddr, dma_addr); -+ else -+ dma_generic_free_coherent(dev, size, vaddr, dma_addr, attrs); - } - - static struct dma_map_ops swiotlb_dma_ops = { -diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c -index 9d8a509..5ceda85 100644 ---- a/arch/x86/pci/sta2x11-fixup.c -+++ b/arch/x86/pci/sta2x11-fixup.c -@@ -173,9 +173,7 @@ static void *sta2x11_swiotlb_alloc_coherent(struct device *dev, - { - void *vaddr; - -- vaddr = dma_generic_alloc_coherent(dev, size, dma_handle, flags, attrs); -- if (!vaddr) -- vaddr = swiotlb_alloc_coherent(dev, size, dma_handle, flags); -+ vaddr = x86_swiotlb_alloc_coherent(dev, size, dma_handle, flags, attrs); - *dma_handle = p2a(*dma_handle, to_pci_dev(dev)); - return vaddr; - } -@@ -183,7 +181,7 @@ static void *sta2x11_swiotlb_alloc_coherent(struct device *dev, - /* We have our own dma_ops: the same as swiotlb but from alloc (above) */ - static struct dma_map_ops sta2x11_dma_ops = { - .alloc = sta2x11_swiotlb_alloc_coherent, -- .free = swiotlb_free_coherent, -+ .free = x86_swiotlb_free_coherent, - .map_page = swiotlb_map_page, - .unmap_page = swiotlb_unmap_page, - .map_sg = swiotlb_map_sg_attrs, --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/patches/x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch b/kernel/kernel-std/centos/patches/x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch deleted file mode 100644 index 10d02ed82..000000000 --- a/kernel/kernel-std/centos/patches/x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 2d627fa0c465b3146191ffa7e336bb1eca5d1879 Mon Sep 17 00:00:00 2001 -Message-Id: <2d627fa0c465b3146191ffa7e336bb1eca5d1879.1527544850.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Akinobu Mita -Date: Wed, 4 Jun 2014 16:06:48 -0700 -Subject: [PATCH 14/26] x86: make dma_alloc_coherent() return zeroed memory if - CMA is enabled - -This patchset enhances the DMA Contiguous Memory Allocator on x86. - -Currently the DMA CMA is only supported with pci-nommu dma_map_ops and -furthermore it can't be enabled on x86_64. But I would like to allocate -big contiguous memory with dma_alloc_coherent() and tell it to the device -that requires it, regardless of which dma mapping implementation is -actually used in the system. - -So this makes it work with swiotlb and intel-iommu dma_map_ops, too. And -this also extends "cma=" kernel parameter to specify placement constraint -by the physical address range of memory allocations. For example, CMA -allocates memory below 4GB by "cma=64M@0-4G", it is required for the -devices only supporting 32-bit addressing on 64-bit systems without iommu. - -This patch (of 5): - -Calling dma_alloc_coherent() with __GFP_ZERO must return zeroed memory. - -But when the contiguous memory allocator (CMA) is enabled on x86 and the -memory region is allocated by dma_alloc_from_contiguous(), it doesn't -return zeroed memory. Because dma_generic_alloc_coherent() forgot to fill -the memory region with zero if it was allocated by -dma_alloc_from_contiguous() - -Most implementations of dma_alloc_coherent() return zeroed memory -regardless of whether __GFP_ZERO is specified. So this fixes it by -unconditionally zeroing the allocated memory region. - -Alternatively, we could fix dma_alloc_from_contiguous() to return zeroed -out memory and remove memset() from all caller of it. But we can't simply -remove the memset on arm because __dma_clear_buffer() is used there for -ensuring cache flushing and it is used in many places. Of course we can -do redundant memset in dma_alloc_from_contiguous(), but I think this patch -is less impact for fixing this problem. - -Signed-off-by: Akinobu Mita -Cc: Marek Szyprowski -Cc: Konrad Rzeszutek Wilk -Cc: David Woodhouse -Cc: Don Dutile -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: "H. Peter Anvin" -Cc: Andi Kleen -Cc: Yinghai Lu -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -(cherry picked from commit d92ef66c4f8fdf7a24736b1ab6c48d32de9bfc07) -Signed-off-by: Jim Somerville ---- - arch/x86/kernel/pci-dma.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c -index 77a4e62..c84ffe7 100644 ---- a/arch/x86/kernel/pci-dma.c -+++ b/arch/x86/kernel/pci-dma.c -@@ -99,7 +99,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, - - dma_mask = dma_alloc_coherent_mask(dev, flag); - -- flag |= __GFP_ZERO; -+ flag &= ~__GFP_ZERO; - again: - page = NULL; - /* CMA can be used only in the context which permits sleeping */ -@@ -130,7 +130,7 @@ again: - - return NULL; - } -- -+ memset(page_address(page), 0, size); - *dma_addr = addr; - return page_address(page); - } --- -1.8.3.1 - diff --git a/kernel/kernel-std/centos/srpm_path b/kernel/kernel-std/centos/srpm_path deleted file mode 100644 index 2575ffa75..000000000 --- a/kernel/kernel-std/centos/srpm_path +++ /dev/null @@ -1,2 +0,0 @@ -mirror:Source/kernel-3.10.0-1062.1.2.el7.src.rpm - diff --git a/kernel/kernel-std/files/ima_signing_key.pub b/kernel/kernel-std/files/ima_signing_key.pub deleted file mode 100644 index 89bb70b6cbd9292656c1af2726984a40a5243261..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 987 zcmXqLV!m$B#I%0_GZP~d6DPy5ZT4G^dP>?G@Un4gwRyCC=VfH%W@RvFY&7IH;ACSC zWnmL$a&|NnFyI4mIC$9o^GXtnGV=}jfm(nf>^yA#B_)aFiH6b!k{|&t9-;8eycC6? z%(B!Xh2YBKlGNN{LvaI9kR&$`Ur1(2VqRuxu7Yz;erbxKq=7g{f|*AEF5&6xsF0mn zX&@)gYiMp@X=q_+Zfa^^93{?c0^%A%xr4%uO^iy&LC46-z}&>h&tTBR$i>ve$jGp4 z`@?;Kq7JR5UTs_~1$R$a_9SOaESx<#Rw(YtzV&;J7hUu!tW=r)S;|&oWmlt^mdAyx zlLZAoW*FCSZGQMm&?QT6TFD#Zy8FF7??0Ky>)dMH%+ z&1Zo~mHqDnMimZ+i*814UcK?wSN|Nls0@}%$4e&IDcflUZ&{>!ZlCj=#4Ki_JGp*nUQtcV4^I`NXqX%g$Iz7reQq5SaO0W|r{0 z1iPHQ%o7`%>a{~A%_}{1PSV|XQwQ^-ggu3E{d|QwlP7#@-=>we(eq@e$MK>P>5aN^ zYSo|-$@M3?b#x1)GOYYY-1SRkMm?$Mu`m(;4*Z;xtmp`70gztGaFKf5GO7Wu5 z|Lbd?#M-1N{kq$hzGZupZ}IcM<1haQaes}9%r7jO!M3k