aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-04-26 15:43:42 -0400
committerAlexander Graf <agraf@suse.de>2012-05-06 10:19:12 -0400
commit5b74716ebab10e7bce960d148fe6d8f6920451e5 (patch)
tree169a36d6bcf64330f5bf026d9b064bfbe5582c85 /include
parentf31e65e1170edba4a86bd8cba0318e251d3746d0 (diff)
kvm/powerpc: Add new ioctl to retreive server MMU infos
This is necessary for qemu to be able to pass the right information to the guest, such as the supported page sizes and corresponding encodings in the SLB and hash table, which can vary depending on the processor type, the type of KVM used (PR vs HV) and the version of KVM Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [agraf: fix compilation on hv, adjust for newer ioctl numbers] Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kvm.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 225b452e1d1..8d696cf6edc 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -449,6 +449,30 @@ struct kvm_ppc_pvinfo {
449 __u8 pad[108]; 449 __u8 pad[108];
450}; 450};
451 451
452/* for KVM_PPC_GET_SMMU_INFO */
453#define KVM_PPC_PAGE_SIZES_MAX_SZ 8
454
455struct kvm_ppc_one_page_size {
456 __u32 page_shift; /* Page shift (or 0) */
457 __u32 pte_enc; /* Encoding in the HPTE (>>12) */
458};
459
460struct kvm_ppc_one_seg_page_size {
461 __u32 page_shift; /* Base page shift of segment (or 0) */
462 __u32 slb_enc; /* SLB encoding for BookS */
463 struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ];
464};
465
466#define KVM_PPC_PAGE_SIZES_REAL 0x00000001
467#define KVM_PPC_1T_SEGMENTS 0x00000002
468
469struct kvm_ppc_smmu_info {
470 __u64 flags;
471 __u32 slb_size;
472 __u32 pad;
473 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
474};
475
452#define KVMIO 0xAE 476#define KVMIO 0xAE
453 477
454/* machine type bits, to be used as argument to KVM_CREATE_VM */ 478/* machine type bits, to be used as argument to KVM_CREATE_VM */
@@ -591,6 +615,7 @@ struct kvm_ppc_pvinfo {
591#define KVM_CAP_PCI_2_3 75 615#define KVM_CAP_PCI_2_3 75
592#define KVM_CAP_KVMCLOCK_CTRL 76 616#define KVM_CAP_KVMCLOCK_CTRL 76
593#define KVM_CAP_SIGNAL_MSI 77 617#define KVM_CAP_SIGNAL_MSI 77
618#define KVM_CAP_PPC_GET_SMMU_INFO 78
594 619
595#ifdef KVM_CAP_IRQ_ROUTING 620#ifdef KVM_CAP_IRQ_ROUTING
596 621
@@ -800,6 +825,8 @@ struct kvm_s390_ucas_mapping {
800 struct kvm_assigned_pci_dev) 825 struct kvm_assigned_pci_dev)
801/* Available with KVM_CAP_SIGNAL_MSI */ 826/* Available with KVM_CAP_SIGNAL_MSI */
802#define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi) 827#define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi)
828/* Available with KVM_CAP_PPC_GET_SMMU_INFO */
829#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info)
803 830
804/* 831/*
805 * ioctls for vcpu fds 832 * ioctls for vcpu fds