Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-03-31 15:05:34 +0200
committerTakashi Iwai <tiwai@suse.de>2017-03-31 15:05:34 +0200
commit8874b7e27e61717495a71e3983288780df8d9c98 (patch)
tree2aa3020dca5ee2ee4cf1e895c3a95044e72d0d74
parent49dbbbdab696895bb3958b46aa981f807399d0e0 (diff)
parent983ce0916a772ecc878cdf8708021d7ac97a0a50 (diff)
Merge branch 'users/ykaukab/SLE12-SP3/for-next' into SLE12-SP3rpm-4.4.57-2
Pull arm64 updates from Mian Yousaf Kaukab (fate#320512).
-rw-r--r--patches.drivers/0010-arm64-fix-KASLR-boot-time-I-cache-maintenance.patch53
-rw-r--r--patches.drivers/0011-arm64-avoid-TLB-conflict-with-CONFIG_RANDOMIZE_BASE.patch49
-rw-r--r--patches.drivers/0012-KVM-arm-arm64-vgic-Don-t-flush-sync-without-a-workin.patch53
-rw-r--r--patches.drivers/0013-arm64-kaslr-fix-breakage-with-CONFIG_MODVERSIONS-y.patch52
-rw-r--r--patches.drivers/0014-KVM-arm-arm64-vgic-Don-t-notify-EOI-for-non-SPIs.patch69
-rw-r--r--patches.drivers/0015-arm64-remove-wrong-CONFIG_PROC_SYSCTL-ifdef.patch48
-rw-r--r--patches.drivers/0016-arm64-kaslr-Fix-up-the-kernel-image-alignment.patch86
-rw-r--r--patches.drivers/0017-arm64-kernel-Fix-unmasked-debug-exceptions-when-rest.patch55
-rw-r--r--patches.drivers/0018-ACPI-IORT-Fix-the-error-return-code-in-iort_add_smmu.patch42
-rw-r--r--patches.drivers/0019-iommu-Disambiguate-MSI-region-types.patch203
-rw-r--r--patches.drivers/0020-genirq-Dont-allow-affinity-mask-to-be-updated-on-IPI.patch50
-rw-r--r--patches.drivers/0021-genirq-Fix-missing-return-value-in-irq_destroy_ipi.patch45
-rw-r--r--patches.drivers/0022-init-Kconfig-keep-Expert-users-menu-together.patch42
-rw-r--r--patches.drivers/0023-Documentation-watchdog-check-return-value-for-magic-.patch81
-rw-r--r--patches.drivers/0024-vfio-Fix-handling-of-error-returned-by-vfio_group_ge.patch54
-rw-r--r--series.conf15
16 files changed, 997 insertions, 0 deletions
diff --git a/patches.drivers/0010-arm64-fix-KASLR-boot-time-I-cache-maintenance.patch b/patches.drivers/0010-arm64-fix-KASLR-boot-time-I-cache-maintenance.patch
new file mode 100644
index 0000000000..74940973bc
--- /dev/null
+++ b/patches.drivers/0010-arm64-fix-KASLR-boot-time-I-cache-maintenance.patch
@@ -0,0 +1,53 @@
+From 457696f3884146bb0f4b3a5f8776c6e4079f72b7 Mon Sep 17 00:00:00 2001
+From: Mark Rutland <mark.rutland@arm.com>
+Date: Tue, 15 Mar 2016 11:22:57 +0000
+Subject: [PATCH 10/17] arm64: fix KASLR boot-time I-cache maintenance
+
+Git-commit: b90b4a608ea2401cc491828f7a385edd2e236e37
+Patch-mainline: v4.6-rc1
+References: fate#320512
+
+Commit f80fb3a3d50843a4 ("arm64: add support for kernel ASLR") missed a
+DSB necessary to complete I-cache maintenance in the primary boot path,
+and hence stale instructions may still be present in the I-cache and may
+be executed until the I-cache maintenance naturally completes.
+
+Since commit 8ec41987436d566f ("arm64: mm: ensure patched kernel text is
+fetched from PoU"), all CPUs invalidate their I-caches after their MMU
+is enabled. Prior a CPU's MMU having been enabled, arbitrary lines may
+have been fetched from the PoC into I-caches. We never patch text
+expected to be executed with the MMU off. Thus, it is unnecessary to
+perform broadcast I-cache maintenance in the primary boot path.
+
+This patch reduces the scope of the I-cache maintenance to the local
+CPU, and adds the missing DSB with similar scope, matching prior
+maintenance in the primary boot path.
+
+Signed-off-by: Mark Rutland <mark.rutland@arm.com>
+Acked-by: Ard Biesehvuel <ard.biesheuvel@linaro.org>
+Cc: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ arch/arm64/kernel/head.S | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
+index 7e1b34b88ec9..1ab59b84d8dd 100644
+--- a/arch/arm64/kernel/head.S
++++ b/arch/arm64/kernel/head.S
+@@ -768,8 +768,9 @@ ENTRY(__enable_mmu)
+
+ msr sctlr_el1, x19 // re-enable the MMU
+ isb
+- ic ialluis // flush instructions fetched
+- isb // via old mapping
++ ic iallu // flush instructions fetched
++ dsb nsh // via old mapping
++ isb
+ add x27, x27, x23 // relocated __mmap_switched
+ #endif
+ br x27
+--
+2.11.0
+
diff --git a/patches.drivers/0011-arm64-avoid-TLB-conflict-with-CONFIG_RANDOMIZE_BASE.patch b/patches.drivers/0011-arm64-avoid-TLB-conflict-with-CONFIG_RANDOMIZE_BASE.patch
new file mode 100644
index 0000000000..96aa500fbb
--- /dev/null
+++ b/patches.drivers/0011-arm64-avoid-TLB-conflict-with-CONFIG_RANDOMIZE_BASE.patch
@@ -0,0 +1,49 @@
+From 233185ed6c98f61cedcf2306efa663e5bbf29362 Mon Sep 17 00:00:00 2001
+From: Mark Rutland <mark.rutland@arm.com>
+Date: Wed, 24 Aug 2016 18:02:08 +0100
+Subject: [PATCH 11/17] arm64: avoid TLB conflict with CONFIG_RANDOMIZE_BASE
+
+Git-commit: fd363bd417ddb6103564c69cfcbd92d9a7877431
+Patch-mainline: v4.8-rc4
+References: fate#320512
+
+When CONFIG_RANDOMIZE_BASE is selected, we modify the page tables to remap the
+kernel at a newly-chosen VA range. We do this with the MMU disabled, but do not
+invalidate TLBs prior to re-enabling the MMU with the new tables. Thus the old
+mappings entries may still live in TLBs, and we risk violating
+Break-Before-Make requirements, leading to TLB conflicts and/or other issues.
+
+We invalidate TLBs when we uninsall the idmap in early setup code, but prior to
+this we are subject to issues relating to the Break-Before-Make violation.
+
+Avoid these issues by invalidating the TLBs before the new mappings can be
+used by the hardware.
+
+Fixes: f80fb3a3d508 ("arm64: add support for kernel ASLR")
+Cc: <stable@vger.kernel.org> # 4.6+
+Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Acked-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Mark Rutland <mark.rutland@arm.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ arch/arm64/kernel/head.S | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
+index 1ab59b84d8dd..361a24accf45 100644
+--- a/arch/arm64/kernel/head.S
++++ b/arch/arm64/kernel/head.S
+@@ -766,6 +766,9 @@ ENTRY(__enable_mmu)
+ isb
+ bl __create_page_tables // recreate kernel mapping
+
++ tlbi vmalle1 // Remove any stale TLB entries
++ dsb nsh
++
+ msr sctlr_el1, x19 // re-enable the MMU
+ isb
+ ic iallu // flush instructions fetched
+--
+2.11.0
+
diff --git a/patches.drivers/0012-KVM-arm-arm64-vgic-Don-t-flush-sync-without-a-workin.patch b/patches.drivers/0012-KVM-arm-arm64-vgic-Don-t-flush-sync-without-a-workin.patch
new file mode 100644
index 0000000000..ebcf33d249
--- /dev/null
+++ b/patches.drivers/0012-KVM-arm-arm64-vgic-Don-t-flush-sync-without-a-workin.patch
@@ -0,0 +1,53 @@
+From e83bf67fc15353a5e38ae6850e376ed2efa1652c Mon Sep 17 00:00:00 2001
+From: Christoffer Dall <christoffer.dall@linaro.org>
+Date: Tue, 27 Sep 2016 18:53:35 +0200
+Subject: [PATCH 12/17] KVM: arm/arm64: vgic: Don't flush/sync without a
+ working vgic
+
+Git-commit: 0099b7701f5296a758d9e6b945ec96f96847cc2f
+Patch-mainline: v4.9-rc1
+References: fate#320512
+
+If the vgic hasn't been created and initialized, we shouldn't attempt to
+look at its data structures or flush/sync anything to the GIC hardware.
+
+This fixes an issue reported by Alexander Graf when using a userspace
+irqchip.
+
+Fixes: 0919e84c0fc1 ("KVM: arm/arm64: vgic-new: Add IRQ sync/flush framework")
+Cc: stable@vger.kernel.org
+Reported-by: Alexander Graf <agraf@suse.de>
+Acked-by: Marc Zyngier <marc.zyngier@arm.com>
+Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ virt/kvm/arm/vgic/vgic.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c
+index e83b7fe4baae..b465ac6d5d48 100644
+--- a/virt/kvm/arm/vgic/vgic.c
++++ b/virt/kvm/arm/vgic/vgic.c
+@@ -645,6 +645,9 @@ next:
+ /* Sync back the hardware VGIC state into our emulation after a guest's run. */
+ void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu)
+ {
++ if (unlikely(!vgic_initialized(vcpu->kvm)))
++ return;
++
+ vgic_process_maintenance_interrupt(vcpu);
+ vgic_fold_lr_state(vcpu);
+ vgic_prune_ap_list(vcpu);
+@@ -653,6 +656,9 @@ void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu)
+ /* Flush our emulation state into the GIC hardware before entering the guest. */
+ void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu)
+ {
++ if (unlikely(!vgic_initialized(vcpu->kvm)))
++ return;
++
+ spin_lock(&vcpu->arch.vgic_cpu.ap_list_lock);
+ vgic_flush_lr_state(vcpu);
+ spin_unlock(&vcpu->arch.vgic_cpu.ap_list_lock);
+--
+2.11.0
+
diff --git a/patches.drivers/0013-arm64-kaslr-fix-breakage-with-CONFIG_MODVERSIONS-y.patch b/patches.drivers/0013-arm64-kaslr-fix-breakage-with-CONFIG_MODVERSIONS-y.patch
new file mode 100644
index 0000000000..3adc4abec6
--- /dev/null
+++ b/patches.drivers/0013-arm64-kaslr-fix-breakage-with-CONFIG_MODVERSIONS-y.patch
@@ -0,0 +1,52 @@
+From 22ea2b4f366164019478a0a14e6d95ad498d5c77 Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Date: Thu, 13 Oct 2016 17:42:09 +0100
+Subject: [PATCH 13/17] arm64: kaslr: fix breakage with CONFIG_MODVERSIONS=y
+
+Git-commit: 9c0e83c371cf4696926c95f9c8c77cd6ea803426
+Patch-mainline: v4.9-rc2
+References: fate#320512
+
+As it turns out, the KASLR code breaks CONFIG_MODVERSIONS, since the
+kcrctab has an absolute address field that is relocated at runtime
+when the kernel offset is randomized.
+
+This has been fixed already for PowerPC in the past, so simply wire up
+the existing code dealing with this issue.
+
+Cc: <stable@vger.kernel.org>
+Fixes: f80fb3a3d508 ("arm64: add support for kernel ASLR")
+Tested-by: Timur Tabi <timur@codeaurora.org>
+Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ arch/arm64/include/asm/module.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/arch/arm64/include/asm/module.h b/arch/arm64/include/asm/module.h
+index e12af6754634..06ff7fd9e81f 100644
+--- a/arch/arm64/include/asm/module.h
++++ b/arch/arm64/include/asm/module.h
+@@ -17,6 +17,7 @@
+ #define __ASM_MODULE_H
+
+ #include <asm-generic/module.h>
++#include <asm/memory.h>
+
+ #define MODULE_ARCH_VERMAGIC "aarch64"
+
+@@ -32,6 +33,10 @@ u64 module_emit_plt_entry(struct module *mod, const Elf64_Rela *rela,
+ Elf64_Sym *sym);
+
+ #ifdef CONFIG_RANDOMIZE_BASE
++#ifdef CONFIG_MODVERSIONS
++#define ARCH_RELOCATES_KCRCTAB
++#define reloc_start (kimage_vaddr - KIMAGE_VADDR)
++#endif
+ extern u64 module_alloc_base;
+ #else
+ #define module_alloc_base ((u64)_etext - MODULES_VSIZE)
+--
+2.11.0
+
diff --git a/patches.drivers/0014-KVM-arm-arm64-vgic-Don-t-notify-EOI-for-non-SPIs.patch b/patches.drivers/0014-KVM-arm-arm64-vgic-Don-t-notify-EOI-for-non-SPIs.patch
new file mode 100644
index 0000000000..0802cc3b50
--- /dev/null
+++ b/patches.drivers/0014-KVM-arm-arm64-vgic-Don-t-notify-EOI-for-non-SPIs.patch
@@ -0,0 +1,69 @@
+From afc0ec2ac766a86cb780dd2956306d3fb65c488c Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Wed, 23 Nov 2016 10:11:21 +0000
+Subject: [PATCH 14/17] KVM: arm/arm64: vgic: Don't notify EOI for non-SPIs
+
+Git-commit: 8ca18eec2b2276b449c1dc86b98bf083c5fe4e09
+Patch-mainline: v4.9-rc8
+References: fate#320512
+
+When we inject a level triggerered interrupt (and unless it
+is backed by the physical distributor - timer style), we request
+a maintenance interrupt. Part of the processing for that interrupt
+is to feed to the rest of KVM (and to the eventfd subsystem) the
+information that the interrupt has been EOIed.
+
+But that notification only makes sense for SPIs, and not PPIs
+(such as the PMU interrupt). Skip over the notification if
+the interrupt is not an SPI.
+
+Cc: stable@vger.kernel.org # 4.7+
+Fixes: 140b086dd197 ("KVM: arm/arm64: vgic-new: Add GICv2 world switch backend")
+Fixes: 59529f69f504 ("KVM: arm/arm64: vgic-new: Add GICv3 world switch backend")
+Reported-by: Catalin Marinas <catalin.marinas@arm.com>
+Tested-by: Catalin Marinas <catalin.marinas@arm.com>
+Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ virt/kvm/arm/vgic/vgic-v2.c | 6 ++++--
+ virt/kvm/arm/vgic/vgic-v3.c | 6 ++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/virt/kvm/arm/vgic/vgic-v2.c b/virt/kvm/arm/vgic/vgic-v2.c
+index 0bf6709d1006..6fb4314cec49 100644
+--- a/virt/kvm/arm/vgic/vgic-v2.c
++++ b/virt/kvm/arm/vgic/vgic-v2.c
+@@ -50,8 +50,10 @@ void vgic_v2_process_maintenance(struct kvm_vcpu *vcpu)
+
+ WARN_ON(cpuif->vgic_lr[lr] & GICH_LR_STATE);
+
+- kvm_notify_acked_irq(vcpu->kvm, 0,
+- intid - VGIC_NR_PRIVATE_IRQS);
++ /* Only SPIs require notification */
++ if (vgic_valid_spi(vcpu->kvm, intid))
++ kvm_notify_acked_irq(vcpu->kvm, 0,
++ intid - VGIC_NR_PRIVATE_IRQS);
+ }
+ }
+
+diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c
+index 9f0dae397d9c..5c9f9745e6ca 100644
+--- a/virt/kvm/arm/vgic/vgic-v3.c
++++ b/virt/kvm/arm/vgic/vgic-v3.c
+@@ -41,8 +41,10 @@ void vgic_v3_process_maintenance(struct kvm_vcpu *vcpu)
+
+ WARN_ON(cpuif->vgic_lr[lr] & ICH_LR_STATE);
+
+- kvm_notify_acked_irq(vcpu->kvm, 0,
+- intid - VGIC_NR_PRIVATE_IRQS);
++ /* Only SPIs require notification */
++ if (vgic_valid_spi(vcpu->kvm, intid))
++ kvm_notify_acked_irq(vcpu->kvm, 0,
++ intid - VGIC_NR_PRIVATE_IRQS);
+ }
+
+ /*
+--
+2.11.0
+
diff --git a/patches.drivers/0015-arm64-remove-wrong-CONFIG_PROC_SYSCTL-ifdef.patch b/patches.drivers/0015-arm64-remove-wrong-CONFIG_PROC_SYSCTL-ifdef.patch
new file mode 100644
index 0000000000..4f900805a2
--- /dev/null
+++ b/patches.drivers/0015-arm64-remove-wrong-CONFIG_PROC_SYSCTL-ifdef.patch
@@ -0,0 +1,48 @@
+From cd35d6d9ce4e71442a8df1e42a5ed51d470da51e Mon Sep 17 00:00:00 2001
+From: Juri Lelli <juri.lelli@arm.com>
+Date: Mon, 6 Feb 2017 16:00:09 +0000
+Subject: [PATCH 15/17] arm64: remove wrong CONFIG_PROC_SYSCTL ifdef
+
+Git-commit: fe0a7ef74d1f65b86820a54636323df2b31e0c3f
+Patch-mainline: v4.11-rc1
+References: fate#320512
+
+The sysfs cpu_capacity entry for each CPU has nothing to do with
+PROC_FS, nor it's in /proc/sys path.
+
+Remove such ifdef.
+
+Cc: Will Deacon <will.deacon@arm.com>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Reported-and-suggested-by: Sudeep Holla <sudeep.holla@arm.com>
+Fixes: be8f185d8af4 ('arm64: add sysfs cpu_capacity attribute')
+Signed-off-by: Juri Lelli <juri.lelli@arm.com>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ arch/arm64/kernel/topology.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
+index 655e65f38f31..565dd69888cc 100644
+--- a/arch/arm64/kernel/topology.c
++++ b/arch/arm64/kernel/topology.c
+@@ -41,7 +41,6 @@ static void set_capacity_scale(unsigned int cpu, unsigned long capacity)
+ per_cpu(cpu_scale, cpu) = capacity;
+ }
+
+-#ifdef CONFIG_PROC_SYSCTL
+ static ssize_t cpu_capacity_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+@@ -98,7 +97,6 @@ static int register_cpu_capacity_sysctl(void)
+ return 0;
+ }
+ subsys_initcall(register_cpu_capacity_sysctl);
+-#endif
+
+ static u32 capacity_scale;
+ static u32 *raw_capacity;
+--
+2.11.0
+
diff --git a/patches.drivers/0016-arm64-kaslr-Fix-up-the-kernel-image-alignment.patch b/patches.drivers/0016-arm64-kaslr-Fix-up-the-kernel-image-alignment.patch
new file mode 100644
index 0000000000..01d5e4c1b5
--- /dev/null
+++ b/patches.drivers/0016-arm64-kaslr-Fix-up-the-kernel-image-alignment.patch
@@ -0,0 +1,86 @@
+From c3a1e5574527278cc0386d4f1c1320a7c0308b6e Mon Sep 17 00:00:00 2001
+From: Neeraj Upadhyay <neeraju@codeaurora.org>
+Date: Wed, 22 Mar 2017 17:08:25 +0530
+Subject: [PATCH 16/17] arm64: kaslr: Fix up the kernel image alignment
+
+Git-commit: afd0e5a876703accb95894f23317a13e2c49b523
+Patch-mainline: v4.11-rc4
+References: fate#320512
+
+If kernel image extends across alignment boundary, existing
+code increases the KASLR offset by size of kernel image. The
+offset is masked after resizing. There are cases, where after
+masking, we may still have kernel image extending across
+boundary. This eventually results in only 2MB block getting
+mapped while creating the page tables. This results in data aborts
+while accessing unmapped regions during second relocation (with
+kaslr offset) in __primary_switch. To fix this problem, round up the
+kernel image size, by swapper block size, before adding it for
+correction.
+
+For example consider below case, where kernel image still crosses
+1GB alignment boundary, after masking the offset, which is fixed
+by rounding up kernel image size.
+
+SWAPPER_TABLE_SHIFT = 30
+Swapper using section maps with section size 2MB.
+CONFIG_PGTABLE_LEVELS = 3
+VA_BITS = 39
+
+_text : 0xffffff8008080000
+_end : 0xffffff800aa1b000
+offset : 0x1f35600000
+mask = ((1UL << (VA_BITS - 2)) - 1) & ~(SZ_2M - 1)
+
+(_text + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7c
+(_end + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7d
+
+offset after existing correction (before mask) = 0x1f37f9b000
+(_text + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7d
+(_end + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7d
+
+offset (after mask) = 0x1f37e00000
+(_text + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7c
+(_end + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7d
+
+new offset w/ rounding up = 0x1f38000000
+(_text + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7d
+(_end + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7d
+
+Fixes: f80fb3a3d508 ("arm64: add support for kernel ASLR")
+Cc: <stable@vger.kernel.org>
+Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
+Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ arch/arm64/kernel/kaslr.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c
+index 8b32a1f8f09f..0efbf1f9b577 100644
+--- a/arch/arm64/kernel/kaslr.c
++++ b/arch/arm64/kernel/kaslr.c
+@@ -126,11 +126,15 @@ u64 __init kaslr_early_init(u64 dt_phys)
+ /*
+ * The kernel Image should not extend across a 1GB/32MB/512MB alignment
+ * boundary (for 4KB/16KB/64KB granule kernels, respectively). If this
+- * happens, increase the KASLR offset by the size of the kernel image.
++ * happens, increase the KASLR offset by the size of the kernel image
++ * rounded up by SWAPPER_BLOCK_SIZE.
+ */
+ if ((((u64)_text + offset) >> SWAPPER_TABLE_SHIFT) !=
+- (((u64)_end + offset) >> SWAPPER_TABLE_SHIFT))
+- offset = (offset + (u64)(_end - _text)) & mask;
++ (((u64)_end + offset + modulo_offset) >> SWAPPER_TABLE_SHIFT)) {
++ u64 kimg_sz = _end - _text;
++ offset = (offset + round_up(kimg_sz, SWAPPER_BLOCK_SIZE))
++ & mask;
++ }
+
+ if (IS_ENABLED(CONFIG_KASAN))
+ /*
+--
+2.11.0
+
diff --git a/patches.drivers/0017-arm64-kernel-Fix-unmasked-debug-exceptions-when-rest.patch b/patches.drivers/0017-arm64-kernel-Fix-unmasked-debug-exceptions-when-rest.patch
new file mode 100644
index 0000000000..eaebaf7417
--- /dev/null
+++ b/patches.drivers/0017-arm64-kernel-Fix-unmasked-debug-exceptions-when-rest.patch
@@ -0,0 +1,55 @@
+From 887da8abe5dc4d4077fb6f246367d2241ab13b6f Mon Sep 17 00:00:00 2001
+From: James Morse <james.morse@arm.com>
+Date: Fri, 26 Aug 2016 16:03:42 +0100
+Subject: [PATCH 17/17] arm64: kernel: Fix unmasked debug exceptions when
+ restoring mdscr_el1
+
+Git-commit: 744c6c37cc18705d19e179622f927f5b781fe9cc
+Patch-mainline: v4.8-rc5
+References: fate#320512
+
+Changes to make the resume from cpu_suspend() code behave more like
+secondary boot caused debug exceptions to be unmasked early by
+__cpu_setup(). We then go on to restore mdscr_el1 in cpu_do_resume(),
+potentially taking break or watch points based on uninitialised registers.
+
+Mask debug exceptions in cpu_do_resume(), which is specific to resume
+from cpu_suspend(). Debug exceptions will be restored to their original
+state by local_dbg_restore() in cpu_suspend(), which runs after
+hw_breakpoint_restore() has re-initialised the other registers.
+
+Reported-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Fixes: cabe1c81ea5b ("arm64: Change cpu_resume() to enable mmu early then access sleep_sp by va")
+Cc: <stable@vger.kernel.org> # 4.7+
+Signed-off-by: James Morse <james.morse@arm.com>
+Acked-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ arch/arm64/mm/proc.S | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
+index 55a7664956ea..44a26b870302 100644
+--- a/arch/arm64/mm/proc.S
++++ b/arch/arm64/mm/proc.S
+@@ -102,7 +102,16 @@ ENTRY(cpu_do_resume)
+
+ msr tcr_el1, x8
+ msr vbar_el1, x9
++
++ /*
++ * __cpu_setup() cleared MDSCR_EL1.MDE and friends, before unmasking
++ * debug exceptions. By restoring MDSCR_EL1 here, we may take a debug
++ * exception. Mask them until local_dbg_restore() in cpu_suspend()
++ * resets them.
++ */
++ disable_dbg
+ msr mdscr_el1, x10
++
+ msr sctlr_el1, x12
+ /*
+ * Restore oslsr_el1 by writing oslar_el1
+--
+2.11.0
+
diff --git a/patches.drivers/0018-ACPI-IORT-Fix-the-error-return-code-in-iort_add_smmu.patch b/patches.drivers/0018-ACPI-IORT-Fix-the-error-return-code-in-iort_add_smmu.patch
new file mode 100644
index 0000000000..6eefd37d4a
--- /dev/null
+++ b/patches.drivers/0018-ACPI-IORT-Fix-the-error-return-code-in-iort_add_smmu.patch
@@ -0,0 +1,42 @@
+From 32407e3d61223d16c6cd9597494ce428e25efd98 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Tue, 17 Jan 2017 16:36:23 +0300
+Subject: [PATCH 18/23] ACPI/IORT: Fix the error return code in
+ iort_add_smmu_platform_device()
+
+Git-commit: 5e5afa6cbdae5cc2ceda232a68a9ddc943d1d5ce
+Patch-mainline: v4.11-rc1
+References: fate#320512
+
+The function iort_add_smmu_platform_device() accidentally returns 0
+(ie PTR_ERR(pdev) where pdev == NULL) if platform_device_alloc() fails;
+fix the bug by returning a proper error value.
+
+Fixes: 846f0e9e74a0 ("ACPI/IORT: Add support for ARM SMMU platform devices creation")
+Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+[lorenzo.pieralisi@arm.com: improved commit log]
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/acpi/arm64/iort.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
+index 95d64a327db0..7e8c466ea49d 100644
+--- a/drivers/acpi/arm64/iort.c
++++ b/drivers/acpi/arm64/iort.c
+@@ -924,7 +924,7 @@ static int __init iort_add_smmu_platform_device(struct acpi_iort_node *node)
+
+ pdev = platform_device_alloc(ops->name, PLATFORM_DEVID_AUTO);
+ if (!pdev)
+- return PTR_ERR(pdev);
++ return -ENOMEM;
+
+ count = ops->iommu_count_resources(node);
+
+--
+2.11.0
+
diff --git a/patches.drivers/0019-iommu-Disambiguate-MSI-region-types.patch b/patches.drivers/0019-iommu-Disambiguate-MSI-region-types.patch
new file mode 100644
index 0000000000..1e4964ef59
--- /dev/null
+++ b/patches.drivers/0019-iommu-Disambiguate-MSI-region-types.patch
@@ -0,0 +1,203 @@
+From fbe630f48acf9a321b9b590a8db8d007a4e0c6f3 Mon Sep 17 00:00:00 2001
+From: Robin Murphy <robin.murphy@arm.com>
+Date: Thu, 16 Mar 2017 17:00:16 +0000
+Subject: [PATCH 19/23] iommu: Disambiguate MSI region types
+
+Git-commit: 9d3a4de4cb8db8e71730e36736272ef041836f68
+Patch-mainline: v4.11-rc4
+References: fate#320512
+
+The introduction of reserved regions has left a couple of rough edges
+which we could do with sorting out sooner rather than later. Since we
+are not yet addressing the potential dynamic aspect of software-managed
+reservations and presenting them at arbitrary fixed addresses, it is
+incongruous that we end up displaying hardware vs. software-managed MSI
+regions to userspace differently, especially since ARM-based systems may
+actually require one or the other, or even potentially both at once,
+(which iommu-dma currently has no hope of dealing with at all). Let's
+resolve the former user-visible inconsistency ASAP before the ABI has
+been baked into a kernel release, in a way that also lays the groundwork
+for the latter shortcoming to be addressed by follow-up patches.
+
+For clarity, rename the software-managed type to IOMMU_RESV_SW_MSI, use
+IOMMU_RESV_MSI to describe the hardware type, and document everything a
+little bit. Since the x86 MSI remapping hardware falls squarely under
+this meaning of IOMMU_RESV_MSI, apply that type to their regions as well,
+so that we tell the same story to userspace across all platforms.
+
+Secondly, as the various region types require quite different handling,
+and it really makes little sense to ever try combining them, convert the
+bitfield-esque #defines to a plain enum in the process before anyone
+gets the wrong impression.
+
+Fixes: d30ddcaa7b02 ("iommu: Add a new type field in iommu_resv_region")
+Reviewed-by: Eric Auger <eric.auger@redhat.com>
+CC: Alex Williamson <alex.williamson@redhat.com>
+CC: David Woodhouse <dwmw2@infradead.org>
+CC: kvm@vger.kernel.org
+Signed-off-by: Robin Murphy <robin.murphy@arm.com>
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/iommu/amd_iommu.c | 2 +-
+ drivers/iommu/arm-smmu-v3.c | 2 +-
+ drivers/iommu/arm-smmu.c | 2 +-
+ drivers/iommu/intel-iommu.c | 2 +-
+ drivers/iommu/iommu.c | 5 +++--
+ drivers/vfio/vfio_iommu_type1.c | 7 +++----
+ include/linux/iommu.h | 18 +++++++++++++-----
+ 7 files changed, 23 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
+index a6ecd805f721..5eccfdb69a99 100644
+--- a/drivers/iommu/amd_iommu.c
++++ b/drivers/iommu/amd_iommu.c
+@@ -3175,7 +3175,7 @@ static void amd_iommu_get_resv_regions(struct device *dev,
+
+ region = iommu_alloc_resv_region(MSI_RANGE_START,
+ MSI_RANGE_END - MSI_RANGE_START + 1,
+- 0, IOMMU_RESV_RESERVED);
++ 0, IOMMU_RESV_MSI);
+ if (!region)
+ return;
+ list_add_tail(&region->list, head);
+diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
+index cb4b04579199..279f634a1d84 100644
+--- a/drivers/iommu/arm-smmu-v3.c
++++ b/drivers/iommu/arm-smmu-v3.c
+@@ -1886,7 +1886,7 @@ static void arm_smmu_get_resv_regions(struct device *dev,
+ int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
+
+ region = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH,
+- prot, IOMMU_RESV_MSI);
++ prot, IOMMU_RESV_SW_MSI);
+ if (!region)
+ return;
+
+diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
+index a975627346e8..b84eed2e285a 100644
+--- a/drivers/iommu/arm-smmu.c
++++ b/drivers/iommu/arm-smmu.c
+@@ -1596,7 +1596,7 @@ static void arm_smmu_get_resv_regions(struct device *dev,
+ int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
+
+ region = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH,
+- prot, IOMMU_RESV_MSI);
++ prot, IOMMU_RESV_SW_MSI);
+ if (!region)
+ return;
+
+diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
+index b5a3b8ce40b5..2232ac7f8059 100644
+--- a/drivers/iommu/intel-iommu.c
++++ b/drivers/iommu/intel-iommu.c
+@@ -5269,7 +5269,7 @@ static void intel_iommu_get_resv_regions(struct device *device,
+
+ reg = iommu_alloc_resv_region(IOAPIC_RANGE_START,
+ IOAPIC_RANGE_END - IOAPIC_RANGE_START + 1,
+- 0, IOMMU_RESV_RESERVED);
++ 0, IOMMU_RESV_MSI);
+ if (!reg)
+ return;
+ list_add_tail(&reg->list, head);
+diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
+index 09ce1599f71d..9753f4c7f9cc 100644
+--- a/drivers/iommu/iommu.c
++++ b/drivers/iommu/iommu.c
+@@ -73,6 +73,7 @@ static const char * const iommu_group_resv_type_string[] = {
+ [IOMMU_RESV_DIRECT] = "direct",
+ [IOMMU_RESV_RESERVED] = "reserved",
+ [IOMMU_RESV_MSI] = "msi",
++ [IOMMU_RESV_SW_MSI] = "msi",
+ };
+
+ #define IOMMU_GROUP_ATTR(_name, _mode, _show, _store) \
+@@ -1712,8 +1713,8 @@ void iommu_put_resv_regions(struct device *dev, struct list_head *list)
+ }
+
+ struct iommu_resv_region *iommu_alloc_resv_region(phys_addr_t start,
+- size_t length,
+- int prot, int type)
++ size_t length, int prot,
++ enum iommu_resv_type type)
+ {
+ struct iommu_resv_region *region;
+
+diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
+index bafede92f8c1..d67af8af9445 100644
+--- a/drivers/vfio/vfio_iommu_type1.c
++++ b/drivers/vfio/vfio_iommu_type1.c
+@@ -751,8 +751,7 @@ static struct vfio_group *find_iommu_group(struct vfio_domain *domain,
+ return NULL;
+ }
+
+-static bool vfio_iommu_has_resv_msi(struct iommu_group *group,
+- phys_addr_t *base)
++static bool vfio_iommu_has_sw_msi(struct iommu_group *group, phys_addr_t *base)
+ {
+ struct list_head group_resv_regions;
+ struct iommu_resv_region *region, *next;
+@@ -761,7 +760,7 @@ static bool vfio_iommu_has_resv_msi(struct iommu_group *group,
+ INIT_LIST_HEAD(&group_resv_regions);
+ iommu_get_group_resv_regions(group, &group_resv_regions);
+ list_for_each_entry(region, &group_resv_regions, list) {
+- if (region->type & IOMMU_RESV_MSI) {
++ if (region->type == IOMMU_RESV_SW_MSI) {
+ *base = region->start;
+ ret = true;
+ goto out;
+@@ -826,7 +825,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
+ if (ret)
+ goto out_domain;
+
+- resv_msi = vfio_iommu_has_resv_msi(iommu_group, &resv_msi_base);
++ resv_msi = vfio_iommu_has_sw_msi(iommu_group, &resv_msi_base);
+
+ INIT_LIST_HEAD(&domain->group_list);
+ list_add(&group->next, &domain->group_list);
+diff --git a/include/linux/iommu.h b/include/linux/iommu.h
+index 31cd587b37b9..010b1e38df71 100644
+--- a/include/linux/iommu.h
++++ b/include/linux/iommu.h
+@@ -117,9 +117,16 @@ enum iommu_attr {
+ };
+
+ /* These are the possible reserved region types */
+-#define IOMMU_RESV_DIRECT (1 << 0)
+-#define IOMMU_RESV_RESERVED (1 << 1)
+-#define IOMMU_RESV_MSI (1 << 2)
++enum iommu_resv_type {
++ /* Memory regions which must be mapped 1:1 at all times */
++ IOMMU_RESV_DIRECT,
++ /* Arbitrary "never map this or give it to a device" address ranges */
++ IOMMU_RESV_RESERVED,
++ /* Hardware MSI region (untranslated) */
++ IOMMU_RESV_MSI,
++ /* Software-managed MSI translation window */
++ IOMMU_RESV_SW_MSI,
++};
+
+ /**
+ * struct iommu_resv_region - descriptor for a reserved memory region
+@@ -134,7 +141,7 @@ struct iommu_resv_region {
+ phys_addr_t start;
+ size_t length;
+ int prot;
+- int type;
++ enum iommu_resv_type type;
+ };
+
+ #ifdef CONFIG_IOMMU_API
+@@ -248,7 +255,8 @@ extern void iommu_get_resv_regions(struct device *dev, struct list_head *list);
+ extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
+ extern int iommu_request_dm_for_dev(struct device *dev);
+ extern struct iommu_resv_region *
+-iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot, int type);
++iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot,
++ enum iommu_resv_type type);
+ extern int iommu_get_group_resv_regions(struct iommu_group *group,
+ struct list_head *head);
+
+--
+2.11.0
+
diff --git a/patches.drivers/0020-genirq-Dont-allow-affinity-mask-to-be-updated-on-IPI.patch b/patches.drivers/0020-genirq-Dont-allow-affinity-mask-to-be-updated-on-IPI.patch
new file mode 100644
index 0000000000..ea3931e49c
--- /dev/null
+++ b/patches.drivers/0020-genirq-Dont-allow-affinity-mask-to-be-updated-on-IPI.patch
@@ -0,0 +1,50 @@
+From 16d35b6f635bf244d98cd379f80c9e926def337e Mon Sep 17 00:00:00 2001
+From: Matt Redfearn <matt.redfearn@imgtec.com>
+Date: Thu, 21 Apr 2016 10:08:32 +0100
+Subject: [PATCH 20/23] genirq: Dont allow affinity mask to be updated on IPIs
+
+Git-commit: 4589f450fb285ab85f7513b6649e51ec2a820653
+Patch-mainline: v4.6-rc5
+References: fate#320512
+
+The IPI domain re-purposes the IRQ affinity to signify the mask of CPUs
+that this IPI will deliver to. This must not be modified before the IPI
+is destroyed again, so set the IRQ_NO_BALANCING flag to prevent the
+affinity being overwritten by setup_affinity().
+
+Without this, if an IPI is reserved for a single target CPU, then
+allocated using __setup_irq(), the affinity is overwritten with
+cpu_online_mask. When ipi_destroy() is subsequently called on a
+multi-cpu system, it will attempt to free cpumask_weight() IRQs
+that were never allocated, and crash.
+
+Fixes: d17bf24e6952 ("genirq: Add a new generic IPI reservation code to irq core")
+Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
+Cc: linux-mips@linux-mips.org
+Cc: jason@lakedaemon.net
+Cc: marc.zyngier@arm.com
+Cc: ralf@linux-mips.org
+Cc: Qais Yousef <qsyousef@gmail.com>
+Cc: lisa.parratt@imgtec.com
+Link: http://lkml.kernel.org/r/1461229712-13057-1-git-send-email-matt.redfearn@imgtec.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ kernel/irq/ipi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/kernel/irq/ipi.c b/kernel/irq/ipi.c
+index e5081c551129..b3345ab51d40 100644
+--- a/kernel/irq/ipi.c
++++ b/kernel/irq/ipi.c
+@@ -94,6 +94,7 @@ int irq_reserve_ipi(struct irq_domain *domain,
+ data = irq_get_irq_data(virq + i);
+ cpumask_copy(data->common->affinity, dest);
+ data->common->ipi_offset = offset;
++ irq_set_status_flags(virq + i, IRQ_NO_BALANCING);
+ }
+ return virq;
+
+--
+2.11.0
+
diff --git a/patches.drivers/0021-genirq-Fix-missing-return-value-in-irq_destroy_ipi.patch b/patches.drivers/0021-genirq-Fix-missing-return-value-in-irq_destroy_ipi.patch
new file mode 100644
index 0000000000..b5e3e5061a
--- /dev/null
+++ b/patches.drivers/0021-genirq-Fix-missing-return-value-in-irq_destroy_ipi.patch
@@ -0,0 +1,45 @@
+From 36abe4d58655e17e12f404afd74f44487552d208 Mon Sep 17 00:00:00 2001
+From: Matt Redfearn <matt.redfearn@imgtec.com>
+Date: Tue, 24 May 2016 11:42:30 +0100
+Subject: [PATCH 21/23] genirq: Fix missing return value in irq_destroy_ipi()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Git-commit: 59fa5860204ffc95128d60cba9f54f9740a42c7d
+Patch-mainline: v4.7-rc2
+References: fate#320512
+
+Commit 7cec18a3906b changed the return type of irq_destroy_ipi to int, but
+missed adding a value to one return statement. Fix this to silence the
+resulting compiler warning:
+
+kernel/irq/ipi.c In function ‘irq_destroy_ipi’:
+kernel/irq/ipi.c:128:3: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
+
+Fixes: 7cec18a3906b "genirq: Add error code reporting to irq_{reserve,destroy}_ipi"
+Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
+Cc: linux-mips@linux-mips.org
+Link: http://lkml.kernel.org/r/1464086550-24734-1-git-send-email-matt.redfearn@imgtec.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ kernel/irq/ipi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/irq/ipi.c b/kernel/irq/ipi.c
+index b3345ab51d40..b49ca35148e4 100644
+--- a/kernel/irq/ipi.c
++++ b/kernel/irq/ipi.c
+@@ -125,7 +125,7 @@ int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest)
+
+ domain = data->domain;
+ if (WARN_ON(domain == NULL))
+- return;
++ return -EINVAL;
+
+ if (!irq_domain_is_ipi(domain)) {
+ pr_warn("Trying to destroy a non IPI domain!\n");
+--
+2.11.0
+
diff --git a/patches.drivers/0022-init-Kconfig-keep-Expert-users-menu-together.patch b/patches.drivers/0022-init-Kconfig-keep-Expert-users-menu-together.patch
new file mode 100644
index 0000000000..ee90f2e0ea
--- /dev/null
+++ b/patches.drivers/0022-init-Kconfig-keep-Expert-users-menu-together.patch
@@ -0,0 +1,42 @@
+From faa18f982826932d7f6628eaafc0c9d175ec2b53 Mon Sep 17 00:00:00 2001
+From: Randy Dunlap <rdunlap@infradead.org>
+Date: Wed, 6 Jul 2016 16:06:53 -0700
+Subject: [PATCH 22/23] init/Kconfig: keep Expert users menu together
+
+Git-commit: 076501ff6ba265a473689c112eda9f1f34f620b5
+Patch-mainline: v4.7-rc7
+References: fate#320512
+
+The "expert" menu was broken (split) such that all entries in it after
+KALLSYMS were displayed in the "General setup" area instead of in the
+"Expert users" area. Fix this by adding one kconfig dependency.
+
+Yes, the Expert users menu is fragile. Problems like this have happened
+several times in the past. I will attempt to isolate the Expert users
+menu if there is interest in that.
+
+Fixes: 4d5d5664c900 ("x86: kallsyms: disable absolute percpu symbols on !SMP")
+Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
+Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Cc: stable@vger.kernel.org # 4.6
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ init/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index d36a05bfb9c2..aaef2d85e301 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -1479,6 +1479,7 @@ config KALLSYMS_ALL
+
+ config KALLSYMS_ABSOLUTE_PERCPU
+ bool
++ depends on KALLSYMS
+ default X86_64 && SMP
+
+ config KALLSYMS_BASE_RELATIVE
+--
+2.11.0
+
diff --git a/patches.drivers/0023-Documentation-watchdog-check-return-value-for-magic-.patch b/patches.drivers/0023-Documentation-watchdog-check-return-value-for-magic-.patch
new file mode 100644
index 0000000000..7bbb24f84b
--- /dev/null
+++ b/patches.drivers/0023-Documentation-watchdog-check-return-value-for-magic-.patch
@@ -0,0 +1,81 @@
+From 80d89ec47b79575a910d6c2ada737bc704d3d669 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Tue, 19 Jul 2016 17:41:22 +0200
+Subject: [PATCH 23/23] Documentation/watchdog: check return value for magic
+ close
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Git-commit: 9dd8d5f870f44597c67d0e5f72753b9d02810308
+Patch-mainline: v4.8-rc1
+References: fate#320512
+
+A recent commit added a write to the watchdog test code for doing the "magic
+close", but that caused a compile-time warning:
+
+Documentation/watchdog/src/watchdog-test.c: In function ‘main’:
+Documentation/watchdog/src/watchdog-test.c:94:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
+
+This changes the code to print a runtime warning if the write fails.
+
+Fixes: 5a2d3de19602 ("Documentation/watchdog: add support for magic close to watchdog-test")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Timur Tabi <timur@codeaurora.org>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ Documentation/watchdog/src/watchdog-test.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/Documentation/watchdog/src/watchdog-test.c b/Documentation/watchdog/src/watchdog-test.c
+index c69153913722..6983d05097e2 100644
+--- a/Documentation/watchdog/src/watchdog-test.c
++++ b/Documentation/watchdog/src/watchdog-test.c
+@@ -2,6 +2,7 @@
+ * Watchdog Driver Test Program
+ */
+
++#include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -35,9 +36,13 @@ static void keep_alive(void)
+
+ static void term(int sig)
+ {
+- write(fd, &v, 1);
++ int ret = write(fd, &v, 1);
++
+ close(fd);
+- printf("\nStopping watchdog ticks...\n");
++ if (ret < 0)
++ printf("\nStopping watchdog ticks failed (%d)...\n", errno);
++ else
++ printf("\nStopping watchdog ticks...\n");
+ exit(0);
+ }
+
+@@ -45,6 +50,7 @@ int main(int argc, char *argv[])
+ {
+ int flags;
+ unsigned int ping_rate = 1;
++ int ret;
+
+ setbuf(stdout, NULL);
+
+@@ -91,7 +97,9 @@ int main(int argc, char *argv[])
+ sleep(ping_rate);
+ }
+ end:
+- write(fd, &v, 1);
++ ret = write(fd, &v, 1);
++ if (ret < 0)
++ printf("Stopping watchdog ticks failed (%d)...\n", errno);
+ close(fd);
+ return 0;
+ }
+--
+2.11.0
+
diff --git a/patches.drivers/0024-vfio-Fix-handling-of-error-returned-by-vfio_group_ge.patch b/patches.drivers/0024-vfio-Fix-handling-of-error-returned-by-vfio_group_ge.patch
new file mode 100644
index 0000000000..8015dddec3
--- /dev/null
+++ b/patches.drivers/0024-vfio-Fix-handling-of-error-returned-by-vfio_group_ge.patch
@@ -0,0 +1,54 @@
+From 7bef62b3c5be33f92440001e9ff03f25fef0da98 Mon Sep 17 00:00:00 2001
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Date: Wed, 30 Nov 2016 08:06:12 +0100
+Subject: [PATCH] vfio: Fix handling of error returned by
+ 'vfio_group_get_from_dev()'
+
+Git-commit: d256459fae4dba66d50850f2d948306503818913 (partial)
+Patch-mainline: v4.10-rc1
+References: fate#320512
+
+'vfio_group_get_from_dev()' seems to return only NULL on error, not an
+error pointer.
+
+Fixes: 2169037dc322 ("vfio iommu: Added pin and unpin callback functions to vfio_iommu_driver_ops")
+Fixes: c086de818dd8 ("vfio iommu: Add blocking notifier to notify DMA_UNMAP")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
+
+[Yousaf]: Partial since c086de818dd8 is missing in the tree.
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/vfio/vfio.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
+index 37f0307eb85a..f795910891d6 100644
+--- a/drivers/vfio/vfio.c
++++ b/drivers/vfio/vfio.c
+@@ -1608,8 +1608,8 @@ int vfio_pin_pages(struct device *dev, unsigned long *user_pfn, int npage,
+ return -E2BIG;
+
+ group = vfio_group_get_from_dev(dev);
+- if (IS_ERR(group))
+- return PTR_ERR(group);
++ if (!group)
++ return -ENODEV;
+
+ ret = vfio_group_add_container_user(group);
+ if (ret)
+@@ -1657,8 +1657,8 @@ int vfio_unpin_pages(struct device *dev, unsigned long *user_pfn, int npage)
+ return -E2BIG;
+
+ group = vfio_group_get_from_dev(dev);
+- if (IS_ERR(group))
+- return PTR_ERR(group);
++ if (!group)
++ return -ENODEV;
+
+ ret = vfio_group_add_container_user(group);
+ if (ret)
+--
+2.11.0
+
diff --git a/series.conf b/series.conf
index 7a2f9fcf70..81a2cc63a6 100644
--- a/series.conf
+++ b/series.conf
@@ -12448,6 +12448,21 @@
patches.drivers/0007-arm64-suspend-Reconfigure-PSTATE-after-resume-from-i.patch
patches.drivers/0008-arm64-Change-cpu_resume-to-enable-mmu-early-then-acc.patch
patches.drivers/0009-arm64-kernel-avoid-literal-load-of-virtual-address-w.patch
+ patches.drivers/0010-arm64-fix-KASLR-boot-time-I-cache-maintenance.patch
+ patches.drivers/0011-arm64-avoid-TLB-conflict-with-CONFIG_RANDOMIZE_BASE.patch
+ patches.drivers/0012-KVM-arm-arm64-vgic-Don-t-flush-sync-without-a-workin.patch
+ patches.drivers/0013-arm64-kaslr-fix-breakage-with-CONFIG_MODVERSIONS-y.patch
+ patches.drivers/0014-KVM-arm-arm64-vgic-Don-t-notify-EOI-for-non-SPIs.patch
+ patches.drivers/0015-arm64-remove-wrong-CONFIG_PROC_SYSCTL-ifdef.patch
+ patches.drivers/0016-arm64-kaslr-Fix-up-the-kernel-image-alignment.patch
+ patches.drivers/0017-arm64-kernel-Fix-unmasked-debug-exceptions-when-rest.patch
+ patches.drivers/0018-ACPI-IORT-Fix-the-error-return-code-in-iort_add_smmu.patch
+ patches.drivers/0019-iommu-Disambiguate-MSI-region-types.patch
+ patches.drivers/0020-genirq-Dont-allow-affinity-mask-to-be-updated-on-IPI.patch
+ patches.drivers/0021-genirq-Fix-missing-return-value-in-irq_destroy_ipi.patch
+ patches.drivers/0022-init-Kconfig-keep-Expert-users-menu-together.patch
+ patches.drivers/0023-Documentation-watchdog-check-return-value-for-magic-.patch
+ patches.drivers/0024-vfio-Fix-handling-of-error-returned-by-vfio_group_ge.patch
########################################################
# kGraft