aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Huber2016-08-02 15:52:23 +0200
committerMarcel Huber2016-08-05 08:18:28 +0200
commitec74303d1f40e37209d71a7fff32ad9c9e70b2e6 (patch)
tree724fdf4881d48f4dbdc6f8ef9245af445f359f91
parentfc830822e0e7c5ec00455ffbd63203e04a4d27b7 (diff)
downloadaur-ec74303d1f40e37209d71a7fff32ad9c9e70b2e6.tar.gz
build everything needed to start using the card
- not use github repos but patch files directly - added download urls - as we already need to have all three *master* tar files present, it is easier to apply changes directly
-rw-r--r--.SRCINFO76
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD142
-rw-r--r--blacklist-mic-host.conf1
-rw-r--r--blacklist-mpss.conf1
-rwxr-xr-xbuildandcopy.sh5
-rw-r--r--mpss-daemon-archlinux-extension.patch134
-rw-r--r--mpss-daemon-minimize-modules.patch25
-rwxr-xr-xmpss-daemon.service18
-rw-r--r--mpss-gen-symver-map-python3-compat.patch85
-rw-r--r--mpss-micmgmt-misleading-indent.patch62
-rw-r--r--mpss-micmgmt-remove-inline0.patch61
-rw-r--r--mpss-micmgmt-remove-inline1.patch50
-rw-r--r--mpss-micmgmt-whitespace.patch33
-rw-r--r--mpss-modules-explicit-coprocessor-build.patch25
-rw-r--r--mpss-modules-init-indent.patch59
-rw-r--r--mpss-modules-page-cache.patch114
-rw-r--r--mpss-modules-rcu-lockup.patch45
18 files changed, 893 insertions, 48 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 76e128ee1f61..87a656c6f07b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,31 +1,53 @@
pkgbase = mpss
pkgdesc = Intel® Manycore Platform Software Stack
pkgver = 3.7.1
- pkgrel = 2
+ pkgrel = 5
url = https://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss
arch = x86_64
license = LGPL2.1
makedepends = asciidoc
+ makedepends = libarchive
depends = dkms
depends = python
- source = dkms.conf
- source = blacklist-mic-host.conf
- source = micmgmt.setup.py
- sha256sums = a76162c169073060ee3a966e95342f29b3e342c956d29169c10a6dd97e342fa5
- sha256sums = 42dda3527ed2496b851c0fad6a841f660a0c086ecf742bb4f132308b9e38d913
- sha256sums = 191d6fd54157ad5a9465947c73b4332a83fc4411be5d9738d0594a2b7ddb7273
- source_x86_64 = git+https://github.com/marcelhuberfoo/mpss-modules.git#branch=ModuleAndKernelUpdates
- source_x86_64 = git+https://github.com/marcelhuberfoo/mpss-gen-symver-map.git
- source_x86_64 = git+https://github.com/marcelhuberfoo/mpss-libscif.git
- source_x86_64 = git+https://github.com/marcelhuberfoo/mpss-daemon.git
- source_x86_64 = git+https://github.com/marcelhuberfoo/mpss-micmgmt.git
- source_x86_64 = git+https://github.com/marcelhuberfoo/mpss-metadata.git
- sha256sums_x86_64 = SKIP
- sha256sums_x86_64 = SKIP
- sha256sums_x86_64 = SKIP
- sha256sums_x86_64 = SKIP
- sha256sums_x86_64 = SKIP
- sha256sums_x86_64 = SKIP
+ depends = nfs-utils
+ depends = netctl
+ depends = ifplugd
+ source_x86_64 = http://registrationcenter-download.intel.com/akdlm/irc_nas/9226/mpss-3.7.1-linux.tar
+ source_x86_64 = http://registrationcenter-download.intel.com/akdlm/irc_nas/9226/mpss-3.7.1-k1om.tar
+ source_x86_64 = http://registrationcenter-download.intel.com/akdlm/irc_nas/9226/mpss-src-3.7.1.tar
+ source_x86_64 = dkms.conf
+ source_x86_64 = blacklist-mpss.conf
+ source_x86_64 = mpss-daemon.service
+ source_x86_64 = micmgmt.setup.py
+ source_x86_64 = mpss-daemon-archlinux-extension.patch
+ source_x86_64 = mpss-daemon-minimize-modules.patch
+ source_x86_64 = mpss-modules-explicit-coprocessor-build.patch
+ source_x86_64 = mpss-modules-init-indent.patch
+ source_x86_64 = mpss-modules-rcu-lockup.patch
+ source_x86_64 = mpss-modules-page-cache.patch
+ source_x86_64 = mpss-gen-symver-map-python3-compat.patch
+ source_x86_64 = mpss-micmgmt-misleading-indent.patch
+ source_x86_64 = mpss-micmgmt-remove-inline0.patch
+ source_x86_64 = mpss-micmgmt-remove-inline1.patch
+ source_x86_64 = mpss-micmgmt-whitespace.patch
+ sha256sums_x86_64 = 3a8d070d7b82d41afa67766db8e3305621643ced1b3f8e2845bf333cdf39b83b
+ sha256sums_x86_64 = d73abe69df8f36e6214194fc010877b2ee5ea47e2227acf823d88896804899aa
+ sha256sums_x86_64 = 4458257ded25dc7b69fa6de49e7ec066d0053ef6be54267bb283dbb4e6eb38c8
+ sha256sums_x86_64 = a76162c169073060ee3a966e95342f29b3e342c956d29169c10a6dd97e342fa5
+ sha256sums_x86_64 = 540cfb724426aaa92fd3998cf6f1a34e491332316af88848d251409bdd596fb3
+ sha256sums_x86_64 = 8fe2d3b0f1374cf74ea9ef1c5ade0a6cdf891cbcd0438420c19da27feef144c7
+ sha256sums_x86_64 = 191d6fd54157ad5a9465947c73b4332a83fc4411be5d9738d0594a2b7ddb7273
+ sha256sums_x86_64 = 265d26efa3e127f4d5211bb32e65c70beb9ee6b1703a5e2c146e9aa3e4d33604
+ sha256sums_x86_64 = b135e8af616fa2404777ae8c689ea97b9ffb73d18036039fd545108b9b9310fc
+ sha256sums_x86_64 = 2169df02b5623c43feb272f2d142472d2d42a089a370a6f33f470aa3dea50603
+ sha256sums_x86_64 = b1264678b77a3ae64716e507e225fce5cfd1c77ae77d0119071c28cab74d0a97
+ sha256sums_x86_64 = 3690295e9e24e6a8b42323ca5b2b76f56a3a8f4bdee75b3dfc5a3f01e3f3d1bc
+ sha256sums_x86_64 = ace053c75b096c2e120c73076c9a86fcbf1528518761766b9e41e975dc44ae43
+ sha256sums_x86_64 = 17791147eef797e4fe161bb08e989685303dbff866d01f2e37335c09e6367688
+ sha256sums_x86_64 = 64d26ff84029d246868f995cf9fd49b20851a671208c3fa474e0fef5216708cd
+ sha256sums_x86_64 = 99d0e6d58a14bfbbe96b41de8f0f4383225acaefba8e4d48c7ff86924502c545
+ sha256sums_x86_64 = ac8e471ddd8ff1cba8b269434ab0efac2ece7bc68cf0044147d99e70e831ce09
+ sha256sums_x86_64 = 1e523015afb1919023d61648126e13baa7d577a9b64aa3445dd67e156e75e5fa
pkgname = mpss-modules-dkms
pkgdesc = mic Kernel module of Intel® Manycore Platform Software Stack
@@ -53,6 +75,8 @@ pkgname = mpss-micmgmt-tools
pkgdesc = micmgmt tools of Intel® Manycore Platform Software Stack
groups = mpss
depends = mpss-micmgmt-miclib
+ depends = netctl
+ depends = ifplugd
pkgname = mpss-micmgmt-python
pkgdesc = miclib python wrapper of Intel® Manycore Platform Software Stack
@@ -66,4 +90,18 @@ pkgname = mpss-daemon
groups = mpss
depends = mpss-libscif
depends = mpss-gen-symver-map
+ depends = nfs-utils
+ depends = mpss-boot-files
+
+pkgname = mpss-boot-files
+ pkgdesc = Boot image for the coprocessor of Intel® Manycore Platform Software Stack
+ arch = any
+ groups = mpss
+ depends =
+
+pkgname = mpss-flash-files
+ pkgdesc = Flash files for the coprocessor of Intel® Manycore Platform Software Stack
+ arch = any
+ groups = mpss
+ depends =
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..017106bc2ec0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/*.tar
+/mpss-*/
+/src/
+*.tar.xz
+/pkg/
diff --git a/PKGBUILD b/PKGBUILD
index 166a6b29064a..853b363890d1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,33 +1,97 @@
# Maintainer: Marcel Huber <`echo "moc tknup liamg tä oofrebuhlecram" | rev`>
pkgbase=mpss
-pkgname=(mpss-modules-dkms mpss-gen-symver-map mpss-libscif mpss-micmgmt-miclib mpss-micmgmt-tools mpss-micmgmt-python mpss-daemon)
+pkgname=(mpss-modules-dkms mpss-gen-symver-map mpss-libscif mpss-micmgmt-miclib
+ mpss-micmgmt-tools mpss-micmgmt-python mpss-daemon
+ mpss-boot-files mpss-flash-files)
pkgdesc="Intel® Manycore Platform Software Stack"
pkgver=3.7.1
-pkgrel=2
+pkgrel=5
arch=('x86_64')
url="https://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss"
license=('LGPL2.1')
-depends=(dkms python)
-makedepends=(asciidoc)
-source=(dkms.conf
- blacklist-mic-host.conf
- micmgmt.setup.py)
-source_x86_64=(git+https://github.com/marcelhuberfoo/mpss-modules.git#branch=ModuleAndKernelUpdates
- git+https://github.com/marcelhuberfoo/mpss-gen-symver-map.git
- git+https://github.com/marcelhuberfoo/mpss-libscif.git
- git+https://github.com/marcelhuberfoo/mpss-daemon.git
- git+https://github.com/marcelhuberfoo/mpss-micmgmt.git
- git+https://github.com/marcelhuberfoo/mpss-metadata.git)
-sha256sums=('a76162c169073060ee3a966e95342f29b3e342c956d29169c10a6dd97e342fa5'
- '42dda3527ed2496b851c0fad6a841f660a0c086ecf742bb4f132308b9e38d913'
- '191d6fd54157ad5a9465947c73b4332a83fc4411be5d9738d0594a2b7ddb7273')
-sha256sums_x86_64=('SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP')
+depends=(dkms python nfs-utils netctl ifplugd)
+makedepends=(asciidoc libarchive)
+source_x86_64=(
+ http://registrationcenter-download.intel.com/akdlm/irc_nas/9226/mpss-${pkgver}-linux.tar
+ http://registrationcenter-download.intel.com/akdlm/irc_nas/9226/mpss-${pkgver}-k1om.tar
+ http://registrationcenter-download.intel.com/akdlm/irc_nas/9226/mpss-src-${pkgver}.tar
+ dkms.conf
+ blacklist-mpss.conf
+ mpss-daemon.service
+ micmgmt.setup.py
+ mpss-daemon-archlinux-extension.patch
+ mpss-daemon-minimize-modules.patch
+ mpss-modules-explicit-coprocessor-build.patch
+ mpss-modules-init-indent.patch
+ mpss-modules-rcu-lockup.patch
+ mpss-modules-page-cache.patch
+ mpss-gen-symver-map-python3-compat.patch
+ mpss-micmgmt-misleading-indent.patch
+ mpss-micmgmt-remove-inline0.patch
+ mpss-micmgmt-remove-inline1.patch
+ mpss-micmgmt-whitespace.patch
+)
+sha256sums_x86_64=('3a8d070d7b82d41afa67766db8e3305621643ced1b3f8e2845bf333cdf39b83b'
+ 'd73abe69df8f36e6214194fc010877b2ee5ea47e2227acf823d88896804899aa'
+ '4458257ded25dc7b69fa6de49e7ec066d0053ef6be54267bb283dbb4e6eb38c8'
+ 'a76162c169073060ee3a966e95342f29b3e342c956d29169c10a6dd97e342fa5'
+ '540cfb724426aaa92fd3998cf6f1a34e491332316af88848d251409bdd596fb3'
+ '8fe2d3b0f1374cf74ea9ef1c5ade0a6cdf891cbcd0438420c19da27feef144c7'
+ '191d6fd54157ad5a9465947c73b4332a83fc4411be5d9738d0594a2b7ddb7273'
+ '265d26efa3e127f4d5211bb32e65c70beb9ee6b1703a5e2c146e9aa3e4d33604'
+ 'b135e8af616fa2404777ae8c689ea97b9ffb73d18036039fd545108b9b9310fc'
+ '2169df02b5623c43feb272f2d142472d2d42a089a370a6f33f470aa3dea50603'
+ 'b1264678b77a3ae64716e507e225fce5cfd1c77ae77d0119071c28cab74d0a97'
+ '3690295e9e24e6a8b42323ca5b2b76f56a3a8f4bdee75b3dfc5a3f01e3f3d1bc'
+ 'ace053c75b096c2e120c73076c9a86fcbf1528518761766b9e41e975dc44ae43'
+ '17791147eef797e4fe161bb08e989685303dbff866d01f2e37335c09e6367688'
+ '64d26ff84029d246868f995cf9fd49b20851a671208c3fa474e0fef5216708cd'
+ '99d0e6d58a14bfbbe96b41de8f0f4383225acaefba8e4d48c7ff86924502c545'
+ 'ac8e471ddd8ff1cba8b269434ab0efac2ece7bc68cf0044147d99e70e831ce09'
+ '1e523015afb1919023d61648126e13baa7d577a9b64aa3445dd67e156e75e5fa')
+
+extract_rpmfiles() {
+ _extract_rpmfiles=(
+ "mpss-boot-files-${pkgver}-1.glibc2.12.${arch}.rpm|mpss-boot-files"
+ "mpss-micsmc-gui-${pkgver}-1.glibc2.12.${arch}.rpm|mpss-micmgmt-tools"
+ "glibc2.12pkg-mpss-flash-${pkgver}-1.glibc2.12.${arch}.rpm|mpss-flash-files"
+ "k1om/mpss-rasmm-kernel-${pkgver}-1.k1om.rpm|mpss-boot-files"
+ "k1om/mpss-memdiag-kernel-${pkgver}-1.k1om.rpm|mpss-boot-files"
+ )
+ for ef in "${_extract_rpmfiles[@]}"; do
+ _filepart="$(cut -d'|' -f1 <<<$ef)";
+ _destdir="$(cut -d'|' -f2 <<<$ef)";
+ msg2 "Extracting into $(basename $srcdir)/$_destdir..."
+ eval "bsdtar xf $srcdir/mpss-${pkgver}/${_filepart} -s '|^.*\$|${_destdir}/~|S'"
+ done
+}
+
+extract_srcfiles() {
+ _extract_srcfiles=(
+ "src/mpss-modules-${pkgver}.tar.bz2|mpss-modules"
+ "src/gen-symver-map-${pkgver}.tar.bz2|mpss-gen-symver-map"
+ "src/libscif-${pkgver}.tar.bz2|mpss-libscif"
+ "src/mpss-daemon-${pkgver}.tar.bz2|mpss-daemon"
+ "src/mpss-micmgmt-${pkgver}.tar.bz2|mpss-micmgmt"
+ "src/mpss-metadata-${pkgver}.tar.bz2|mpss-metadata"
+ )
+ for ef in "${_extract_srcfiles[@]}"; do
+ _filepart="$(cut -d'|' -f1 <<<$ef)";
+ _destdir="$(cut -d'|' -f2 <<<$ef)";
+ msg2 "Extracting into $(basename $srcdir)/$_destdir..."
+ eval "bsdtar xf $srcdir/mpss-${pkgver}/${_filepart} -s '|^.*-${pkgver}|${_destdir}|S'"
+ done
+}
+
+prepare() {
+ extract_rpmfiles
+ extract_srcfiles
+ msg2 "Patching files..."
+ for p in $srcdir/*.patch; do
+ ( cd $srcdir && patch --forward --strip=0 --input="$p" )
+ done
+}
## within each split package’s packaging function:
# arch
@@ -57,11 +121,11 @@ package_mpss-modules-dkms() {
# Copy dkms.conf
install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgname}-${pkgver}/dkms.conf
- install -Dm644 blacklist-mic-host.conf "${pkgdir}"/etc/modprobe.d/
+ install -Dm644 blacklist-mpss.conf "${pkgdir}"/etc/modprobe.d/
sed -e "s|/sbin/modprobe|/usr/bin/modprobe|" \
-i "${pkgdir}"/etc/sysconfig/modules/mic.modules
- sed '8,9 d' \
+ sed -e '/redhat/ d' -e '/rhel7/ d' \
-i "${pkgdir}"/etc/udev/rules.d/50-udev-mic.rules
sed -e "s/@_PKGNAME@/${_pkgname}/" \
@@ -133,7 +197,7 @@ package_mpss-micmgmt-miclib() {
}
package_mpss-micmgmt-tools() {
- depends=(mpss-micmgmt-miclib)
+ depends=(mpss-micmgmt-miclib netctl ifplugd)
pkgdesc="micmgmt tools of Intel® Manycore Platform Software Stack"
groups=(mpss)
_pkgname=${pkgname%-*}
@@ -160,6 +224,7 @@ package_mpss-micmgmt-tools() {
install
# already installed by mpss-micmgmt-miclib
rm $pkgdir/usr/share/doc/micmgmt/libmicmgmt.7.html
+ install -D -m755 $srcdir/${pkgname}/usr/bin/micsmc-gui "$pkgdir"/usr/bin/
install -D -m644 ${_pkgname}/COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
@@ -185,8 +250,29 @@ package_mpss-micmgmt-python() {
install -D -m644 $srcdir/${_pkgname}/COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
+package_mpss-boot-files() {
+ depends=()
+ pkgdesc="Boot image for the coprocessor of Intel® Manycore Platform Software Stack"
+ groups=(mpss)
+ arch=('any')
+ _pkgname=${pkgname}
+ install -d -m644 $pkgdir/usr/share/mpss/boot/
+ bsdtar cf - -C $srcdir/${_pkgname}/usr/share/mpss/boot/ . | bsdtar xf - -C "$pkgdir"/usr/share/mpss/boot/
+ install -D -m644 $srcdir/${_pkgname}/usr/share/doc/${_pkgname}-${pkgver}/COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_mpss-flash-files() {
+ depends=()
+ pkgdesc="Flash files for the coprocessor of Intel® Manycore Platform Software Stack"
+ groups=(mpss)
+ arch=('any')
+ _pkgname=${pkgname}
+ install -d -m644 $pkgdir/usr/share/mpss/flash/
+ bsdtar cf - -C $srcdir/${_pkgname}/usr/share/mpss/flash/ . | bsdtar xf - -C "$pkgdir"/usr/share/mpss/flash/
+}
+
package_mpss-daemon() {
- depends=(mpss-libscif mpss-gen-symver-map)
+ depends=(mpss-libscif mpss-gen-symver-map nfs-utils mpss-boot-files)
pkgdesc="mpssd and micctrl of Intel® Manycore Platform Software Stack"
groups=(mpss)
_pkgname=${pkgname}
@@ -209,6 +295,10 @@ package_mpss-daemon() {
sbindir=/usr/bin \
libdir=/usr/lib \
install
+ sed -e "s|/usr/sbin/|/usr/bin/|g" \
+ -i "${pkgdir}"/etc/mpss/mpss.*
+ rm "${pkgdir}"/etc/mpss/mpss.{redhat,ubuntu,suse,service,resume,suspend*}
+ install -D -m644 $srcdir/mpss-daemon.service "$pkgdir/usr/lib/systemd/system/mpssd.service"
install -D -m644 ${_pkgname}/COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
diff --git a/blacklist-mic-host.conf b/blacklist-mic-host.conf
deleted file mode 100644
index 920080d0bf53..000000000000
--- a/blacklist-mic-host.conf
+++ /dev/null
@@ -1 +0,0 @@
-blacklist mic_host
diff --git a/blacklist-mpss.conf b/blacklist-mpss.conf
new file mode 100644
index 000000000000..e3092d13b492
--- /dev/null
+++ b/blacklist-mpss.conf
@@ -0,0 +1 @@
+blacklist mic_cosm mic_host scif scif_bus
diff --git a/buildandcopy.sh b/buildandcopy.sh
index 8593b99e2c6f..1b098d5323d2 100755
--- a/buildandcopy.sh
+++ b/buildandcopy.sh
@@ -4,9 +4,10 @@ thedirs="."
repodir=/home/own-repo
thingsToDo=(
- 'for n in $thedirs; do ( cd $n && updpkgsums; makepkg --force --nodeps --nobuild; makepkg --printsrcinfo > .SRCINFO ); done'
+ 'for n in $thedirs; do ( cd $n && updpkgsums); done'
+ 'for n in $thedirs; do ( cd $n && makepkg --force --nodeps --nobuild --cleanbuild; makepkg --printsrcinfo > .SRCINFO ); done'
'git diff --quiet --no-ext-diff --exit-code && echo clean || ( git diff -b -w && git add -p && git commit ) || true'
- 'for n in $thedirs; do ( cd $n && updpkgsums; makepkg --force --nodeps --cleanbuild ); done'
+ 'for n in $thedirs; do ( cd $n && makepkg --force --nodeps --noextract --skipchecksums); done'
'test -n "$repodir" -a -d "$repodir" && for n in $thedirs; do for pkgdir in $(find $n -name "*.tar.xz" -printf "%h\n" | sort | uniq); do cpfn=$(ls -tc1 $pkgdir/*.tar.xz | head -1); echo "move [$cpfn]? (y*|n)"; read v; if [ ! "$v" = "n" -a ! "$v" = "N" ]; then sh -c "mv --interactive --update $cpfn $repodir && ( repo-add --new --quiet ${repodir}/ownrepo.db.tar.gz $repodir/$(basename $cpfn); )"; fi; done; done'
'git push origin'
'for n in $thedirs; do ( cd $n && makepkg --nodeps --noextract --force --nobuild --noarchive --nocheck --noprepare --skipinteg --clean ); done'
diff --git a/mpss-daemon-archlinux-extension.patch b/mpss-daemon-archlinux-extension.patch
new file mode 100644
index 000000000000..5e65cfa4ee5f
--- /dev/null
+++ b/mpss-daemon-archlinux-extension.patch
@@ -0,0 +1,134 @@
+From bcc90e8a54015a3bcc0ebd87d02e5b5e5ab55b41 Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Thu, 4 Aug 2016 11:09:04 +0200
+Subject: extend network setup minimally for arch linux
+
+---
+ libmpssconfig/micenv.c | 7 +++++++
+ libmpssconfig/mpssconfig.h | 2 ++
+ micctrl/network.c | 36 ++++++++++++++++++++++++++++++++++++
+ 3 files changed, 45 insertions(+)
+
+diff --git libmpssconfig/micenv.c libmpssconfig/micenv.c
+index b162ebc..fae9d3e 100644
+--- mpss-daemon/libmpssconfig/micenv.c
++++ mpss-daemon/libmpssconfig/micenv.c
+@@ -106,6 +106,8 @@ mpssenv_set_distrib(struct mpss_env *menv, char *dist)
+ menv->dist = DISTRIB_SUSE;
+ else if (!strcasecmp(dist, "ubuntu"))
+ menv->dist = DISTRIB_UBUNTU;
++ else if (!strcasecmp(dist, "arch"))
++ menv->dist = DISTRIB_ARCH;
+ else
+ return (SETENV_FUNC_DIST << 16) | SETENV_CMDLINE_DIST;
+ } else if ((dist = getenv("MPSS_DIST")) != NULL) {
+@@ -117,6 +119,8 @@ mpssenv_set_distrib(struct mpss_env *menv, char *dist)
+ menv->dist = DISTRIB_SUSE;
+ else if (!strcasecmp(dist, "ubuntu"))
+ menv->dist = DISTRIB_UBUNTU;
++ else if (!strcasecmp(dist, "arch"))
++ menv->dist = DISTRIB_ARCH;
+ else
+ return (SETENV_FUNC_DIST << 16) | SETENV_ENV_DIST;
+ } else {
+@@ -126,6 +130,8 @@ mpssenv_set_distrib(struct mpss_env *menv, char *dist)
+ menv->dist = DISTRIB_SUSE;
+ else if ((stat(UBUNTU_NETWORK_DIR, &sbuf) == 0) && S_ISDIR(sbuf.st_mode))
+ menv->dist = DISTRIB_UBUNTU;
++ else if ((stat(ARCH_NETWORK_DIR, &sbuf) == 0) && S_ISDIR(sbuf.st_mode))
++ menv->dist = DISTRIB_ARCH;
+ else
+ return (SETENV_FUNC_DIST << 16) | SETENV_PROBE_DIST;
+ }
+@@ -133,6 +139,7 @@ mpssenv_set_distrib(struct mpss_env *menv, char *dist)
+ switch(menv->dist) {
+ case DISTRIB_REDHAT:
+ case DISTRIB_SUSE:
++ case DISTRIB_ARCH:
+ menv->lockfile = LSB_LOCK_FILENAME;
+ break;
+ case DISTRIB_UBUNTU:
+diff --git libmpssconfig/mpssconfig.h libmpssconfig/mpssconfig.h
+index cf25280..7c6ecdf 100644
+--- mpss-daemon/libmpssconfig/mpssconfig.h
++++ mpss-daemon/libmpssconfig/mpssconfig.h
+@@ -218,6 +218,7 @@ int mpss_sync_cookie(unsigned long *cookie, uid_t uid);
+ #define REDHAT_NETWORK_DIR "/etc/sysconfig/network-scripts"
+ #define SUSE_NETWORK_DIR "/etc/sysconfig/network"
+ #define UBUNTU_NETWORK_DIR "/etc/network"
++#define ARCH_NETWORK_DIR "/etc/netctl"
+
+ /**
+ * Mic family
+@@ -239,6 +240,7 @@ struct mpss_env {
+ #define DISTRIB_REDHAT 1
+ #define DISTRIB_SUSE 2
+ #define DISTRIB_UBUNTU 3
++#define DISTRIB_ARCH 4
+ char *home;
+ char *confdir;
+ char *destdir;
+diff --git micctrl/network.c micctrl/network.c
+index 4b71e0e..3c182d2 100644
+--- mpss-daemon/micctrl/network.c
++++ mpss-daemon/micctrl/network.c
+@@ -101,6 +101,8 @@ void ubuntu_host_addif(char *name, char *ip, char *netbits, char *mtu, char *mac
+ void ubuntu_unattach_hostbridge(char *name, char *bridge);
+ void ubuntu_remove_bridges(void);
+
++void arch_host_addif(char *name, char *ip, char *netbits, char *mtu, char *mac);
++
+ struct netinfo {
+ char *netdir;
+ char *defnetdir;
+@@ -141,6 +143,14 @@ struct netinfo {
+ ubuntu_br_remove,
+ ubuntu_attach_hostbridge,
+ ubuntu_host_addif,
++ ubuntu_remove_bridges},
++ {ARCH_NETWORK_DIR,
++ ARCH_NETWORK_DIR,
++ "/usr/bin/brctl",
++ ubuntu_net_remove,
++ ubuntu_br_remove,
++ ubuntu_attach_hostbridge,
++ arch_host_addif,
+ ubuntu_remove_bridges}
+ };
+
+@@ -2571,6 +2581,32 @@ ubuntu_host_addif(char *name, char *ip, char *netbits, char *mtu, char *mac)
+ }
+
+ void
++arch_host_addif(char *name, char *ip, char *netbits, char *mtu, char *mac)
++{
++ char filename[PATH_MAX];
++ FILE *fp;
++
++ snprintf(filename, PATH_MAX, "%s/static-%s", ni[mpssenv.dist].netdir, name);
++ if ((fp = fopen(filename, "a")) == NULL) {
++ display(PERROR, "%s: Error opening %s: %s\n", name, filename, strerror(errno));
++ return;
++ }
++
++ fprintf(fp, "Description='static connection to %s'\n", name);
++ fprintf(fp, "Interface=%s\n", name);
++ fprintf(fp, "Connection=ethernet\n");
++ fprintf(fp, "IP=static\n");
++ fprintf(fp, "Address=('%s/%s')\n", ip, netbits);
++ fprintf(fp, "# netctl-ifplugd settings\n");
++ fprintf(fp, "ExcludeAuto=no\n");
++ fprintf(fp, "ForceConnect=yes\n");
++ fclose(fp);
++ display(PFS, "%s: Created %s\n", name, filename);
++
++ do_ifup(name, name, FALSE);
++}
++
++void
+ common_host_addif(char *name, char *ip, char *netbits, char *mtu, char *mac)
+ {
+ char filename[PATH_MAX];
+--
+2.9.2
+
diff --git a/mpss-daemon-minimize-modules.patch b/mpss-daemon-minimize-modules.patch
new file mode 100644
index 000000000000..f3a69234095a
--- /dev/null
+++ b/mpss-daemon-minimize-modules.patch
@@ -0,0 +1,25 @@
+From 63017cfe17809e328f35dd58866bb69a2a008919 Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Thu, 4 Aug 2016 11:10:21 +0200
+Subject: reduced modules list to the ones working
+
+---
+ mpssd/mpss.common | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git mpssd/mpss.common mpssd/mpss.common
+index b0d131e..6a37778 100755
+--- mpss-daemon/mpssd/mpss.common
++++ mpss-daemon/mpssd/mpss.common
+@@ -44,7 +44,7 @@ sysfs="/sys/class/mic"
+ # - after unloading we check whether each module is really unloaded
+ # - not always udev loads required modules after MPSS package installation
+ knc_modules_v3="mic"
+-knc_modules_v4="mic_x100_dma scif_bus vop_bus mic_bus cosm_bus mic_host scif vop mic_cosm"
++knc_modules_v4="mic mic_x100_dma vop_bus cosm_bus vop"
+
+ knl_modules_v4="mic_x200_dma scif_bus vop_bus cosm_bus scif vop mic_cosm mic_x200"
+
+--
+2.9.2
+
diff --git a/mpss-daemon.service b/mpss-daemon.service
new file mode 100755
index 000000000000..a2baaaf81b9c
--- /dev/null
+++ b/mpss-daemon.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=Intel(R) MPSS control service
+After=nfs-server.service
+
+[Service]
+Type=forking
+ExecStartPre=/usr/bin/bash -c '. /etc/mpss/mpss.common; mic_check'
+ExecStartPre=/usr/bin/bash -c '. /etc/mpss/mpss.common; mic_load_modules'
+ExecStart=/usr/bin/mpssd --pidfile /var/run/mpssd.pid
+ExecStartPost=/usr/bin/micctrl -w
+ExecStartPost=/usr/bin/micctrl -s
+ExecStopPost=/usr/bin/micctrl -w
+#ExecStopPost=/usr/bin/bash -c '. /etc/mpss/mpss.common; mic_unload_modules'
+TimeoutSec=300
+KillSignal=SIGQUIT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mpss-gen-symver-map-python3-compat.patch b/mpss-gen-symver-map-python3-compat.patch
new file mode 100644
index 000000000000..f9647343caa7
--- /dev/null
+++ b/mpss-gen-symver-map-python3-compat.patch
@@ -0,0 +1,85 @@
+From fce5af28b47bc6b8bbedf06bbf29a1c293f3220f Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Fri, 29 Jul 2016 09:29:51 +0200
+Subject: work with python3.x and python2.x
+
+---
+ gen-symver-map | 33 ++++++++++++++++++++-------------
+ 1 file changed, 20 insertions(+), 13 deletions(-)
+
+diff --git mpss-gen-symver-map/gen-symver-map mpss-gen-symver-map/gen-symver-map
+index 6dfa395..e33a46f 100755
+--- mpss-gen-symver-map/gen-symver-map
++++ mpss-gen-symver-map/gen-symver-map
+@@ -7,12 +7,19 @@
+ #
+ # See example.c for a demonstration of the various macros.
+
+-import sys, re, ConfigParser
++from __future__ import print_function
++import sys, re
++try:
++ # python 3.x
++ import configparser
++except ImportError:
++ # python 2.x
++ import ConfigParser as configparser
+ from subprocess import Popen, PIPE
+
+ def parsecfg(fn):
+ global VERNAME, VERDEPS
+- c = ConfigParser.RawConfigParser()
++ c = configparser.RawConfigParser()
+ c.read(fn)
+
+ VERNAME, = c.sections() # there may be only one
+@@ -63,27 +70,27 @@ def symmap(symtab):
+ assert version in vermap # must be in VERDEPS
+ vermap[version].append(sym)
+ except AssertionError:
+- print >>sys.stderr, 'CURRENT SYMBOL:', sym
+- print >>sys.stderr, 'VERSIONS:', o + d + c
++ print('CURRENT SYMBOL:', sym, file=sys.stderr)
++ print('VERSIONS:', o + d + c, file=sys.stderr)
+ raise
+ return vermap
+
+ def printmap(f, vermap, fns):
+ def tag(version):
+ return '%s_%s' % (VERNAME, version)
+- print >>f, '/* Version script generated from %s */' % fns
++ print('/* Version script generated from %s */' % fns, file=f)
+ for i, (version, deps) in enumerate(VERDEPS):
+- print >>f
+- print >>f, '%s {' % tag(version)
++ print(file=f)
++ print('%s {' % tag(version), file=f)
+ if vermap[version]:
+- print >>f, 'global:'
++ print('global:', file=f)
+ for symbol in sorted(vermap[version]):
+- print >>f, '\t%s;' % symbol
++ print('\t%s;' % symbol, file=f)
+ if i == 0:
+- print >>f, 'local:'
+- print >>f, '\t*;'
++ print('local:', file=f)
++ print('\t*;', file=f)
+ deps = [tag(d) for d in deps]
+- print >>f, '}%s;' % (' ' + ' '.join(deps) if deps else '')
++ print('}%s;' % (' ' + ' '.join(deps) if deps else ''), file=f)
+
+ def main(argv):
+ i = argv.index('--')
+@@ -97,7 +104,7 @@ def main(argv):
+ # parse each file on the command line
+ symtab = {}
+ for fn in argv:
+- p = Popen(cmd + ['-DGENMAP_PARSING_PASS', '-E', fn], stdout=PIPE)
++ p = Popen(cmd + ['-DGENMAP_PARSING_PASS', '-E', fn], stdout=PIPE, universal_newlines=True)
+ findsyms(symtab, p.communicate()[0])
+
+ # compute the version map and apply sanity checks
+--
+2.9.2
+
diff --git a/mpss-micmgmt-misleading-indent.patch b/mpss-micmgmt-misleading-indent.patch
new file mode 100644
index 000000000000..c08c5a29d711
--- /dev/null
+++ b/mpss-micmgmt-misleading-indent.patch
@@ -0,0 +1,62 @@
+From 15649e7b4c2e0a5f0945cd48217354b2d6ed350a Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Fri, 29 Jul 2016 22:42:18 +0200
+Subject: have misleading indent corrected
+
+---
+ miclib/src/miclib.cpp | 29 ++++++++++++++---------------
+ 1 file changed, 14 insertions(+), 15 deletions(-)
+
+diff --git mpss-micmgmt/miclib/src/miclib.cpp mpss-micmgmt/miclib/src/miclib.cpp
+index 41ad0cf..9414b90 100644
+--- mpss-micmgmt/miclib/src/miclib.cpp
++++ mpss-micmgmt/miclib/src/miclib.cpp
+@@ -167,16 +167,15 @@ int mic_get_device_at_index(struct mic_devices_list *d, int index, int *device)
+
+ const char *mic_get_device_name(struct mic_device *mdh)
+ {
+- ASSERT(mdh != NULL);
+- try {
+- return mdh->get_device_name();
+- } catch (mic_exception const &e) {
+- e.get_mic_errno();
+- return (const char *)NULL;
+- }
+- catch (...) {
+- return (const char *)NULL;
+- }
++ ASSERT(mdh != NULL);
++ try {
++ return mdh->get_device_name();
++ } catch (mic_exception const &e) {
++ e.get_mic_errno();
++ return (const char *) NULL;
++ } catch (...) {
++ return (const char *) NULL;
++ }
+ }
+
+ int mic_open_device(struct mic_device **device, uint32_t device_num)
+@@ -966,14 +965,14 @@ int mic_get_processor_steppingid(struct mic_processor_info *processor,
+ int mic_get_processor_stepping(struct mic_processor_info *processor,
+ char *stepping, size_t *size)
+ {
+- ASSERT((processor != NULL) && (size != NULL));
+- if ((stepping != NULL) && (*size > 0)) {
++ ASSERT((processor != NULL) && (size != NULL));
++ if ((stepping != NULL) && (*size > 0)) {
+ strncpy(stepping, processor->stepping, *size);
+- stepping[*size-1] = '\0';
++ stepping[*size - 1] = '\0';
+ }
+
+- if (*size < strlen(processor->stepping) + 1)
+- *size = strlen(processor->stepping) + 1;
++ if (*size < strlen(processor->stepping) + 1)
++ *size = strlen(processor->stepping) + 1;
+
+ return E_MIC_SUCCESS;
+ }
+--
+2.9.2
+
diff --git a/mpss-micmgmt-remove-inline0.patch b/mpss-micmgmt-remove-inline0.patch
new file mode 100644
index 000000000000..2c9c63979286
--- /dev/null
+++ b/mpss-micmgmt-remove-inline0.patch
@@ -0,0 +1,61 @@
+From c9ca01f953491a2e23f8d093df2bb8fbf9f5b2ac Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Fri, 29 Jul 2016 23:44:25 +0200
+Subject: have invalid inline removed
+
+---
+ apps/mpssinfo/helper.c | 6 +++---
+ apps/mpssinfo/helper.h | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git mpss-micmgmt/apps/mpssinfo/helper.c mpss-micmgmt/apps/mpssinfo/helper.c
+index 8f77110..74f15cf 100644
+--- mpss-micmgmt/apps/mpssinfo/helper.c
++++ mpss-micmgmt/apps/mpssinfo/helper.c
+@@ -41,7 +41,7 @@
+
+ char *progname = NULL;
+ #ifdef __linux__
+-inline void error_msg_start(char *format, ...)
++void error_msg_start(char *format, ...)
+ {
+ va_list args;
+
+@@ -51,7 +51,7 @@ inline void error_msg_start(char *format, ...)
+ va_end(args);
+ }
+
+-inline void error_msg_cont(char *format, ...)
++void error_msg_cont(char *format, ...)
+ {
+ va_list args;
+
+@@ -60,7 +60,7 @@ inline void error_msg_cont(char *format, ...)
+ va_end(args);
+ }
+
+-inline void log_msg_start(char *format, ...)
++void log_msg_start(char *format, ...)
+ {
+ va_list args;
+
+diff --git mpss-micmgmt/apps/mpssinfo/helper.h mpss-micmgmt/apps/mpssinfo/helper.h
+index 6576777..155a942 100755
+--- mpss-micmgmt/apps/mpssinfo/helper.h
++++ mpss-micmgmt/apps/mpssinfo/helper.h
+@@ -41,9 +41,9 @@
+
+ extern char *progname;
+ #ifdef __linux__
+-inline void error_msg_start(char *, ...);
+-inline void error_msg_cont(char *, ...);
+-inline void log_msg_start(char *, ...);
++void error_msg_start(char *, ...);
++void error_msg_cont(char *, ...);
++void log_msg_start(char *, ...);
+ #else
+ #ifdef WINDOWS
+ //inline methods with var_args is not allowed in windows
+--
+2.9.2
+
diff --git a/mpss-micmgmt-remove-inline1.patch b/mpss-micmgmt-remove-inline1.patch
new file mode 100644
index 000000000000..f754c325b15c
--- /dev/null
+++ b/mpss-micmgmt-remove-inline1.patch
@@ -0,0 +1,50 @@
+From 527441f9101ed9ff35346ab49a7ea12b27008ed9 Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Fri, 29 Jul 2016 23:58:04 +0200
+Subject: invalid inline removed
+
+---
+ apps/mpssflash/helper.c | 4 ++--
+ apps/mpssflash/helper.h | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git mpss-micmgmt/apps/mpssflash/helper.c mpss-micmgmt/apps/mpssflash/helper.c
+index 82cfc31..dfc5246 100644
+--- mpss-micmgmt/apps/mpssflash/helper.c
++++ mpss-micmgmt/apps/mpssflash/helper.c
+@@ -1719,7 +1719,7 @@ free_scanned:
+ return ret;
+ }
+
+-inline void error_msg_start(char *
++void error_msg_start(char *
+ format,
+ ...)
+ {
+@@ -1746,7 +1746,7 @@ inline void error_msg_start(char *
+ va_end(args);
+ }
+
+-inline void error_msg_cont(char *
++void error_msg_cont(char *
+ format,
+ ...)
+ {
+diff --git mpss-micmgmt/apps/mpssflash/helper.h mpss-micmgmt/apps/mpssflash/helper.h
+index f317d4c..734b5f1 100644
+--- mpss-micmgmt/apps/mpssflash/helper.h
++++ mpss-micmgmt/apps/mpssflash/helper.h
+@@ -106,8 +106,8 @@ int read_flash_device_maint_mode(struct mic_device *, void **, size_t *);
+
+ int check_smc_bootloader_image(char*, int);
+
+-inline void error_msg_start(char *, ...);
+-inline void error_msg_cont(char *, ...);
++void error_msg_start(char *, ...);
++void error_msg_cont(char *, ...);
+
+ #define MAINT_MODE_POLL_INTERVAL (1) /* seconds */
+ #define READY_MODE_POLL_INTERVAL (1) /* seconds */
+--
+2.9.2
+
diff --git a/mpss-micmgmt-whitespace.patch b/mpss-micmgmt-whitespace.patch
new file mode 100644
index 000000000000..9cae5d377a46
--- /dev/null
+++ b/mpss-micmgmt-whitespace.patch
@@ -0,0 +1,33 @@
+From d45edaf5b754f6ee3d3e37e715370d68506d6c96 Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Fri, 29 Jul 2016 23:55:55 +0200
+Subject: spaces converted to tabs
+
+---
+ apps/mpssflash/micflash.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git mpss-micmgmt/apps/mpssflash/micflash.c mpss-micmgmt/apps/mpssflash/micflash.c
+index a92993c..a293c9b 100644
+--- mpss-micmgmt/apps/mpssflash/micflash.c
++++ mpss-micmgmt/apps/mpssflash/micflash.c
+@@ -1999,11 +1999,11 @@ static void common_options_help(void)
+ static int do_help_cmd(build_cmd_func *build_func, setup_cmd_func *setup_func,
+ done_cmd_func *done_func, init_cmd_func *init_func)
+ {
+- ARG_USED(build_func);
+- ARG_USED(setup_func);
+- ARG_USED(done_func);
+- ARG_USED(init_func);
+-
++ ARG_USED(build_func);
++ ARG_USED(setup_func);
++ ARG_USED(done_func);
++ ARG_USED(init_func);
++
+ printf("%s\n\n", MIC_COPYRIGHT);
+
+ if (nodowngrade || silent || device_arg || noreboot || image_path ||
+--
+2.9.2
+
diff --git a/mpss-modules-explicit-coprocessor-build.patch b/mpss-modules-explicit-coprocessor-build.patch
new file mode 100644
index 000000000000..f3828ac1307a
--- /dev/null
+++ b/mpss-modules-explicit-coprocessor-build.patch
@@ -0,0 +1,25 @@
+From 32193ddb4ad05c60e469e178a277220c1693b30b Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Thu, 4 Aug 2016 13:17:30 +0200
+Subject: explicitly set coprocessor build
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git Makefile Makefile
+index 29faca8..42dd454 100644
+--- mpss-modules/Makefile
++++ mpss-modules/Makefile
+@@ -59,7 +59,7 @@ kmodincludedir = $(realpath $(KERNEL_SRC))/include/modules
+
+ # If building the host's driver for a MIC co-processor card, which card
+ # $(ARCH) it should support
+-export MIC_CARD_ARCH
++export MIC_CARD_ARCH := k1om
+
+ .PHONY: all install modules
+ .PHONY: modules_install conf_install dev_install kdev_install
+--
+2.9.2
+
diff --git a/mpss-modules-init-indent.patch b/mpss-modules-init-indent.patch
new file mode 100644
index 000000000000..fdd0e6469ad1
--- /dev/null
+++ b/mpss-modules-init-indent.patch
@@ -0,0 +1,59 @@
+From cd8220070bc8f01f8fea1233245e9de49985c056 Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Thu, 4 Aug 2016 13:30:04 +0200
+Subject: initialice rc var, fix indents
+
+---
+ host/linux.c | 2 +-
+ host/pm_pcstate.c | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git host/linux.c host/linux.c
+index 90bab0a..986afd6 100644
+--- mpss-modules/host/linux.c
++++ mpss-modules/host/linux.c
+@@ -174,7 +174,7 @@ mic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+ static int
+ mic_fasync(int fd, struct file *filp, int on)
+ {
+- int rc;
++ int rc=0;
+
+ if ((rc = fasync_helper(fd, filp, on, &mic_data.dd_fasync)) < 0) {
+ return rc;
+diff --git host/pm_pcstate.c host/pm_pcstate.c
+index c28e08e..26be455 100644
+--- mpss-modules/host/pm_pcstate.c
++++ mpss-modules/host/pm_pcstate.c
+@@ -45,20 +45,20 @@
+ //few helper functions
+ int pm_reg_read(mic_ctx_t *mic_ctx, uint32_t regoffset) {
+ uint32_t regval = 0;
+-if (mic_ctx->bi_family == FAMILY_ABR)
+- regval = DBOX_READ(mic_ctx->mmio.va, regoffset);
+-else if (mic_ctx->bi_family == FAMILY_KNC)
+- regval = SBOX_READ(mic_ctx->mmio.va, regoffset);
++ if (mic_ctx->bi_family == FAMILY_ABR)
++ regval = DBOX_READ(mic_ctx->mmio.va, regoffset);
++ else if (mic_ctx->bi_family == FAMILY_KNC)
++ regval = SBOX_READ(mic_ctx->mmio.va, regoffset);
+
+ return regval;
+ }
+
+ int pm_reg_write(uint32_t value, mic_ctx_t *mic_ctx, uint32_t regoffset) {
+ int err = 0;
+-if (mic_ctx->bi_family == FAMILY_ABR)
+- DBOX_WRITE(value, mic_ctx->mmio.va, regoffset);
+-else if (mic_ctx->bi_family == FAMILY_KNC)
+- SBOX_WRITE(value, mic_ctx->mmio.va, regoffset);
++ if (mic_ctx->bi_family == FAMILY_ABR)
++ DBOX_WRITE(value, mic_ctx->mmio.va, regoffset);
++ else if (mic_ctx->bi_family == FAMILY_KNC)
++ SBOX_WRITE(value, mic_ctx->mmio.va, regoffset);
+
+ return err;
+ }
+--
+2.9.2
+
diff --git a/mpss-modules-page-cache.patch b/mpss-modules-page-cache.patch
new file mode 100644
index 000000000000..e2f67ff4421c
--- /dev/null
+++ b/mpss-modules-page-cache.patch
@@ -0,0 +1,114 @@
+From 4eaa693c59dfad494e1e560cd1bd6d6ef1e2b9e5 Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Thu, 4 Aug 2016 13:34:10 +0200
+Subject: use newer functions for pages
+
+---
+ host/tools_support.c | 9 +++++++++
+ host/vhost/mic_blk.c | 8 ++++++++
+ micscif/micscif_api.c | 8 ++++++++
+ micscif/micscif_rma.c | 4 ++++
+ 4 files changed, 29 insertions(+)
+
+diff --git host/tools_support.c host/tools_support.c
+index d9b213d..832caf6 100644
+--- mpss-modules/host/tools_support.c
++++ mpss-modules/host/tools_support.c
+@@ -64,7 +64,11 @@ mic_unpin_user_pages(struct page **pages, uint32_t nf_pages)
+ for (j = 0; j < nf_pages; j++) {
+ if (pages[j]) {
+ SetPageDirty(pages[j]);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ put_page(pages[j]);
++#else
+ page_cache_release(pages[j]);
++#endif
+ }
+ }
+ kfree(pages);
+@@ -89,8 +93,13 @@ mic_pin_user_pages (void *data, struct page **pages, uint32_t len, int32_t *nf_p
+
+ // pin the user pages; use semaphores on linux for doing the same
+ down_read(&current->mm->mmap_sem);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ *nf_pages = (int32_t)get_user_pages_remote(current, current->mm,
++ (uint64_t)data, nr_pages, PROT_WRITE, 1, pages, NULL);
++#else
+ *nf_pages = (int32_t)get_user_pages(current, current->mm, (uint64_t)data,
+ nr_pages, PROT_WRITE, 1, pages, NULL);
++#endif
+ up_read(&current->mm->mmap_sem);
+
+ // compare if the no of final pages is equal to no of requested pages
+diff --git host/vhost/mic_blk.c host/vhost/mic_blk.c
+index 12bc880..47a0924 100644
+--- mpss-modules/host/vhost/mic_blk.c
++++ mpss-modules/host/vhost/mic_blk.c
+@@ -153,12 +153,20 @@ static void handle_io_work(struct work_struct *work)
+ for (iov = vbio->iov; iov < &vbio->iov[vbio->nvecs]; iov++) {
+ iov->iov_base = mic_addr_in_host(aper_va, iov->iov_base);
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ ret = vfs_writev(vbio->file, vbio->iov, vbio->nvecs, &pos, 0);
++#else
+ ret = vfs_writev(vbio->file, vbio->iov, vbio->nvecs, &pos);
++#endif
+ } else {
+ for (iov = vbio->iov; iov < &vbio->iov[vbio->nvecs]; iov++) {
+ iov->iov_base = mic_addr_in_host(aper_va, iov->iov_base);
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ ret = vfs_readv(vbio->file, vbio->iov, vbio->nvecs, &pos, 0);
++#else
+ ret = vfs_readv(vbio->file, vbio->iov, vbio->nvecs, &pos);
++#endif
+ }
+ status = (ret < 0) ? VIRTIO_BLK_S_IOERR : VIRTIO_BLK_S_OK;
+ if (vbio->head != -1) {
+diff --git micscif/micscif_api.c micscif/micscif_api.c
+index 03d6d92..a61454c 100644
+--- mpss-modules/micscif/micscif_api.c
++++ mpss-modules/micscif/micscif_api.c
+@@ -1981,7 +1981,11 @@ retry:
+ }
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ pinned_pages->nr_pages = get_user_pages_remote(
++#else
+ pinned_pages->nr_pages = get_user_pages(
++#endif
+ current,
+ mm,
+ (uint64_t)addr,
+@@ -2007,7 +2011,11 @@ retry:
+ /* Roll back any pinned pages */
+ for (i = 0; i < pinned_pages->nr_pages; i++) {
+ if (pinned_pages->pages[i])
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ put_page(pinned_pages->pages[i]);
++#else
+ page_cache_release(pinned_pages->pages[i]);
++#endif
+ }
+ prot &= ~SCIF_PROT_WRITE;
+ try_upgrade = false;
+diff --git micscif/micscif_rma.c micscif/micscif_rma.c
+index 520d7bb..3e41407 100644
+--- mpss-modules/micscif/micscif_rma.c
++++ mpss-modules/micscif/micscif_rma.c
+@@ -413,7 +413,11 @@ int micscif_destroy_pinned_pages(struct scif_pinned_pages *pinned_pages)
+ BUG_ON(!page_count(pinned_pages->pages[j]));
+ BUG_ON(atomic_long_sub_return(1, &ms_info.rma_pin_cnt) < 0);
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ put_page(pinned_pages->pages[j]);
++#else
+ page_cache_release(pinned_pages->pages[j]);
++#endif
+ }
+ }
+ }
+--
+2.9.2
+
diff --git a/mpss-modules-rcu-lockup.patch b/mpss-modules-rcu-lockup.patch
new file mode 100644
index 000000000000..61a9975fd8d9
--- /dev/null
+++ b/mpss-modules-rcu-lockup.patch
@@ -0,0 +1,45 @@
+From ab23490f38613aa80cfa811b384f29094b5f3672 Mon Sep 17 00:00:00 2001
+From: Marcel Huber <marcelhuberfoo@gmail.com>
+Date: Thu, 4 Aug 2016 13:33:05 +0200
+Subject: remove rcu_lockup
+ https://github.com/bradyjoh/mpss-modules/commit/70560c893e8acc8d834f04dd2eee0d9e1780c840
+
+---
+ host/vhost/vhost.h | 14 +-------------
+ 1 file changed, 1 insertion(+), 13 deletions(-)
+
+diff --git host/vhost/vhost.h host/vhost/vhost.h
+index ad61802..0d9abf9 100644
+--- mpss-modules/host/vhost/vhost.h
++++ mpss-modules/host/vhost/vhost.h
+@@ -205,18 +205,6 @@ int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq);
+ eventfd_signal((vq)->error_ctx, 1);\
+ } while (0)
+
+-#ifndef __rcu_dereference_index_check
+-#define __rcu_dereference_index_check(p, c) \
+- ({ \
+- typeof(p) _________p1 = ACCESS_ONCE(p); \
+- rcu_lockdep_assert(c, \
+- "suspicious rcu_dereference_index_check()" \
+- " usage"); \
+- smp_read_barrier_depends(); \
+- (_________p1); \
+- })
+-#endif
+-
+ enum {
+ VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |
+ (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
+@@ -238,7 +226,7 @@ static inline int vhost_has_feature(struct vhost_dev *dev, int bit)
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0))
+ unsigned acked_features = rcu_dereference_index_check(dev->acked_features, rcu_read_lock_held());
+ #else
+- unsigned acked_features = __rcu_dereference_index_check(dev->acked_features, rcu_read_lock_held());
++ unsigned acked_features = smp_load_acquire(&(dev->acked_features));
+ #endif
+ #endif
+ return acked_features & (1 << bit);
+--
+2.9.2
+