linux_dsm_epyc7002/arch/arm64/include/asm
James Morse c612505f86 arm64: kvm: Fix kvm teardown for systems using the extended idmap
If memory is located above 1<<VA_BITS, kvm adds an extra level to its page
tables, merging the runtime tables and boot tables that contain the idmap.
This lets us avoid the trampoline dance during initialisation.

This also means there is no trampoline page mapped, so
__cpu_reset_hyp_mode() can't call __kvm_hyp_reset() in this page. The good
news is the idmap is still mapped, so we don't need the trampoline page.
The bad news is we can't call it directly as the idmap is above
HYP_PAGE_OFFSET, so its address is masked by kvm_call_hyp.

Add a function __extended_idmap_trampoline which will branch into
__kvm_hyp_reset in the idmap, change kvm_hyp_reset_entry() to return
this address if __kvm_cpu_uses_extended_idmap(). In this case
__kvm_hyp_reset() will still switch to the boot tables (which are the
merged tables that were already in use), and branch into the idmap (where
it already was).

This fixes boot failures on these systems, where we fail to execute the
missing trampoline page when tearing down kvm in init_subsystems():
[    2.508922] kvm [1]: 8-bit VMID
[    2.512057] kvm [1]: Hyp mode initialized successfully
[    2.517242] kvm [1]: interrupt-controller@e1140000 IRQ13
[    2.522622] kvm [1]: timer IRQ3
[    2.525783] Kernel panic - not syncing: HYP panic:
[    2.525783] PS:200003c9 PC:0000007ffffff820 ESR:86000005
[    2.525783] FAR:0000007ffffff820 HPFAR:00000000003ffff0 PAR:0000000000000000
[    2.525783] VCPU:          (null)
[    2.525783]
[    2.547667] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W       4.6.0-rc5+ #1
[    2.555137] Hardware name: Default string Default string/Default string, BIOS ROD0084E 09/03/2015
[    2.563994] Call trace:
[    2.566432] [<ffffff80080888d0>] dump_backtrace+0x0/0x240
[    2.571818] [<ffffff8008088b24>] show_stack+0x14/0x20
[    2.576858] [<ffffff80083423ac>] dump_stack+0x94/0xb8
[    2.581899] [<ffffff8008152130>] panic+0x10c/0x250
[    2.586677] [<ffffff8008152024>] panic+0x0/0x250
[    2.591281] SMP: stopping secondary CPUs
[    3.649692] SMP: failed to stop secondary CPUs 0-2,4-7
[    3.654818] Kernel Offset: disabled
[    3.658293] Memory Limit: none
[    3.661337] ---[ end Kernel panic - not syncing: HYP panic:
[    3.661337] PS:200003c9 PC:0000007ffffff820 ESR:86000005
[    3.661337] FAR:0000007ffffff820 HPFAR:00000000003ffff0 PAR:0000000000000000
[    3.661337] VCPU:          (null)
[    3.661337]

Reported-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2016-05-03 09:50:27 +01:00
..
xen xen/events: Support event channel rebind on ARM 2015-08-20 12:24:15 +01:00
acenv.h ARM64 / ACPI: Get RSDP and ACPI boot-time tables 2015-03-25 11:49:30 +00:00
acpi.h arm64: kernel: implement ACPI parking protocol 2016-02-16 15:12:32 +00:00
alternative.h arm64: switch to relative exception tables 2016-02-24 14:57:26 +00:00
arch_gicv3.h irqchip/gic-v3: Make sure read from ICC_IAR1_EL1 is visible on redestributor 2016-02-11 10:20:02 +00:00
arch_timer.h arm64: fix missing linux/bug.h include in asm/arch_timer.h 2015-01-07 11:40:59 +00:00
arm-cci.h arm-cci: Get rid of secure transactions for PMU driver 2015-03-27 13:44:35 +00:00
asm-offsets.h
assembler.h arm64: Add new asm macro copy_page 2016-04-28 12:05:46 +01:00
atomic_ll_sc.h arm64: cmpxchg_dbl: fix return value type 2015-11-05 17:29:40 +00:00
atomic_lse.h arm64: lse: deal with clobbered IP registers after branch via PLT 2016-02-26 18:35:02 +00:00
atomic.h arm64 updates for 4.4: 2015-11-04 14:47:13 -08:00
barrier.h arm64: define __smp_xxx 2016-01-12 20:46:53 +02:00
bitops.h arch,arm64: Convert smp_mb__*() 2014-04-18 11:40:33 +02:00
bitrev.h ARM: 8189/1: arm64:add bitrev.h file to support rbit instruction 2014-12-22 16:47:32 +00:00
boot.h arm64: allow kernel Image to be loaded anywhere in physical memory 2016-02-18 18:16:53 +00:00
brk-imm.h arm64: move brk immediate argument definitions to separate header 2016-02-23 17:43:25 +00:00
bug.h arm64: move brk immediate argument definitions to separate header 2016-02-23 17:43:25 +00:00
cache.h arm64: Increase the max granular size 2015-10-28 19:09:17 +00:00
cacheflush.h 2nd set of arm64 updates for 4.6: 2016-03-24 19:13:59 -07:00
cachetype.h arm64: cachetype: fix definitions of ICACHEF_* flags 2015-10-28 18:32:12 +00:00
cmpxchg.h arm64: cmpxchg: Don't incldue linux/mmdebug.h 2015-12-10 17:36:09 +00:00
compat.h arm64: do not include ptrace.h from compat.h 2015-11-17 13:24:36 +00:00
compiler.h arm64: Miscellaneous header files 2012-09-17 13:42:21 +01:00
cpu_ops.h ARM64: kernel: unify ACPI and DT cpus initialization 2015-05-19 16:09:29 +01:00
cpu.h arm64: add ARMv8.2 id_aa64mmfr2 boiler plate 2016-02-18 12:00:01 +00:00
cpufeature.h arm64: Verify CPU errata work arounds on hotplugged CPU 2016-04-25 15:14:03 +01:00
cpuidle.h arm64: kernel: rename __cpu_suspend to keep it aligned with arm 2015-06-19 14:46:39 +01:00
cputype.h ARM: SoC 64-bit changes for v4.6 2016-03-20 15:08:45 -07:00
dcc.h ARM64: TTY: hvc_dcc: Add support for ARM64 dcc 2015-10-04 17:49:27 +01:00
debug-monitors.h arm64: move brk immediate argument definitions to separate header 2016-02-23 17:43:25 +00:00
device.h arm64: introduce is_device_dma_coherent 2014-12-04 12:41:49 +00:00
dma-mapping.h dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
dmi.h arm64: dmi: Add SMBIOS/DMI support 2014-11-05 09:03:25 +01:00
efi.h arm64/efi: refactor EFI init and runtime code for reuse by 32-bit ARM 2015-12-09 16:57:23 +00:00
elf.h arm64: compat: Check for AArch32 state 2016-04-20 12:22:42 +01:00
esr.h arm64/debug: Add missing #includes 2015-07-27 11:08:42 +01:00
exception.h arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections 2016-03-25 16:37:42 -07:00
exec.h arm64: Miscellaneous header files 2012-09-17 13:42:21 +01:00
fb.h arm64: Device specific operations 2012-09-17 13:42:04 +01:00
fixmap.h arm64: Remove fixmap include fragility 2016-02-26 15:22:53 +00:00
fpsimd.h arm64: add support for kernel mode NEON in interrupt context 2014-05-08 11:31:57 +02:00
fpsimdmacros.h arm64: Avoid breakage caused by .altmacro in fpsimd save/restore macros 2015-01-29 17:24:39 +00:00
ftrace.h arm64: Fix misspellings in comments. 2016-03-04 18:19:17 +00:00
futex.h arm64: switch to relative exception tables 2016-02-24 14:57:26 +00:00
hardirq.h arm64: kernel: implement ACPI parking protocol 2016-02-16 15:12:32 +00:00
hugetlb.h arm64: hugetlb: add support for PTE contiguous bit 2015-12-21 17:26:00 +00:00
hw_breakpoint.h arm64: hw_breakpoint: Allow EL2 breakpoints if running in HYP 2016-02-29 18:34:18 +00:00
hwcap.h arm64/HWCAP: Use system wide safe values 2015-10-21 15:35:58 +01:00
hypervisor.h arm64/xen: introduce asm/xen header files on arm64 2013-06-07 10:39:45 +00:00
insn.h arm64: insn: Add aarch64_{get,set}_branch_offset 2015-06-03 15:43:24 +01:00
io.h Revert "arm64: ioremap: add ioremap_cache macro" 2015-10-13 16:18:17 +01:00
irq_work.h arm64: force CONFIG_SMP=y and remove redundant #ifdefs 2015-07-27 11:08:40 +01:00
irq.h arm64: remove irq_count and do_softirq_own_stack() 2015-12-21 17:26:01 +00:00
irqflags.h arm64: Add macros to manage processor debug state 2014-02-26 11:16:25 +00:00
jump_label.h locking/static_keys: Add a new static_key interface 2015-08-03 11:34:15 +02:00
kasan.h arm64: move kernel image to base of vmalloc area 2016-02-18 18:16:44 +00:00
Kbuild ARM64: PCI: Remove generated include of asm-generic/pci-bridge.h 2016-02-05 16:29:12 -06:00
kernel-pgtable.h arm64: choose memstart_addr based on minimum sparsemem section alignment 2016-04-14 16:15:08 +01:00
kgdb.h arm64: Fix typos in KGDB macros 2014-09-25 15:35:41 +01:00
kvm_arm.h arm64: Cleanup SCTLR flags 2016-04-28 12:05:46 +01:00
kvm_asm.h arm64: kvm: allows kvm cpu hotplug 2016-04-28 12:05:46 +01:00
kvm_coproc.h arm64: KVM: common infrastructure for handling AArch32 CP14/CP15 2014-07-11 04:57:44 -07:00
kvm_emulate.h arm64: KVM: VHE: Implement VHE activate/deactivate_traps 2016-02-29 18:34:17 +00:00
kvm_host.h arm64: kvm: Fix kvm teardown for systems using the extended idmap 2016-05-03 09:50:27 +01:00
kvm_hyp.h arm64: perf: Move PMU register related defines to asm/perf_event.h 2016-03-29 16:04:57 +01:00
kvm_mmio.h arm64: KVM: Turn system register numbers to an enum 2015-12-14 11:30:43 +00:00
kvm_mmu.h arm64: kvm: allows kvm cpu hotplug 2016-04-28 12:05:46 +01:00
kvm_psci.h ARM/ARM64: KVM: Make kvm_psci_call() return convention more flexible 2014-04-30 04:18:57 -07:00
linkage.h arm64: fix alignment padding in assembly code 2012-10-20 11:12:01 +01:00
lse.h arm64: lse: deal with clobbered IP registers after branch via PLT 2016-02-26 18:35:02 +00:00
memblock.h arm64: MMU initialisation 2012-09-17 13:41:56 +01:00
memory.h arm64: Promote KERNEL_START/KERNEL_END definitions to a header file 2016-04-28 12:05:46 +01:00
mmu_context.h arm64: Ensure the secondary CPUs have safe ASIDBits size 2016-02-25 10:33:06 +00:00
mmu.h arm64: Move unflatten_device_tree() call earlier. 2016-04-15 18:06:08 +01:00
mmzone.h arm64, numa: Add NUMA support for arm64 platforms. 2016-04-15 18:06:09 +01:00
module.h arm64: add support for kernel ASLR 2016-02-24 14:57:27 +00:00
neon.h arm64: add support for kernel mode NEON in interrupt context 2014-05-08 11:31:57 +02:00
numa.h arm64, numa: Add NUMA support for arm64 platforms. 2016-04-15 18:06:09 +01:00
opcodes.h arm64: opcodes.h: Add arm big-endian config options before including arm header 2016-03-29 16:04:57 +01:00
page.h arm64: kernel: Include _AC definition in page.h 2016-04-28 12:05:46 +01:00
paravirt.h arm64: introduce CONFIG_PARAVIRT, PARAVIRT_TIME_ACCOUNTING and pv_time_ops 2015-12-21 14:40:54 +00:00
pci.h PCI: Move pci_dma_* helpers to common code 2016-03-07 10:40:02 -06:00
percpu.h arm64: force CONFIG_SMP=y and remove redundant #ifdefs 2015-07-27 11:08:40 +01:00
perf_event.h arm64: perf: Move PMU register related defines to asm/perf_event.h 2016-03-29 16:04:57 +01:00
pgalloc.h arm64: mm: add __{pud,pgd}_populate 2016-02-16 15:10:46 +00:00
pgtable-hwdef.h arm64: hugetlb: add support for PTE contiguous bit 2015-12-21 17:26:00 +00:00
pgtable-prot.h arm64: Remove fixmap include fragility 2016-02-26 15:22:53 +00:00
pgtable-types.h arm64: expose number of page table levels on Kconfig level 2015-04-14 16:49:01 -07:00
pgtable.h arm64: Implement ptep_set_access_flags() for hardware AF/DBM 2016-04-15 18:06:09 +01:00
proc-fns.h arm64: kill flush_cache_all() 2015-05-19 15:27:42 +01:00
processor.h arm64: kernel: Add support for User Access Override 2016-02-18 17:27:04 +00:00
ptrace.h arm64: Rework valid_user_regs 2016-03-02 15:49:28 +00:00
seccomp.h arm64: add seccomp support 2014-11-28 10:24:59 +00:00
shmparam.h arm64: fix COMPAT_SHMLBA definition for large pages 2015-12-02 14:00:10 +00:00
signal32.h arm64: Use get_signal() signal_setup_done() 2014-08-06 12:56:16 +02:00
smp_plat.h arm64: remove dead-code depending on CONFIG_UP_LATE_INIT 2015-07-29 18:32:09 +01:00
smp.h arm64: Add cpu_panic_kernel helper 2016-04-15 18:06:06 +01:00
sparsemem.h arm64: mm: update max pa bits to 48 2014-08-19 20:23:02 +01:00
spinlock_types.h arm64: include linux/types.h in asm/spinlock_types.h 2015-07-27 11:09:34 +01:00
spinlock.h arm64: spinlock: serialise spin_unlock_wait against concurrent lockers 2015-12-03 19:37:59 +00:00
stackprotector.h arm64: Add CONFIG_CC_STACKPROTECTOR 2014-07-09 12:23:48 +01:00
stacktrace.h arm64: ftrace: fix a stack tracer's output under function graph tracer 2015-12-21 17:26:02 +00:00
stat.h UAPI: (Scripted) Disintegrate arch/arm64/include/asm 2012-10-11 11:05:13 +01:00
string.h arm64: add KASAN support 2015-10-12 17:46:36 +01:00
suspend.h arm64: kernel: Add support for hibernate/suspend-to-disk 2016-04-28 13:36:22 +01:00
sync_bitops.h arm64/xen: introduce asm/xen header files on arm64 2013-06-07 10:39:45 +00:00
syscall.h arm64: Add audit support 2014-07-10 11:06:00 +01:00
sysreg.h arm64: Cleanup SCTLR flags 2016-04-28 12:05:46 +01:00
system_misc.h arm64: use private ratelimit state along with show_unhandled_signals 2015-06-19 16:26:15 +01:00
thread_info.h arm64: Remove the get_thread_info() function 2016-02-18 17:27:05 +00:00
timex.h arm64: kernel: compiling issue, need delete read_current_timer() 2013-06-10 17:58:20 +01:00
tlb.h arm64: tlbflush: avoid flushing when fullmm == 1 2015-10-07 11:56:21 +01:00
tlbflush.h arm64: tlb: remove redundant barrier from __flush_tlb_pgtable 2015-10-07 11:56:33 +01:00
topology.h arm64, numa: Add NUMA support for arm64 platforms. 2016-04-15 18:06:09 +01:00
traps.h arm64: Add __exception_irq_entry definition for function graph 2015-08-12 17:23:45 +01:00
uaccess.h arm64: switch to relative exception tables 2016-02-24 14:57:26 +00:00
unistd32.h arm64: compat: wire up new syscalls 2015-10-14 13:51:41 +01:00
unistd.h arm64: compat: wire up new syscalls 2015-10-14 13:51:41 +01:00
vdso_datapage.h arm64: VDSO support 2012-09-17 13:42:09 +01:00
vdso.h arm64: VDSO support 2012-09-17 13:42:09 +01:00
virt.h arm64: hyp/kvm: Make hyp-stub extensible 2016-04-28 12:05:46 +01:00
word-at-a-time.h arm64: switch to relative exception tables 2016-02-24 14:57:26 +00:00