Internal restructuring of stx-integ

Create new directories:
   ceph
   config
   config-files
   filesystem
   kernel
   kernel/kernel-modules
   ldap
   logging
   strorage-drivers
   tools
   utilities
   virt

Retire directories:
   connectivity
   core
   devtools
   support
   extended

Delete two packages:
   tgt
   irqbalance

Relocated packages:
   base/
      dhcp
      initscripts
      libevent
      lighttpd
      linuxptp
      memcached
      net-snmp
      novnc
      ntp
      openssh
      pam
      procps
      sanlock
      shadow
      sudo
      systemd
      util-linux
      vim
      watchdog

   ceph/
      python-cephclient

   config/
      facter
      puppet-4.8.2
      puppet-modules

   filesystem/
      e2fsprogs
      nfs-utils
      nfscheck

   kernel/
      kernel-std
      kernel-rt

   kernel/kernel-modules/
      mlnx-ofa_kernel

   ldap/
      nss-pam-ldapd
      openldap

   logging/
      syslog-ng
      logrotate

   networking/
      lldpd
      iproute
      mellanox
      python-ryu
      mlx4-config

   python/
      python-2.7.5
      python-django
      python-gunicorn
      python-setuptools
      python-smartpm
      python-voluptuous

   security/
      shim-signed
      shim-unsigned
      tboot

   strorage-drivers/
      python-3parclient
      python-lefthandclient

   virt/
      cloud-init
      libvirt
      libvirt-python
      qemu

   tools/
      storage-topology
      vm-topology

   utilities/
      tis-extensions
      namespace-utils
      nova-utils
      update-motd

Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Scott Little 2018-08-01 10:02:19 -04:00
parent 948d42b03b
commit 5dda5de465
93 changed files with 82678 additions and 0 deletions

View File

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

View File

@ -0,0 +1,196 @@
From 88ea759637bfe3359375e86dd698a1efbf274784 Mon Sep 17 00:00:00 2001
Message-Id: <88ea759637bfe3359375e86dd698a1efbf274784.1527782348.git.Jim.Somerville@windriver.com>
From: eric zhang <eric.zhang@windriver.com>
Date: Wed, 14 Mar 2018 15:52:15 -0400
Subject: [PATCH 1/1] Support TiS system
This patch added the following to support TiS system:
1. Support package versioning for TiS format
2. Add rt support
3. Compile fix in dcbnl.h
4. Fix compile for some ks stuff
5. Fix compile neuter some stats output
6. Load all kernel modules
7. Sign kernel module
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
Signed-off-by: Kam Nasim <kam.nasim@windriver.com>
Signed-off-by: eric zhang <eric.zhang@windriver.com>
---
SPECS/mlnx-ofa_kernel.spec | 49 +++++++++++++++++++++++++++++++---------------
1 file changed, 33 insertions(+), 16 deletions(-)
diff --git a/SPECS/mlnx-ofa_kernel.spec b/SPECS/mlnx-ofa_kernel.spec
index 33fe911..7a9253d 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
@@ -62,7 +67,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.3}
%{!?_release: %global _release OFED.4.3.3.0.2.1.gcf60532}
%global _kmp_rel %{_release}%{?_kmp_build_num}%{?_dist}
@@ -74,11 +81,16 @@
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
+
BuildRoot: %{?build_root:%{build_root}}%{!?build_root:/var/tmp/OFED}
Vendor: Mellanox Technologies
Obsoletes: kernel-ib
@@ -133,7 +145,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
@@ -160,7 +171,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}
@@ -172,7 +183,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
@@ -209,13 +220,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
@@ -228,7 +238,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
@@ -259,12 +268,16 @@ 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
+
%build
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
export INSTALL_MOD_DIR=%{install_mod_dir}
@@ -279,7 +292,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
@@ -288,9 +300,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}
@@ -340,6 +354,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
@@ -680,6 +696,7 @@ fi
%config(noreplace) %{_sysconfdir}/depmod.d/zz01-%{_name}-*.conf
%endif
%endif
+%{_sysconfdir}/modules-load.d/mlnx.conf
%endif
%files -n %{devel_pname}
--
1.8.3.1

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1 @@
repo:stx/downloads/mlnx-ofa_kernel-4.3-OFED.4.3.3.0.2.1.gcf60532.src.rpm

View File

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

View File

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

View File

@ -0,0 +1,527 @@
From 779c7986900ecc5dcc736c46b80690df8626746b Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Mon, 23 Apr 2018 15:18:45 -0400
Subject: [PATCH 1/5] Build logic and sources for TiC
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel-rt.spec | 279 +++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 272 insertions(+), 7 deletions(-)
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
index dc814f7..4dc3361 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,12 +359,26 @@ 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
Source51: kernel-%{version}-x86_64-rt-trace.config
Source52: kernel-%{version}-x86_64-rt-debug.config
+# 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
### Started using a unified SRPM
# Sources for kernel modprobe config files
@@ -373,6 +406,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
@@ -384,13 +418,14 @@ 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
Group: Development/System
Obsoletes: glibc-kernheaders < 3.0-46
Provides: glibc-kernheaders = 3.0-46
+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
@@ -438,6 +473,7 @@ AutoReq: no\
This package provides KVM modules for package %{name}%{?1:-%{1}}.\
%{nil}
+%if %{builddebuginfo}
#
# This macro creates a kernel-rt-<subpackage>-kvm-debuginfo package.
# %%kernel_kvm_debuginfo_package <subpackage>
@@ -453,7 +489,9 @@ This package provides debug information for package %{name}%{?1:-%{1}}.\
This is required to use SystemTap with %{name}%{?1:-%{1}}-%{KVERREL}.\
%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVERREL}%{?1:\.%{1}}/.*|/.*%%{KVERREL}%{?1:\.%{1}}(\.debug)?' -o debuginfo%{?1}-kvm.list}\
%{nil}
+%endif
+%if %{builddebuginfo}
#
# This macro creates a kernel-<subpackage>-debuginfo package.
# %%kernel_debuginfo_package <subpackage>
@@ -470,6 +508,7 @@ This package provides debug information for package %{name}%{?1:-%{1}}.\
This is required to use SystemTap with %{name}%{?1:-%{1}}-%{KVERREL}.\
%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVERREL}%{?1:\.%{1}}/.*|/.*%%{KVERREL}%{?1:\.%{1}}(\.debug)?' -o debuginfo%{?1}.list}\
%{nil}
+%endif
#
# This macro creates a kernel-<subpackage>-devel package.
@@ -483,6 +522,7 @@ Provides: installonlypkg(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\
@@ -495,6 +535,7 @@ against the %{?2:%{2} }kernel package.\
# %%define variant_summary The Linux kernel compiled for <configuration>
# %%kernel_variant_package [-n <pretty-name>] <subpackage>
#
+%if %{builddebuginfo}
%define kernel_variant_package(n:) \
%package %1\
Summary: %{variant_summary}\
@@ -505,15 +546,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.
@@ -563,6 +618,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'
@@ -607,6 +710,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
@@ -630,6 +739,15 @@ for i in *.config
do
mv $i .config
Arch=`head -1 .config | cut -b 3-`
+
+ # Handle Titanium 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 Titanium 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
@@ -764,10 +882,14 @@ 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
@@ -910,6 +1032,12 @@ BuildKernel() {
cp signing_key.priv signing_key.priv.sign${Flavour:+.${Flavour}}
cp signing_key.x509 signing_key.x509.sign${Flavour:+.${Flavour}}
+ # WRS: Copy these keys as part of the devel package
+ # The Module signing keys are to ensure that only Out-of-tree
+ # built against the Titanium 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
@@ -925,6 +1053,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 {} \;
}
@@ -972,6 +1109,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}
@@ -1004,6 +1166,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-` \
@@ -1022,6 +1185,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
###
@@ -1111,6 +1292,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
@@ -1153,6 +1367,14 @@ rm -rf $RPM_BUILD_ROOT
### scripts
###
+%if %{with_tools}
+%post -n kernel-rt-tools
+/sbin/ldconfig
+
+%postun -n kernel-rt-tools
+/sbin/ldconfig
+%endif
+
#
# This macro defines a %%post script for a kernel*-devel package.
# %%kernel_devel_post [<subpackage>]
@@ -1316,6 +1538,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}}
@@ -1332,6 +1591,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}}\
%exclude /lib/modules/%{KVERREL}%{?2:.%{2}}/kernel/arch/x86/kvm\
%exclude /lib/modules/%{KVERREL}%{?2:.%{2}}/kernel/drivers/gpu/drm/i915/gvt\
@@ -1410,6 +1670,11 @@ fi
%kernel_variant_files %{buildvanilla} vanilla
%endif
+%if %{do_sign}
+%files unsigned
+/boot/vmlinuz.unsigned
+%endif # do_sign
+
%changelog
* Mon Jun 18 2018 Luis Claudio R. Goncalves <lgoncalv@redhat.com> [3.10.0-862.6.3.rt56.811.el7]
- [rt] Update source tree to match RHEL 7.5 tree [1549768 1462329]
--
2.7.4

View File

@ -0,0 +1,34 @@
From 72f81cd0693c1abfdb5d86bf207cfcd3201646d7 Mon Sep 17 00:00:00 2001
Message-Id: <72f81cd0693c1abfdb5d86bf207cfcd3201646d7.1528231893.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 5 Jun 2018 16:51:28 -0400
Subject: [PATCH 1/1] Compile issues
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel-rt.spec | 2 ++
1 file changed, 2 insertions(+)
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
index ab6daf3..3c0e4b4 100644
--- a/SPECS/kernel-rt.spec
+++ b/SPECS/kernel-rt.spec
@@ -420,6 +420,7 @@ Patch1029: dpt_i2o-fix-build-warning.patch
# DRBD was choking on write same
Patch1030: turn-off-write-same-in-smartqpi-driver.patch
Patch1031: restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch
+Patch1032: fix-compilation-issues.patch
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -784,6 +785,7 @@ 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 fix-compilation-issues.patch
# move off upstream version mechanism
if [ -e localversion-rt ]; then
--
1.8.3.1

View File

@ -0,0 +1,100 @@
From 4412b4d092c2f38feed1d0f8ea1a69c799315663 Mon Sep 17 00:00:00 2001
Message-Id: <4412b4d092c2f38feed1d0f8ea1a69c799315663.1528227675.git.Jim.Somerville@windriver.com>
In-Reply-To: <dc53b79fa7cf0faa28e58d72ef4b34d405b469c0.1528227674.git.Jim.Somerville@windriver.com>
References: <dc53b79fa7cf0faa28e58d72ef4b34d405b469c0.1528227674.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Mon, 23 Apr 2018 15:19:36 -0400
Subject: [PATCH 2/3] Kernel source patches for TiC
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel-rt.spec | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
index 905ae52..15114e6 100644
--- a/SPECS/kernel-rt.spec
+++ b/SPECS/kernel-rt.spec
@@ -386,6 +386,40 @@ Source1000: modprobe-dccp-blacklist.conf
# 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
+Patch1014: Enable-building-mpt2sas-and-mpt3sas-as-builtin-for-C.patch
+Patch1015: Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch
+Patch1016: x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch
+Patch1017: rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.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
+Patch1026: timer-Reduce-timer-migration-overhead-if-disabled.patch
+Patch1027: timer-Minimize-nohz-off-overhead.patch
+# Fix compile warnings that break the build
+Patch1028: aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch
+Patch1029: dpt_i2o-fix-build-warning.patch
+# DRBD was choking on write same
+Patch1030: turn-off-write-same-in-smartqpi-driver.patch
+Patch1031: restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -718,6 +752,38 @@ 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-mpt2sas-and-mpt3sas-as-builtin-for-C.patch
+ApplyPatch Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch
+ApplyPatch x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch
+ApplyPatch rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.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 timer-Reduce-timer-migration-overhead-if-disabled.patch
+ApplyPatch timer-Minimize-nohz-off-overhead.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
# move off upstream version mechanism
if [ -e localversion-rt ]; then
--
1.8.3.1

View File

@ -0,0 +1,29 @@
From 2266f2e97fc39650ad6afb55cae3b9e11a4d1021 Mon Sep 17 00:00:00 2001
Message-Id: <2266f2e97fc39650ad6afb55cae3b9e11a4d1021.1528227675.git.Jim.Somerville@windriver.com>
In-Reply-To: <dc53b79fa7cf0faa28e58d72ef4b34d405b469c0.1528227674.git.Jim.Somerville@windriver.com>
References: <dc53b79fa7cf0faa28e58d72ef4b34d405b469c0.1528227674.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 29 May 2018 13:06:24 -0400
Subject: [PATCH 3/3] Lower the compiler version requirement
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel-rt.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
index 15114e6..ab6daf3 100644
--- a/SPECS/kernel-rt.spec
+++ b/SPECS/kernel-rt.spec
@@ -296,7 +296,7 @@ Provides: kernel-rt-%{_target_cpu} = %{rpmversion}-%{pkg_release}
#
BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
BuildRequires: xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk
-BuildRequires: gcc >= 4.8.5-28, binutils >= 2.25, redhat-rpm-config >= 9.1.0-55
+BuildRequires: gcc >= 4.8.5-16, binutils >= 2.25, redhat-rpm-config >= 9.1.0-55
BuildRequires: hostname, net-tools, patchutils, bc
%if %{builddoc}
BuildRequires: xmlto, asciidoc
--
1.8.3.1

View File

@ -0,0 +1,27 @@
From ab1bce8c119b1f99f5b22eba8f419854262744f6 Mon Sep 17 00:00:00 2001
Message-Id: <ab1bce8c119b1f99f5b22eba8f419854262744f6.1528321296.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Fri, 1 Jun 2018 16:17:43 -0400
Subject: [PATCH 1/1] Lower the linux firmware version requirement
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel-rt.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
index 3c0e4b4..e614b70 100644
--- a/SPECS/kernel-rt.spec
+++ b/SPECS/kernel-rt.spec
@@ -259,7 +259,7 @@ Provides: kernel-modeset = 1\
Provides: kernel-uname-r = %{KVERREL}%{?1:.%{1}}\
Requires(pre): %{kernel_prereq}\
Requires(pre): %{initrd_prereq}\
-Requires(pre): linux-firmware >= 20180113-61\
+Requires(pre): linux-firmware >= 20170606-56\
Requires(post): %{_sbindir}/new-kernel-pkg\
Requires(post): system-release\
Requires(preun): %{_sbindir}/new-kernel-pkg\
--
1.8.3.1

View File

@ -0,0 +1,5 @@
Build-logic-and-sources-for-TiC.patch
Kernel-source-patches-for-TiC.patch
Lower-the-compiler-version-requirement.patch
Compile-issues.patch
Lower-the-linux-firmware-version-requirement.patch

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,539 @@
From 81c2c9a73d99e3df9c96daf65fec42997428af3e Mon Sep 17 00:00:00 2001
Message-Id: <81c2c9a73d99e3df9c96daf65fec42997428af3e.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
Date: Thu, 7 Apr 2016 11:16:19 -0600
Subject: [PATCH 11/32] Notification of death of arbitrary processes
Note: this commit was copied from Titanium Cloud Rel2
This exposes a new feature which may be called to request
notification when an arbitrary process changes state. The
caller specifies a pid, signal number, and event mask, and
when that pid dies, or is stopped, or anything else that
would normally cause a SIGCHLD, the kernel will send the
specified signal to the caller if the event is in the event
mask originally passed down. The siginfo_t struct will
contain the same information as would be included with SIGCHLD.
This is exposed to userspace via the prctl() call with the
PR_DO_NOTIFY_TASK_STATE option.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
include/linux/init_task.h | 9 ++
include/linux/sched.h | 6 ++
include/uapi/linux/prctl.h | 18 ++++
init/Kconfig | 15 +++
kernel/Makefile | 1 +
kernel/death_notify.c | 227 +++++++++++++++++++++++++++++++++++++++++++++
kernel/death_notify.h | 45 +++++++++
kernel/exit.c | 6 ++
kernel/fork.c | 4 +
kernel/signal.c | 11 +++
kernel/sys.c | 9 ++
11 files changed, 351 insertions(+)
create mode 100644 kernel/death_notify.c
create mode 100644 kernel/death_notify.h
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d8c82e0..ba0c12e 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -77,6 +77,14 @@ extern struct nsproxy init_nsproxy;
.signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh), \
}
+#ifdef CONFIG_SIGEXIT
+#define INIT_SIGEXIT(tsk) \
+ .notify = LIST_HEAD_INIT(tsk.notify), \
+ .monitor = LIST_HEAD_INIT(tsk.monitor),
+#else
+#define INIT_SIGEXIT(tsk)
+#endif
+
extern struct group_info init_groups;
#define INIT_STRUCT_PID { \
@@ -231,6 +239,7 @@ extern struct task_group root_task_group;
.alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \
.journal_info = NULL, \
.cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
+ INIT_SIGEXIT(tsk) \
.pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
.timer_slack_ns = 50000, /* 50 usec default slack */ \
INIT_TIMER_LIST \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f8294d9..ab9c0f1 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1664,6 +1664,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 8ddaa82..53d6392 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
@@ -1539,6 +1539,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
@@ -117,6 +117,7 @@ obj-$(CONFIG_RING_BUFFER) += trace/
obj-$(CONFIG_TRACEPOINTS) += trace/
obj-$(CONFIG_IRQ_WORK) += irq_work.o
obj-$(CONFIG_CPU_PM) += cpu_pm.o
+obj-$(CONFIG_SIGEXIT) += death_notify.o
obj-$(CONFIG_PERF_EVENTS) += events/
diff --git a/kernel/death_notify.c b/kernel/death_notify.c
new file mode 100644
index 0000000..5eb8bfc
--- /dev/null
+++ b/kernel/death_notify.c
@@ -0,0 +1,227 @@
+/*
+ * kernel/death_notify.c, Process death notification support
+ *
+ * Copyright (c) 2006-2014 Wind River Systems, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/prctl.h>
+#include <linux/uaccess.h>
+
+#include "death_notify.h"
+
+static void unlink_status_notifier(struct signotifier *n)
+{
+ list_del(&n->monitor_list);
+ list_del(&n->notify_list);
+ kfree(n);
+}
+
+static void handle_already_monitoring(struct signotifier *node,
+ struct task_state_notify_info *args,
+ struct task_state_notify_info *oldargs)
+{
+ /* Store the old values */
+ oldargs->sig = node->sig;
+ oldargs->events = node->events;
+
+ /* We know that args->sig is 0 or a valid signal. */
+ if (args->sig > 0) {
+ /* Update the new values */
+ node->sig = args->sig;
+ node->events = args->events;
+ } else if (!args->sig) {
+ /* args->sig of 0 means to deregister */
+ unlink_status_notifier(node);
+ }
+}
+
+static void setup_new_node(struct task_struct *p,
+ struct signotifier *node,
+ struct task_state_notify_info *args)
+{
+ node->notify_tsk = current;
+ node->sig = args->sig;
+ node->events = args->events;
+
+ /* Add this node to the list of notification requests
+ * for the specified process.
+ */
+ list_add_tail(&node->notify_list, &p->notify);
+
+ /* Also add this node to the list of monitor requests
+ * for the current process.
+ */
+ list_add_tail(&node->monitor_list, &current->monitor);
+}
+
+
+/* Returns 0 if arguments are valid, 1 if they are not. */
+static int invalid_args(struct task_state_notify_info *args)
+{
+ int ret = 1;
+
+ if (args->pid <= 0)
+ goto out;
+
+ /* Sig of -1 implies query, sig of 0 implies deregistration.
+ * Otherwise sig must be positive and within range.
+ */
+ if ((args->sig < -1) || (args->sig > _NSIG))
+ goto out;
+
+ /* If positive sig, must have valid events. */
+ if (args->sig > 0) {
+ if (!args->events || (args->events >= (1 << (NSIGCHLD+1))))
+ goto out;
+ }
+
+ ret = 0;
+out:
+ return ret;
+}
+
+/* Notify those registered for process state updates via do_notify_task_state().
+ * If "del" is nonzero, the process is dying and we want to free
+ * the nodes in the list as we go.
+ *
+ * Note: we only notify processes for events in which they have registered
+ * interest.
+ *
+ * Must be called holding a lock on tasklist_lock.
+ */
+void do_notify_others(struct task_struct *tsk, struct siginfo *info)
+{
+ struct signotifier *node;
+ unsigned int events;
+
+ /* This method of generating the event bit must be
+ * matched in the userspace library.
+ */
+ events = 1 << (info->si_code & 0xFF);
+
+ list_for_each_entry(node, &tsk->notify, notify_list) {
+ if (events & node->events) {
+ info->si_signo = node->sig;
+ group_send_sig_info(node->sig, info, node->notify_tsk);
+ }
+ }
+}
+
+void release_notify_others(struct task_struct *p)
+{
+ struct signotifier *n, *t;
+
+ /* Need to clean up any outstanding requests where we
+ * wanted to be notified when others died.
+ */
+ list_for_each_entry_safe(n, t, &p->monitor, monitor_list) {
+ unlink_status_notifier(n);
+ }
+
+ /* Also need to clean up any outstanding requests where others
+ * wanted to be notified when we died.
+ */
+ list_for_each_entry_safe(n, t, &p->notify, notify_list) {
+ unlink_status_notifier(n);
+ }
+}
+
+/* If the config is defined, then processes can call this routine
+ * to request notification when the specified task's state changes.
+ * On the death (or other state change) of the specified process,
+ * we will send them the specified signal if the event is listed
+ * in their event bitfield.
+ *
+ * A sig of 0 means that we want to deregister.
+ *
+ * The sig/events fields are value/result. On success we update them
+ * to reflect what they were before the call.
+ *
+ * Returns error code on error, on success we return 0.
+ */
+int do_notify_task_state(unsigned long arg)
+{
+ int err;
+ struct task_struct *p;
+ struct signotifier *node, *tmp;
+ struct task_state_notify_info args, oldargs;
+
+ if (copy_from_user(&args, (struct task_state_notify_info __user *)arg,
+ sizeof(args)))
+ return -EFAULT;
+ oldargs.pid = args.pid;
+
+ /* Validate the arguments passed in. */
+ err = -EINVAL;
+ if (invalid_args(&args))
+ goto out;
+
+ /* We must hold a write lock on tasklist_lock to add the notification
+ * later on, and we need some lock on tasklist_lock for
+ * find_task_by_pid(), so may as well take the write lock now.
+ * Must use write_lock_irq().
+ */
+ write_lock_irq(&tasklist_lock);
+
+ err = -ESRCH;
+ p = find_task_by_vpid(args.pid);
+ if (!p)
+ goto unlock_out;
+
+ /* Now we know pid exists, unlikely to fail. */
+ err = 0;
+
+ /* Check if we're already monitoring the specified pid. If so, update
+ * the monitoring parameters and return the old ones.
+ */
+ list_for_each_entry(tmp, &p->notify, notify_list) {
+ if (tmp->notify_tsk == current) {
+ handle_already_monitoring(tmp, &args, &oldargs);
+ goto unlock_out;
+ }
+ }
+
+ /* If we get here, we're not currently monitoring the process. */
+ oldargs.sig = 0;
+ oldargs.events = 0;
+
+ /* If we wanted to set up a new monitor, do it now. If we didn't
+ * manage to allocate memory for the new node, then we return
+ * an appropriate error.
+ */
+ if (args.sig > 0) {
+ node = kmalloc(sizeof(*node), GFP_ATOMIC);
+ if (node)
+ setup_new_node(p, node, &args);
+ else
+ err = -ENOMEM;
+ }
+
+unlock_out:
+ write_unlock_irq(&tasklist_lock);
+
+ /* Copy the old values back to caller. */
+ if (copy_to_user((struct task_state_notify_info __user *)arg,
+ &oldargs, sizeof(oldargs)))
+ err = -EFAULT;
+
+out:
+ return err;
+}
diff --git a/kernel/death_notify.h b/kernel/death_notify.h
new file mode 100644
index 0000000..b2b8e8c
--- /dev/null
+++ b/kernel/death_notify.h
@@ -0,0 +1,45 @@
+/*
+ * kernel/death_notify.h, Process death notification support
+ *
+ * Copyright (c) 2006-2014 Wind River Systems, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifndef _KERNEL_DEATH_NOTIFY_H
+#define _KERNEL_DEATH_NOTIFY_H
+
+#ifdef CONFIG_SIGEXIT
+
+struct signotifier {
+ struct task_struct *notify_tsk;
+ struct list_head notify_list;
+ struct list_head monitor_list;
+ int sig;
+ unsigned int events;
+};
+
+extern int do_notify_task_state(unsigned long arg);
+extern void do_notify_others(struct task_struct *tsk,
+ struct siginfo *info);
+extern void release_notify_others(struct task_struct *p);
+
+#else /* !CONFIG_SIGEXIT */
+
+static inline void do_notify_others(struct task_struct *tsk,
+ struct siginfo *info) {}
+static inline void release_notify_others(struct task_struct *p) {}
+
+#endif /* CONFIG_SIGEXIT */
+#endif
diff --git a/kernel/exit.c b/kernel/exit.c
index 8a908ea..448a3c3 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -59,6 +59,9 @@
#include <asm/unistd.h>
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
static void exit_mm(struct task_struct * tsk);
@@ -184,6 +187,9 @@ repeat:
proc_flush_task(p);
tasklist_write_lock_irq();
+#ifdef CONFIG_SIGEXIT
+ release_notify_others(p);
+#endif
ptrace_release_task(p);
__exit_signal(p);
diff --git a/kernel/fork.c b/kernel/fork.c
index c390b02..6340c77 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1512,6 +1512,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 f1ecca9..daaa6ab 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -47,6 +47,9 @@
#include <asm/siginfo.h>
#include <asm/cacheflush.h>
#include "audit.h" /* audit_signal_info() */
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
/*
* SLAB caches for signal bits.
@@ -1849,6 +1852,10 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
__wake_up_parent(tsk, tsk->parent);
spin_unlock_irqrestore(&psig->siglock, flags);
+#ifdef CONFIG_SIGEXIT
+ do_notify_others(tsk, &info);
+#endif
+
return autoreap;
}
@@ -1920,6 +1927,10 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
*/
__wake_up_parent(tsk, parent);
spin_unlock_irqrestore(&sighand->siglock, flags);
+
+#ifdef CONFIG_SIGEXIT
+ do_notify_others(tsk, &info);
+#endif
}
static inline int may_ptrace_stop(void)
diff --git a/kernel/sys.c b/kernel/sys.c
index 9c2a4ed..54538e3 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -64,6 +64,10 @@
#include <asm/io.h>
#include <asm/unistd.h>
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
+
#ifndef SET_UNALIGN_CTL
# define SET_UNALIGN_CTL(a,b) (-EINVAL)
#endif
@@ -2474,6 +2478,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;
--
1.8.3.1

View File

@ -0,0 +1,34 @@
From a0da95b0152227a9a80d98edf5fc0af345479dce Mon Sep 17 00:00:00 2001
Message-Id: <a0da95b0152227a9a80d98edf5fc0af345479dce.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Dahir Osman <dahir.osman@windriver.com>
Date: Wed, 13 Jan 2016 10:01:11 -0500
Subject: [PATCH 12/32] PCI: Add ACS quirk for Intel Fortville NICs
Use quirks to determine isolation for now until a later kernel can
properly read the Fortville ACS capabilities.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/pci/quirks.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 5614e3f..4a0bfed 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4289,6 +4289,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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,373 @@
From 7e592781c3f5635f8b455cfcc2daaca572c633da Mon Sep 17 00:00:00 2001
Message-Id: <7e592781c3f5635f8b455cfcc2daaca572c633da.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Kam Nasim <kam.nasim@windriver.com>
Date: Wed, 23 Aug 2017 17:58:12 -0400
Subject: [PATCH 25/32] US101216: IMA support in Titanium kernel
facilitate building the IMA subsytem out-of-the-kernel tree as a Kernel
module (for which CONFIG_IMA and CONFIG_INTEGRITY will be undefined) by:
- exporting certain function symbols which will be linked to the kernel
module. This includes redefining the export symbols for kernel
functions such that when the kernel module loads, it dynamically points
to those new function definations and reverts to Kernel default
definitions on module deinit
- enabling inode readcount
- modification to ima_file_check to pass in file OPEN status
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -3236,7 +3236,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
@@ -883,7 +883,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
@@ -207,6 +207,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
@@ -677,9 +677,8 @@ struct inode {
struct fsnotify_mark_connector __rcu *i_fsnotify_marks)
#endif
-#ifdef CONFIG_IMA
atomic_t i_readcount; /* struct files open RO */
-#endif
+
void *i_private; /* fs or device private pointer */
};
@@ -2827,7 +2826,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));
@@ -2837,16 +2835,7 @@ static inline void i_readcount_inc(struct inode *inode)
{
atomic_inc(&inode->i_readcount);
}
-#else
-static inline void i_readcount_dec(struct inode *inode)
-{
- return;
-}
-static inline void i_readcount_inc(struct inode *inode)
-{
- return;
-}
-#endif
+
extern int do_pipe_flags(int *, int);
extern int kernel_read(struct file *, loff_t, char *, unsigned long);
diff --git a/include/linux/ima.h b/include/linux/ima.h
index 1b7f268..9fee45c 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -13,64 +13,21 @@
#include <linux/fs.h>
struct linux_binprm;
-#ifdef CONFIG_IMA
-extern int ima_bprm_check(struct linux_binprm *bprm);
-extern int ima_file_check(struct file *file, int mask);
-extern void ima_file_free(struct file *file);
-extern int ima_file_mmap(struct file *file, unsigned long prot);
-extern int ima_module_check(struct file *file);
-
-#else
-static inline int ima_bprm_check(struct linux_binprm *bprm)
-{
- return 0;
-}
-
-static inline int ima_file_check(struct file *file, int mask)
-{
- return 0;
-}
-
-static inline void ima_file_free(struct file *file)
-{
- return;
-}
-
-static inline int ima_file_mmap(struct file *file, unsigned long prot)
-{
- return 0;
-}
-
-static inline int ima_module_check(struct file *file)
-{
- return 0;
-}
-
-#endif /* CONFIG_IMA */
-
-#ifdef CONFIG_IMA_APPRAISE
-extern void ima_inode_post_setattr(struct dentry *dentry);
-extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,
+/*
+ * The IMA Kernel module has to redefine these symbols so that
+ * the kernel module can link a dynamic function, as a hook into
+ * the Kernel FS calls (which use these)
+ */
+/* ifdef CONFIG_IMA */
+extern int (*ima_bprm_check)(struct linux_binprm *bprm);
+extern int (*ima_file_check)(struct file *file, int mask, int opened);
+extern void (*ima_file_free)(struct file *file);
+extern int (*ima_file_mmap)(struct file *file, unsigned long prot);
+extern int (*ima_module_check)(struct file *file);
+
+/* ifdef CONFIG_IMA_APPRAISE */
+extern void (*ima_inode_post_setattr)(struct dentry *dentry);
+extern int (*ima_inode_setxattr)(struct dentry *dentry, const char *xattr_name,
const void *xattr_value, size_t xattr_value_len);
-extern int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name);
-#else
-static inline void ima_inode_post_setattr(struct dentry *dentry)
-{
- return;
-}
-
-static inline int ima_inode_setxattr(struct dentry *dentry,
- const char *xattr_name,
- const void *xattr_value,
- size_t xattr_value_len)
-{
- return 0;
-}
-
-static inline int ima_inode_removexattr(struct dentry *dentry,
- const char *xattr_name)
-{
- return 0;
-}
-#endif /* CONFIG_IMA_APPRAISE */
-#endif /* _LINUX_IMA_H */
+extern int (*ima_inode_removexattr)(struct dentry *dentry, const char *xattr_name);
+#endif
diff --git a/include/linux/integrity.h b/include/linux/integrity.h
index 83222ce..a5040b6 100644
--- a/include/linux/integrity.h
+++ b/include/linux/integrity.h
@@ -21,20 +21,14 @@ enum integrity_status {
};
/* List of EVM protected security xattrs */
-#ifdef CONFIG_INTEGRITY
-extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode);
-extern void integrity_inode_free(struct inode *inode);
+/*
+ * The Integrity Kernel module has to redefine these symbols so that
+ * the kernel module can link a dynamic function, as a hook into
+ * the Kernel Security subsystem (which use these)
+ */
-#else
-static inline struct integrity_iint_cache *
- integrity_inode_get(struct inode *inode)
-{
- return NULL;
-}
+/* #ifdef CONFIG_INTEGRITY */
+extern struct integrity_iint_cache *(*integrity_inode_get)(struct inode *inode);
+extern void (*integrity_inode_free)(struct inode *inode);
-static inline void integrity_inode_free(struct inode *inode)
-{
- return;
-}
-#endif /* CONFIG_INTEGRITY */
#endif /* _LINUX_INTEGRITY_H */
diff --git a/security/security.c b/security/security.c
index f069482..646a0e3 100644
--- a/security/security.c
+++ b/security/security.c
@@ -156,6 +156,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
@@ -715,8 +819,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)
{
@@ -1525,6 +1632,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)
{
@@ -1541,5 +1649,6 @@ 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

View File

@ -0,0 +1,236 @@
From d84a5bd81b7ef68f35c3bbd845e71aee10e4e9b7 Mon Sep 17 00:00:00 2001
Message-Id: <d84a5bd81b7ef68f35c3bbd845e71aee10e4e9b7.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Kam Nasim <kam.nasim@windriver.com>
Date: Wed, 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 <Jim.Somerville@windriver.com>
---
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
@@ -202,7 +202,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 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 <linux/export.h>
+#include <linux/init.h>
+
+ __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

View File

@ -0,0 +1,168 @@
From a15588101329965ad3974bd571a9207d6a5e154a Mon Sep 17 00:00:00 2001
Message-Id: <a15588101329965ad3974bd571a9207d6a5e154a.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
Date: Tue, 24 Nov 2015 16:27: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=<cpulist>. 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 <cl@linux.com>
Signed-off-by: Chris Friesen <chris.friesen@windriver.com>
[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 <vu.tran@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -1539,6 +1539,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
@@ -958,10 +958,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);
@@ -977,6 +973,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
@@ -1073,6 +1073,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(&current->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, &param);
- 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

View File

@ -0,0 +1,55 @@
From 1b9b21d80f85665b29dda49dd52d80058111d811 Mon Sep 17 00:00:00 2001
Message-Id: <1b9b21d80f85665b29dda49dd52d80058111d811.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Hannes Reinecke <hare@suse.de>
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 <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,224 @@
From 0bce5a8a5158d690f232873efa3379bd00dfa9f5 Mon Sep 17 00:00:00 2001
Message-Id: <0bce5a8a5158d690f232873efa3379bd00dfa9f5.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <nam.ninh@windriver.com>
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 <akinobu.mita@gmail.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -579,8 +579,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
@@ -1283,7 +1283,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

View File

@ -0,0 +1,92 @@
From 5d7f38974c3279339c7d12d13980471fb50cf6c6 Mon Sep 17 00:00:00 2001
Message-Id: <5d7f38974c3279339c7d12d13980471fb50cf6c6.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
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 <alex.shi@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/base/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

View File

@ -0,0 +1,71 @@
From f5020c58583d04f0c6f8df1cbbd7d2e747fcb537 Mon Sep 17 00:00:00 2001
Message-Id: <f5020c58583d04f0c6f8df1cbbd7d2e747fcb537.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Alex Shi <alex.shi@linaro.org>
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 <alex.shi@linaro.org>
Acked-by: Rik van Riel <riel@redhat.com>
[ rjw : Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/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 <linux/tick.h>
#include <linux/sched.h>
#include <linux/math64.h>
+#include <linux/cpu.h>
#include <linux/module.h>
#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

View File

@ -0,0 +1,52 @@
From 9218064183a57581be8b7b980ce4b8ac9821555b Mon Sep 17 00:00:00 2001
Message-Id: <9218064183a57581be8b7b980ce4b8ac9821555b.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Alex Shi <alex.shi@linaro.org>
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 <alex.shi@linaro.org>
Acked-by: Rik van Riel <riel@redhat.com>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/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

View File

@ -0,0 +1,3 @@
# See 'cpupower help' and cpupower(1) for more info
CPUPOWER_START_OPTS="frequency-set -g performance"
CPUPOWER_STOP_OPTS="frequency-set -g ondemand"

View File

@ -0,0 +1,13 @@
[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

View File

@ -0,0 +1,29 @@
From 7d1684c010cbbc13b80056d53932ef62d280dc3f Mon Sep 17 00:00:00 2001
Message-Id: <7d1684c010cbbc13b80056d53932ef62d280dc3f.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 3 Apr 2018 18:07:37 -0400
Subject: [PATCH 03/32] debrand rh i686 cpu
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,29 @@
From 71f6d30a1acd723dfbb721fb690efb082d9fc2e0 Mon Sep 17 00:00:00 2001
Message-Id: <71f6d30a1acd723dfbb721fb690efb082d9fc2e0.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Jim Perrin <jperrin@centos.org>
Date: Thu, 19 Jun 2014 10:05:12 -0500
Subject: [PATCH 02/32] debrand rh_taint
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,27 @@
From c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed Mon Sep 17 00:00:00 2001
Message-Id: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Jim Perrin <jperrin@centos.org>
Date: Thu, 19 Jun 2014 09:53:13 -0500
Subject: [PATCH 01/32] debrand single cpu
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -922,7 +922,7 @@ static void rh_check_supported(void)
if (((boot_cpu_data.x86_max_cores * smp_num_siblings) == 1) &&
!x86_hyper && !cpu_has_hypervisor && !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

View File

@ -0,0 +1,44 @@
From 143c2720aaa898f6e4cd53598808ff1230c33cd8 Mon Sep 17 00:00:00 2001
Message-Id: <143c2720aaa898f6e4cd53598808ff1230c33cd8.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
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 <sudip@vectorindia.org>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,27 @@
From 8b830ee6b0abaae23ca437b0f37e640f9b64582a Mon Sep 17 00:00:00 2001
Message-Id: <8b830ee6b0abaae23ca437b0f37e640f9b64582a.1528231742.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Wed, 30 May 2018 13:06:58 -0400
Subject: [PATCH 1/1] fix compilation issues
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,120 @@
From 02f7bfe8cb36d7903bd7904b05071a2c91bc02a1 Mon Sep 17 00:00:00 2001
Message-Id: <02f7bfe8cb36d7903bd7904b05071a2c91bc02a1.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Matt Peters <matt.peters@windriver.com>
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 <matt.peters@windriver.com>
[PG: Added bootarg wrapper and documentation entries.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Nam Ninh <nam.ninh@windriver.com>
Signed-off-by: Nam Ninh <nam.ninh@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -1306,6 +1306,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
@@ -504,6 +504,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
@@ -563,6 +564,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;
@@ -2733,6 +2743,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

View File

@ -0,0 +1,6 @@
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

View File

@ -0,0 +1,6 @@
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

View File

@ -0,0 +1,947 @@
# 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
CONFIG_SCSI_MPT2SAS=y
CONFIG_SCSI_MPT3SAS=y
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
# 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_PTP_1588_CLOCK_PCH=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
# 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_GPIO_BT8XX=n
CONFIG_KERNFS=y
CONFIG_INTEL_RDT_A=y

View File

@ -0,0 +1,96 @@
From ea38fcef34645b2220eadad6c862d5884c48026d Mon Sep 17 00:00:00 2001
Message-Id: <ea38fcef34645b2220eadad6c862d5884c48026d.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <nam.ninh@windriver.com>
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 <akinobu.mita@gmail.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -304,6 +304,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

View File

@ -0,0 +1,47 @@
From b48c1062db1a4529f9ebecbffb5a80542da9f4f5 Mon Sep 17 00:00:00 2001
Message-Id: <b48c1062db1a4529f9ebecbffb5a80542da9f4f5.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Thu, 15 Dec 2016 15:37:47 -0800
Subject: [PATCH 18/32] 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 <chris.friesen@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
kernel/rcutree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 9648918..fb7b2a8 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -319,7 +319,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

View File

@ -0,0 +1,47 @@
From d692cbb183b38e030c7c1221b67c9389bdeaf7f3 Mon Sep 17 00:00:00 2001
Message-Id: <d692cbb183b38e030c7c1221b67c9389bdeaf7f3.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Alex Kozyrev <alex.kozyrev@windriver.com>
Date: 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 <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -3594,8 +3594,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

View File

@ -0,0 +1,168 @@
From ecfd98039a9be52230746b209010c77adb575629 Mon Sep 17 00:00:00 2001
Message-Id: <ecfd98039a9be52230746b209010c77adb575629.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 26 May 2015 22:50:35 +0000
Subject: [PATCH 28/32] timer: Minimize nohz off overhead
If nohz is disabled on the kernel command line the [hr]timer code
still calls wake_up_nohz_cpu() and tick_nohz_full_cpu(), a pretty
pointless exercise. Cache nohz_active in [hr]timer per cpu bases and
avoid the overhead.
Before:
48.10% hog [.] main
15.25% [kernel] [k] _raw_spin_lock_irqsave
9.76% [kernel] [k] _raw_spin_unlock_irqrestore
6.50% [kernel] [k] mod_timer
6.44% [kernel] [k] lock_timer_base.isra.38
3.87% [kernel] [k] detach_if_pending
3.80% [kernel] [k] del_timer
2.67% [kernel] [k] internal_add_timer
1.33% [kernel] [k] __internal_add_timer
0.73% [kernel] [k] timerfn
0.54% [kernel] [k] wake_up_nohz_cpu
After:
48.73% hog [.] main
15.36% [kernel] [k] _raw_spin_lock_irqsave
9.77% [kernel] [k] _raw_spin_unlock_irqrestore
6.61% [kernel] [k] lock_timer_base.isra.38
6.42% [kernel] [k] mod_timer
3.90% [kernel] [k] detach_if_pending
3.76% [kernel] [k] del_timer
2.41% [kernel] [k] internal_add_timer
1.39% [kernel] [k] __internal_add_timer
0.76% [kernel] [k] timerfn
We probably should have a cached value for nohz full in the per cpu
bases as well to avoid the cpumask check. The base cache line is hot
already, the cpumask not necessarily.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Joonwoo Park <joonwoop@codeaurora.org>
Cc: Wenbo Wang <wenbo.wang@memblaze.com>
Link: http://lkml.kernel.org/r/20150526224512.207378134@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
include/linux/hrtimer.h | 2 ++
kernel/time/tick-internal.h | 4 ++--
kernel/time/tick-sched.c | 2 +-
kernel/timer.c | 14 +++++++++++---
4 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 00d4c9b..6183bf8 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -176,6 +176,7 @@ enum hrtimer_base_type {
* Note that in RHEL7 clock_was_set is upstream's
* clock_was_set_seq (KABI).
* @migration_enabled: The migration of hrtimers to other cpus is enabled
+ * @nohz_active: The nohz functionality is enabled
* @expires_next: absolute time of the next event which was scheduled
* via clock_set_next_event()
* @hres_active: State of high resolution mode
@@ -191,6 +192,7 @@ struct hrtimer_cpu_base {
unsigned int active_bases;
unsigned int clock_was_set; /* clock_was_set_seq */
bool migration_enabled;
+ bool nohz_active;
#ifdef CONFIG_HIGH_RES_TIMERS
ktime_t expires_next;
int hres_active;
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
index 3ebdda4..13468bd 100644
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -173,9 +173,9 @@ extern unsigned long tick_nohz_active;
#endif
#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
-extern void timers_update_migration(void);
+extern void timers_update_migration(bool update_nohz);
#else
-static inline void timers_update_migration(void) { }
+static inline void timers_update_migration(bool update_nohz) { }
#endif
DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 6c92920..3ccc18c 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -980,7 +980,7 @@ static inline void tick_nohz_activate(struct tick_sched *ts, int mode)
ts->nohz_mode = mode;
/* One update is enough */
if (!test_and_set_bit(0, &tick_nohz_active))
- timers_update_migration();
+ timers_update_migration(true);
}
/**
diff --git a/kernel/timer.c b/kernel/timer.c
index 4fcb630..08c96e1 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -88,6 +88,7 @@ struct tvec_base {
unsigned long active_timers;
int cpu;
bool migration_enabled;
+ bool nohz_active;
struct tvec_root tv1;
struct tvec tv2;
struct tvec tv3;
@@ -103,7 +104,7 @@ static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases;
#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
unsigned int sysctl_timer_migration = 1;
-void timers_update_migration(void)
+void timers_update_migration(bool update_nohz)
{
bool on = sysctl_timer_migration && tick_nohz_active;
unsigned int cpu;
@@ -119,6 +120,10 @@ void timers_update_migration(void)
tvec_base->migration_enabled = on;
hrtimer_base = &per_cpu(hrtimer_bases, cpu);
hrtimer_base->migration_enabled = on;
+ if (!update_nohz)
+ continue;
+ tvec_base->nohz_active = true;
+ hrtimer_base->nohz_active = true;
}
}
@@ -132,7 +137,7 @@ int timer_migration_handler(struct ctl_table *table, int write,
mutex_lock(&mutex);
ret = proc_dointvec(table, write, buffer, lenp, ppos);
if (!ret && write)
- timers_update_migration();
+ timers_update_migration(false);
mutex_unlock(&mutex);
return ret;
}
@@ -482,8 +487,11 @@ static void internal_add_timer(struct tvec_base *base, struct timer_list *timer)
* require special care against races with idle_cpu(), lets deal
* with that later.
*/
- if (!tbase_get_deferrable(base) || tick_nohz_full_cpu(base->cpu))
+ if (base->nohz_active) {
+ if (!tbase_get_deferrable(base) ||
+ tick_nohz_full_cpu(base->cpu))
wake_up_nohz_cpu(base->cpu);
+ }
}
#ifdef CONFIG_TIMER_STATS
--
1.8.3.1

View File

@ -0,0 +1,533 @@
From 100eaa897b32405365ce13248c20fcbfd6e4a85d Mon Sep 17 00:00:00 2001
Message-Id: <100eaa897b32405365ce13248c20fcbfd6e4a85d.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 26 May 2015 22:50:33 +0000
Subject: [PATCH 27/32] timer: Reduce timer migration overhead if disabled
Eric reported that the timer_migration sysctl is not really nice
performance wise as it needs to check at every timer insertion whether
the feature is enabled or not. Further the check does not live in the
timer code, so we have an extra function call which checks an extra
cache line to figure out that it is disabled.
We can do better and store that information in the per cpu (hr)timer
bases. I pondered to use a static key, but that's a nightmare to
update from the nohz code and the timer base cache line is hot anyway
when we select a timer base.
The old logic enabled the timer migration unconditionally if
CONFIG_NO_HZ was set even if nohz was disabled on the kernel command
line.
With this modification, we start off with migration disabled. The user
visible sysctl is still set to enabled. If the kernel switches to NOHZ
migration is enabled, if the user did not disable it via the sysctl
prior to the switch. If nohz=off is on the kernel command line,
migration stays disabled no matter what.
Before:
47.76% hog [.] main
14.84% [kernel] [k] _raw_spin_lock_irqsave
9.55% [kernel] [k] _raw_spin_unlock_irqrestore
6.71% [kernel] [k] mod_timer
6.24% [kernel] [k] lock_timer_base.isra.38
3.76% [kernel] [k] detach_if_pending
3.71% [kernel] [k] del_timer
2.50% [kernel] [k] internal_add_timer
1.51% [kernel] [k] get_nohz_timer_target
1.28% [kernel] [k] __internal_add_timer
0.78% [kernel] [k] timerfn
0.48% [kernel] [k] wake_up_nohz_cpu
After:
48.10% hog [.] main
15.25% [kernel] [k] _raw_spin_lock_irqsave
9.76% [kernel] [k] _raw_spin_unlock_irqrestore
6.50% [kernel] [k] mod_timer
6.44% [kernel] [k] lock_timer_base.isra.38
3.87% [kernel] [k] detach_if_pending
3.80% [kernel] [k] del_timer
2.67% [kernel] [k] internal_add_timer
1.33% [kernel] [k] __internal_add_timer
0.73% [kernel] [k] timerfn
0.54% [kernel] [k] wake_up_nohz_cpu
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Joonwoo Park <joonwoop@codeaurora.org>
Cc: Wenbo Wang <wenbo.wang@memblaze.com>
Link: http://lkml.kernel.org/r/20150526224512.127050787@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
include/linux/hrtimer.h | 2 ++
include/linux/sched/sysctl.h | 12 --------
include/linux/timer.h | 8 +++++
kernel/hrtimer.c | 48 +++++++++++++++++-------------
kernel/rcutree_plugin.h | 2 --
kernel/sched/core.c | 2 --
kernel/sysctl.c | 18 ++++++------
kernel/time/tick-internal.h | 14 +++++++++
kernel/time/tick-sched.c | 25 +++++++++-------
kernel/time/timer_list.c | 3 +-
kernel/timer.c | 70 ++++++++++++++++++++++++++++++++++++--------
11 files changed, 133 insertions(+), 71 deletions(-)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index cd04b77..00d4c9b 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -175,6 +175,7 @@ enum hrtimer_base_type {
* @clock_was_set: Sequence counter of clock was set events
* Note that in RHEL7 clock_was_set is upstream's
* clock_was_set_seq (KABI).
+ * @migration_enabled: The migration of hrtimers to other cpus is enabled
* @expires_next: absolute time of the next event which was scheduled
* via clock_set_next_event()
* @hres_active: State of high resolution mode
@@ -189,6 +190,7 @@ struct hrtimer_cpu_base {
raw_spinlock_t lock;
unsigned int active_bases;
unsigned int clock_was_set; /* clock_was_set_seq */
+ bool migration_enabled;
#ifdef CONFIG_HIGH_RES_TIMERS
ktime_t expires_next;
int hres_active;
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index 4895484..02ab10e 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -54,24 +54,12 @@ extern unsigned int sysctl_numa_balancing_settle_count;
extern unsigned int sysctl_sched_migration_cost;
extern unsigned int sysctl_sched_nr_migrate;
extern unsigned int sysctl_sched_time_avg;
-extern unsigned int sysctl_timer_migration;
extern unsigned int sysctl_sched_shares_window;
int sched_proc_update_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *length,
loff_t *ppos);
#endif
-#ifdef CONFIG_SCHED_DEBUG
-static inline unsigned int get_sysctl_timer_migration(void)
-{
- return sysctl_timer_migration;
-}
-#else
-static inline unsigned int get_sysctl_timer_migration(void)
-{
- return 1;
-}
-#endif
/*
* control realtime throttling:
diff --git a/include/linux/timer.h b/include/linux/timer.h
index c37d9b9..8eb4558 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -249,6 +249,14 @@ extern void run_local_timers(void);
struct hrtimer;
extern enum hrtimer_restart it_real_fn(struct hrtimer *);
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+#include <linux/sysctl.h>
+extern unsigned int sysctl_timer_migration;
+int timer_migration_handler(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp,
+ loff_t *ppos);
+#endif
+
unsigned long __round_jiffies(unsigned long j, int cpu);
unsigned long __round_jiffies_relative(unsigned long j, int cpu);
unsigned long round_jiffies(unsigned long j);
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 40655c8..55444ab 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -168,19 +168,6 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer,
}
}
-
-/*
- * Get the preferred target CPU for NOHZ
- */
-static int hrtimer_get_target(int this_cpu, int pinned)
-{
-#ifdef CONFIG_NO_HZ_COMMON
- if (!pinned && get_sysctl_timer_migration())
- return get_nohz_timer_target();
-#endif
- return this_cpu;
-}
-
/*
* With HIGHRES=y we do not migrate the timer when it is expiring
* before the next event on the target cpu because we cannot reprogram
@@ -204,6 +191,24 @@ hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base)
#endif
}
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+static inline
+struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base,
+ int pinned)
+{
+ if (pinned || !base->migration_enabled)
+ return this_cpu_ptr(&hrtimer_bases);
+ return &per_cpu(hrtimer_bases, get_nohz_timer_target());
+}
+#else
+static inline
+struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base,
+ int pinned)
+{
+ return this_cpu_ptr(&hrtimer_bases);
+}
+#endif
+
/*
* Switch the timer base to the current CPU when possible.
*/
@@ -211,14 +216,13 @@ static inline struct hrtimer_clock_base *
switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base,
int pinned)
{
+ struct hrtimer_cpu_base *new_cpu_base, *this_base;
struct hrtimer_clock_base *new_base;
- struct hrtimer_cpu_base *new_cpu_base;
- int this_cpu = smp_processor_id();
- int cpu = hrtimer_get_target(this_cpu, pinned);
int basenum = base->index;
+ this_base = this_cpu_ptr(&hrtimer_bases);
+ new_cpu_base = get_target_base(this_base, pinned);
again:
- new_cpu_base = &per_cpu(hrtimer_bases, cpu);
new_base = &new_cpu_base->clock_base[basenum];
if (base != new_base) {
@@ -239,17 +243,19 @@ again:
raw_spin_unlock(&base->cpu_base->lock);
raw_spin_lock(&new_base->cpu_base->lock);
- if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) {
- cpu = this_cpu;
+ if (new_cpu_base != this_base &&
+ hrtimer_check_target(timer, new_base)) {
raw_spin_unlock(&new_base->cpu_base->lock);
raw_spin_lock(&base->cpu_base->lock);
+ new_cpu_base = this_base;
timer->base = base;
goto again;
}
timer->base = new_base;
} else {
- if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) {
- cpu = this_cpu;
+ if (new_cpu_base != this_base &&
+ hrtimer_check_target(timer, new_base)) {
+ new_cpu_base = this_base;
goto again;
}
}
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 8f410cc..7232ecb 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -1502,8 +1502,6 @@ module_param(rcu_idle_gp_delay, int, 0644);
static int rcu_idle_lazy_gp_delay = RCU_IDLE_LAZY_GP_DELAY;
module_param(rcu_idle_lazy_gp_delay, int, 0644);
-extern int tick_nohz_active;
-
/*
* Try to advance callbacks for all flavors of RCU on the current CPU.
* Afterwards, if there are any callbacks ready for immediate invocation,
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index b2333b7..d82e745 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8824,8 +8824,6 @@ void __init sched_init_smp(void)
}
#endif /* CONFIG_SMP */
-const_debug unsigned int sysctl_timer_migration = 1;
-
int in_sched_functions(unsigned long addr)
{
return in_lock_functions(addr) ||
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8516049..b435155 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -376,15 +376,6 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec,
},
- {
- .procname = "timer_migration",
- .data = &sysctl_timer_migration,
- .maxlen = sizeof(unsigned int),
- .mode = 0644,
- .proc_handler = proc_dointvec_minmax,
- .extra1 = &zero,
- .extra2 = &one,
- },
#ifdef CONFIG_SCHEDSTATS
{
.procname = "sched_schedstats",
@@ -1200,6 +1191,15 @@ static struct ctl_table kern_table[] = {
.extra1 = &zero,
.extra2 = &one,
},
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+ {
+ .procname = "timer_migration",
+ .data = &sysctl_timer_migration,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = timer_migration_handler,
+ },
+#endif
{ }
};
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
index ecd2ff4..3ebdda4 100644
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -165,3 +165,17 @@ extern void do_timer(unsigned long ticks);
extern void update_wall_time(void);
extern u64 get_next_timer_interrupt(unsigned long basej, u64 basem);
+
+#ifdef CONFIG_NO_HZ_COMMON
+extern unsigned long tick_nohz_active;
+#else
+#define tick_nohz_active (0)
+#endif
+
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+extern void timers_update_migration(void);
+#else
+static inline void timers_update_migration(void) { }
+#endif
+
+DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 625c116..6c92920 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -412,7 +412,7 @@ void __init tick_nohz_init(void)
/*
* NO HZ enabled ?
*/
-int tick_nohz_active __read_mostly;
+unsigned long tick_nohz_active __read_mostly;
/*
* Enable / Disable tickless mode
*/
@@ -973,6 +973,16 @@ static void tick_nohz_handler(struct clock_event_device *dev)
tick_program_event(hrtimer_get_expires(&ts->sched_timer), 1);
}
+static inline void tick_nohz_activate(struct tick_sched *ts, int mode)
+{
+ if (!tick_nohz_enabled)
+ return;
+ ts->nohz_mode = mode;
+ /* One update is enough */
+ if (!test_and_set_bit(0, &tick_nohz_active))
+ timers_update_migration();
+}
+
/**
* tick_nohz_switch_to_nohz - switch to nohz mode
*/
@@ -987,9 +997,6 @@ static void tick_nohz_switch_to_nohz(void)
if (tick_switch_to_oneshot(tick_nohz_handler))
return;
- tick_nohz_active = 1;
- ts->nohz_mode = NOHZ_MODE_LOWRES;
-
/*
* Recycle the hrtimer in ts, so we can share the
* hrtimer_forward with the highres code.
@@ -1001,6 +1008,7 @@ static void tick_nohz_switch_to_nohz(void)
hrtimer_forward_now(&ts->sched_timer, tick_period);
hrtimer_set_expires(&ts->sched_timer, next);
tick_program_event(next, 1);
+ tick_nohz_activate(ts, NOHZ_MODE_LOWRES);
}
/*
@@ -1052,6 +1060,7 @@ static inline void tick_check_nohz_this_cpu(void)
static inline void tick_nohz_switch_to_nohz(void) { }
static inline void tick_check_nohz_this_cpu(void) { }
+static inline void tick_nohz_activate(struct tick_sched *ts, int mode) { }
#endif /* CONFIG_NO_HZ_COMMON */
@@ -1137,13 +1146,7 @@ void tick_setup_sched_timer(void)
hrtimer_forward(&ts->sched_timer, now, tick_period);
hrtimer_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS_PINNED);
-
-#ifdef CONFIG_NO_HZ_COMMON
- if (tick_nohz_enabled) {
- ts->nohz_mode = NOHZ_MODE_HIGHRES;
- tick_nohz_active = 1;
- }
-#endif
+ tick_nohz_activate(ts, NOHZ_MODE_HIGHRES);
}
#endif /* HIGH_RES_TIMERS */
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index 9174c0a..d7dd92a 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -20,6 +20,7 @@
#include <asm/uaccess.h>
+#include "tick-internal.h"
struct timer_list_iter {
int cpu;
@@ -29,8 +30,6 @@ struct timer_list_iter {
typedef void (*print_fn_t)(struct seq_file *m, unsigned int *classes);
-DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
-
/*
* This allows printing both to /proc/timer_list and
* to the console (on SysRq-Q):
diff --git a/kernel/timer.c b/kernel/timer.c
index dc85e24..4fcb630 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -49,6 +49,8 @@
#include <asm/timex.h>
#include <asm/io.h>
+#include "time/tick-internal.h"
+
#define CREATE_TRACE_POINTS
#include <trace/events/timer.h>
@@ -85,6 +87,7 @@ struct tvec_base {
unsigned long next_timer;
unsigned long active_timers;
int cpu;
+ bool migration_enabled;
struct tvec_root tv1;
struct tvec tv2;
struct tvec tv3;
@@ -97,6 +100,58 @@ struct tvec_base boot_tvec_bases;
EXPORT_SYMBOL(boot_tvec_bases);
static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases;
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+unsigned int sysctl_timer_migration = 1;
+
+void timers_update_migration(void)
+{
+ bool on = sysctl_timer_migration && tick_nohz_active;
+ unsigned int cpu;
+ struct tvec_base *tvec_base = this_cpu_read(tvec_bases);
+ struct hrtimer_cpu_base *hrtimer_base = this_cpu_ptr(&hrtimer_bases);
+
+ /* Avoid the loop, if nothing to update */
+ if (tvec_base->migration_enabled == on)
+ return;
+
+ for_each_possible_cpu(cpu) {
+ tvec_base = per_cpu(tvec_bases, cpu);
+ tvec_base->migration_enabled = on;
+ hrtimer_base = &per_cpu(hrtimer_bases, cpu);
+ hrtimer_base->migration_enabled = on;
+ }
+}
+
+int timer_migration_handler(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp,
+ loff_t *ppos)
+{
+ static DEFINE_MUTEX(mutex);
+ int ret;
+
+ mutex_lock(&mutex);
+ ret = proc_dointvec(table, write, buffer, lenp, ppos);
+ if (!ret && write)
+ timers_update_migration();
+ mutex_unlock(&mutex);
+ return ret;
+}
+
+static inline struct tvec_base *get_target_base(struct tvec_base *base,
+ int pinned)
+{
+ if (pinned || !base->migration_enabled)
+ return this_cpu_read(tvec_bases);
+ return per_cpu(tvec_bases, get_nohz_timer_target());
+}
+#else
+static inline struct tvec_base *get_target_base(struct tvec_base *base,
+ int pinned)
+{
+ return this_cpu_read(tvec_bases);
+}
+#endif
+
/* Functions below help us manage 'deferrable' flag */
static inline unsigned int tbase_get_deferrable(struct tvec_base *base)
{
@@ -793,11 +848,11 @@ static inline struct tvec_base *switch_timer_base(struct timer_list *timer,
static inline int
__mod_timer(struct timer_list *timer, unsigned long expires,
- bool pending_only, int pinned)
+ bool pending_only, int pinned)
{
struct tvec_base *base, *new_base;
unsigned long flags;
- int ret = 0 , cpu;
+ int ret = 0;
timer_stats_timer_set_start_info(timer);
BUG_ON(!timer->function);
@@ -810,16 +865,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires,
debug_activate(timer, expires);
- preempt_disable_rt();
- cpu = smp_processor_id();
-
-#if defined(CONFIG_NO_HZ_COMMON) && defined(CONFIG_SMP)
- if (!pinned && get_sysctl_timer_migration())
- cpu = get_nohz_timer_target();
-#endif
- preempt_enable_rt();
-
- new_base = per_cpu(tvec_bases, cpu);
+ new_base = get_target_base(base, pinned);
if (base != new_base) {
/*
--
1.8.3.1

View File

@ -0,0 +1,28 @@
From 81371b5453a5a08d8d03d37aa993b41a7169b342 Mon Sep 17 00:00:00 2001
Message-Id: <81371b5453a5a08d8d03d37aa993b41a7169b342.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 6 Mar 2018 12:54:40 -0500
Subject: [PATCH 31/32] turn off write same in smartqpi driver
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -5843,6 +5843,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

View File

@ -0,0 +1,182 @@
From 37680a25caeba0ee4e5f26cb524ff8b4faa5c0f5 Mon Sep 17 00:00:00 2001
Message-Id: <37680a25caeba0ee4e5f26cb524ff8b4faa5c0f5.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <nam.ninh@windriver.com>
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 <akinobu.mita@gmail.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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 ++----
include/linux/swiotlb.h | 2 ++
lib/swiotlb.c | 2 +-
7 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index bdcca71..f67aa39 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -44,7 +44,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,
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 16c296a..65c4a7a 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -117,4 +117,6 @@ static inline void swiotlb_free(void) { }
#endif
extern void swiotlb_print_info(void);
+extern int is_swiotlb_buffer(phys_addr_t paddr);
+
#endif /* __LINUX_SWIOTLB_H */
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index ffcaff5..d89c82a 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -404,7 +404,7 @@ void __init swiotlb_free(void)
io_tlb_nslabs = 0;
}
-static int is_swiotlb_buffer(phys_addr_t paddr)
+int is_swiotlb_buffer(phys_addr_t paddr)
{
return paddr >= io_tlb_start && paddr < io_tlb_end;
}
--
1.8.3.1

View File

@ -0,0 +1,87 @@
From 78743472402604dc4fc3304aed9634ae9fe845dd Mon Sep 17 00:00:00 2001
Message-Id: <78743472402604dc4fc3304aed9634ae9fe845dd.1528226387.git.Jim.Somerville@windriver.com>
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <akinobu.mita@gmail.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit d92ef66c4f8fdf7a24736b1ab6c48d32de9bfc07)
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1 @@
mirror:Source/kernel-rt-3.10.0-862.6.3.rt56.811.el7.src.rpm

BIN
kernel-rt/files/centos.cer Normal file

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -0,0 +1,231 @@
From a75195ff25cd30a4662cae5835d32a2403032a33 Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Fri, 20 Apr 2018 14:51:56 -0400
Subject: [PATCH 1/5] Build logic and sources for TiC
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel.spec | 73 +++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 60 insertions(+), 13 deletions(-)
diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec
index 31a5f11..eef356a 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 WRS 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 862
%define rpmversion 3.10.0
-%define pkgrelease 862.6.3.el7
+%define _pkgrelease 862.6.3
+%define pkgrelease %{_pkgrelease}.el7
+
# allow pkg_release to have configurable %%{?dist} tag
%define specrelease 862.6.3%{?dist}
-%define pkg_release %{specrelease}%{?buildid}
+%define pkg_release %{specrelease}%{buildid}
# The kernel tarball/base version
%define rheltarball %{rpmversion}-%{pkgrelease}
@@ -66,7 +69,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 1
@@ -89,7 +92,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}
@@ -370,6 +373,7 @@ BuildRequires: bison flex
# required for zfcpdump
BuildRequires: glibc-static
%endif
+BuildRequires: util-linux
Source0: linux-%{rpmversion}-%{pkgrelease}.tar.xz
@@ -435,6 +439,12 @@ Patch1000: debrand-single-cpu.patch
Patch1001: debrand-rh_taint.patch
Patch1002: debrand-rh-i686-cpu.patch
+# Titanium 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
@@ -586,6 +596,13 @@ This package provides debug information for package kernel-tools.
%endif # with_tools
+%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.
@@ -751,6 +768,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
@@ -795,6 +815,15 @@ for i in *.config
do
mv $i .config
Arch=`head -1 .config | cut -b 3-`
+
+ # Handle Titanium 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 Titanium 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
@@ -868,12 +897,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
@@ -888,8 +918,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
@@ -913,6 +943,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 %{SOURCE13}
mv $KernelImage.signed $KernelImage
%endif
@@ -929,7 +961,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} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw=
+ make -s -j"%(nproc)" %{?cross_opts} 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
@@ -939,7 +971,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."
@@ -1148,6 +1180,12 @@ BuildKernel() {
cp signing_key.priv signing_key.priv.sign${Flavour:+.${Flavour}}
cp signing_key.x509 signing_key.x509.sign${Flavour:+.${Flavour}}
+ # WRS: Copy these keys as part of the devel package
+ # The Module signing keys are to ensure that only Out-of-tree
+ # built against the Titanium 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
@@ -1208,15 +1246,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
@@ -1487,6 +1525,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}
#
@@ -1697,6 +1739,11 @@ fi
%kernel_variant_files %{with_debug} debug
%kernel_variant_files %{with_kdump} kdump
+%ifarch x86_64
+%files unsigned
+/boot/vmlinuz.unsigned
+%endif
+
%changelog
* Tue Jun 26 2018 CentOS Sources <bugs@centos.org> - 3.10.0-862.6.3.el7
- Apply debranding changes
--
2.7.4

View File

@ -0,0 +1,34 @@
From 0bdbfc48c66177522eae9bb7c0449f39f418e609 Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Wed, 30 May 2018 13:12:03 -0400
Subject: [PATCH 4/5] Compile issues
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel.spec | 3 +++
1 file changed, 3 insertions(+)
diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec
index 01dd989..d45c419 100644
--- a/SPECS/kernel.spec
+++ b/SPECS/kernel.spec
@@ -474,6 +474,8 @@ 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 assorted compilation issues
+Patch40027: fix-compilation-issues.patch
BuildRoot: %{_tmppath}/kernel-%{KVRA}-root
@@ -833,6 +835,7 @@ 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 fix-compilation-issues.patch
# Any further pre-build tree manipulations happen here.
--
2.7.4

View File

@ -0,0 +1,89 @@
From d9d90b72c19c1d063272d2b84bd76c52514bf6ac Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Fri, 20 Apr 2018 16:13:47 -0400
Subject: [PATCH 2/5] Kernel source patches for TiC
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel.spec | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec
index eef356a..f1a0092 100644
--- a/SPECS/kernel.spec
+++ b/SPECS/kernel.spec
@@ -445,6 +445,36 @@ Patch1002: debrand-rh-i686-cpu.patch
Source30000: kernel-3.10.0-x86_64.config.tis_extra
Source30001: ima_signing_key.pub
+# Titanium 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
+Patch40012: Enable-building-mpt2sas-and-mpt3sas-as-builtin-for-C.patch
+Patch40013: Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch
+Patch40014: x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch
+Patch40015: rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.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
+
BuildRoot: %{_tmppath}/kernel-%{KVRA}-root
%description
@@ -776,6 +806,34 @@ ApplyOptionalPatch debrand-single-cpu.patch
ApplyOptionalPatch debrand-rh_taint.patch
ApplyOptionalPatch debrand-rh-i686-cpu.patch
+# Titanium 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-mpt2sas-and-mpt3sas-as-builtin-for-C.patch
+ApplyOptionalPatch Enable-building-kernel-with-CONFIG_BLK_DEV_NBD.patch
+ApplyOptionalPatch x86-make-dma_alloc_coherent-return-zeroed-memory-if-.patch
+ApplyOptionalPatch rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.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
+
# Any further pre-build tree manipulations happen here.
chmod +x scripts/checkpatch.pl
--
2.7.4

View File

@ -0,0 +1,26 @@
From 393eb8d3d3a15cda274f5d0c45763de9a8b3fcab Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Tue, 29 May 2018 13:06:24 -0400
Subject: [PATCH 3/5] Lower the compiler version requirement
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec
index f1a0092..01dd989 100644
--- a/SPECS/kernel.spec
+++ b/SPECS/kernel.spec
@@ -335,7 +335,7 @@ ExclusiveOS: Linux
#
BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
BuildRequires: xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk
-BuildRequires: gcc >= 4.8.5-28.el7_5.1, binutils >= 2.25, redhat-rpm-config >= 9.1.0-55
+BuildRequires: gcc >= 4.8.5-16, binutils >= 2.25, redhat-rpm-config >= 9.1.0-55
BuildRequires: hostname, net-tools, bc
BuildRequires: xmlto, asciidoc
BuildRequires: openssl
--
2.7.4

View File

@ -0,0 +1,26 @@
From ec433bddc585744616d73daefc1b32326002a8ab Mon Sep 17 00:00:00 2001
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Fri, 1 Jun 2018 16:17:43 -0400
Subject: [PATCH 5/5] Lower the linux firmware version requirement
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
SPECS/kernel.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec
index d45c419..9fdd37a 100644
--- a/SPECS/kernel.spec
+++ b/SPECS/kernel.spec
@@ -301,7 +301,7 @@ Provides: kernel-modeset = 1\
Provides: kernel-uname-r = %{KVRA}%{?1:.%{1}}\
Requires(pre): %{kernel_prereq}\
Requires(pre): %{initrd_prereq}\
-Requires(pre): linux-firmware >= 20180113-61\
+Requires(pre): linux-firmware >= 20170606-56\
Requires(post): %{_sbindir}/new-kernel-pkg\
Requires(post): system-release\
Requires(preun): %{_sbindir}/new-kernel-pkg\
--
2.7.4

View File

@ -0,0 +1,5 @@
Build-logic-and-sources-for-TiC.patch
Kernel-source-patches-for-TiC.patch
Lower-the-compiler-version-requirement.patch
Compile-issues.patch
Lower-the-linux-firmware-version-requirement.patch

View File

@ -0,0 +1,73 @@
From e223cda3a8edd8fd935d589231c8e19a66bd8947 Mon Sep 17 00:00:00 2001
Message-Id: <e223cda3a8edd8fd935d589231c8e19a66bd8947.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
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 <chris.friesen@windriver.com>
[VT: replacing spaces with tabs. Performed tests]
Signed-off-by: Vu Tran <vu.tran@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
kernel/irq/manage.c | 7 +++++++
kernel/workqueue.c | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index e639145..be46349 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -366,6 +366,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
@@ -5424,6 +5424,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;
/*
@@ -5434,6 +5436,8 @@ static int __init init_workqueues(void)
BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL)));
attrs->nice = std_nice[i];
attrs->no_numa = true;
+ /* If we've specified a kthread mask apply it here too. */
+ cpumask_copy(attrs->cpumask, cpu_kthread_mask);
ordered_wq_attrs[i] = attrs;
}
--
1.8.3.1

View File

@ -0,0 +1,58 @@
From 049ff2fee2c00370ddc9c9bb598fe1e89aaced2d Mon Sep 17 00:00:00 2001
Message-Id: <049ff2fee2c00370ddc9c9bb598fe1e89aaced2d.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Allain Legacy <allain.legacy@windriver.com>
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 <allain.legacy@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
net/ipv4/route.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f19aca2..5246096 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2057,6 +2057,17 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
*/
if (fi && res->prefixlen < 4)
fi = NULL;
+ } else if ((type == RTN_LOCAL) && (orig_oif != 0)) {
+ /*
+ * For local routes that require a particular output interface we do
+ * not want to cache the result. Caching the result causes incorrect
+ * behaviour when there are multiple source addresses on the interface.
+ * The end result being that if the intended recipient is waiting on
+ * that interface for the packet he won't receive it because it will be
+ * delivered on the loopback interface and the IP_PKTINFO ipi_ifindex
+ * will be set to the loopback interface as well.
+ */
+ fi = NULL;
}
fnhe = NULL;
--
1.8.3.1

View File

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

View File

@ -0,0 +1,36 @@
From aeefa74788f568a9c3b49e18a17fc3d59657bbe0 Mon Sep 17 00:00:00 2001
Message-Id: <aeefa74788f568a9c3b49e18a17fc3d59657bbe0.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
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 <Jim.Somerville@windriver.com>
---
drivers/block/nbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index a40a4f0..e0c6b62 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -616,7 +616,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
fsync_bdev(bdev);
mutex_lock(&nbd->tx_lock);
blk_rq_init(NULL, &sreq);
- sreq.cmd_type = REQ_TYPE_SPECIAL;
+ sreq.cmd_type = REQ_TYPE_DRV_PRIV;
nbd_cmd(&sreq) = NBD_CMD_DISC;
/* Check again after getting mutex back. */
--
1.8.3.1

View File

@ -0,0 +1,114 @@
From f49689ec7d42e30014e2aebd57bff050b187ef22 Mon Sep 17 00:00:00 2001
Message-Id: <f49689ec7d42e30014e2aebd57bff050b187ef22.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Alex Kozyrev <alex.kozyrev@windriver.com>
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 <Jim.Somerville@windriver.com>
---
drivers/base/cacheinfo.c | 65 ++++++++++++++++++++++++++++++++++++------------
1 file changed, 49 insertions(+), 16 deletions(-)
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index eb3af27..c924f7e 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -383,7 +383,12 @@ static ssize_t shared_cpumap_show_func(struct device *dev, bool list, char *buf)
struct cacheinfo *this_leaf = dev_get_drvdata(dev);
const struct cpumask *mask = &this_leaf->shared_cpu_map;
- return cpumap_print_to_pagebuf(list, buf, mask);
+ int len = list?
+ cpulist_scnprintf(buf, PAGE_SIZE-2, mask) :
+ cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
+ buf[len++] = '\n';
+ buf[len] = '\0';
+ return len;
}
static ssize_t shared_cpu_map_show(struct device *dev,
@@ -633,30 +638,58 @@ err:
return rc;
}
-static int cacheinfo_cpu_online(unsigned int cpu)
+static void cache_remove_dev(unsigned int cpu)
{
- int rc = detect_cache_attributes(cpu);
+ if (!cpumask_test_cpu(cpu, &cache_dev_map))
+ return;
+ cpumask_clear_cpu(cpu, &cache_dev_map);
- if (rc)
- return rc;
- rc = cache_add_dev(cpu);
- if (rc)
- free_cache_attributes(cpu);
- return rc;
+ cpu_cache_sysfs_exit(cpu);
}
-static int cacheinfo_cpu_pre_down(unsigned int cpu)
+static int cacheinfo_cpu_callback(struct notifier_block *nfb,
+ unsigned long action, void *hcpu)
{
- if (cpumask_test_and_clear_cpu(cpu, &cache_dev_map))
- cpu_cache_sysfs_exit(cpu);
+ unsigned int cpu = (unsigned long)hcpu;
+ int rc = 0;
- free_cache_attributes(cpu);
- return 0;
+ switch (action & ~CPU_TASKS_FROZEN) {
+ case CPU_ONLINE:
+ rc = detect_cache_attributes(cpu);
+ if (!rc)
+ rc = cache_add_dev(cpu);
+ break;
+ case CPU_DEAD:
+ cache_remove_dev(cpu);
+ if (per_cpu_cacheinfo(cpu))
+ free_cache_attributes(cpu);
+ break;
+ }
+ return notifier_from_errno(rc);
}
static int __init cacheinfo_sysfs_init(void)
{
- return cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "base/cacheinfo:online",
- cacheinfo_cpu_online, cacheinfo_cpu_pre_down);
+ int cpu, rc = 0;
+
+ cpu_notifier_register_begin();
+
+ for_each_online_cpu(cpu) {
+ rc = detect_cache_attributes(cpu);
+ if (rc)
+ goto out;
+ rc = cache_add_dev(cpu);
+ if (rc) {
+ free_cache_attributes(cpu);
+ pr_err("error populating cacheinfo..cpu%d\n", cpu);
+ goto out;
+ }
+ }
+ __hotcpu_notifier(cacheinfo_cpu_callback, 0);
+
+out:
+ cpu_notifier_register_done();
+ return rc;
}
+
device_initcall(cacheinfo_sysfs_init);
--
1.8.3.1

View File

@ -0,0 +1,29 @@
From b6ceef1c915827b50ce3f76da4dc47f3eb768b44 Mon Sep 17 00:00:00 2001
Message-Id: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
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 <Jim.Somerville@windriver.com>
---
mm/swap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/swap.c b/mm/swap.c
index 0982a35..6dcf38c 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -998,8 +998,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

View File

@ -0,0 +1,37 @@
From 0e86f726ba6e46ee206ecc7e09ce049ed4145f6c Mon Sep 17 00:00:00 2001
Message-Id: <0e86f726ba6e46ee206ecc7e09ce049ed4145f6c.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
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 <Jim.Somerville@windriver.com>
---
net/core/dev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 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);
}
+ /* WRS extension, want kernel to start at eth1000 */
+ if (strcmp(name, "eth%d") == 0) {
+ for (i=0; i < 1000; i++)
+ set_bit(i, inuse);
+ }
+
i = find_first_zero_bit(inuse, max_netdevices);
free_page((unsigned long) inuse);
}
--
1.8.3.1

View File

@ -0,0 +1,539 @@
From f18a1429e701642388614b47073f4425020deee6 Mon Sep 17 00:00:00 2001
Message-Id: <f18a1429e701642388614b47073f4425020deee6.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
Date: Thu, 7 Apr 2016 11:16:19 -0600
Subject: [PATCH 02/26] Notification of death of arbitrary processes
Note: this commit was copied from Titanium Cloud Rel2
This exposes a new feature which may be called to request
notification when an arbitrary process changes state. The
caller specifies a pid, signal number, and event mask, and
when that pid dies, or is stopped, or anything else that
would normally cause a SIGCHLD, the kernel will send the
specified signal to the caller if the event is in the event
mask originally passed down. The siginfo_t struct will
contain the same information as would be included with SIGCHLD.
This is exposed to userspace via the prctl() call with the
PR_DO_NOTIFY_TASK_STATE option.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
include/linux/init_task.h | 9 ++
include/linux/sched.h | 6 ++
include/uapi/linux/prctl.h | 18 ++++
init/Kconfig | 15 +++
kernel/Makefile | 1 +
kernel/death_notify.c | 227 +++++++++++++++++++++++++++++++++++++++++++++
kernel/death_notify.h | 45 +++++++++
kernel/exit.c | 6 ++
kernel/fork.c | 4 +
kernel/signal.c | 11 +++
kernel/sys.c | 9 ++
11 files changed, 351 insertions(+)
create mode 100644 kernel/death_notify.c
create mode 100644 kernel/death_notify.h
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 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 0646138..3933e24 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1631,6 +1631,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 8ddaa82..53d6392 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
@@ -1538,6 +1538,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
@@ -112,6 +112,7 @@ obj-$(CONFIG_RING_BUFFER) += trace/
obj-$(CONFIG_TRACEPOINTS) += trace/
obj-$(CONFIG_IRQ_WORK) += irq_work.o
obj-$(CONFIG_CPU_PM) += cpu_pm.o
+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 <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/prctl.h>
+#include <linux/uaccess.h>
+
+#include "death_notify.h"
+
+static void unlink_status_notifier(struct signotifier *n)
+{
+ list_del(&n->monitor_list);
+ list_del(&n->notify_list);
+ kfree(n);
+}
+
+static void handle_already_monitoring(struct signotifier *node,
+ struct task_state_notify_info *args,
+ struct task_state_notify_info *oldargs)
+{
+ /* Store the old values */
+ oldargs->sig = node->sig;
+ oldargs->events = node->events;
+
+ /* We know that args->sig is 0 or a valid signal. */
+ if (args->sig > 0) {
+ /* Update the new values */
+ node->sig = args->sig;
+ node->events = args->events;
+ } else if (!args->sig) {
+ /* args->sig of 0 means to deregister */
+ unlink_status_notifier(node);
+ }
+}
+
+static void setup_new_node(struct task_struct *p,
+ struct signotifier *node,
+ struct task_state_notify_info *args)
+{
+ node->notify_tsk = current;
+ node->sig = args->sig;
+ node->events = args->events;
+
+ /* Add this node to the list of notification requests
+ * for the specified process.
+ */
+ list_add_tail(&node->notify_list, &p->notify);
+
+ /* Also add this node to the list of monitor requests
+ * for the current process.
+ */
+ list_add_tail(&node->monitor_list, &current->monitor);
+}
+
+
+/* Returns 0 if arguments are valid, 1 if they are not. */
+static int invalid_args(struct task_state_notify_info *args)
+{
+ int ret = 1;
+
+ if (args->pid <= 0)
+ goto out;
+
+ /* Sig of -1 implies query, sig of 0 implies deregistration.
+ * Otherwise sig must be positive and within range.
+ */
+ if ((args->sig < -1) || (args->sig > _NSIG))
+ goto out;
+
+ /* If positive sig, must have valid events. */
+ if (args->sig > 0) {
+ if (!args->events || (args->events >= (1 << (NSIGCHLD+1))))
+ goto out;
+ }
+
+ ret = 0;
+out:
+ return ret;
+}
+
+/* Notify those registered for process state updates via do_notify_task_state().
+ * If "del" is nonzero, the process is dying and we want to free
+ * the nodes in the list as we go.
+ *
+ * Note: we only notify processes for events in which they have registered
+ * interest.
+ *
+ * Must be called holding a lock on tasklist_lock.
+ */
+void do_notify_others(struct task_struct *tsk, struct siginfo *info)
+{
+ struct signotifier *node;
+ unsigned int events;
+
+ /* This method of generating the event bit must be
+ * matched in the userspace library.
+ */
+ events = 1 << (info->si_code & 0xFF);
+
+ list_for_each_entry(node, &tsk->notify, notify_list) {
+ if (events & node->events) {
+ info->si_signo = node->sig;
+ group_send_sig_info(node->sig, info, node->notify_tsk);
+ }
+ }
+}
+
+void release_notify_others(struct task_struct *p)
+{
+ struct signotifier *n, *t;
+
+ /* Need to clean up any outstanding requests where we
+ * wanted to be notified when others died.
+ */
+ list_for_each_entry_safe(n, t, &p->monitor, monitor_list) {
+ unlink_status_notifier(n);
+ }
+
+ /* Also need to clean up any outstanding requests where others
+ * wanted to be notified when we died.
+ */
+ list_for_each_entry_safe(n, t, &p->notify, notify_list) {
+ unlink_status_notifier(n);
+ }
+}
+
+/* If the config is defined, then processes can call this routine
+ * to request notification when the specified task's state changes.
+ * On the death (or other state change) of the specified process,
+ * we will send them the specified signal if the event is listed
+ * in their event bitfield.
+ *
+ * A sig of 0 means that we want to deregister.
+ *
+ * The sig/events fields are value/result. On success we update them
+ * to reflect what they were before the call.
+ *
+ * Returns error code on error, on success we return 0.
+ */
+int do_notify_task_state(unsigned long arg)
+{
+ int err;
+ struct task_struct *p;
+ struct signotifier *node, *tmp;
+ struct task_state_notify_info args, oldargs;
+
+ if (copy_from_user(&args, (struct task_state_notify_info __user *)arg,
+ sizeof(args)))
+ return -EFAULT;
+ oldargs.pid = args.pid;
+
+ /* Validate the arguments passed in. */
+ err = -EINVAL;
+ if (invalid_args(&args))
+ goto out;
+
+ /* We must hold a write lock on tasklist_lock to add the notification
+ * later on, and we need some lock on tasklist_lock for
+ * find_task_by_pid(), so may as well take the write lock now.
+ * Must use write_lock_irq().
+ */
+ 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 <asm/unistd.h>
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
static void exit_mm(struct task_struct * tsk);
@@ -184,6 +187,9 @@ repeat:
proc_flush_task(p);
tasklist_write_lock_irq();
+#ifdef CONFIG_SIGEXIT
+ release_notify_others(p);
+#endif
ptrace_release_task(p);
__exit_signal(p);
diff --git a/kernel/fork.c b/kernel/fork.c
index 55e4ca4..e721eed 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1471,6 +1471,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 a5aa525..b9d138e 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -46,6 +46,9 @@
#include <asm/siginfo.h>
#include <asm/cacheflush.h>
#include "audit.h" /* audit_signal_info() */
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
/*
* SLAB caches for signal bits.
@@ -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 cb90b1c..c68f98e 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -64,6 +64,10 @@
#include <asm/io.h>
#include <asm/unistd.h>
+#ifdef CONFIG_SIGEXIT
+#include "death_notify.h"
+#endif
+
#ifndef SET_UNALIGN_CTL
# define SET_UNALIGN_CTL(a,b) (-EINVAL)
#endif
@@ -2474,6 +2478,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;
--
1.8.3.1

View File

@ -0,0 +1,34 @@
From 98f7b9d926abbe0bb60ab0a14a306516fa36b9d8 Mon Sep 17 00:00:00 2001
Message-Id: <98f7b9d926abbe0bb60ab0a14a306516fa36b9d8.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Dahir Osman <dahir.osman@windriver.com>
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 <Jim.Somerville@windriver.com>
---
drivers/pci/quirks.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 5614e3f..4a0bfed 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4289,6 +4289,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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,373 @@
From 1d197374f04642f9a5e71cc013d65d5438c35dc3 Mon Sep 17 00:00:00 2001
Message-Id: <1d197374f04642f9a5e71cc013d65d5438c35dc3.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Kam Nasim <kam.nasim@windriver.com>
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 <Jim.Somerville@windriver.com>
---
fs/namei.c | 2 +-
fs/nfsd/vfs.c | 2 +-
fs/xattr.c | 1 +
include/linux/fs.h | 15 +------
include/linux/ima.h | 77 +++++++-------------------------
include/linux/integrity.h | 22 ++++-----
security/security.c | 111 +++++++++++++++++++++++++++++++++++++++++++++-
7 files changed, 140 insertions(+), 90 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 9f90b63..bf91ea0 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3236,7 +3236,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
@@ -883,7 +883,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
@@ -207,6 +207,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
@@ -677,9 +677,8 @@ struct inode {
struct fsnotify_mark_connector __rcu *i_fsnotify_marks)
#endif
-#ifdef CONFIG_IMA
atomic_t i_readcount; /* struct files open RO */
-#endif
+
void *i_private; /* fs or device private pointer */
};
@@ -2827,7 +2826,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));
@@ -2837,16 +2835,7 @@ static inline void i_readcount_inc(struct inode *inode)
{
atomic_inc(&inode->i_readcount);
}
-#else
-static inline void i_readcount_dec(struct inode *inode)
-{
- return;
-}
-static inline void i_readcount_inc(struct inode *inode)
-{
- return;
-}
-#endif
+
extern int do_pipe_flags(int *, int);
extern int kernel_read(struct file *, loff_t, char *, unsigned long);
diff --git a/include/linux/ima.h b/include/linux/ima.h
index 1b7f268..9fee45c 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -13,64 +13,21 @@
#include <linux/fs.h>
struct linux_binprm;
-#ifdef CONFIG_IMA
-extern int ima_bprm_check(struct linux_binprm *bprm);
-extern int ima_file_check(struct file *file, int mask);
-extern void ima_file_free(struct file *file);
-extern int ima_file_mmap(struct file *file, unsigned long prot);
-extern int ima_module_check(struct file *file);
-
-#else
-static inline int ima_bprm_check(struct linux_binprm *bprm)
-{
- return 0;
-}
-
-static inline int ima_file_check(struct file *file, int mask)
-{
- return 0;
-}
-
-static inline void ima_file_free(struct file *file)
-{
- return;
-}
-
-static inline int ima_file_mmap(struct file *file, unsigned long prot)
-{
- return 0;
-}
-
-static inline int ima_module_check(struct file *file)
-{
- return 0;
-}
-
-#endif /* CONFIG_IMA */
-
-#ifdef CONFIG_IMA_APPRAISE
-extern void ima_inode_post_setattr(struct dentry *dentry);
-extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,
+/*
+ * The IMA Kernel module has to redefine these symbols so that
+ * the kernel module can link a dynamic function, as a hook into
+ * the Kernel FS calls (which use these)
+ */
+/* ifdef CONFIG_IMA */
+extern int (*ima_bprm_check)(struct linux_binprm *bprm);
+extern int (*ima_file_check)(struct file *file, int mask, int opened);
+extern void (*ima_file_free)(struct file *file);
+extern int (*ima_file_mmap)(struct file *file, unsigned long prot);
+extern int (*ima_module_check)(struct file *file);
+
+/* ifdef CONFIG_IMA_APPRAISE */
+extern void (*ima_inode_post_setattr)(struct dentry *dentry);
+extern int (*ima_inode_setxattr)(struct dentry *dentry, const char *xattr_name,
const void *xattr_value, size_t xattr_value_len);
-extern int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name);
-#else
-static inline void ima_inode_post_setattr(struct dentry *dentry)
-{
- return;
-}
-
-static inline int ima_inode_setxattr(struct dentry *dentry,
- const char *xattr_name,
- const void *xattr_value,
- size_t xattr_value_len)
-{
- return 0;
-}
-
-static inline int ima_inode_removexattr(struct dentry *dentry,
- const char *xattr_name)
-{
- return 0;
-}
-#endif /* CONFIG_IMA_APPRAISE */
-#endif /* _LINUX_IMA_H */
+extern int (*ima_inode_removexattr)(struct dentry *dentry, const char *xattr_name);
+#endif
diff --git a/include/linux/integrity.h b/include/linux/integrity.h
index 83222ce..a5040b6 100644
--- a/include/linux/integrity.h
+++ b/include/linux/integrity.h
@@ -21,20 +21,14 @@ enum integrity_status {
};
/* List of EVM protected security xattrs */
-#ifdef CONFIG_INTEGRITY
-extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode);
-extern void integrity_inode_free(struct inode *inode);
+/*
+ * The Integrity Kernel module has to redefine these symbols so that
+ * the kernel module can link a dynamic function, as a hook into
+ * the Kernel Security subsystem (which use these)
+ */
-#else
-static inline struct integrity_iint_cache *
- integrity_inode_get(struct inode *inode)
-{
- return NULL;
-}
+/* #ifdef CONFIG_INTEGRITY */
+extern struct integrity_iint_cache *(*integrity_inode_get)(struct inode *inode);
+extern void (*integrity_inode_free)(struct inode *inode);
-static inline void integrity_inode_free(struct inode *inode)
-{
- return;
-}
-#endif /* CONFIG_INTEGRITY */
#endif /* _LINUX_INTEGRITY_H */
diff --git a/security/security.c b/security/security.c
index f069482..646a0e3 100644
--- a/security/security.c
+++ b/security/security.c
@@ -156,6 +156,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
@@ -715,8 +819,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)
{
@@ -1525,6 +1632,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)
{
@@ -1541,5 +1649,6 @@ 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

View File

@ -0,0 +1,246 @@
From 43dfb08aa6e053bcf1cf5696ea6bc3b9b2aa3d53 Mon Sep 17 00:00:00 2001
Message-Id: <43dfb08aa6e053bcf1cf5696ea6bc3b9b2aa3d53.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Kam Nasim <kam.nasim@windriver.com>
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 <Jim.Somerville@windriver.com>
---
.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
@@ -197,7 +197,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 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 <linux/export.h>
+#include <linux/init.h>
+
+ __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

View File

@ -0,0 +1,168 @@
From 6b6edb5a389c03e208e6a123a7807af66283237d Mon Sep 17 00:00:00 2001
Message-Id: <6b6edb5a389c03e208e6a123a7807af66283237d.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Chris Friesen <chris.friesen@windriver.com>
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=<cpulist>. 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 <cl@linux.com>
Signed-off-by: Chris Friesen <chris.friesen@windriver.com>
[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 <vu.tran@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -1539,6 +1539,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
@@ -956,10 +956,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);
@@ -975,6 +971,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
@@ -756,6 +756,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(&current->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, &param);
- 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

View File

@ -0,0 +1,55 @@
From 6771ec5b24042ea92c2a872d28b41e39c4445c68 Mon Sep 17 00:00:00 2001
Message-Id: <6771ec5b24042ea92c2a872d28b41e39c4445c68.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Hannes Reinecke <hare@suse.de>
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 <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,224 @@
From b6eb39977df83c5ceca5b35c041bb2923e5a47d8 Mon Sep 17 00:00:00 2001
Message-Id: <b6eb39977df83c5ceca5b35c041bb2923e5a47d8.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <nam.ninh@windriver.com>
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 <akinobu.mita@gmail.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -579,8 +579,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
@@ -1283,7 +1283,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

View File

@ -0,0 +1,92 @@
From c900922b59bc9f2b680f9d1846bf7599d8410de8 Mon Sep 17 00:00:00 2001
Message-Id: <c900922b59bc9f2b680f9d1846bf7599d8410de8.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
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 <alex.shi@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/base/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

View File

@ -0,0 +1,71 @@
From e3d73746230638fd50670d67843346ccaebb885b Mon Sep 17 00:00:00 2001
Message-Id: <e3d73746230638fd50670d67843346ccaebb885b.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Alex Shi <alex.shi@linaro.org>
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 <alex.shi@linaro.org>
Acked-by: Rik van Riel <riel@redhat.com>
[ rjw : Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/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 <linux/tick.h>
#include <linux/sched.h>
#include <linux/math64.h>
+#include <linux/cpu.h>
#include <linux/module.h>
#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

View File

@ -0,0 +1,52 @@
From 3735f7414216e00f72e08c5d85a98e3b649fc085 Mon Sep 17 00:00:00 2001
Message-Id: <3735f7414216e00f72e08c5d85a98e3b649fc085.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Alex Shi <alex.shi@linaro.org>
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 <alex.shi@linaro.org>
Acked-by: Rik van Riel <riel@redhat.com>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
drivers/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

View File

@ -0,0 +1,44 @@
From 47b0bf6b68f473392fe04755721f57990a4b111d Mon Sep 17 00:00:00 2001
Message-Id: <47b0bf6b68f473392fe04755721f57990a4b111d.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
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 <sudip@vectorindia.org>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,96 @@
From d4187124ed859c36b9055cc240cc0c8181e54725 Mon Sep 17 00:00:00 2001
Message-Id: <d4187124ed859c36b9055cc240cc0c8181e54725.1528311567.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Thu, 31 May 2018 17:47:26 -0400
Subject: [PATCH 1/1] fix compilation issues
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -620,7 +620,7 @@ static const struct file_operations fops_kaiser_enabled = {
static int __init create_kpti_enabled(void)
{
- if (!xen_pv_domain())
+ if (!is_xen_pv_domain())
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
@@ -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)
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

View File

@ -0,0 +1,120 @@
From c449e4c490ac85ccf04e8aab67c8120aa48f8ad0 Mon Sep 17 00:00:00 2001
Message-Id: <c449e4c490ac85ccf04e8aab67c8120aa48f8ad0.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Matt Peters <matt.peters@windriver.com>
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 <matt.peters@windriver.com>
[PG: Added bootarg wrapper and documentation entries.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Nam Ninh <nam.ninh@windriver.com>
Signed-off-by: Nam Ninh <nam.ninh@windriver.com>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -1303,6 +1303,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
@@ -504,6 +504,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
@@ -563,6 +564,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;
@@ -2733,6 +2743,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

View File

@ -0,0 +1,807 @@
# 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
CONFIG_SCSI_MPT2SAS=y
CONFIG_SCSI_MPT3SAS=y
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
# 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_PTP_1588_CLOCK_PCH=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
# 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
CONFIG_GPIO_BT8XX=n
CONFIG_KERNFS=y
CONFIG_INTEL_RDT_A=y

View File

@ -0,0 +1,96 @@
From b4007dff3d6d7fc27d8b3431213202fb9c34793d Mon Sep 17 00:00:00 2001
Message-Id: <b4007dff3d6d7fc27d8b3431213202fb9c34793d.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <nam.ninh@windriver.com>
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 <akinobu.mita@gmail.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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
@@ -304,6 +304,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

View File

@ -0,0 +1,47 @@
From fe5869e78860a9150e24ea32c1a131da6af057c8 Mon Sep 17 00:00:00 2001
Message-Id: <fe5869e78860a9150e24ea32c1a131da6af057c8.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
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 <chris.friesen@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,28 @@
From 533c1cd1909a81bd027435dd934a194983c9e9b8 Mon Sep 17 00:00:00 2001
Message-Id: <533c1cd1909a81bd027435dd934a194983c9e9b8.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
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 <Jim.Somerville@windriver.com>
---
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
@@ -5843,6 +5843,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

View File

@ -0,0 +1,182 @@
From e27598227a12485c787a57581b1797531941bf51 Mon Sep 17 00:00:00 2001
Message-Id: <e27598227a12485c787a57581b1797531941bf51.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <nam.ninh@windriver.com>
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 <akinobu.mita@gmail.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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 ++----
include/linux/swiotlb.h | 2 ++
lib/swiotlb.c | 2 +-
7 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 48ae099..9e841a5 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -44,7 +44,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,
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 16c296a..65c4a7a 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -117,4 +117,6 @@ static inline void swiotlb_free(void) { }
#endif
extern void swiotlb_print_info(void);
+extern int is_swiotlb_buffer(phys_addr_t paddr);
+
#endif /* __LINUX_SWIOTLB_H */
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index ffcaff5..d89c82a 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -404,7 +404,7 @@ void __init swiotlb_free(void)
io_tlb_nslabs = 0;
}
-static int is_swiotlb_buffer(phys_addr_t paddr)
+int is_swiotlb_buffer(phys_addr_t paddr)
{
return paddr >= io_tlb_start && paddr < io_tlb_end;
}
--
1.8.3.1

View File

@ -0,0 +1,87 @@
From 2d627fa0c465b3146191ffa7e336bb1eca5d1879 Mon Sep 17 00:00:00 2001
Message-Id: <2d627fa0c465b3146191ffa7e336bb1eca5d1879.1527544850.git.Jim.Somerville@windriver.com>
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <akinobu.mita@gmail.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit d92ef66c4f8fdf7a24736b1ab6c48d32de9bfc07)
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
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

View File

@ -0,0 +1,2 @@
mirror:Source/kernel-3.10.0-862.6.3.el7.src.rpm

Binary file not shown.