Commit 9f16cd8f authored by BrLi's avatar BrLi

Merge with AlmAck

parents 13b1f172 e40e390a
......@@ -4,7 +4,7 @@ source ../linux.conf
pkgname=acpi_call
_pkgname=acpi_call
pkgver=1.1.0
pkgrel=43
pkgrel=44
pkgdesc="A kernel module that enables you to call parameterless ACPI methods by writing the method name to /proc/acpi/call, e.g. to turn off discrete graphics card in a dual graphics environment (like NVIDIA Optimus)."
arch=('x86_64')
url=("http://github.com/mkottman/acpi_call")
......
post_install() {
EXTRAMODULES='extramodules-4.15-CHAKRA'
EXTRAMODULES='extramodules-4.16-CHAKRA'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
echo ""
echo "[+] modprobe acpi_call"
......@@ -12,7 +12,7 @@ post_upgrade() {
}
post_remove() {
EXTRAMODULES='extramodules-4.15-CHAKRA'
EXTRAMODULES='extramodules-4.16-CHAKRA'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
}
......
......@@ -3,7 +3,7 @@ source ../linux.conf
pkgname=bbswitch
pkgver=0.8
pkgrel=37
pkgrel=38
pkgdesc="kernel module allowing to switch dedicated graphics card on Optimus laptops"
arch=('x86_64')
url=("http://github.com/Bumblebee-Project/bbswitch")
......
post_install() {
EXTRAMODULES='extramodules-4.15-CHAKRA'
EXTRAMODULES='extramodules-4.16-CHAKRA'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
echo 'In order to use nvidia module, reboot the system.'
}
post_upgrade() {
EXTRAMODULES='extramodules-4.15-CHAKRA'
EXTRAMODULES='extramodules-4.16-CHAKRA'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
}
post_remove() {
EXTRAMODULES='extramodules-4.15-CHAKRA'
EXTRAMODULES='extramodules-4.16-CHAKRA'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
}
......@@ -3,7 +3,7 @@ source ../linux.conf
pkgname=broadcom-wl
pkgver=6.30.223.271
pkgrel=19
pkgrel=20
pkgdesc='Broadcom 802.11abgn hybrid Linux networking device driver'
url='http://www.broadcom.com/support/802.11/linux_sta.php'
arch=('x86_64')
......
......@@ -2,12 +2,12 @@
# kernel.
pkgname=btrfs-progs
pkgver=4.15.1
pkgver=4.16
pkgrel=2
pkgdesc='Btrfs filesystem utilities'
arch=('x86_64')
depends=('glibc' 'util-linux' 'e2fsprogs' 'lzo2' 'zlib' 'zstd')
makedepends=('git' 'asciidoc' 'xmlto')
makedepends=('git' 'asciidoc' 'xmlto' 'systemd' 'python3-setuptools')
url='http://btrfs.wiki.kernel.org/'
license=('GPL2')
source=("https://github.com/kdave/${pkgname}/archive/v${pkgver}.tar.gz"
......@@ -15,7 +15,7 @@ source=("https://github.com/kdave/${pkgname}/archive/v${pkgver}.tar.gz"
'initcpio-hook-btrfs'
'btrfs-scrub@.service'
'btrfs-scrub@.timer')
md5sums=('90e22a853bb5680f9b6192cdb0b5ea34'
md5sums=('8b071de61c6a33ba0e1fef78a6eed51c'
'7241ba3a4286d08da0d50b7176941112'
'b09688a915a0ec8f40e2f5aacbabc9ad'
'794b867e09451284c545bae112aa0cfd'
......@@ -25,7 +25,7 @@ options=(!staticlibs)
build() {
cd $pkgname-$pkgver
./autogen.sh
./autogen.sh
./configure --prefix=/usr
make
}
......
pkgbase=cython
pkgname=('cython3' 'cython2')
pkgver=0.27.3
pkgbase=cython
pkgver=0.28.2
pkgrel=1
pkgdesc="C-Extensions for Python"
arch=(x86_64)
......@@ -8,7 +8,7 @@ url="http://cython.org"
license=('APACHE')
makedepends=('python3-setuptools' 'python2-setuptools')
source=($pkgbase-$pkgver.tar.gz::"https://github.com/cython/cython/archive/$pkgver.tar.gz")
sha256sums=('648feb8a257574a3e4ef854475e7d767732ef26e870d2f9fcc1ca5b244b3ac89')
sha256sums=('d8fad58f7484466ff64a3d54f76943a3e2aef72a4efa1506eccca6ddc3ee547a')
prepare() {
cp -r cython-$pkgver cython2-$pkgver
......@@ -25,6 +25,9 @@ build() {
package_cython3() {
depends=(python3 python3-setuptools)
provides=(python3-cython)
conflicts=(python3-cython)
replaces=(python3-cython)
cd cython-$pkgver
python3 setup.py install --root="$pkgdir" --skip-build
......@@ -37,6 +40,9 @@ package_cython3() {
package_cython2() {
depends=(python2 python2-setuptools)
provides=(python2-cython)
conflicts=(python2-cython)
replaces=(python2-cython)
cd cython2-$pkgver
python2 setup.py install --root="$pkgdir" --skip-build
......
pkgname=libimobiledevice
pkgver=1.2.0
pkgrel=6
pkgver=1.2.0+66+g5a85432
pkgrel=1
pkgdesc="Library that talks the protocols to support iPhone and iPod Touch devices on Linux"
url="http://libimobiledevice.org/"
arch=('x86_64')
license=('GPL2' 'LGPL2.1')
depends=('libusbmuxd' 'usbmuxd' 'gnutls')
makedepends=('python2' 'python2-cython' 'python3' 'python3-cython' 'libplist' 'autoconf-archive')
source=(http://libimobiledevice.org/downloads/$pkgname-$pkgver.tar.bz2
0001-Fix-installation_proxy-when-using-GnuTLS-instead-of-.patch
CVE-2016-5104.patch
0001-Add-new-function-to-get-the-underlying-file-descript.patch
0001-Updated-gnutls-certificate-callback-to-new-API-backw.patch
0001-idevice-Update-GnuTLS-code-to-support-iOS-10.patch
0001-userpref-GnuTLS-Fix-pairing-record-generation-and-im.patch)
sha256sums=('786b0de0875053bf61b5531a86ae8119e320edab724fc62fe2150cc931f11037'
'9fb1523276f9ab4273f0065728c52792ec6c99c09d587c28175c748175106a09'
'30d8032244859adc85f11df00a5b3adb017160821ddf4b22a8528f9b104c0951'
'a4a1844dfedc933cb998afbbe4b2066d8bcedf8d305990715160b957f754922c'
'9e03d66e15ad036e7e3b8639b07788a0c1959016444766ad63f708e722bd516c'
'173291a36ea08226c221643580c007f44e430867f345d8106395cce0f52a38c5'
'7d3c5a89ce6611c219d80255a1cce4a02de4ca00fb58c32e87733d9a0e20c4ce')
makedepends=('python2' 'cython2' 'python3' 'cython3' 'libplist' 'autoconf-archive' git python2-setuptools python3-setuptools)
_commit=5a85432719fb3d18027d528f87d2a44b76fd3e12 # master
source=("git+https://github.com/libimobiledevice/libimobiledevice/#commit=$_commit")
sha256sums=('SKIP')
pkgver() {
cd $pkgname
git describe --tags | sed 's/-/+/g'
}
check() {
cd build-py2
make check
}
prepare() {
cd "$pkgname-$pkgver"
patch -Np1 -i ../0001-Fix-installation_proxy-when-using-GnuTLS-instead-of-.patch
patch -Np1 -i ../CVE-2016-5104.patch
patch -Np1 -i ../0001-Add-new-function-to-get-the-underlying-file-descript.patch
patch -Np1 -i ../0001-Updated-gnutls-certificate-callback-to-new-API-backw.patch
patch -Np1 -i ../0001-idevice-Update-GnuTLS-code-to-support-iOS-10.patch
patch -Np1 -i ../0001-userpref-GnuTLS-Fix-pairing-record-generation-and-im.patch
sed -e 's/AC_PYTHON_DEVEL/AX_PYTHON_DEVEL/' -i m4/cython_python.m4
autoreconf -fi
cd $pkgname
NOCONFIGURE=1 ./autogen.sh
}
build() {
mkdir build-py2
pushd build-py2
PYTHON=/usr/bin/python2 CYTHON=/usr/bin/cython2 ../$pkgname-$pkgver/configure --prefix=/usr --disable-openssl
PYTHON=/usr/bin/python2 CYTHON=/usr/bin/cython2 ../$pkgname/configure --prefix=/usr --disable-openssl
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
popd
mkdir build-py3
pushd build-py3
PYTHON=/usr/bin/python3 CYTHON=/usr/bin/cython3 ../$pkgname-$pkgver/configure --prefix=/usr --disable-openssl
PYTHON=/usr/bin/python3 CYTHON=/usr/bin/cython3 ../$pkgname/configure --prefix=/usr --disable-openssl
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
}
......
......@@ -9,13 +9,11 @@ pkgdesc="Kernel headers sanitized for use in userspace"
arch=('x86_64')
url="http://www.gnu.org/software/libc"
license=('GPL2')
source=(http://www.kernel.org/pub/linux/kernel/v4.x/linux-${_basekernel}.tar.xz
http://www.kernel.org/pub/linux/kernel/v4.x/linux-${_basekernel}.tar.sign
http://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz
http://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign)
sha256sums=('5a26478906d5005f4f809402e981518d2b8844949199f60c4b6e1f986ca2a769'
source=(https://www.kernel.org/pub/linux/kernel/v4.x/linux-${pkgver%.*}.tar.{xz,sign}
https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.{xz,sign})
sha256sums=('63f6dc8e3c9f3a0273d5d6f4dca38a2413ca3a5f689329d05b750e4c87bb21b9'
'SKIP'
'6be2c185839d730769a8e6bcf46ca0962845732e25ed4801fe1ea995218b1133'
'336252cb15f2f2574461c1d3daabf5dc207842526085802270e1e5223f645db3'
'SKIP')
validpgpkeys=('ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E') # Greg Kroah-Hartman
......
......@@ -29,7 +29,7 @@ source=("http://www.kernel.org/pub/linux/kernel/v4.x/linux-${pkgver}.tar.xz"
'cpupower.systemd'
'cpupower.service'
'usbipd.service')
sha256sums=('4a7452fcf97c93e73e7d04264a75da550772c912e9749bcf509331cad8b716a1'
sha256sums=('0d6971a81da97e38b974c5eba31a74803bfe41aabc46d406c3acda56306c81a3'
'4fa509949d6863d001075fa3e8671eff2599c046d20c98bb4a70778595cd1c3f'
'fbf6e0ce6eb0ef15703fe212958de6ca46e62188900b5e9f9272ed3cc9cfd54e'
'a89284d0ecb556ca53a66d1c2087b5fd6d0a901ab2769cd3aebb93f4478905dc'
......
......@@ -6,8 +6,8 @@
# These are the "basic variables" appliable for the normal kernel group
_kernelname="-CHAKRA"
_kernelver=4.15.14
_basekernel=4.15
_kernelver=4.16.3
_basekernel=4.16
_extramodules=extramodules-${_basekernel}${_kernelname}
_kver="$(cat /lib/modules/${_extramodules}/version)"
......
......@@ -15,15 +15,15 @@
#core_packages
#linux
#linux-api-headers
linux-tools
vhba-module
broadcom-wl
acpi_call
ndiswrapper
btrfs-progs
r8168
bbswitch
#linux-tools
Please register or sign in to reply
#vhba-module
#broadcom-wl
#acpi_call
#ndiswrapper
#btrfs-progs
#r8168
#
#bbswitch
nvidia-utils
nvidia
#../lib32/lib32-nvidia-utils
......
From ff9d06de19e83c0c5a00a4d46376b4d1032c4f99 Mon Sep 17 00:00:00 2001
Message-Id: <ff9d06de19e83c0c5a00a4d46376b4d1032c4f99.1524129246.git.jan.steffens@gmail.com>
From: Serge Hallyn <serge.hallyn@canonical.com>
Date: Fri, 31 May 2013 19:12:12 +0100
Subject: [PATCH 1/6] add sysctl to disallow unprivileged CLONE_NEWUSER by
default
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
[bwh: Remove unneeded binary sysctl bits]
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
---
kernel/fork.c | 15 +++++++++++++++
kernel/sysctl.c | 12 ++++++++++++
kernel/user_namespace.c | 3 +++
3 files changed, 30 insertions(+)
diff --git a/kernel/fork.c b/kernel/fork.c
index e5d9d405ae4e..c4be89c51f25 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -103,6 +103,11 @@
#define CREATE_TRACE_POINTS
#include <trace/events/task.h>
+#ifdef CONFIG_USER_NS
+extern int unprivileged_userns_clone;
+#else
+#define unprivileged_userns_clone 0
+#endif
/*
* Minimum number of threads to boot the kernel
@@ -1591,6 +1596,10 @@ static __latent_entropy struct task_struct *copy_process(
if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS))
return ERR_PTR(-EINVAL);
+ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone)
+ if (!capable(CAP_SYS_ADMIN))
+ return ERR_PTR(-EPERM);
+
/*
* Thread groups must share signals as well, and detached threads
* can only be started up within the thread group.
@@ -2385,6 +2394,12 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
if (unshare_flags & CLONE_NEWNS)
unshare_flags |= CLONE_FS;
+ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) {
+ err = -EPERM;
+ if (!capable(CAP_SYS_ADMIN))
+ goto bad_unshare_out;
+ }
+
err = check_unshare_flags(unshare_flags);
if (err)
goto bad_unshare_out;
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index f98f28c12020..7256d339a32a 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -105,6 +105,9 @@ extern int core_uses_pid;
extern char core_pattern[];
extern unsigned int core_pipe_limit;
#endif
+#ifdef CONFIG_USER_NS
+extern int unprivileged_userns_clone;
+#endif
extern int pid_max;
extern int pid_max_min, pid_max_max;
extern int percpu_pagelist_fraction;
@@ -515,6 +518,15 @@ static struct ctl_table kern_table[] = {
.proc_handler = proc_dointvec,
},
#endif
+#ifdef CONFIG_USER_NS
+ {
+ .procname = "unprivileged_userns_clone",
+ .data = &unprivileged_userns_clone,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
+#endif
#ifdef CONFIG_PROC_SYSCTL
{
.procname = "tainted",
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 246d4d4ce5c7..f64432b45cec 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -26,6 +26,9 @@
#include <linux/bsearch.h>
#include <linux/sort.h>
+/* sysctl */
+int unprivileged_userns_clone;
+
static struct kmem_cache *user_ns_cachep __read_mostly;
static DEFINE_MUTEX(userns_state_mutex);
--
2.17.0
From 3dcbf4dd14d295c3a238d73e9f791a827b906058 Mon Sep 17 00:00:00 2001
Message-Id: <3dcbf4dd14d295c3a238d73e9f791a827b906058.1524129246.git.jan.steffens@gmail.com>
In-Reply-To: <ff9d06de19e83c0c5a00a4d46376b4d1032c4f99.1524129246.git.jan.steffens@gmail.com>
References: <ff9d06de19e83c0c5a00a4d46376b4d1032c4f99.1524129246.git.jan.steffens@gmail.com>
From: Jim Bride <jim.bride@linux.intel.com>
Date: Mon, 6 Nov 2017 13:38:57 -0800
Subject: [PATCH 2/6] drm/i915/edp: Only use the alternate fixed mode if it's
asked for
In commit dc911f5bd8aa ("drm/i915/edp: Allow alternate fixed mode for
eDP if available."), the patch allows for the use of an alternate fixed
mode if it is available, but the patch was not ensuring that the only
time the alternate mode is used is when it is specifically requested.
This patch adds an additional comparison to intel_edp_compare_alt_mode
to ensure that we only use the alternate mode if it is directly
requested.
Fixes: dc911f5bd8aac ("Allow alternate fixed mode for eDP if available.")
Cc: David Weinehall <david.weinehall@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jim Bride <jim.bride@linux.intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a29868cd30c7..b6d07b615b12 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1597,7 +1597,8 @@ static bool intel_edp_compare_alt_mode(struct drm_display_mode *m1,
m1->vdisplay == m2->vdisplay &&
m1->vsync_start == m2->vsync_start &&
m1->vsync_end == m2->vsync_end &&
- m1->vtotal == m2->vtotal);
+ m1->vtotal == m2->vtotal &&
+ m1->vrefresh == m2->vrefresh);
return bres;
}
--
2.17.0
From 1b03bcc6faecde170f9bea83accdde7bbd36df96 Mon Sep 17 00:00:00 2001
Message-Id: <1b03bcc6faecde170f9bea83accdde7bbd36df96.1524129246.git.jan.steffens@gmail.com>
In-Reply-To: <ff9d06de19e83c0c5a00a4d46376b4d1032c4f99.1524129246.git.jan.steffens@gmail.com>
References: <ff9d06de19e83c0c5a00a4d46376b4d1032c4f99.1524129246.git.jan.steffens@gmail.com>
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Fri, 6 Apr 2018 16:19:38 +0200
Subject: [PATCH 3/6] Partially revert "swiotlb: remove various exports"
This partially reverts commit 4bd89ed39b2ab8dc4ac4b6c59b07d420b0213bec.
The proprietary NVIDIA driver needs one of the exports.
---
lib/swiotlb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index c43ec2271469..77d699f14af7 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -1016,6 +1016,7 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,
}
return nelems;
}
+EXPORT_SYMBOL(swiotlb_map_sg_attrs);
/*
* Unmap a set of streaming mode DMA translations. Again, cpu read rules
--
2.17.0
From b04d533fa7e16e58243296b5063a624e91d2048e Mon Sep 17 00:00:00 2001
Message-Id: <b04d533fa7e16e58243296b5063a624e91d2048e.1524129246.git.jan.steffens@gmail.com>
In-Reply-To: <ff9d06de19e83c0c5a00a4d46376b4d1032c4f99.1524129246.git.jan.steffens@gmail.com>
References: <ff9d06de19e83c0c5a00a4d46376b4d1032c4f99.1524129246.git.jan.steffens@gmail.com>
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Wed, 11 Apr 2018 21:27:44 +0200
Subject: [PATCH 4/6] Fix vboxguest on guests with more than 4G RAM
Squashed commit of the following:
commit 042b191f6b98165d6bcca3ae09a0f9b289d6155e
Author: Hans de Goede <hdegoede@redhat.com>
Date: Thu Mar 29 17:28:57 2018 +0200
virt: vbox: Log an error when we fail to get the host version
This was the only error path during probe without a message being logged
about what went wrong, this fixes this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
commit e4111a6c617687f7cb414ddfa8176206910db76e
Author: Hans de Goede <hdegoede@redhat.com>
Date: Thu Mar 29 17:28:56 2018 +0200
virt: vbox: Use __get_free_pages instead of kmalloc for DMA32 memory
It is not possible to get DMA32 zone memory through kmalloc, causing
the vboxguest driver to malfunction due to getting memory above
4G which the PCI device cannot handle.
This commit changes the kmalloc calls where the 4G limit matters to
using __get_free_pages() fixing vboxguest not working on x86_64 guests
with more then 4G RAM.
Cc: stable@vger.kernel.org
Reported-by: Eloy Coto Pereiro <eloy.coto@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
commit 2cb20368ce32e7275a351eadadd4c8f3da742a28
Author: Hans de Goede <hdegoede@redhat.com>
Date: Thu Mar 29 17:28:55 2018 +0200
virt: vbox: Add vbg_req_free() helper function
This is a preparation patch for fixing issues on x86_64 virtual-machines
with more then 4G of RAM, atm we pass __GFP_DMA32 to kmalloc, but kmalloc
does not honor that, so we need to switch to get_pages, which means we
will not be able to use kfree to free memory allocated with vbg_alloc_req.
While at it also remove a comment on a vbg_alloc_req call which talks
about Windows (inherited from the vbox upstream cross-platform code).
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
commit fa5c012bc9c3e1ada5cde0bfa3c6706be97b7cb0
Author: Hans de Goede <hdegoede@redhat.com>
Date: Thu Mar 29 17:28:54 2018 +0200
virt: vbox: Move declarations of vboxguest private functions to private header
Move the declarations of functions from vboxguest_utils.c which are only
meant for vboxguest internal use from include/linux/vbox_utils.h to
drivers/virt/vboxguest/vboxguest_core.h.
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/virt/vboxguest/vboxguest_core.c | 70 +++++++++++++-----------
drivers/virt/vboxguest/vboxguest_core.h | 9 +++
drivers/virt/vboxguest/vboxguest_linux.c | 19 ++++++-
drivers/virt/vboxguest/vboxguest_utils.c | 17 ++++--
include/linux/vbox_utils.h | 23 --------
5 files changed, 76 insertions(+), 62 deletions(-)
diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
index 190dbf8cfcb5..2f3856a95856 100644
--- a/drivers/virt/vboxguest/vboxguest_core.c
+++ b/drivers/virt/vboxguest/vboxguest_core.c
@@ -114,7 +114,7 @@ static void vbg_guest_mappings_init(struct vbg_dev *gdev)
}
out:
- kfree(req);
+ vbg_req_free(req, sizeof(*req));
kfree(pages);
}
@@ -144,7 +144,7 @@ static void vbg_guest_mappings_exit(struct vbg_dev *gdev)
rc = vbg_req_perform(gdev, req);
- kfree(req);
+ vbg_req_free(req, sizeof(*req));
if (rc < 0) {
vbg_err("%s error: %d\n", __func__, rc);
@@ -214,8 +214,8 @@ static int vbg_report_guest_info(struct vbg_dev *gdev)
ret = vbg_status_code_to_errno(rc);
out_free:
- kfree(req2);
- kfree(req1);
+ vbg_req_free(req2, sizeof(*req2));
+ vbg_req_free(req1, sizeof(*req1));
return ret;
}
@@ -245,7 +245,7 @@ static int vbg_report_driver_status(struct vbg_dev *gdev, bool active)
if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */
rc = VINF_SUCCESS;
- kfree(req);
+ vbg_req_free(req, sizeof(*req));
return vbg_status_code_to_errno(rc);
}
@@ -431,58 +431,52 @@ static int vbg_heartbeat_host_config(struct vbg_dev *gdev, bool enabled)
rc = vbg_req_perform(gdev, req);
do_div(req->interval_ns, 1000000); /* ns -> ms */
gdev->heartbeat_interval_ms = req->interval_ns;
- kfree(req);
+ vbg_req_free(req, sizeof(*req));
return vbg_status_code_to_errno(rc);
}
/**
* Initializes the heartbeat timer. This feature may be disabled by the host.
* Return: 0 or negative errno value.
* @gdev: The Guest extension device.
*/
static int vbg_heartbeat_init(struct vbg_dev *gdev)
{
int ret;
/* Make sure that heartbeat checking is disabled if we fail. */
ret = vbg_heartbeat_host_config(gdev, false);
if (ret < 0)
return ret;
ret = vbg_heartbeat_host_config(gdev, true);
if (ret < 0)
return ret;
- /*
- * Preallocate the request to use it from the timer callback because:
- * 1) on Windows vbg_req_alloc must be called at IRQL <= APC_LEVEL
- * and the timer callback runs at DISPATCH_LEVEL;
- * 2) avoid repeated allocations.
- */
gdev->guest_heartbeat_req = vbg_req_alloc(
sizeof(*gdev->guest_heartbeat_req),
VMMDEVREQ_GUEST_HEARTBEAT);