summaryrefslogtreecommitdiffstats
path: root/Documentation/virtual
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2014-07-04 10:11:35 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-07-09 12:09:59 -0400
commitc2d2c21bff27617ff2ada064f7b70079a2123364 (patch)
tree7e1f0defea996c0b794c636d59ff738c991185a8 /Documentation/virtual
parentbf5590f379196aa3ca48a6c778a0ae511ba67d77 (diff)
KVM: MIPS: Document MIPS specifics of KVM API.
Document the MIPS specific parts of the KVM API, including: - The layout of the kvm_regs structure. - The interrupt number passed to KVM_INTERRUPT. - The registers supported by the KVM_{GET,SET}_ONE_REG interface, and the encoding of those register ids. - That KVM_INTERRUPT and KVM_GET_REG_LIST are supported on MIPS. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Gleb Natapov <gleb@kernel.org> Cc: kvm@vger.kernel.org Cc: Randy Dunlap <rdunlap@infradead.org> Cc: linux-doc@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Documentation/virtual')
-rw-r--r--Documentation/virtual/kvm/api.txt63
1 files changed, 61 insertions, 2 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index c9e91cca7c52..5833266407f5 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -297,6 +297,15 @@ struct kvm_regs {
297 __u64 rip, rflags; 297 __u64 rip, rflags;
298}; 298};
299 299
300/* mips */
301struct kvm_regs {
302 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
303 __u64 gpr[32];
304 __u64 hi;
305 __u64 lo;
306 __u64 pc;
307};
308
300 309
3014.12 KVM_SET_REGS 3104.12 KVM_SET_REGS
302 311
@@ -378,7 +387,7 @@ struct kvm_translation {
3784.16 KVM_INTERRUPT 3874.16 KVM_INTERRUPT
379 388
380Capability: basic 389Capability: basic
381Architectures: x86, ppc 390Architectures: x86, ppc, mips
382Type: vcpu ioctl 391Type: vcpu ioctl
383Parameters: struct kvm_interrupt (in) 392Parameters: struct kvm_interrupt (in)
384Returns: 0 on success, -1 on error 393Returns: 0 on success, -1 on error
@@ -423,6 +432,11 @@ c) KVM_INTERRUPT_SET_LEVEL
423Note that any value for 'irq' other than the ones stated above is invalid 432Note that any value for 'irq' other than the ones stated above is invalid
424and incurs unexpected behavior. 433and incurs unexpected behavior.
425 434
435MIPS:
436
437Queues an external interrupt to be injected into the virtual CPU. A negative
438interrupt number dequeues the interrupt.
439
426 440
4274.17 KVM_DEBUG_GUEST 4414.17 KVM_DEBUG_GUEST
428 442
@@ -1890,6 +1904,35 @@ registers, find a list below:
1890 PPC | KVM_REG_PPC_TM_VSCR | 32 1904 PPC | KVM_REG_PPC_TM_VSCR | 32
1891 PPC | KVM_REG_PPC_TM_DSCR | 64 1905 PPC | KVM_REG_PPC_TM_DSCR | 64
1892 PPC | KVM_REG_PPC_TM_TAR | 64 1906 PPC | KVM_REG_PPC_TM_TAR | 64
1907 | |
1908 MIPS | KVM_REG_MIPS_R0 | 64
1909 ...
1910 MIPS | KVM_REG_MIPS_R31 | 64
1911 MIPS | KVM_REG_MIPS_HI | 64
1912 MIPS | KVM_REG_MIPS_LO | 64
1913 MIPS | KVM_REG_MIPS_PC | 64
1914 MIPS | KVM_REG_MIPS_CP0_INDEX | 32
1915 MIPS | KVM_REG_MIPS_CP0_CONTEXT | 64
1916 MIPS | KVM_REG_MIPS_CP0_USERLOCAL | 64
1917 MIPS | KVM_REG_MIPS_CP0_PAGEMASK | 32
1918 MIPS | KVM_REG_MIPS_CP0_WIRED | 32
1919 MIPS | KVM_REG_MIPS_CP0_HWRENA | 32
1920 MIPS | KVM_REG_MIPS_CP0_BADVADDR | 64
1921 MIPS | KVM_REG_MIPS_CP0_COUNT | 32
1922 MIPS | KVM_REG_MIPS_CP0_ENTRYHI | 64
1923 MIPS | KVM_REG_MIPS_CP0_COMPARE | 32
1924 MIPS | KVM_REG_MIPS_CP0_STATUS | 32
1925 MIPS | KVM_REG_MIPS_CP0_CAUSE | 32
1926 MIPS | KVM_REG_MIPS_CP0_EPC | 64
1927 MIPS | KVM_REG_MIPS_CP0_CONFIG | 32
1928 MIPS | KVM_REG_MIPS_CP0_CONFIG1 | 32
1929 MIPS | KVM_REG_MIPS_CP0_CONFIG2 | 32
1930 MIPS | KVM_REG_MIPS_CP0_CONFIG3 | 32
1931 MIPS | KVM_REG_MIPS_CP0_CONFIG7 | 32
1932 MIPS | KVM_REG_MIPS_CP0_ERROREPC | 64
1933 MIPS | KVM_REG_MIPS_COUNT_CTL | 64
1934 MIPS | KVM_REG_MIPS_COUNT_RESUME | 64
1935 MIPS | KVM_REG_MIPS_COUNT_HZ | 64
1893 1936
1894ARM registers are mapped using the lower 32 bits. The upper 16 of that 1937ARM registers are mapped using the lower 32 bits. The upper 16 of that
1895is the register group type, or coprocessor number: 1938is the register group type, or coprocessor number:
@@ -1928,6 +1971,22 @@ arm64 CCSIDR registers are demultiplexed by CSSELR value:
1928arm64 system registers have the following id bit patterns: 1971arm64 system registers have the following id bit patterns:
1929 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3> 1972 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3>
1930 1973
1974
1975MIPS registers are mapped using the lower 32 bits. The upper 16 of that is
1976the register group type:
1977
1978MIPS core registers (see above) have the following id bit patterns:
1979 0x7030 0000 0000 <reg:16>
1980
1981MIPS CP0 registers (see KVM_REG_MIPS_CP0_* above) have the following id bit
1982patterns depending on whether they're 32-bit or 64-bit registers:
1983 0x7020 0000 0001 00 <reg:5> <sel:3> (32-bit)
1984 0x7030 0000 0001 00 <reg:5> <sel:3> (64-bit)
1985
1986MIPS KVM control registers (see above) have the following id bit patterns:
1987 0x7030 0000 0002 <reg:16>
1988
1989
19314.69 KVM_GET_ONE_REG 19904.69 KVM_GET_ONE_REG
1932 1991
1933Capability: KVM_CAP_ONE_REG 1992Capability: KVM_CAP_ONE_REG
@@ -2415,7 +2474,7 @@ in VCPU matching underlying host.
24154.84 KVM_GET_REG_LIST 24744.84 KVM_GET_REG_LIST
2416 2475
2417Capability: basic 2476Capability: basic
2418Architectures: arm, arm64 2477Architectures: arm, arm64, mips
2419Type: vcpu ioctl 2478Type: vcpu ioctl
2420Parameters: struct kvm_reg_list (in/out) 2479Parameters: struct kvm_reg_list (in/out)
2421Returns: 0 on success; -1 on error 2480Returns: 0 on success; -1 on error