forked from Minki/linux
66bb0aa077
they had small conflicts (respectively within KVM documentation, and with 3.16-rc changes). Since they were all within the subsystem, I took care of them. Stephen Rothwell reported some snags in PPC builds, but they are all fixed now; the latest linux-next report was clean. New features for ARM include: - KVM VGIC v2 emulation on GICv3 hardware - Big-Endian support for arm/arm64 (guest and host) - Debug Architecture support for arm64 (arm32 is on Christoffer's todo list) And for PPC: - Book3S: Good number of LE host fixes, enable HV on LE - Book3S HV: Add in-guest debug support This release drops support for KVM on the PPC440. As a result, the PPC merge removes more lines than it adds. :) I also included an x86 change, since Davidlohr tied it to an independent bug report and the reporter quickly provided a Tested-by; there was no reason to wait for -rc2. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJT4iIJAAoJEBvWZb6bTYbyZqoP/3Wxy8NWPFJ8HGt81NHlGnDS a9UbL7EibcOEG+aaKqmtBglTD5YDiGBDNCxxiSJaDHt+grLN4fsWIliJob1nJFoO 90f89EWN2XjeCrJXA5nUoeg5tpc5OoYKsiP6pTgzIwkP8vvs/H1+zpcTS/UmYsr/ qipVMMsM+zZeHWZcSbqjW88z7YqIn1sr5282wJ85cbyv4KGizb/G4dyPuDqLb6np hkAD8Ah6VV2suQ2FSy7G2fg20R0vglUi60hkEHLoCBPVqJCl7SmC8MvxNbjBnP8S J36R0R0u1wHYKzAGooLJGVOZ/o/gSiVqKX+++L2EvJBN+kuA6u/7fxLyBT+LwDAE IF/Aln5rpg1fe+eywvhz86WljTVEQ8bO1zVsIQUPY+/ZOPedZHMwyvXft8ogbjSp 2m9OJ/3e8Aggh0OeHpCDoeow+QDUXvX0YdCw+2Yh0p+7VMXqkyp0QEiBu38jrusC rB3VNifJbDSWLKdG9LfCAPHnxZD2XYEwv2WFBo6KQOGMGHfx0GXpCOL/jQihrhA6 HtEG5Bs3lvnHQemdpUZ58xojiABbMaUPdcnPXQQEp23WhZzrfLMLzqVG0VYnhSsC 9pi7MJj8c31rqx5WU2oRM28i/BvNxN0NCtkDpineO5s3f89Ws1xnwxqlm38AKP0J irJQTYFEqec+GM9JK1rG =hyQP -----END PGP SIGNATURE----- Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull second round of KVM changes from Paolo Bonzini: "Here are the PPC and ARM changes for KVM, which I separated because they had small conflicts (respectively within KVM documentation, and with 3.16-rc changes). Since they were all within the subsystem, I took care of them. Stephen Rothwell reported some snags in PPC builds, but they are all fixed now; the latest linux-next report was clean. New features for ARM include: - KVM VGIC v2 emulation on GICv3 hardware - Big-Endian support for arm/arm64 (guest and host) - Debug Architecture support for arm64 (arm32 is on Christoffer's todo list) And for PPC: - Book3S: Good number of LE host fixes, enable HV on LE - Book3S HV: Add in-guest debug support This release drops support for KVM on the PPC440. As a result, the PPC merge removes more lines than it adds. :) I also included an x86 change, since Davidlohr tied it to an independent bug report and the reporter quickly provided a Tested-by; there was no reason to wait for -rc2" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (122 commits) KVM: Move more code under CONFIG_HAVE_KVM_IRQFD KVM: nVMX: fix "acknowledge interrupt on exit" when APICv is in use KVM: nVMX: Fix nested vmexit ack intr before load vmcs01 KVM: PPC: Enable IRQFD support for the XICS interrupt controller KVM: Give IRQFD its own separate enabling Kconfig option KVM: Move irq notifier implementation into eventfd.c KVM: Move all accesses to kvm::irq_routing into irqchip.c KVM: irqchip: Provide and use accessors for irq routing table KVM: Don't keep reference to irq routing table in irqfd struct KVM: PPC: drop duplicate tracepoint arm64: KVM: fix 64bit CP15 VM access for 32bit guests KVM: arm64: GICv3: mandate page-aligned GICV region arm64: KVM: GICv3: move system register access to msr_s/mrs_s KVM: PPC: PR: Handle FSCR feature deselects KVM: PPC: HV: Remove generic instruction emulation KVM: PPC: BOOKEHV: rename e500hv_spr to bookehv_spr KVM: PPC: Remove DCR handling KVM: PPC: Expose helper functions for data/inst faults KVM: PPC: Separate loadstore emulation from priv emulation KVM: PPC: Handle magic page in kvmppc_ld/st ...
154 lines
5.3 KiB
C
154 lines
5.3 KiB
C
/*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License, version 2, as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
* Copyright IBM Corp. 2008
|
|
*
|
|
* Authors: Hollis Blanchard <hollisb@us.ibm.com>
|
|
*/
|
|
|
|
#ifndef __POWERPC_KVM_ASM_H__
|
|
#define __POWERPC_KVM_ASM_H__
|
|
|
|
#ifdef __ASSEMBLY__
|
|
#ifdef CONFIG_64BIT
|
|
#define PPC_STD(sreg, offset, areg) std sreg, (offset)(areg)
|
|
#define PPC_LD(treg, offset, areg) ld treg, (offset)(areg)
|
|
#else
|
|
#define PPC_STD(sreg, offset, areg) stw sreg, (offset+4)(areg)
|
|
#define PPC_LD(treg, offset, areg) lwz treg, (offset+4)(areg)
|
|
#endif
|
|
#endif
|
|
|
|
/* IVPR must be 64KiB-aligned. */
|
|
#define VCPU_SIZE_ORDER 4
|
|
#define VCPU_SIZE_LOG (VCPU_SIZE_ORDER + 12)
|
|
#define VCPU_SIZE_BYTES (1<<VCPU_SIZE_LOG)
|
|
|
|
#define BOOKE_INTERRUPT_CRITICAL 0
|
|
#define BOOKE_INTERRUPT_MACHINE_CHECK 1
|
|
#define BOOKE_INTERRUPT_DATA_STORAGE 2
|
|
#define BOOKE_INTERRUPT_INST_STORAGE 3
|
|
#define BOOKE_INTERRUPT_EXTERNAL 4
|
|
#define BOOKE_INTERRUPT_ALIGNMENT 5
|
|
#define BOOKE_INTERRUPT_PROGRAM 6
|
|
#define BOOKE_INTERRUPT_FP_UNAVAIL 7
|
|
#define BOOKE_INTERRUPT_SYSCALL 8
|
|
#define BOOKE_INTERRUPT_AP_UNAVAIL 9
|
|
#define BOOKE_INTERRUPT_DECREMENTER 10
|
|
#define BOOKE_INTERRUPT_FIT 11
|
|
#define BOOKE_INTERRUPT_WATCHDOG 12
|
|
#define BOOKE_INTERRUPT_DTLB_MISS 13
|
|
#define BOOKE_INTERRUPT_ITLB_MISS 14
|
|
#define BOOKE_INTERRUPT_DEBUG 15
|
|
|
|
/* E500 */
|
|
#define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
|
|
#define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
|
|
/*
|
|
* TODO: Unify 32-bit and 64-bit kernel exception handlers to use same defines
|
|
*/
|
|
#define BOOKE_INTERRUPT_SPE_UNAVAIL BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
|
|
#define BOOKE_INTERRUPT_SPE_FP_DATA BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
|
|
#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
|
|
#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
|
|
BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
|
|
#define BOOKE_INTERRUPT_SPE_FP_ROUND 34
|
|
#define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
|
|
#define BOOKE_INTERRUPT_DOORBELL 36
|
|
#define BOOKE_INTERRUPT_DOORBELL_CRITICAL 37
|
|
|
|
/* booke_hv */
|
|
#define BOOKE_INTERRUPT_GUEST_DBELL 38
|
|
#define BOOKE_INTERRUPT_GUEST_DBELL_CRIT 39
|
|
#define BOOKE_INTERRUPT_HV_SYSCALL 40
|
|
#define BOOKE_INTERRUPT_HV_PRIV 41
|
|
#define BOOKE_INTERRUPT_LRAT_ERROR 42
|
|
|
|
/* book3s */
|
|
|
|
#define BOOK3S_INTERRUPT_SYSTEM_RESET 0x100
|
|
#define BOOK3S_INTERRUPT_MACHINE_CHECK 0x200
|
|
#define BOOK3S_INTERRUPT_DATA_STORAGE 0x300
|
|
#define BOOK3S_INTERRUPT_DATA_SEGMENT 0x380
|
|
#define BOOK3S_INTERRUPT_INST_STORAGE 0x400
|
|
#define BOOK3S_INTERRUPT_INST_SEGMENT 0x480
|
|
#define BOOK3S_INTERRUPT_EXTERNAL 0x500
|
|
#define BOOK3S_INTERRUPT_EXTERNAL_LEVEL 0x501
|
|
#define BOOK3S_INTERRUPT_EXTERNAL_HV 0x502
|
|
#define BOOK3S_INTERRUPT_ALIGNMENT 0x600
|
|
#define BOOK3S_INTERRUPT_PROGRAM 0x700
|
|
#define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800
|
|
#define BOOK3S_INTERRUPT_DECREMENTER 0x900
|
|
#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x980
|
|
#define BOOK3S_INTERRUPT_DOORBELL 0xa00
|
|
#define BOOK3S_INTERRUPT_SYSCALL 0xc00
|
|
#define BOOK3S_INTERRUPT_TRACE 0xd00
|
|
#define BOOK3S_INTERRUPT_H_DATA_STORAGE 0xe00
|
|
#define BOOK3S_INTERRUPT_H_INST_STORAGE 0xe20
|
|
#define BOOK3S_INTERRUPT_H_EMUL_ASSIST 0xe40
|
|
#define BOOK3S_INTERRUPT_HMI 0xe60
|
|
#define BOOK3S_INTERRUPT_H_DOORBELL 0xe80
|
|
#define BOOK3S_INTERRUPT_PERFMON 0xf00
|
|
#define BOOK3S_INTERRUPT_ALTIVEC 0xf20
|
|
#define BOOK3S_INTERRUPT_VSX 0xf40
|
|
#define BOOK3S_INTERRUPT_FAC_UNAVAIL 0xf60
|
|
#define BOOK3S_INTERRUPT_H_FAC_UNAVAIL 0xf80
|
|
|
|
#define BOOK3S_IRQPRIO_SYSTEM_RESET 0
|
|
#define BOOK3S_IRQPRIO_DATA_SEGMENT 1
|
|
#define BOOK3S_IRQPRIO_INST_SEGMENT 2
|
|
#define BOOK3S_IRQPRIO_DATA_STORAGE 3
|
|
#define BOOK3S_IRQPRIO_INST_STORAGE 4
|
|
#define BOOK3S_IRQPRIO_ALIGNMENT 5
|
|
#define BOOK3S_IRQPRIO_PROGRAM 6
|
|
#define BOOK3S_IRQPRIO_FP_UNAVAIL 7
|
|
#define BOOK3S_IRQPRIO_ALTIVEC 8
|
|
#define BOOK3S_IRQPRIO_VSX 9
|
|
#define BOOK3S_IRQPRIO_FAC_UNAVAIL 10
|
|
#define BOOK3S_IRQPRIO_SYSCALL 11
|
|
#define BOOK3S_IRQPRIO_MACHINE_CHECK 12
|
|
#define BOOK3S_IRQPRIO_DEBUG 13
|
|
#define BOOK3S_IRQPRIO_EXTERNAL 14
|
|
#define BOOK3S_IRQPRIO_DECREMENTER 15
|
|
#define BOOK3S_IRQPRIO_PERFORMANCE_MONITOR 16
|
|
#define BOOK3S_IRQPRIO_EXTERNAL_LEVEL 17
|
|
#define BOOK3S_IRQPRIO_MAX 18
|
|
|
|
#define BOOK3S_HFLAG_DCBZ32 0x1
|
|
#define BOOK3S_HFLAG_SLB 0x2
|
|
#define BOOK3S_HFLAG_PAIRED_SINGLE 0x4
|
|
#define BOOK3S_HFLAG_NATIVE_PS 0x8
|
|
#define BOOK3S_HFLAG_MULTI_PGSIZE 0x10
|
|
#define BOOK3S_HFLAG_NEW_TLBIE 0x20
|
|
#define BOOK3S_HFLAG_SPLIT_HACK 0x40
|
|
|
|
#define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */
|
|
#define RESUME_FLAG_HOST (1<<1) /* Resume host? */
|
|
#define RESUME_FLAG_ARCH1 (1<<2)
|
|
|
|
#define RESUME_GUEST 0
|
|
#define RESUME_GUEST_NV RESUME_FLAG_NV
|
|
#define RESUME_HOST RESUME_FLAG_HOST
|
|
#define RESUME_HOST_NV (RESUME_FLAG_HOST|RESUME_FLAG_NV)
|
|
|
|
#define KVM_GUEST_MODE_NONE 0
|
|
#define KVM_GUEST_MODE_GUEST 1
|
|
#define KVM_GUEST_MODE_SKIP 2
|
|
#define KVM_GUEST_MODE_GUEST_HV 3
|
|
#define KVM_GUEST_MODE_HOST_HV 4
|
|
|
|
#define KVM_INST_FETCH_FAILED -1
|
|
|
|
#endif /* __POWERPC_KVM_ASM_H__ */
|