diff options
Diffstat (limited to 'arch/powerpc/include/uapi')
-rw-r--r-- | arch/powerpc/include/uapi/asm/kvm.h | 86 |
1 files changed, 82 insertions, 4 deletions
diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index 0fb1a6e9ff90..6836ec79a830 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/kvm.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define __KVM_HAVE_PPC_SMT | 27 | #define __KVM_HAVE_PPC_SMT |
28 | #define __KVM_HAVE_IRQCHIP | 28 | #define __KVM_HAVE_IRQCHIP |
29 | #define __KVM_HAVE_IRQ_LINE | 29 | #define __KVM_HAVE_IRQ_LINE |
30 | #define __KVM_HAVE_GUEST_DEBUG | ||
30 | 31 | ||
31 | struct kvm_regs { | 32 | struct kvm_regs { |
32 | __u64 pc; | 33 | __u64 pc; |
@@ -269,7 +270,24 @@ struct kvm_fpu { | |||
269 | __u64 fpr[32]; | 270 | __u64 fpr[32]; |
270 | }; | 271 | }; |
271 | 272 | ||
273 | /* | ||
274 | * Defines for h/w breakpoint, watchpoint (read, write or both) and | ||
275 | * software breakpoint. | ||
276 | * These are used as "type" in KVM_SET_GUEST_DEBUG ioctl and "status" | ||
277 | * for KVM_DEBUG_EXIT. | ||
278 | */ | ||
279 | #define KVMPPC_DEBUG_NONE 0x0 | ||
280 | #define KVMPPC_DEBUG_BREAKPOINT (1UL << 1) | ||
281 | #define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2) | ||
282 | #define KVMPPC_DEBUG_WATCH_READ (1UL << 3) | ||
272 | struct kvm_debug_exit_arch { | 283 | struct kvm_debug_exit_arch { |
284 | __u64 address; | ||
285 | /* | ||
286 | * exiting to userspace because of h/w breakpoint, watchpoint | ||
287 | * (read, write or both) and software breakpoint. | ||
288 | */ | ||
289 | __u32 status; | ||
290 | __u32 reserved; | ||
273 | }; | 291 | }; |
274 | 292 | ||
275 | /* for KVM_SET_GUEST_DEBUG */ | 293 | /* for KVM_SET_GUEST_DEBUG */ |
@@ -281,10 +299,6 @@ struct kvm_guest_debug_arch { | |||
281 | * Type denotes h/w breakpoint, read watchpoint, write | 299 | * Type denotes h/w breakpoint, read watchpoint, write |
282 | * watchpoint or watchpoint (both read and write). | 300 | * watchpoint or watchpoint (both read and write). |
283 | */ | 301 | */ |
284 | #define KVMPPC_DEBUG_NONE 0x0 | ||
285 | #define KVMPPC_DEBUG_BREAKPOINT (1UL << 1) | ||
286 | #define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2) | ||
287 | #define KVMPPC_DEBUG_WATCH_READ (1UL << 3) | ||
288 | __u32 type; | 302 | __u32 type; |
289 | __u32 reserved; | 303 | __u32 reserved; |
290 | } bp[16]; | 304 | } bp[16]; |
@@ -429,6 +443,11 @@ struct kvm_get_htab_header { | |||
429 | #define KVM_REG_PPC_MMCR0 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x10) | 443 | #define KVM_REG_PPC_MMCR0 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x10) |
430 | #define KVM_REG_PPC_MMCR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x11) | 444 | #define KVM_REG_PPC_MMCR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x11) |
431 | #define KVM_REG_PPC_MMCRA (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x12) | 445 | #define KVM_REG_PPC_MMCRA (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x12) |
446 | #define KVM_REG_PPC_MMCR2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x13) | ||
447 | #define KVM_REG_PPC_MMCRS (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x14) | ||
448 | #define KVM_REG_PPC_SIAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x15) | ||
449 | #define KVM_REG_PPC_SDAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x16) | ||
450 | #define KVM_REG_PPC_SIER (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x17) | ||
432 | 451 | ||
433 | #define KVM_REG_PPC_PMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x18) | 452 | #define KVM_REG_PPC_PMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x18) |
434 | #define KVM_REG_PPC_PMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x19) | 453 | #define KVM_REG_PPC_PMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x19) |
@@ -499,6 +518,65 @@ struct kvm_get_htab_header { | |||
499 | #define KVM_REG_PPC_TLB3PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9a) | 518 | #define KVM_REG_PPC_TLB3PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9a) |
500 | #define KVM_REG_PPC_EPTCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9b) | 519 | #define KVM_REG_PPC_EPTCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9b) |
501 | 520 | ||
521 | /* Timebase offset */ | ||
522 | #define KVM_REG_PPC_TB_OFFSET (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9c) | ||
523 | |||
524 | /* POWER8 registers */ | ||
525 | #define KVM_REG_PPC_SPMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9d) | ||
526 | #define KVM_REG_PPC_SPMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9e) | ||
527 | #define KVM_REG_PPC_IAMR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9f) | ||
528 | #define KVM_REG_PPC_TFHAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa0) | ||
529 | #define KVM_REG_PPC_TFIAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa1) | ||
530 | #define KVM_REG_PPC_TEXASR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa2) | ||
531 | #define KVM_REG_PPC_FSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa3) | ||
532 | #define KVM_REG_PPC_PSPB (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xa4) | ||
533 | #define KVM_REG_PPC_EBBHR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa5) | ||
534 | #define KVM_REG_PPC_EBBRR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa6) | ||
535 | #define KVM_REG_PPC_BESCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa7) | ||
536 | #define KVM_REG_PPC_TAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa8) | ||
537 | #define KVM_REG_PPC_DPDES (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa9) | ||
538 | #define KVM_REG_PPC_DAWR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xaa) | ||
539 | #define KVM_REG_PPC_DAWRX (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xab) | ||
540 | #define KVM_REG_PPC_CIABR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xac) | ||
541 | #define KVM_REG_PPC_IC (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xad) | ||
542 | #define KVM_REG_PPC_VTB (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xae) | ||
543 | #define KVM_REG_PPC_CSIGR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xaf) | ||
544 | #define KVM_REG_PPC_TACR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb0) | ||
545 | #define KVM_REG_PPC_TCSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb1) | ||
546 | #define KVM_REG_PPC_PID (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb2) | ||
547 | #define KVM_REG_PPC_ACOP (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb3) | ||
548 | |||
549 | #define KVM_REG_PPC_VRSAVE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb4) | ||
550 | #define KVM_REG_PPC_LPCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb5) | ||
551 | #define KVM_REG_PPC_PPR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb6) | ||
552 | |||
553 | /* Architecture compatibility level */ | ||
554 | #define KVM_REG_PPC_ARCH_COMPAT (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb7) | ||
555 | |||
556 | /* Transactional Memory checkpointed state: | ||
557 | * This is all GPRs, all VSX regs and a subset of SPRs | ||
558 | */ | ||
559 | #define KVM_REG_PPC_TM (KVM_REG_PPC | 0x80000000) | ||
560 | /* TM GPRs */ | ||
561 | #define KVM_REG_PPC_TM_GPR0 (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0) | ||
562 | #define KVM_REG_PPC_TM_GPR(n) (KVM_REG_PPC_TM_GPR0 + (n)) | ||
563 | #define KVM_REG_PPC_TM_GPR31 (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x1f) | ||
564 | /* TM VSX */ | ||
565 | #define KVM_REG_PPC_TM_VSR0 (KVM_REG_PPC_TM | KVM_REG_SIZE_U128 | 0x20) | ||
566 | #define KVM_REG_PPC_TM_VSR(n) (KVM_REG_PPC_TM_VSR0 + (n)) | ||
567 | #define KVM_REG_PPC_TM_VSR63 (KVM_REG_PPC_TM | KVM_REG_SIZE_U128 | 0x5f) | ||
568 | /* TM SPRS */ | ||
569 | #define KVM_REG_PPC_TM_CR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x60) | ||
570 | #define KVM_REG_PPC_TM_LR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x61) | ||
571 | #define KVM_REG_PPC_TM_CTR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x62) | ||
572 | #define KVM_REG_PPC_TM_FPSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x63) | ||
573 | #define KVM_REG_PPC_TM_AMR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x64) | ||
574 | #define KVM_REG_PPC_TM_PPR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x65) | ||
575 | #define KVM_REG_PPC_TM_VRSAVE (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x66) | ||
576 | #define KVM_REG_PPC_TM_VSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U32 | 0x67) | ||
577 | #define KVM_REG_PPC_TM_DSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x68) | ||
578 | #define KVM_REG_PPC_TM_TAR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x69) | ||
579 | |||
502 | /* PPC64 eXternal Interrupt Controller Specification */ | 580 | /* PPC64 eXternal Interrupt Controller Specification */ |
503 | #define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */ | 581 | #define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */ |
504 | 582 | ||