]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.69/vmw_balloon-fix-vmci-use-when-balloon-built-into-kernel.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.69 / vmw_balloon-fix-vmci-use-when-balloon-built-into-kernel.patch
1 From c3cc1b0fc27508da53fe955a3b23d03964410682 Mon Sep 17 00:00:00 2001
2 From: Nadav Amit <namit@vmware.com>
3 Date: Tue, 19 Jun 2018 16:00:27 -0700
4 Subject: vmw_balloon: fix VMCI use when balloon built into kernel
5
6 From: Nadav Amit <namit@vmware.com>
7
8 commit c3cc1b0fc27508da53fe955a3b23d03964410682 upstream.
9
10 Currently, when all modules, including VMCI and VMware balloon are built
11 into the kernel, the initialization of the balloon happens before the
12 VMCI is probed. As a result, the balloon fails to initialize the VMCI
13 doorbell, which it uses to get asynchronous requests for balloon size
14 changes.
15
16 The problem can be seen in the logs, in the form of the following
17 message:
18 "vmw_balloon: failed to initialize vmci doorbell"
19
20 The driver would work correctly but slightly less efficiently, probing
21 for requests periodically. This patch changes the balloon to be
22 initialized using late_initcall() instead of module_init() to address
23 this issue. It does not address a situation in which VMCI is built as a
24 module and the balloon is built into the kernel.
25
26 Fixes: 48e3d668b790 ("VMware balloon: Enable notification via VMCI")
27 Cc: stable@vger.kernel.org
28 Reviewed-by: Xavier Deguillard <xdeguillard@vmware.com>
29 Signed-off-by: Nadav Amit <namit@vmware.com>
30 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31
32 ---
33 drivers/misc/vmw_balloon.c | 9 ++++++++-
34 1 file changed, 8 insertions(+), 1 deletion(-)
35
36 --- a/drivers/misc/vmw_balloon.c
37 +++ b/drivers/misc/vmw_balloon.c
38 @@ -1297,7 +1297,14 @@ static int __init vmballoon_init(void)
39
40 return 0;
41 }
42 -module_init(vmballoon_init);
43 +
44 +/*
45 + * Using late_initcall() instead of module_init() allows the balloon to use the
46 + * VMCI doorbell even when the balloon is built into the kernel. Otherwise the
47 + * VMCI is probed only after the balloon is initialized. If the balloon is used
48 + * as a module, late_initcall() is equivalent to module_init().
49 + */
50 +late_initcall(vmballoon_init);
51
52 static void __exit vmballoon_exit(void)
53 {