]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Sat, 5 Sep 2020 16:56:26 +0000 (12:56 -0400)
committerSasha Levin <sashal@kernel.org>
Sat, 5 Sep 2020 16:56:26 +0000 (12:56 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/ceph-don-t-allow-setlease-on-cephfs.patch [new file with mode: 0644]
queue-4.14/cpuidle-fixup-irq-state.patch [new file with mode: 0644]
queue-4.14/drm-msm-add-shutdown-support-for-display-platform_dr.patch [new file with mode: 0644]
queue-4.14/hwmon-applesmc-check-status-earlier.patch [new file with mode: 0644]
queue-4.14/nvmet-disable-keep-alive-timer-when-kato-is-cleared-.patch [new file with mode: 0644]
queue-4.14/s390-don-t-trace-preemption-in-percpu-macros.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/xen-xenbus-fix-granting-of-vmalloc-d-memory.patch [new file with mode: 0644]

diff --git a/queue-4.14/ceph-don-t-allow-setlease-on-cephfs.patch b/queue-4.14/ceph-don-t-allow-setlease-on-cephfs.patch
new file mode 100644 (file)
index 0000000..1fc22dd
--- /dev/null
@@ -0,0 +1,39 @@
+From 453719bda33d39360baab69f1a4cfa6f68e568bb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Aug 2020 11:00:26 -0400
+Subject: ceph: don't allow setlease on cephfs
+
+From: Jeff Layton <jlayton@kernel.org>
+
+[ Upstream commit 496ceaf12432b3d136dcdec48424312e71359ea7 ]
+
+Leases don't currently work correctly on kcephfs, as they are not broken
+when caps are revoked. They could eventually be implemented similarly to
+how we did them in libcephfs, but for now don't allow them.
+
+[ idryomov: no need for simple_nosetlease() in ceph_dir_fops and
+  ceph_snapdir_fops ]
+
+Signed-off-by: Jeff Layton <jlayton@kernel.org>
+Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
+Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/ceph/file.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fs/ceph/file.c b/fs/ceph/file.c
+index 6d653235e323b..1f873034f4691 100644
+--- a/fs/ceph/file.c
++++ b/fs/ceph/file.c
+@@ -1728,6 +1728,7 @@ const struct file_operations ceph_file_fops = {
+       .mmap = ceph_mmap,
+       .fsync = ceph_fsync,
+       .lock = ceph_lock,
++      .setlease = simple_nosetlease,
+       .flock = ceph_flock,
+       .splice_read = generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
+-- 
+2.25.1
+
diff --git a/queue-4.14/cpuidle-fixup-irq-state.patch b/queue-4.14/cpuidle-fixup-irq-state.patch
new file mode 100644 (file)
index 0000000..ba595af
--- /dev/null
@@ -0,0 +1,39 @@
+From 05c142878e951ea27591f9e62c81748606d80477 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Aug 2020 16:47:24 +0200
+Subject: cpuidle: Fixup IRQ state
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+[ Upstream commit 49d9c5936314e44d314c605c39cce0fd947f9c3a ]
+
+Match the pattern elsewhere in this file.
+
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
+Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Tested-by: Marco Elver <elver@google.com>
+Link: https://lkml.kernel.org/r/20200821085348.251340558@infradead.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/cpuidle/cpuidle.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
+index ed4df58a855e1..da9eb38d79d9c 100644
+--- a/drivers/cpuidle/cpuidle.c
++++ b/drivers/cpuidle/cpuidle.c
+@@ -144,7 +144,8 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
+        */
+       stop_critical_timings();
+       drv->states[index].enter_s2idle(dev, drv, index);
+-      WARN_ON(!irqs_disabled());
++      if (WARN_ON_ONCE(!irqs_disabled()))
++              local_irq_disable();
+       /*
+        * timekeeping_resume() that will be called by tick_unfreeze() for the
+        * first CPU executing it calls functions containing RCU read-side
+-- 
+2.25.1
+
diff --git a/queue-4.14/drm-msm-add-shutdown-support-for-display-platform_dr.patch b/queue-4.14/drm-msm-add-shutdown-support-for-display-platform_dr.patch
new file mode 100644 (file)
index 0000000..1f2f73a
--- /dev/null
@@ -0,0 +1,60 @@
+From 8369d87f8cc9b1c6d20d85e05a905a5c39151cf1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 1 Jun 2020 16:33:22 +0530
+Subject: drm/msm: add shutdown support for display platform_driver
+
+From: Krishna Manikandan <mkrishn@codeaurora.org>
+
+[ Upstream commit 9d5cbf5fe46e350715389d89d0c350d83289a102 ]
+
+Define shutdown callback for display drm driver,
+so as to disable all the CRTCS when shutdown
+notification is received by the driver.
+
+This change will turn off the timing engine so
+that no display transactions are requested
+while mmu translations are getting disabled
+during reboot sequence.
+
+Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
+
+Changes in v2:
+       - Remove NULL check from msm_pdev_shutdown (Stephen Boyd)
+       - Change commit text to reflect when this issue
+         was uncovered (Sai Prakash Ranjan)
+
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/msm/msm_drv.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
+index d9c0687435a05..c59240b566d83 100644
+--- a/drivers/gpu/drm/msm/msm_drv.c
++++ b/drivers/gpu/drm/msm/msm_drv.c
+@@ -1134,6 +1134,13 @@ static int msm_pdev_remove(struct platform_device *pdev)
+       return 0;
+ }
++static void msm_pdev_shutdown(struct platform_device *pdev)
++{
++      struct drm_device *drm = platform_get_drvdata(pdev);
++
++      drm_atomic_helper_shutdown(drm);
++}
++
+ static const struct of_device_id dt_match[] = {
+       { .compatible = "qcom,mdp4", .data = (void *)4 },       /* MDP4 */
+       { .compatible = "qcom,mdss", .data = (void *)5 },       /* MDP5 MDSS */
+@@ -1144,6 +1151,7 @@ MODULE_DEVICE_TABLE(of, dt_match);
+ static struct platform_driver msm_platform_driver = {
+       .probe      = msm_pdev_probe,
+       .remove     = msm_pdev_remove,
++      .shutdown   = msm_pdev_shutdown,
+       .driver     = {
+               .name   = "msm",
+               .of_match_table = dt_match,
+-- 
+2.25.1
+
diff --git a/queue-4.14/hwmon-applesmc-check-status-earlier.patch b/queue-4.14/hwmon-applesmc-check-status-earlier.patch
new file mode 100644 (file)
index 0000000..237c4a5
--- /dev/null
@@ -0,0 +1,123 @@
+From b0ea52d7f7c2b9a81b2fdae01f78af5f82fa7b22 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Aug 2020 06:19:32 -0700
+Subject: hwmon: (applesmc) check status earlier.
+
+From: Tom Rix <trix@redhat.com>
+
+[ Upstream commit cecf7560f00a8419396a2ed0f6e5d245ccb4feac ]
+
+clang static analysis reports this representative problem
+
+applesmc.c:758:10: warning: 1st function call argument is an
+  uninitialized value
+        left = be16_to_cpu(*(__be16 *)(buffer + 6)) >> 2;
+               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+buffer is filled by the earlier call
+
+       ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, ...
+
+This problem is reported because a goto skips the status check.
+Other similar problems use data from applesmc_read_key before checking
+the status.  So move the checks to before the use.
+
+Signed-off-by: Tom Rix <trix@redhat.com>
+Reviewed-by: Henrik Rydberg <rydberg@bitmath.org>
+Link: https://lore.kernel.org/r/20200820131932.10590-1-trix@redhat.com
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hwmon/applesmc.c | 31 ++++++++++++++++---------------
+ 1 file changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
+index 5c677ba440143..b201129a9beae 100644
+--- a/drivers/hwmon/applesmc.c
++++ b/drivers/hwmon/applesmc.c
+@@ -760,15 +760,18 @@ static ssize_t applesmc_light_show(struct device *dev,
+       }
+       ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length);
++      if (ret)
++              goto out;
+       /* newer macbooks report a single 10-bit bigendian value */
+       if (data_length == 10) {
+               left = be16_to_cpu(*(__be16 *)(buffer + 6)) >> 2;
+               goto out;
+       }
+       left = buffer[2];
++
++      ret = applesmc_read_key(LIGHT_SENSOR_RIGHT_KEY, buffer, data_length);
+       if (ret)
+               goto out;
+-      ret = applesmc_read_key(LIGHT_SENSOR_RIGHT_KEY, buffer, data_length);
+       right = buffer[2];
+ out:
+@@ -817,12 +820,11 @@ static ssize_t applesmc_show_fan_speed(struct device *dev,
+                 to_index(attr));
+       ret = applesmc_read_key(newkey, buffer, 2);
+-      speed = ((buffer[0] << 8 | buffer[1]) >> 2);
+-
+       if (ret)
+               return ret;
+-      else
+-              return snprintf(sysfsbuf, PAGE_SIZE, "%u\n", speed);
++
++      speed = ((buffer[0] << 8 | buffer[1]) >> 2);
++      return snprintf(sysfsbuf, PAGE_SIZE, "%u\n", speed);
+ }
+ static ssize_t applesmc_store_fan_speed(struct device *dev,
+@@ -858,12 +860,11 @@ static ssize_t applesmc_show_fan_manual(struct device *dev,
+       u8 buffer[2];
+       ret = applesmc_read_key(FANS_MANUAL, buffer, 2);
+-      manual = ((buffer[0] << 8 | buffer[1]) >> to_index(attr)) & 0x01;
+-
+       if (ret)
+               return ret;
+-      else
+-              return snprintf(sysfsbuf, PAGE_SIZE, "%d\n", manual);
++
++      manual = ((buffer[0] << 8 | buffer[1]) >> to_index(attr)) & 0x01;
++      return snprintf(sysfsbuf, PAGE_SIZE, "%d\n", manual);
+ }
+ static ssize_t applesmc_store_fan_manual(struct device *dev,
+@@ -879,10 +880,11 @@ static ssize_t applesmc_store_fan_manual(struct device *dev,
+               return -EINVAL;
+       ret = applesmc_read_key(FANS_MANUAL, buffer, 2);
+-      val = (buffer[0] << 8 | buffer[1]);
+       if (ret)
+               goto out;
++      val = (buffer[0] << 8 | buffer[1]);
++
+       if (input)
+               val = val | (0x01 << to_index(attr));
+       else
+@@ -958,13 +960,12 @@ static ssize_t applesmc_key_count_show(struct device *dev,
+       u32 count;
+       ret = applesmc_read_key(KEY_COUNT_KEY, buffer, 4);
+-      count = ((u32)buffer[0]<<24) + ((u32)buffer[1]<<16) +
+-                                              ((u32)buffer[2]<<8) + buffer[3];
+-
+       if (ret)
+               return ret;
+-      else
+-              return snprintf(sysfsbuf, PAGE_SIZE, "%d\n", count);
++
++      count = ((u32)buffer[0]<<24) + ((u32)buffer[1]<<16) +
++                                              ((u32)buffer[2]<<8) + buffer[3];
++      return snprintf(sysfsbuf, PAGE_SIZE, "%d\n", count);
+ }
+ static ssize_t applesmc_key_at_index_read_show(struct device *dev,
+-- 
+2.25.1
+
diff --git a/queue-4.14/nvmet-disable-keep-alive-timer-when-kato-is-cleared-.patch b/queue-4.14/nvmet-disable-keep-alive-timer-when-kato-is-cleared-.patch
new file mode 100644 (file)
index 0000000..d9e4940
--- /dev/null
@@ -0,0 +1,47 @@
+From 8ee4efc64d74795e66c235536f5f7a3fda0f8712 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 19 Aug 2020 11:31:11 +0300
+Subject: nvmet: Disable keep-alive timer when kato is cleared to 0h
+
+From: Amit Engel <amit.engel@dell.com>
+
+[ Upstream commit 0d3b6a8d213a30387b5104b2fb25376d18636f23 ]
+
+Based on nvme spec, when keep alive timeout is set to zero
+the keep-alive timer should be disabled.
+
+Signed-off-by: Amit Engel <amit.engel@dell.com>
+Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/target/core.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
+index 09a39f4aaf821..d0be85d0c289a 100644
+--- a/drivers/nvme/target/core.c
++++ b/drivers/nvme/target/core.c
+@@ -208,6 +208,9 @@ static void nvmet_keep_alive_timer(struct work_struct *work)
+ static void nvmet_start_keep_alive_timer(struct nvmet_ctrl *ctrl)
+ {
++      if (unlikely(ctrl->kato == 0))
++              return;
++
+       pr_debug("ctrl %d start keep-alive timer for %d secs\n",
+               ctrl->cntlid, ctrl->kato);
+@@ -217,6 +220,9 @@ static void nvmet_start_keep_alive_timer(struct nvmet_ctrl *ctrl)
+ static void nvmet_stop_keep_alive_timer(struct nvmet_ctrl *ctrl)
+ {
++      if (unlikely(ctrl->kato == 0))
++              return;
++
+       pr_debug("ctrl %d stop keep-alive\n", ctrl->cntlid);
+       cancel_delayed_work_sync(&ctrl->ka_work);
+-- 
+2.25.1
+
diff --git a/queue-4.14/s390-don-t-trace-preemption-in-percpu-macros.patch b/queue-4.14/s390-don-t-trace-preemption-in-percpu-macros.patch
new file mode 100644 (file)
index 0000000..716300a
--- /dev/null
@@ -0,0 +1,139 @@
+From 3bb5b10ef595131c831b99814a35305b27048f80 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Aug 2020 09:48:23 +0200
+Subject: s390: don't trace preemption in percpu macros
+
+From: Sven Schnelle <svens@linux.ibm.com>
+
+[ Upstream commit 1196f12a2c960951d02262af25af0bb1775ebcc2 ]
+
+Since commit a21ee6055c30 ("lockdep: Change hardirq{s_enabled,_context}
+to per-cpu variables") the lockdep code itself uses percpu variables. This
+leads to recursions because the percpu macros are calling preempt_enable()
+which might call trace_preempt_on().
+
+Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
+Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/s390/include/asm/percpu.h | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h
+index 0095ddb58ff69..50f6661ba5664 100644
+--- a/arch/s390/include/asm/percpu.h
++++ b/arch/s390/include/asm/percpu.h
+@@ -29,7 +29,7 @@
+       typedef typeof(pcp) pcp_op_T__;                                 \
+       pcp_op_T__ old__, new__, prev__;                                \
+       pcp_op_T__ *ptr__;                                              \
+-      preempt_disable();                                              \
++      preempt_disable_notrace();                                      \
+       ptr__ = raw_cpu_ptr(&(pcp));                                    \
+       prev__ = *ptr__;                                                \
+       do {                                                            \
+@@ -37,7 +37,7 @@
+               new__ = old__ op (val);                                 \
+               prev__ = cmpxchg(ptr__, old__, new__);                  \
+       } while (prev__ != old__);                                      \
+-      preempt_enable();                                               \
++      preempt_enable_notrace();                                       \
+       new__;                                                          \
+ })
+@@ -68,7 +68,7 @@
+       typedef typeof(pcp) pcp_op_T__;                                 \
+       pcp_op_T__ val__ = (val);                                       \
+       pcp_op_T__ old__, *ptr__;                                       \
+-      preempt_disable();                                              \
++      preempt_disable_notrace();                                      \
+       ptr__ = raw_cpu_ptr(&(pcp));                            \
+       if (__builtin_constant_p(val__) &&                              \
+           ((szcast)val__ > -129) && ((szcast)val__ < 128)) {          \
+@@ -84,7 +84,7 @@
+                       : [val__] "d" (val__)                           \
+                       : "cc");                                        \
+       }                                                               \
+-      preempt_enable();                                               \
++      preempt_enable_notrace();                                       \
+ }
+ #define this_cpu_add_4(pcp, val) arch_this_cpu_add(pcp, val, "laa", "asi", int)
+@@ -95,14 +95,14 @@
+       typedef typeof(pcp) pcp_op_T__;                                 \
+       pcp_op_T__ val__ = (val);                                       \
+       pcp_op_T__ old__, *ptr__;                                       \
+-      preempt_disable();                                              \
++      preempt_disable_notrace();                                      \
+       ptr__ = raw_cpu_ptr(&(pcp));                                    \
+       asm volatile(                                                   \
+               op "    %[old__],%[val__],%[ptr__]\n"                   \
+               : [old__] "=d" (old__), [ptr__] "+Q" (*ptr__)           \
+               : [val__] "d" (val__)                                   \
+               : "cc");                                                \
+-      preempt_enable();                                               \
++      preempt_enable_notrace();                                               \
+       old__ + val__;                                                  \
+ })
+@@ -114,14 +114,14 @@
+       typedef typeof(pcp) pcp_op_T__;                                 \
+       pcp_op_T__ val__ = (val);                                       \
+       pcp_op_T__ old__, *ptr__;                                       \
+-      preempt_disable();                                              \
++      preempt_disable_notrace();                                      \
+       ptr__ = raw_cpu_ptr(&(pcp));                                    \
+       asm volatile(                                                   \
+               op "    %[old__],%[val__],%[ptr__]\n"                   \
+               : [old__] "=d" (old__), [ptr__] "+Q" (*ptr__)           \
+               : [val__] "d" (val__)                                   \
+               : "cc");                                                \
+-      preempt_enable();                                               \
++      preempt_enable_notrace();                                       \
+ }
+ #define this_cpu_and_4(pcp, val)      arch_this_cpu_to_op(pcp, val, "lan")
+@@ -136,10 +136,10 @@
+       typedef typeof(pcp) pcp_op_T__;                                 \
+       pcp_op_T__ ret__;                                               \
+       pcp_op_T__ *ptr__;                                              \
+-      preempt_disable();                                              \
++      preempt_disable_notrace();                                      \
+       ptr__ = raw_cpu_ptr(&(pcp));                                    \
+       ret__ = cmpxchg(ptr__, oval, nval);                             \
+-      preempt_enable();                                               \
++      preempt_enable_notrace();                                       \
+       ret__;                                                          \
+ })
+@@ -152,10 +152,10 @@
+ ({                                                                    \
+       typeof(pcp) *ptr__;                                             \
+       typeof(pcp) ret__;                                              \
+-      preempt_disable();                                              \
++      preempt_disable_notrace();                                      \
+       ptr__ = raw_cpu_ptr(&(pcp));                                    \
+       ret__ = xchg(ptr__, nval);                                      \
+-      preempt_enable();                                               \
++      preempt_enable_notrace();                                       \
+       ret__;                                                          \
+ })
+@@ -171,11 +171,11 @@
+       typeof(pcp1) *p1__;                                             \
+       typeof(pcp2) *p2__;                                             \
+       int ret__;                                                      \
+-      preempt_disable();                                              \
++      preempt_disable_notrace();                                      \
+       p1__ = raw_cpu_ptr(&(pcp1));                                    \
+       p2__ = raw_cpu_ptr(&(pcp2));                                    \
+       ret__ = __cmpxchg_double(p1__, p2__, o1__, o2__, n1__, n2__);   \
+-      preempt_enable();                                               \
++      preempt_enable_notrace();                                       \
+       ret__;                                                          \
+ })
+-- 
+2.25.1
+
index 079a4e651654d9e65b32fc4631e86e1312577dae..8d3cd9b627f3775e30988cf117dd2c562b669e27 100644 (file)
@@ -1,3 +1,10 @@
 hid-core-correctly-handle-reportsize-being-zero.patch
 hid-core-sanitize-event-code-and-type-when-mapping-input.patch
 perf-record-stat-explicitly-call-out-event-modifiers-in-the-documentation.patch
+drm-msm-add-shutdown-support-for-display-platform_dr.patch
+hwmon-applesmc-check-status-earlier.patch
+nvmet-disable-keep-alive-timer-when-kato-is-cleared-.patch
+ceph-don-t-allow-setlease-on-cephfs.patch
+cpuidle-fixup-irq-state.patch
+s390-don-t-trace-preemption-in-percpu-macros.patch
+xen-xenbus-fix-granting-of-vmalloc-d-memory.patch
diff --git a/queue-4.14/xen-xenbus-fix-granting-of-vmalloc-d-memory.patch b/queue-4.14/xen-xenbus-fix-granting-of-vmalloc-d-memory.patch
new file mode 100644 (file)
index 0000000..38a2367
--- /dev/null
@@ -0,0 +1,47 @@
+From a78c94e4a65aef5cd1958015895743fd06952229 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 25 Aug 2020 11:31:52 +0200
+Subject: xen/xenbus: Fix granting of vmalloc'd memory
+
+From: Simon Leiner <simon@leiner.me>
+
+[ Upstream commit d742db70033c745e410523e00522ee0cfe2aa416 ]
+
+On some architectures (like ARM), virt_to_gfn cannot be used for
+vmalloc'd memory because of its reliance on virt_to_phys. This patch
+introduces a check for vmalloc'd addresses and obtains the PFN using
+vmalloc_to_pfn in that case.
+
+Signed-off-by: Simon Leiner <simon@leiner.me>
+Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
+Link: https://lore.kernel.org/r/20200825093153.35500-1-simon@leiner.me
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/xen/xenbus/xenbus_client.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
+index e94a61eaeceb0..f7b553faadb10 100644
+--- a/drivers/xen/xenbus/xenbus_client.c
++++ b/drivers/xen/xenbus/xenbus_client.c
+@@ -365,8 +365,14 @@ int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr,
+       int i, j;
+       for (i = 0; i < nr_pages; i++) {
+-              err = gnttab_grant_foreign_access(dev->otherend_id,
+-                                                virt_to_gfn(vaddr), 0);
++              unsigned long gfn;
++
++              if (is_vmalloc_addr(vaddr))
++                      gfn = pfn_to_gfn(vmalloc_to_pfn(vaddr));
++              else
++                      gfn = virt_to_gfn(vaddr);
++
++              err = gnttab_grant_foreign_access(dev->otherend_id, gfn, 0);
+               if (err < 0) {
+                       xenbus_dev_fatal(dev, err,
+                                        "granting access to ring page");
+-- 
+2.25.1
+