diff options
author | James Hogan <james.hogan@imgtec.com> | 2014-07-04 10:11:35 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-09 12:09:59 -0400 |
commit | c2d2c21bff27617ff2ada064f7b70079a2123364 (patch) | |
tree | 7e1f0defea996c0b794c636d59ff738c991185a8 /Documentation/virtual | |
parent | bf5590f379196aa3ca48a6c778a0ae511ba67d77 (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.txt | 63 |
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 */ | ||
301 | struct 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 | ||
301 | 4.12 KVM_SET_REGS | 310 | 4.12 KVM_SET_REGS |
302 | 311 | ||
@@ -378,7 +387,7 @@ struct kvm_translation { | |||
378 | 4.16 KVM_INTERRUPT | 387 | 4.16 KVM_INTERRUPT |
379 | 388 | ||
380 | Capability: basic | 389 | Capability: basic |
381 | Architectures: x86, ppc | 390 | Architectures: x86, ppc, mips |
382 | Type: vcpu ioctl | 391 | Type: vcpu ioctl |
383 | Parameters: struct kvm_interrupt (in) | 392 | Parameters: struct kvm_interrupt (in) |
384 | Returns: 0 on success, -1 on error | 393 | Returns: 0 on success, -1 on error |
@@ -423,6 +432,11 @@ c) KVM_INTERRUPT_SET_LEVEL | |||
423 | Note that any value for 'irq' other than the ones stated above is invalid | 432 | Note that any value for 'irq' other than the ones stated above is invalid |
424 | and incurs unexpected behavior. | 433 | and incurs unexpected behavior. |
425 | 434 | ||
435 | MIPS: | ||
436 | |||
437 | Queues an external interrupt to be injected into the virtual CPU. A negative | ||
438 | interrupt number dequeues the interrupt. | ||
439 | |||
426 | 440 | ||
427 | 4.17 KVM_DEBUG_GUEST | 441 | 4.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 | ||
1894 | ARM registers are mapped using the lower 32 bits. The upper 16 of that | 1937 | ARM registers are mapped using the lower 32 bits. The upper 16 of that |
1895 | is the register group type, or coprocessor number: | 1938 | is the register group type, or coprocessor number: |
@@ -1928,6 +1971,22 @@ arm64 CCSIDR registers are demultiplexed by CSSELR value: | |||
1928 | arm64 system registers have the following id bit patterns: | 1971 | arm64 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 | |||
1975 | MIPS registers are mapped using the lower 32 bits. The upper 16 of that is | ||
1976 | the register group type: | ||
1977 | |||
1978 | MIPS core registers (see above) have the following id bit patterns: | ||
1979 | 0x7030 0000 0000 <reg:16> | ||
1980 | |||
1981 | MIPS CP0 registers (see KVM_REG_MIPS_CP0_* above) have the following id bit | ||
1982 | patterns 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 | |||
1986 | MIPS KVM control registers (see above) have the following id bit patterns: | ||
1987 | 0x7030 0000 0002 <reg:16> | ||
1988 | |||
1989 | |||
1931 | 4.69 KVM_GET_ONE_REG | 1990 | 4.69 KVM_GET_ONE_REG |
1932 | 1991 | ||
1933 | Capability: KVM_CAP_ONE_REG | 1992 | Capability: KVM_CAP_ONE_REG |
@@ -2415,7 +2474,7 @@ in VCPU matching underlying host. | |||
2415 | 4.84 KVM_GET_REG_LIST | 2474 | 4.84 KVM_GET_REG_LIST |
2416 | 2475 | ||
2417 | Capability: basic | 2476 | Capability: basic |
2418 | Architectures: arm, arm64 | 2477 | Architectures: arm, arm64, mips |
2419 | Type: vcpu ioctl | 2478 | Type: vcpu ioctl |
2420 | Parameters: struct kvm_reg_list (in/out) | 2479 | Parameters: struct kvm_reg_list (in/out) |
2421 | Returns: 0 on success; -1 on error | 2480 | Returns: 0 on success; -1 on error |