160021220SAndre Przywara /* 260021220SAndre Przywara * This program is free software; you can redistribute it and/or modify 360021220SAndre Przywara * it under the terms of the GNU General Public License, version 2, as 460021220SAndre Przywara * published by the Free Software Foundation. 560021220SAndre Przywara * 660021220SAndre Przywara * This program is distributed in the hope that it will be useful, 760021220SAndre Przywara * but WITHOUT ANY WARRANTY; without even the implied warranty of 860021220SAndre Przywara * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 960021220SAndre Przywara * GNU General Public License for more details. 1060021220SAndre Przywara * 1160021220SAndre Przywara * You should have received a copy of the GNU General Public License 1260021220SAndre Przywara * along with this program; if not, write to the Free Software 1360021220SAndre Przywara * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 1460021220SAndre Przywara * 1560021220SAndre Przywara * Copyright IBM Corp. 2007 1660021220SAndre Przywara * 1760021220SAndre Przywara * Authors: Hollis Blanchard <hollisb@us.ibm.com> 1860021220SAndre Przywara */ 1960021220SAndre Przywara 2060021220SAndre Przywara #ifndef __LINUX_KVM_POWERPC_H 2160021220SAndre Przywara #define __LINUX_KVM_POWERPC_H 2260021220SAndre Przywara 2360021220SAndre Przywara #include <linux/types.h> 2460021220SAndre Przywara 2560021220SAndre Przywara /* Select powerpc specific features in <linux/kvm.h> */ 2660021220SAndre Przywara #define __KVM_HAVE_SPAPR_TCE 2760021220SAndre Przywara #define __KVM_HAVE_PPC_SMT 2860021220SAndre Przywara #define __KVM_HAVE_IRQCHIP 2960021220SAndre Przywara #define __KVM_HAVE_IRQ_LINE 3060021220SAndre Przywara #define __KVM_HAVE_GUEST_DEBUG 3160021220SAndre Przywara 3260021220SAndre Przywara struct kvm_regs { 3360021220SAndre Przywara __u64 pc; 3460021220SAndre Przywara __u64 cr; 3560021220SAndre Przywara __u64 ctr; 3660021220SAndre Przywara __u64 lr; 3760021220SAndre Przywara __u64 xer; 3860021220SAndre Przywara __u64 msr; 3960021220SAndre Przywara __u64 srr0; 4060021220SAndre Przywara __u64 srr1; 4160021220SAndre Przywara __u64 pid; 4260021220SAndre Przywara 4360021220SAndre Przywara __u64 sprg0; 4460021220SAndre Przywara __u64 sprg1; 4560021220SAndre Przywara __u64 sprg2; 4660021220SAndre Przywara __u64 sprg3; 4760021220SAndre Przywara __u64 sprg4; 4860021220SAndre Przywara __u64 sprg5; 4960021220SAndre Przywara __u64 sprg6; 5060021220SAndre Przywara __u64 sprg7; 5160021220SAndre Przywara 5260021220SAndre Przywara __u64 gpr[32]; 5360021220SAndre Przywara }; 5460021220SAndre Przywara 5560021220SAndre Przywara #define KVM_SREGS_E_IMPL_NONE 0 5660021220SAndre Przywara #define KVM_SREGS_E_IMPL_FSL 1 5760021220SAndre Przywara 5860021220SAndre Przywara #define KVM_SREGS_E_FSL_PIDn (1 << 0) /* PID1/PID2 */ 5960021220SAndre Przywara 6060021220SAndre Przywara /* 6160021220SAndre Przywara * Feature bits indicate which sections of the sregs struct are valid, 6260021220SAndre Przywara * both in KVM_GET_SREGS and KVM_SET_SREGS. On KVM_SET_SREGS, registers 6360021220SAndre Przywara * corresponding to unset feature bits will not be modified. This allows 6460021220SAndre Przywara * restoring a checkpoint made without that feature, while keeping the 6560021220SAndre Przywara * default values of the new registers. 6660021220SAndre Przywara * 6760021220SAndre Przywara * KVM_SREGS_E_BASE contains: 6860021220SAndre Przywara * CSRR0/1 (refers to SRR2/3 on 40x) 6960021220SAndre Przywara * ESR 7060021220SAndre Przywara * DEAR 7160021220SAndre Przywara * MCSR 7260021220SAndre Przywara * TSR 7360021220SAndre Przywara * TCR 7460021220SAndre Przywara * DEC 7560021220SAndre Przywara * TB 7660021220SAndre Przywara * VRSAVE (USPRG0) 7760021220SAndre Przywara */ 7860021220SAndre Przywara #define KVM_SREGS_E_BASE (1 << 0) 7960021220SAndre Przywara 8060021220SAndre Przywara /* 8160021220SAndre Przywara * KVM_SREGS_E_ARCH206 contains: 8260021220SAndre Przywara * 8360021220SAndre Przywara * PIR 8460021220SAndre Przywara * MCSRR0/1 8560021220SAndre Przywara * DECAR 8660021220SAndre Przywara * IVPR 8760021220SAndre Przywara */ 8860021220SAndre Przywara #define KVM_SREGS_E_ARCH206 (1 << 1) 8960021220SAndre Przywara 9060021220SAndre Przywara /* 9160021220SAndre Przywara * Contains EPCR, plus the upper half of 64-bit registers 9260021220SAndre Przywara * that are 32-bit on 32-bit implementations. 9360021220SAndre Przywara */ 9460021220SAndre Przywara #define KVM_SREGS_E_64 (1 << 2) 9560021220SAndre Przywara 9660021220SAndre Przywara #define KVM_SREGS_E_SPRG8 (1 << 3) 9760021220SAndre Przywara #define KVM_SREGS_E_MCIVPR (1 << 4) 9860021220SAndre Przywara 9960021220SAndre Przywara /* 10060021220SAndre Przywara * IVORs are used -- contains IVOR0-15, plus additional IVORs 10160021220SAndre Przywara * in combination with an appropriate feature bit. 10260021220SAndre Przywara */ 10360021220SAndre Przywara #define KVM_SREGS_E_IVOR (1 << 5) 10460021220SAndre Przywara 10560021220SAndre Przywara /* 10660021220SAndre Przywara * Contains MAS0-4, MAS6-7, TLBnCFG, MMUCFG. 10760021220SAndre Przywara * Also TLBnPS if MMUCFG[MAVN] = 1. 10860021220SAndre Przywara */ 10960021220SAndre Przywara #define KVM_SREGS_E_ARCH206_MMU (1 << 6) 11060021220SAndre Przywara 11160021220SAndre Przywara /* DBSR, DBCR, IAC, DAC, DVC */ 11260021220SAndre Przywara #define KVM_SREGS_E_DEBUG (1 << 7) 11360021220SAndre Przywara 11460021220SAndre Przywara /* Enhanced debug -- DSRR0/1, SPRG9 */ 11560021220SAndre Przywara #define KVM_SREGS_E_ED (1 << 8) 11660021220SAndre Przywara 11760021220SAndre Przywara /* Embedded Floating Point (SPE) -- IVOR32-34 if KVM_SREGS_E_IVOR */ 11860021220SAndre Przywara #define KVM_SREGS_E_SPE (1 << 9) 11960021220SAndre Przywara 12060021220SAndre Przywara /* 12160021220SAndre Przywara * DEPRECATED! USE ONE_REG FOR THIS ONE! 12260021220SAndre Przywara * External Proxy (EXP) -- EPR 12360021220SAndre Przywara */ 12460021220SAndre Przywara #define KVM_SREGS_EXP (1 << 10) 12560021220SAndre Przywara 12660021220SAndre Przywara /* External PID (E.PD) -- EPSC/EPLC */ 12760021220SAndre Przywara #define KVM_SREGS_E_PD (1 << 11) 12860021220SAndre Przywara 12960021220SAndre Przywara /* Processor Control (E.PC) -- IVOR36-37 if KVM_SREGS_E_IVOR */ 13060021220SAndre Przywara #define KVM_SREGS_E_PC (1 << 12) 13160021220SAndre Przywara 13260021220SAndre Przywara /* Page table (E.PT) -- EPTCFG */ 13360021220SAndre Przywara #define KVM_SREGS_E_PT (1 << 13) 13460021220SAndre Przywara 13560021220SAndre Przywara /* Embedded Performance Monitor (E.PM) -- IVOR35 if KVM_SREGS_E_IVOR */ 13660021220SAndre Przywara #define KVM_SREGS_E_PM (1 << 14) 13760021220SAndre Przywara 13860021220SAndre Przywara /* 13960021220SAndre Przywara * Special updates: 14060021220SAndre Przywara * 14160021220SAndre Przywara * Some registers may change even while a vcpu is not running. 14260021220SAndre Przywara * To avoid losing these changes, by default these registers are 14360021220SAndre Przywara * not updated by KVM_SET_SREGS. To force an update, set the bit 14460021220SAndre Przywara * in u.e.update_special corresponding to the register to be updated. 14560021220SAndre Przywara * 14660021220SAndre Przywara * The update_special field is zero on return from KVM_GET_SREGS. 14760021220SAndre Przywara * 14860021220SAndre Przywara * When restoring a checkpoint, the caller can set update_special 14960021220SAndre Przywara * to 0xffffffff to ensure that everything is restored, even new features 15060021220SAndre Przywara * that the caller doesn't know about. 15160021220SAndre Przywara */ 15260021220SAndre Przywara #define KVM_SREGS_E_UPDATE_MCSR (1 << 0) 15360021220SAndre Przywara #define KVM_SREGS_E_UPDATE_TSR (1 << 1) 15460021220SAndre Przywara #define KVM_SREGS_E_UPDATE_DEC (1 << 2) 15560021220SAndre Przywara #define KVM_SREGS_E_UPDATE_DBSR (1 << 3) 15660021220SAndre Przywara 15760021220SAndre Przywara /* 15860021220SAndre Przywara * In KVM_SET_SREGS, reserved/pad fields must be left untouched from a 15960021220SAndre Przywara * previous KVM_GET_REGS. 16060021220SAndre Przywara * 16160021220SAndre Przywara * Unless otherwise indicated, setting any register with KVM_SET_SREGS 16260021220SAndre Przywara * directly sets its value. It does not trigger any special semantics such 16360021220SAndre Przywara * as write-one-to-clear. Calling KVM_SET_SREGS on an unmodified struct 16460021220SAndre Przywara * just received from KVM_GET_SREGS is always a no-op. 16560021220SAndre Przywara */ 16660021220SAndre Przywara struct kvm_sregs { 16760021220SAndre Przywara __u32 pvr; 16860021220SAndre Przywara union { 16960021220SAndre Przywara struct { 17060021220SAndre Przywara __u64 sdr1; 17160021220SAndre Przywara struct { 17260021220SAndre Przywara struct { 17360021220SAndre Przywara __u64 slbe; 17460021220SAndre Przywara __u64 slbv; 17560021220SAndre Przywara } slb[64]; 17660021220SAndre Przywara } ppc64; 17760021220SAndre Przywara struct { 17860021220SAndre Przywara __u32 sr[16]; 17960021220SAndre Przywara __u64 ibat[8]; 18060021220SAndre Przywara __u64 dbat[8]; 18160021220SAndre Przywara } ppc32; 18260021220SAndre Przywara } s; 18360021220SAndre Przywara struct { 18460021220SAndre Przywara union { 18560021220SAndre Przywara struct { /* KVM_SREGS_E_IMPL_FSL */ 18660021220SAndre Przywara __u32 features; /* KVM_SREGS_E_FSL_ */ 18760021220SAndre Przywara __u32 svr; 18860021220SAndre Przywara __u64 mcar; 18960021220SAndre Przywara __u32 hid0; 19060021220SAndre Przywara 19160021220SAndre Przywara /* KVM_SREGS_E_FSL_PIDn */ 19260021220SAndre Przywara __u32 pid1, pid2; 19360021220SAndre Przywara } fsl; 19460021220SAndre Przywara __u8 pad[256]; 19560021220SAndre Przywara } impl; 19660021220SAndre Przywara 19760021220SAndre Przywara __u32 features; /* KVM_SREGS_E_ */ 19860021220SAndre Przywara __u32 impl_id; /* KVM_SREGS_E_IMPL_ */ 19960021220SAndre Przywara __u32 update_special; /* KVM_SREGS_E_UPDATE_ */ 20060021220SAndre Przywara __u32 pir; /* read-only */ 20160021220SAndre Przywara __u64 sprg8; 20260021220SAndre Przywara __u64 sprg9; /* E.ED */ 20360021220SAndre Przywara __u64 csrr0; 20460021220SAndre Przywara __u64 dsrr0; /* E.ED */ 20560021220SAndre Przywara __u64 mcsrr0; 20660021220SAndre Przywara __u32 csrr1; 20760021220SAndre Przywara __u32 dsrr1; /* E.ED */ 20860021220SAndre Przywara __u32 mcsrr1; 20960021220SAndre Przywara __u32 esr; 21060021220SAndre Przywara __u64 dear; 21160021220SAndre Przywara __u64 ivpr; 21260021220SAndre Przywara __u64 mcivpr; 21360021220SAndre Przywara __u64 mcsr; /* KVM_SREGS_E_UPDATE_MCSR */ 21460021220SAndre Przywara 21560021220SAndre Przywara __u32 tsr; /* KVM_SREGS_E_UPDATE_TSR */ 21660021220SAndre Przywara __u32 tcr; 21760021220SAndre Przywara __u32 decar; 21860021220SAndre Przywara __u32 dec; /* KVM_SREGS_E_UPDATE_DEC */ 21960021220SAndre Przywara 22060021220SAndre Przywara /* 22160021220SAndre Przywara * Userspace can read TB directly, but the 22260021220SAndre Przywara * value reported here is consistent with "dec". 22360021220SAndre Przywara * 22460021220SAndre Przywara * Read-only. 22560021220SAndre Przywara */ 22660021220SAndre Przywara __u64 tb; 22760021220SAndre Przywara 22860021220SAndre Przywara __u32 dbsr; /* KVM_SREGS_E_UPDATE_DBSR */ 22960021220SAndre Przywara __u32 dbcr[3]; 23060021220SAndre Przywara /* 23160021220SAndre Przywara * iac/dac registers are 64bit wide, while this API 23260021220SAndre Przywara * interface provides only lower 32 bits on 64 bit 23360021220SAndre Przywara * processors. ONE_REG interface is added for 64bit 23460021220SAndre Przywara * iac/dac registers. 23560021220SAndre Przywara */ 23660021220SAndre Przywara __u32 iac[4]; 23760021220SAndre Przywara __u32 dac[2]; 23860021220SAndre Przywara __u32 dvc[2]; 23960021220SAndre Przywara __u8 num_iac; /* read-only */ 24060021220SAndre Przywara __u8 num_dac; /* read-only */ 24160021220SAndre Przywara __u8 num_dvc; /* read-only */ 24260021220SAndre Przywara __u8 pad; 24360021220SAndre Przywara 24460021220SAndre Przywara __u32 epr; /* EXP */ 24560021220SAndre Przywara __u32 vrsave; /* a.k.a. USPRG0 */ 24660021220SAndre Przywara __u32 epcr; /* KVM_SREGS_E_64 */ 24760021220SAndre Przywara 24860021220SAndre Przywara __u32 mas0; 24960021220SAndre Przywara __u32 mas1; 25060021220SAndre Przywara __u64 mas2; 25160021220SAndre Przywara __u64 mas7_3; 25260021220SAndre Przywara __u32 mas4; 25360021220SAndre Przywara __u32 mas6; 25460021220SAndre Przywara 25560021220SAndre Przywara __u32 ivor_low[16]; /* IVOR0-15 */ 25660021220SAndre Przywara __u32 ivor_high[18]; /* IVOR32+, plus room to expand */ 25760021220SAndre Przywara 25860021220SAndre Przywara __u32 mmucfg; /* read-only */ 25960021220SAndre Przywara __u32 eptcfg; /* E.PT, read-only */ 26060021220SAndre Przywara __u32 tlbcfg[4];/* read-only */ 26160021220SAndre Przywara __u32 tlbps[4]; /* read-only */ 26260021220SAndre Przywara 26360021220SAndre Przywara __u32 eplc, epsc; /* E.PD */ 26460021220SAndre Przywara } e; 26560021220SAndre Przywara __u8 pad[1020]; 26660021220SAndre Przywara } u; 26760021220SAndre Przywara }; 26860021220SAndre Przywara 26960021220SAndre Przywara struct kvm_fpu { 27060021220SAndre Przywara __u64 fpr[32]; 27160021220SAndre Przywara }; 27260021220SAndre Przywara 27360021220SAndre Przywara /* 27460021220SAndre Przywara * Defines for h/w breakpoint, watchpoint (read, write or both) and 27560021220SAndre Przywara * software breakpoint. 27660021220SAndre Przywara * These are used as "type" in KVM_SET_GUEST_DEBUG ioctl and "status" 27760021220SAndre Przywara * for KVM_DEBUG_EXIT. 27860021220SAndre Przywara */ 27960021220SAndre Przywara #define KVMPPC_DEBUG_NONE 0x0 28060021220SAndre Przywara #define KVMPPC_DEBUG_BREAKPOINT (1UL << 1) 28160021220SAndre Przywara #define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2) 28260021220SAndre Przywara #define KVMPPC_DEBUG_WATCH_READ (1UL << 3) 28360021220SAndre Przywara struct kvm_debug_exit_arch { 28460021220SAndre Przywara __u64 address; 28560021220SAndre Przywara /* 28660021220SAndre Przywara * exiting to userspace because of h/w breakpoint, watchpoint 28760021220SAndre Przywara * (read, write or both) and software breakpoint. 28860021220SAndre Przywara */ 28960021220SAndre Przywara __u32 status; 29060021220SAndre Przywara __u32 reserved; 29160021220SAndre Przywara }; 29260021220SAndre Przywara 29360021220SAndre Przywara /* for KVM_SET_GUEST_DEBUG */ 29460021220SAndre Przywara struct kvm_guest_debug_arch { 29560021220SAndre Przywara struct { 29660021220SAndre Przywara /* H/W breakpoint/watchpoint address */ 29760021220SAndre Przywara __u64 addr; 29860021220SAndre Przywara /* 29960021220SAndre Przywara * Type denotes h/w breakpoint, read watchpoint, write 30060021220SAndre Przywara * watchpoint or watchpoint (both read and write). 30160021220SAndre Przywara */ 30260021220SAndre Przywara __u32 type; 30360021220SAndre Przywara __u32 reserved; 30460021220SAndre Przywara } bp[16]; 30560021220SAndre Przywara }; 30660021220SAndre Przywara 30760021220SAndre Przywara /* Debug related defines */ 30860021220SAndre Przywara /* 30960021220SAndre Przywara * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic 31060021220SAndre Przywara * and upper 16 bits are architecture specific. Architecture specific defines 31160021220SAndre Przywara * that ioctl is for setting hardware breakpoint or software breakpoint. 31260021220SAndre Przywara */ 31360021220SAndre Przywara #define KVM_GUESTDBG_USE_SW_BP 0x00010000 31460021220SAndre Przywara #define KVM_GUESTDBG_USE_HW_BP 0x00020000 31560021220SAndre Przywara 31660021220SAndre Przywara /* definition of registers in kvm_run */ 31760021220SAndre Przywara struct kvm_sync_regs { 31860021220SAndre Przywara }; 31960021220SAndre Przywara 32060021220SAndre Przywara #define KVM_INTERRUPT_SET -1U 32160021220SAndre Przywara #define KVM_INTERRUPT_UNSET -2U 32260021220SAndre Przywara #define KVM_INTERRUPT_SET_LEVEL -3U 32360021220SAndre Przywara 32460021220SAndre Przywara #define KVM_CPU_440 1 32560021220SAndre Przywara #define KVM_CPU_E500V2 2 32660021220SAndre Przywara #define KVM_CPU_3S_32 3 32760021220SAndre Przywara #define KVM_CPU_3S_64 4 32860021220SAndre Przywara #define KVM_CPU_E500MC 5 32960021220SAndre Przywara 33060021220SAndre Przywara /* for KVM_CAP_SPAPR_TCE */ 33160021220SAndre Przywara struct kvm_create_spapr_tce { 33260021220SAndre Przywara __u64 liobn; 33360021220SAndre Przywara __u32 window_size; 33460021220SAndre Przywara }; 33560021220SAndre Przywara 336b37ed70eSAndre Przywara /* for KVM_CAP_SPAPR_TCE_64 */ 337b37ed70eSAndre Przywara struct kvm_create_spapr_tce_64 { 338b37ed70eSAndre Przywara __u64 liobn; 339b37ed70eSAndre Przywara __u32 page_shift; 340b37ed70eSAndre Przywara __u32 flags; 341b37ed70eSAndre Przywara __u64 offset; /* in pages */ 342b37ed70eSAndre Przywara __u64 size; /* in pages */ 343b37ed70eSAndre Przywara }; 344b37ed70eSAndre Przywara 34560021220SAndre Przywara /* for KVM_ALLOCATE_RMA */ 34660021220SAndre Przywara struct kvm_allocate_rma { 34760021220SAndre Przywara __u64 rma_size; 34860021220SAndre Przywara }; 34960021220SAndre Przywara 35060021220SAndre Przywara /* for KVM_CAP_PPC_RTAS */ 35160021220SAndre Przywara struct kvm_rtas_token_args { 35260021220SAndre Przywara char name[120]; 35360021220SAndre Przywara __u64 token; /* Use a token of 0 to undefine a mapping */ 35460021220SAndre Przywara }; 35560021220SAndre Przywara 35660021220SAndre Przywara struct kvm_book3e_206_tlb_entry { 35760021220SAndre Przywara __u32 mas8; 35860021220SAndre Przywara __u32 mas1; 35960021220SAndre Przywara __u64 mas2; 36060021220SAndre Przywara __u64 mas7_3; 36160021220SAndre Przywara }; 36260021220SAndre Przywara 36360021220SAndre Przywara struct kvm_book3e_206_tlb_params { 36460021220SAndre Przywara /* 36560021220SAndre Przywara * For mmu types KVM_MMU_FSL_BOOKE_NOHV and KVM_MMU_FSL_BOOKE_HV: 36660021220SAndre Przywara * 36760021220SAndre Przywara * - The number of ways of TLB0 must be a power of two between 2 and 36860021220SAndre Przywara * 16. 36960021220SAndre Przywara * - TLB1 must be fully associative. 37060021220SAndre Przywara * - The size of TLB0 must be a multiple of the number of ways, and 37160021220SAndre Przywara * the number of sets must be a power of two. 37260021220SAndre Przywara * - The size of TLB1 may not exceed 64 entries. 37360021220SAndre Przywara * - TLB0 supports 4 KiB pages. 37460021220SAndre Przywara * - The page sizes supported by TLB1 are as indicated by 37560021220SAndre Przywara * TLB1CFG (if MMUCFG[MAVN] = 0) or TLB1PS (if MMUCFG[MAVN] = 1) 37660021220SAndre Przywara * as returned by KVM_GET_SREGS. 37760021220SAndre Przywara * - TLB2 and TLB3 are reserved, and their entries in tlb_sizes[] 37860021220SAndre Przywara * and tlb_ways[] must be zero. 37960021220SAndre Przywara * 38060021220SAndre Przywara * tlb_ways[n] = tlb_sizes[n] means the array is fully associative. 38160021220SAndre Przywara * 38260021220SAndre Przywara * KVM will adjust TLBnCFG based on the sizes configured here, 38360021220SAndre Przywara * though arrays greater than 2048 entries will have TLBnCFG[NENTRY] 38460021220SAndre Przywara * set to zero. 38560021220SAndre Przywara */ 38660021220SAndre Przywara __u32 tlb_sizes[4]; 38760021220SAndre Przywara __u32 tlb_ways[4]; 38860021220SAndre Przywara __u32 reserved[8]; 38960021220SAndre Przywara }; 39060021220SAndre Przywara 39160021220SAndre Przywara /* For KVM_PPC_GET_HTAB_FD */ 39260021220SAndre Przywara struct kvm_get_htab_fd { 39360021220SAndre Przywara __u64 flags; 39460021220SAndre Przywara __u64 start_index; 39560021220SAndre Przywara __u64 reserved[2]; 39660021220SAndre Przywara }; 39760021220SAndre Przywara 39860021220SAndre Przywara /* Values for kvm_get_htab_fd.flags */ 39960021220SAndre Przywara #define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1) 40060021220SAndre Przywara #define KVM_GET_HTAB_WRITE ((__u64)0x2) 40160021220SAndre Przywara 40260021220SAndre Przywara /* 40360021220SAndre Przywara * Data read on the file descriptor is formatted as a series of 40460021220SAndre Przywara * records, each consisting of a header followed by a series of 40560021220SAndre Przywara * `n_valid' HPTEs (16 bytes each), which are all valid. Following 40660021220SAndre Przywara * those valid HPTEs there are `n_invalid' invalid HPTEs, which 40760021220SAndre Przywara * are not represented explicitly in the stream. The same format 40860021220SAndre Przywara * is used for writing. 40960021220SAndre Przywara */ 41060021220SAndre Przywara struct kvm_get_htab_header { 41160021220SAndre Przywara __u32 index; 41260021220SAndre Przywara __u16 n_valid; 41360021220SAndre Przywara __u16 n_invalid; 41460021220SAndre Przywara }; 41560021220SAndre Przywara 416*764dfba1SAndre Przywara /* For KVM_PPC_CONFIGURE_V3_MMU */ 417*764dfba1SAndre Przywara struct kvm_ppc_mmuv3_cfg { 418*764dfba1SAndre Przywara __u64 flags; 419*764dfba1SAndre Przywara __u64 process_table; /* second doubleword of partition table entry */ 420*764dfba1SAndre Przywara }; 421*764dfba1SAndre Przywara 422*764dfba1SAndre Przywara /* Flag values for KVM_PPC_CONFIGURE_V3_MMU */ 423*764dfba1SAndre Przywara #define KVM_PPC_MMUV3_RADIX 1 /* 1 = radix mode, 0 = HPT */ 424*764dfba1SAndre Przywara #define KVM_PPC_MMUV3_GTSE 2 /* global translation shootdown enb. */ 425*764dfba1SAndre Przywara 426*764dfba1SAndre Przywara /* For KVM_PPC_GET_RMMU_INFO */ 427*764dfba1SAndre Przywara struct kvm_ppc_rmmu_info { 428*764dfba1SAndre Przywara struct kvm_ppc_radix_geom { 429*764dfba1SAndre Przywara __u8 page_shift; 430*764dfba1SAndre Przywara __u8 level_bits[4]; 431*764dfba1SAndre Przywara __u8 pad[3]; 432*764dfba1SAndre Przywara } geometries[8]; 433*764dfba1SAndre Przywara __u32 ap_encodings[8]; 434*764dfba1SAndre Przywara }; 435*764dfba1SAndre Przywara 43660021220SAndre Przywara /* Per-vcpu XICS interrupt controller state */ 43760021220SAndre Przywara #define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c) 43860021220SAndre Przywara 43960021220SAndre Przywara #define KVM_REG_PPC_ICP_CPPR_SHIFT 56 /* current proc priority */ 44060021220SAndre Przywara #define KVM_REG_PPC_ICP_CPPR_MASK 0xff 44160021220SAndre Przywara #define KVM_REG_PPC_ICP_XISR_SHIFT 32 /* interrupt status field */ 44260021220SAndre Przywara #define KVM_REG_PPC_ICP_XISR_MASK 0xffffff 44360021220SAndre Przywara #define KVM_REG_PPC_ICP_MFRR_SHIFT 24 /* pending IPI priority */ 44460021220SAndre Przywara #define KVM_REG_PPC_ICP_MFRR_MASK 0xff 44560021220SAndre Przywara #define KVM_REG_PPC_ICP_PPRI_SHIFT 16 /* pending irq priority */ 44660021220SAndre Przywara #define KVM_REG_PPC_ICP_PPRI_MASK 0xff 44760021220SAndre Przywara 44860021220SAndre Przywara /* Device control API: PPC-specific devices */ 44960021220SAndre Przywara #define KVM_DEV_MPIC_GRP_MISC 1 45060021220SAndre Przywara #define KVM_DEV_MPIC_BASE_ADDR 0 /* 64-bit */ 45160021220SAndre Przywara 45260021220SAndre Przywara #define KVM_DEV_MPIC_GRP_REGISTER 2 /* 32-bit */ 45360021220SAndre Przywara #define KVM_DEV_MPIC_GRP_IRQ_ACTIVE 3 /* 32-bit */ 45460021220SAndre Przywara 45560021220SAndre Przywara /* One-Reg API: PPC-specific registers */ 45660021220SAndre Przywara #define KVM_REG_PPC_HIOR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x1) 45760021220SAndre Przywara #define KVM_REG_PPC_IAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x2) 45860021220SAndre Przywara #define KVM_REG_PPC_IAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3) 45960021220SAndre Przywara #define KVM_REG_PPC_IAC3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x4) 46060021220SAndre Przywara #define KVM_REG_PPC_IAC4 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x5) 46160021220SAndre Przywara #define KVM_REG_PPC_DAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x6) 46260021220SAndre Przywara #define KVM_REG_PPC_DAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x7) 46360021220SAndre Przywara #define KVM_REG_PPC_DABR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8) 46460021220SAndre Przywara #define KVM_REG_PPC_DSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9) 46560021220SAndre Przywara #define KVM_REG_PPC_PURR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa) 46660021220SAndre Przywara #define KVM_REG_PPC_SPURR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb) 46760021220SAndre Przywara #define KVM_REG_PPC_DAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc) 46860021220SAndre Przywara #define KVM_REG_PPC_DSISR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xd) 46960021220SAndre Przywara #define KVM_REG_PPC_AMR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xe) 47060021220SAndre Przywara #define KVM_REG_PPC_UAMOR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xf) 47160021220SAndre Przywara 47260021220SAndre Przywara #define KVM_REG_PPC_MMCR0 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x10) 47360021220SAndre Przywara #define KVM_REG_PPC_MMCR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x11) 47460021220SAndre Przywara #define KVM_REG_PPC_MMCRA (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x12) 47560021220SAndre Przywara #define KVM_REG_PPC_MMCR2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x13) 47660021220SAndre Przywara #define KVM_REG_PPC_MMCRS (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x14) 47760021220SAndre Przywara #define KVM_REG_PPC_SIAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x15) 47860021220SAndre Przywara #define KVM_REG_PPC_SDAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x16) 47960021220SAndre Przywara #define KVM_REG_PPC_SIER (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x17) 48060021220SAndre Przywara 48160021220SAndre Przywara #define KVM_REG_PPC_PMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x18) 48260021220SAndre Przywara #define KVM_REG_PPC_PMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x19) 48360021220SAndre Przywara #define KVM_REG_PPC_PMC3 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1a) 48460021220SAndre Przywara #define KVM_REG_PPC_PMC4 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1b) 48560021220SAndre Przywara #define KVM_REG_PPC_PMC5 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1c) 48660021220SAndre Przywara #define KVM_REG_PPC_PMC6 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1d) 48760021220SAndre Przywara #define KVM_REG_PPC_PMC7 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1e) 48860021220SAndre Przywara #define KVM_REG_PPC_PMC8 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1f) 48960021220SAndre Przywara 49060021220SAndre Przywara /* 32 floating-point registers */ 49160021220SAndre Przywara #define KVM_REG_PPC_FPR0 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x20) 49260021220SAndre Przywara #define KVM_REG_PPC_FPR(n) (KVM_REG_PPC_FPR0 + (n)) 49360021220SAndre Przywara #define KVM_REG_PPC_FPR31 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3f) 49460021220SAndre Przywara 49560021220SAndre Przywara /* 32 VMX/Altivec vector registers */ 49660021220SAndre Przywara #define KVM_REG_PPC_VR0 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x40) 49760021220SAndre Przywara #define KVM_REG_PPC_VR(n) (KVM_REG_PPC_VR0 + (n)) 49860021220SAndre Przywara #define KVM_REG_PPC_VR31 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x5f) 49960021220SAndre Przywara 50060021220SAndre Przywara /* 32 double-width FP registers for VSX */ 50160021220SAndre Przywara /* High-order halves overlap with FP regs */ 50260021220SAndre Przywara #define KVM_REG_PPC_VSR0 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x60) 50360021220SAndre Przywara #define KVM_REG_PPC_VSR(n) (KVM_REG_PPC_VSR0 + (n)) 50460021220SAndre Przywara #define KVM_REG_PPC_VSR31 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x7f) 50560021220SAndre Przywara 50660021220SAndre Przywara /* FP and vector status/control registers */ 50760021220SAndre Przywara #define KVM_REG_PPC_FPSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x80) 50860021220SAndre Przywara /* 50960021220SAndre Przywara * VSCR register is documented as a 32-bit register in the ISA, but it can 51060021220SAndre Przywara * only be accesses via a vector register. Expose VSCR as a 32-bit register 51160021220SAndre Przywara * even though the kernel represents it as a 128-bit vector. 51260021220SAndre Przywara */ 51360021220SAndre Przywara #define KVM_REG_PPC_VSCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x81) 51460021220SAndre Przywara 51560021220SAndre Przywara /* Virtual processor areas */ 51660021220SAndre Przywara /* For SLB & DTL, address in high (first) half, length in low half */ 51760021220SAndre Przywara #define KVM_REG_PPC_VPA_ADDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x82) 51860021220SAndre Przywara #define KVM_REG_PPC_VPA_SLB (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x83) 51960021220SAndre Przywara #define KVM_REG_PPC_VPA_DTL (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x84) 52060021220SAndre Przywara 52160021220SAndre Przywara #define KVM_REG_PPC_EPCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x85) 52260021220SAndre Przywara #define KVM_REG_PPC_EPR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x86) 52360021220SAndre Przywara 52460021220SAndre Przywara /* Timer Status Register OR/CLEAR interface */ 52560021220SAndre Przywara #define KVM_REG_PPC_OR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x87) 52660021220SAndre Przywara #define KVM_REG_PPC_CLEAR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x88) 52760021220SAndre Przywara #define KVM_REG_PPC_TCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x89) 52860021220SAndre Przywara #define KVM_REG_PPC_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8a) 52960021220SAndre Przywara 53060021220SAndre Przywara /* Debugging: Special instruction for software breakpoint */ 53160021220SAndre Przywara #define KVM_REG_PPC_DEBUG_INST (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8b) 53260021220SAndre Przywara 53360021220SAndre Przywara /* MMU registers */ 53460021220SAndre Przywara #define KVM_REG_PPC_MAS0 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8c) 53560021220SAndre Przywara #define KVM_REG_PPC_MAS1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8d) 53660021220SAndre Przywara #define KVM_REG_PPC_MAS2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8e) 53760021220SAndre Przywara #define KVM_REG_PPC_MAS7_3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8f) 53860021220SAndre Przywara #define KVM_REG_PPC_MAS4 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x90) 53960021220SAndre Przywara #define KVM_REG_PPC_MAS6 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x91) 54060021220SAndre Przywara #define KVM_REG_PPC_MMUCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x92) 54160021220SAndre Przywara /* 54260021220SAndre Przywara * TLBnCFG fields TLBnCFG_N_ENTRY and TLBnCFG_ASSOC can be changed only using 54360021220SAndre Przywara * KVM_CAP_SW_TLB ioctl 54460021220SAndre Przywara */ 54560021220SAndre Przywara #define KVM_REG_PPC_TLB0CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x93) 54660021220SAndre Przywara #define KVM_REG_PPC_TLB1CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x94) 54760021220SAndre Przywara #define KVM_REG_PPC_TLB2CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x95) 54860021220SAndre Przywara #define KVM_REG_PPC_TLB3CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x96) 54960021220SAndre Przywara #define KVM_REG_PPC_TLB0PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x97) 55060021220SAndre Przywara #define KVM_REG_PPC_TLB1PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x98) 55160021220SAndre Przywara #define KVM_REG_PPC_TLB2PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x99) 55260021220SAndre Przywara #define KVM_REG_PPC_TLB3PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9a) 55360021220SAndre Przywara #define KVM_REG_PPC_EPTCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9b) 55460021220SAndre Przywara 55560021220SAndre Przywara /* Timebase offset */ 55660021220SAndre Przywara #define KVM_REG_PPC_TB_OFFSET (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9c) 55760021220SAndre Przywara 55860021220SAndre Przywara /* POWER8 registers */ 55960021220SAndre Przywara #define KVM_REG_PPC_SPMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9d) 56060021220SAndre Przywara #define KVM_REG_PPC_SPMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9e) 56160021220SAndre Przywara #define KVM_REG_PPC_IAMR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9f) 56260021220SAndre Przywara #define KVM_REG_PPC_TFHAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa0) 56360021220SAndre Przywara #define KVM_REG_PPC_TFIAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa1) 56460021220SAndre Przywara #define KVM_REG_PPC_TEXASR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa2) 56560021220SAndre Przywara #define KVM_REG_PPC_FSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa3) 56660021220SAndre Przywara #define KVM_REG_PPC_PSPB (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xa4) 56760021220SAndre Przywara #define KVM_REG_PPC_EBBHR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa5) 56860021220SAndre Przywara #define KVM_REG_PPC_EBBRR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa6) 56960021220SAndre Przywara #define KVM_REG_PPC_BESCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa7) 57060021220SAndre Przywara #define KVM_REG_PPC_TAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa8) 57160021220SAndre Przywara #define KVM_REG_PPC_DPDES (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa9) 57260021220SAndre Przywara #define KVM_REG_PPC_DAWR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xaa) 57360021220SAndre Przywara #define KVM_REG_PPC_DAWRX (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xab) 57460021220SAndre Przywara #define KVM_REG_PPC_CIABR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xac) 57560021220SAndre Przywara #define KVM_REG_PPC_IC (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xad) 57660021220SAndre Przywara #define KVM_REG_PPC_VTB (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xae) 57760021220SAndre Przywara #define KVM_REG_PPC_CSIGR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xaf) 57860021220SAndre Przywara #define KVM_REG_PPC_TACR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb0) 57960021220SAndre Przywara #define KVM_REG_PPC_TCSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb1) 58060021220SAndre Przywara #define KVM_REG_PPC_PID (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb2) 58160021220SAndre Przywara #define KVM_REG_PPC_ACOP (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb3) 58260021220SAndre Przywara 58360021220SAndre Przywara #define KVM_REG_PPC_VRSAVE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb4) 58460021220SAndre Przywara #define KVM_REG_PPC_LPCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb5) 58560021220SAndre Przywara #define KVM_REG_PPC_LPCR_64 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb5) 58660021220SAndre Przywara #define KVM_REG_PPC_PPR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb6) 58760021220SAndre Przywara 58860021220SAndre Przywara /* Architecture compatibility level */ 58960021220SAndre Przywara #define KVM_REG_PPC_ARCH_COMPAT (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb7) 59060021220SAndre Przywara 59160021220SAndre Przywara #define KVM_REG_PPC_DABRX (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8) 59260021220SAndre Przywara #define KVM_REG_PPC_WORT (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9) 59360021220SAndre Przywara #define KVM_REG_PPC_SPRG9 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba) 59460021220SAndre Przywara #define KVM_REG_PPC_DBSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbb) 59560021220SAndre Przywara 596*764dfba1SAndre Przywara /* POWER9 registers */ 597*764dfba1SAndre Przywara #define KVM_REG_PPC_TIDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbc) 598*764dfba1SAndre Przywara #define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd) 599*764dfba1SAndre Przywara 60060021220SAndre Przywara /* Transactional Memory checkpointed state: 60160021220SAndre Przywara * This is all GPRs, all VSX regs and a subset of SPRs 60260021220SAndre Przywara */ 60360021220SAndre Przywara #define KVM_REG_PPC_TM (KVM_REG_PPC | 0x80000000) 60460021220SAndre Przywara /* TM GPRs */ 60560021220SAndre Przywara #define KVM_REG_PPC_TM_GPR0 (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0) 60660021220SAndre Przywara #define KVM_REG_PPC_TM_GPR(n) (KVM_REG_PPC_TM_GPR0 + (n)) 60760021220SAndre Przywara #define KVM_REG_PPC_TM_GPR31 (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x1f) 60860021220SAndre Przywara /* TM VSX */ 60960021220SAndre Przywara #define KVM_REG_PPC_TM_VSR0 (KVM_REG_PPC_TM | KVM_REG_SIZE_U128 | 0x20) 61060021220SAndre Przywara #define KVM_REG_PPC_TM_VSR(n) (KVM_REG_PPC_TM_VSR0 + (n)) 61160021220SAndre Przywara #define KVM_REG_PPC_TM_VSR63 (KVM_REG_PPC_TM | KVM_REG_SIZE_U128 | 0x5f) 61260021220SAndre Przywara /* TM SPRS */ 61360021220SAndre Przywara #define KVM_REG_PPC_TM_CR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x60) 61460021220SAndre Przywara #define KVM_REG_PPC_TM_LR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x61) 61560021220SAndre Przywara #define KVM_REG_PPC_TM_CTR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x62) 61660021220SAndre Przywara #define KVM_REG_PPC_TM_FPSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x63) 61760021220SAndre Przywara #define KVM_REG_PPC_TM_AMR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x64) 61860021220SAndre Przywara #define KVM_REG_PPC_TM_PPR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x65) 61960021220SAndre Przywara #define KVM_REG_PPC_TM_VRSAVE (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x66) 62060021220SAndre Przywara #define KVM_REG_PPC_TM_VSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U32 | 0x67) 62160021220SAndre Przywara #define KVM_REG_PPC_TM_DSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x68) 62260021220SAndre Przywara #define KVM_REG_PPC_TM_TAR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x69) 623*764dfba1SAndre Przywara #define KVM_REG_PPC_TM_XER (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x6a) 62460021220SAndre Przywara 62560021220SAndre Przywara /* PPC64 eXternal Interrupt Controller Specification */ 62660021220SAndre Przywara #define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */ 62760021220SAndre Przywara 62860021220SAndre Przywara /* Layout of 64-bit source attribute values */ 62960021220SAndre Przywara #define KVM_XICS_DESTINATION_SHIFT 0 63060021220SAndre Przywara #define KVM_XICS_DESTINATION_MASK 0xffffffffULL 63160021220SAndre Przywara #define KVM_XICS_PRIORITY_SHIFT 32 63260021220SAndre Przywara #define KVM_XICS_PRIORITY_MASK 0xff 63360021220SAndre Przywara #define KVM_XICS_LEVEL_SENSITIVE (1ULL << 40) 63460021220SAndre Przywara #define KVM_XICS_MASKED (1ULL << 41) 63560021220SAndre Przywara #define KVM_XICS_PENDING (1ULL << 42) 636*764dfba1SAndre Przywara #define KVM_XICS_PRESENTED (1ULL << 43) 637*764dfba1SAndre Przywara #define KVM_XICS_QUEUED (1ULL << 44) 63860021220SAndre Przywara 63960021220SAndre Przywara #endif /* __LINUX_KVM_POWERPC_H */ 640