25
25
/* Select powerpc specific features in <linux/kvm.h> */
26
26
#define __KVM_HAVE_SPAPR_TCE
27
27
#define __KVM_HAVE_PPC_SMT
28
+ #define __KVM_HAVE_IRQCHIP
29
+ #define __KVM_HAVE_IRQ_LINE
28
30
29
31
struct kvm_regs {
30
32
__u64 pc ;
@@ -272,8 +274,31 @@ struct kvm_debug_exit_arch {
272
274
273
275
/* for KVM_SET_GUEST_DEBUG */
274
276
struct kvm_guest_debug_arch {
277
+ struct {
278
+ /* H/W breakpoint/watchpoint address */
279
+ __u64 addr ;
280
+ /*
281
+ * Type denotes h/w breakpoint, read watchpoint, write
282
+ * watchpoint or watchpoint (both read and write).
283
+ */
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 ;
289
+ __u32 reserved ;
290
+ } bp [16 ];
275
291
};
276
292
293
+ /* Debug related defines */
294
+ /*
295
+ * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic
296
+ * and upper 16 bits are architecture specific. Architecture specific defines
297
+ * that ioctl is for setting hardware breakpoint or software breakpoint.
298
+ */
299
+ #define KVM_GUESTDBG_USE_SW_BP 0x00010000
300
+ #define KVM_GUESTDBG_USE_HW_BP 0x00020000
301
+
277
302
/* definition of registers in kvm_run */
278
303
struct kvm_sync_regs {
279
304
};
@@ -299,6 +324,12 @@ struct kvm_allocate_rma {
299
324
__u64 rma_size ;
300
325
};
301
326
327
+ /* for KVM_CAP_PPC_RTAS */
328
+ struct kvm_rtas_token_args {
329
+ char name [120 ];
330
+ __u64 token ; /* Use a token of 0 to undefine a mapping */
331
+ };
332
+
302
333
struct kvm_book3e_206_tlb_entry {
303
334
__u32 mas8 ;
304
335
__u32 mas1 ;
@@ -359,6 +390,26 @@ struct kvm_get_htab_header {
359
390
__u16 n_invalid ;
360
391
};
361
392
393
+ /* Per-vcpu XICS interrupt controller state */
394
+ #define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)
395
+
396
+ #define KVM_REG_PPC_ICP_CPPR_SHIFT 56 /* current proc priority */
397
+ #define KVM_REG_PPC_ICP_CPPR_MASK 0xff
398
+ #define KVM_REG_PPC_ICP_XISR_SHIFT 32 /* interrupt status field */
399
+ #define KVM_REG_PPC_ICP_XISR_MASK 0xffffff
400
+ #define KVM_REG_PPC_ICP_MFRR_SHIFT 24 /* pending IPI priority */
401
+ #define KVM_REG_PPC_ICP_MFRR_MASK 0xff
402
+ #define KVM_REG_PPC_ICP_PPRI_SHIFT 16 /* pending irq priority */
403
+ #define KVM_REG_PPC_ICP_PPRI_MASK 0xff
404
+
405
+ /* Device control API: PPC-specific devices */
406
+ #define KVM_DEV_MPIC_GRP_MISC 1
407
+ #define KVM_DEV_MPIC_BASE_ADDR 0 /* 64-bit */
408
+
409
+ #define KVM_DEV_MPIC_GRP_REGISTER 2 /* 32-bit */
410
+ #define KVM_DEV_MPIC_GRP_IRQ_ACTIVE 3 /* 32-bit */
411
+
412
+ /* One-Reg API: PPC-specific registers */
362
413
#define KVM_REG_PPC_HIOR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x1)
363
414
#define KVM_REG_PPC_IAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x2)
364
415
#define KVM_REG_PPC_IAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3)
@@ -422,4 +473,42 @@ struct kvm_get_htab_header {
422
473
#define KVM_REG_PPC_CLEAR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x88)
423
474
#define KVM_REG_PPC_TCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x89)
424
475
#define KVM_REG_PPC_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8a)
476
+
477
+ /* Debugging: Special instruction for software breakpoint */
478
+ #define KVM_REG_PPC_DEBUG_INST (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8b)
479
+
480
+ /* MMU registers */
481
+ #define KVM_REG_PPC_MAS0 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8c)
482
+ #define KVM_REG_PPC_MAS1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8d)
483
+ #define KVM_REG_PPC_MAS2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8e)
484
+ #define KVM_REG_PPC_MAS7_3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8f)
485
+ #define KVM_REG_PPC_MAS4 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x90)
486
+ #define KVM_REG_PPC_MAS6 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x91)
487
+ #define KVM_REG_PPC_MMUCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x92)
488
+ /*
489
+ * TLBnCFG fields TLBnCFG_N_ENTRY and TLBnCFG_ASSOC can be changed only using
490
+ * KVM_CAP_SW_TLB ioctl
491
+ */
492
+ #define KVM_REG_PPC_TLB0CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x93)
493
+ #define KVM_REG_PPC_TLB1CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x94)
494
+ #define KVM_REG_PPC_TLB2CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x95)
495
+ #define KVM_REG_PPC_TLB3CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x96)
496
+ #define KVM_REG_PPC_TLB0PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x97)
497
+ #define KVM_REG_PPC_TLB1PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x98)
498
+ #define KVM_REG_PPC_TLB2PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x99)
499
+ #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)
501
+
502
+ /* PPC64 eXternal Interrupt Controller Specification */
503
+ #define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */
504
+
505
+ /* Layout of 64-bit source attribute values */
506
+ #define KVM_XICS_DESTINATION_SHIFT 0
507
+ #define KVM_XICS_DESTINATION_MASK 0xffffffffULL
508
+ #define KVM_XICS_PRIORITY_SHIFT 32
509
+ #define KVM_XICS_PRIORITY_MASK 0xff
510
+ #define KVM_XICS_LEVEL_SENSITIVE (1ULL << 40)
511
+ #define KVM_XICS_MASKED (1ULL << 41)
512
+ #define KVM_XICS_PENDING (1ULL << 42)
513
+
425
514
#endif /* __LINUX_KVM_POWERPC_H */
0 commit comments