summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0143-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0143-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch')
-rw-r--r--debian/patches-rt/0143-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/debian/patches-rt/0143-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches-rt/0143-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch
new file mode 100644
index 000000000..c9ae6c6ea
--- /dev/null
+++ b/debian/patches-rt/0143-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch
@@ -0,0 +1,60 @@
+From 088c483f549f48ccd41c075dc8111ed7c2826a87 Mon Sep 17 00:00:00 2001
+From: Josh Cartwright <joshc@ni.com>
+Date: Thu, 11 Feb 2016 11:54:01 -0600
+Subject: [PATCH 143/158] KVM: arm/arm64: downgrade preempt_disable()d region
+ to migrate_disable()
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.15/older/patches-5.15.10-rt24.tar.xz
+
+kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating
+the vgic and timer states to prevent the calling task from migrating to
+another CPU. It does so to prevent the task from writing to the
+incorrect per-CPU GIC distributor registers.
+
+On -rt kernels, it's possible to maintain the same guarantee with the
+use of migrate_{disable,enable}(), with the added benefit that the
+migrate-disabled region is preemptible. Update
+kvm_arch_vcpu_ioctl_run() to do so.
+
+Cc: Christoffer Dall <christoffer.dall@linaro.org>
+Reported-by: Manish Jaggi <Manish.Jaggi@caviumnetworks.com>
+Signed-off-by: Josh Cartwright <joshc@ni.com>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+---
+ arch/arm64/kvm/arm.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
+index 9b328bb05596..12b29d851012 100644
+--- a/arch/arm64/kvm/arm.c
++++ b/arch/arm64/kvm/arm.c
+@@ -811,7 +811,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
+ * involves poking the GIC, which must be done in a
+ * non-preemptible context.
+ */
+- preempt_disable();
++ migrate_disable();
+
+ kvm_pmu_flush_hwstate(vcpu);
+
+@@ -835,7 +835,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
+ kvm_timer_sync_user(vcpu);
+ kvm_vgic_sync_hwstate(vcpu);
+ local_irq_enable();
+- preempt_enable();
++ migrate_enable();
+ continue;
+ }
+
+@@ -907,7 +907,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
+ /* Exit types that need handling before we can be preempted */
+ handle_exit_early(vcpu, ret);
+
+- preempt_enable();
++ migrate_enable();
+
+ /*
+ * The ARMv8 architecture doesn't give the hypervisor
+--
+2.33.1
+