KVM: Documentation: document MCE ioctls
Subsystems (2)
PATCH v2 1/1 KVM: Documentation: document MCE ioctls
---
o v2
- Rebase against latest queue branch
- Several text fixups [Paolo]
Documentation/virtual/kvm/api.txt | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)
Documentation/virtual/kvm/api.txt +63 -0
@@ -3373,6 +3373,69 @@ struct kvm_ppc_resize_hpt { __u32 pad; }; +4.104 KVM_X86_GET_MCE_CAP_SUPPORTED + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: system ioctl +Parameters: u64 mce_cap (in/out) +Returns: 0 on success, -1 on error + +Returns supported MCE capabilities. The u64 mce_cap parameter +has the same format as the MSR_IA32_MCG_CAP register. Supported +capabilities will have the corresponding bits set. + +4.105 KVM_X86_SETUP_MCE + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: vcpu ioctl +Parameters: u64 mcg_cap (in) +Returns: 0 on success, + -EFAULT if u64 mcg_cap cannot be read, + -EINVAL if the requested number of banks is invalid, + -EINVAL if requested MCE capability is not supported. + +Initializes MCE support for use. The u64 mcg_cap parameter +has the same format as the MSR_IA32_MCG_CAP register and +specifies which capabilities should be enabled. The maximum +supported number of error-reporting banks can be retrieved when +checking for KVM_CAP_MCE. The supported capabilities can be +retrieved with KVM_X86_GET_MCE_CAP_SUPPORTED. + +4.106 KVM_X86_SET_MCE + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: vcpu ioctl +Parameters: struct kvm_x86_mce (in) +Returns: 0 on success, + -EFAULT if struct kvm_x86_mce cannot be read, + -EINVAL if the bank number is invalid, + -EINVAL if VAL bit is not set in status field. + +Inject a machine check error (MCE) into the guest. The input +parameter is: + +struct kvm_x86_mce { + __u64 status; + __u64 addr; + __u64 misc; + __u64 mcg_status; + __u8 bank; + __u8 pad1[7]; + __u64 pad2[3]; +}; + +If the MCE being reported is an uncorrected error, KVM will +inject it as an MCE exception into the guest. If the guest +MCG_STATUS register reports that an MCE is in progress, KVM +causes an KVM_EXIT_SHUTDOWN vmexit. + +Otherwise, if the MCE is an corrected error, KVM will just +store it in the corresponding bank (provided this bank is +not holding a previously reported uncorrected error). + 5. The kvm_run structure ------------------------
Signature · 1 line
2.9.3
Am 10.03.2017 um 17:44 schrieb Luiz Capitulino:
Quoted 17 lines
Signed-off-by Luiz Capitulino <[email protected]>---
o v2
- Rebase against latest queue branch
- Several text fixups [Paolo]Documentation/virtual/kvm/api.txt | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)Documentation/virtual/kvm/api.txt +0
-0
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3381
Quoted 9 lines
Documentation/virtual/kvm/api.txt +6
-0@@ -3373,6 +3373,69 @@ struct kvm_ppc_resize_hpt { __u32 pad; }; +4.104 KVM_X86_GET_MCE_CAP_SUPPORTED + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: system ioctl +Parameters: u64 mce_cap (in/out)
Shouldn't this be (out) only?
Quoted 40 lines
Documentation/virtual/kvm/api.txt +40
-0+Returns: 0 on success, -1 on error + +Returns supported MCE capabilities. The u64 mce_cap parameter +has the same format as the MSR_IA32_MCG_CAP register. Supported +capabilities will have the corresponding bits set. + +4.105 KVM_X86_SETUP_MCE + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: vcpu ioctl +Parameters: u64 mcg_cap (in) +Returns: 0 on success, + -EFAULT if u64 mcg_cap cannot be read, + -EINVAL if the requested number of banks is invalid, + -EINVAL if requested MCE capability is not supported. + +Initializes MCE support for use. The u64 mcg_cap parameter +has the same format as the MSR_IA32_MCG_CAP register and +specifies which capabilities should be enabled. The maximum +supported number of error-reporting banks can be retrieved when +checking for KVM_CAP_MCE. The supported capabilities can be +retrieved with KVM_X86_GET_MCE_CAP_SUPPORTED. + +4.106 KVM_X86_SET_MCE + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: vcpu ioctl +Parameters: struct kvm_x86_mce (in) +Returns: 0 on success, + -EFAULT if struct kvm_x86_mce cannot be read, + -EINVAL if the bank number is invalid, + -EINVAL if VAL bit is not set in status field. + +Inject a machine check error (MCE) into the guest. The input +parameter is: + +struct kvm_x86_mce { + __u64 status;
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3431
Quoted 10 lines
Documentation/virtual/kvm/api.txt +10
-0+ __u64 addr; + __u64 misc; + __u64 mcg_status; + __u8 bank; + __u8 pad1[7]; + __u64 pad2[3]; +}; + +If the MCE being reported is an uncorrected error, KVM will +inject it as an MCE exception into the guest. If the guest
s/an MCE/a MCE/ ? (not a native speaker)
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3435
Quoted 4 lines
Documentation/virtual/kvm/api.txt +4
-0+MCG_STATUS register reports that an MCE is in progress, KVM +causes an KVM_EXIT_SHUTDOWN vmexit. + +Otherwise, if the MCE is an corrected error, KVM will just
s/an corrected/a corrected/ ? (not a native speaker)
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3441
Quoted 7 lines
Documentation/virtual/kvm/api.txt +3
-0+store it in the corresponding bank (provided this bank is +not holding a previously reported uncorrected error). + 5. The kvm_run structure ------------------------
Feel free to add
Signature · 3 lines
Thanks, David
Quoted 21 lines · On Mon, 13 Mar 2017 09:44:56 +0100 David Hildenbrand <[email protected]> wrote:
Am 10.03.2017 um 17:44 schrieb Luiz Capitulino:
Quoted 20 lines
Signed-off-by Luiz Capitulino <[email protected]>---
o v2
- Rebase against latest queue branch
- Several text fixups [Paolo]Documentation/virtual/kvm/api.txt | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)Documentation/virtual/kvm/api.txt +0
-0@@ -3373,6 +3373,69 @@ struct kvm_ppc_resize_hpt { __u32 pad; };
Quoted 8 lines
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3381
Quoted 6 lines
Documentation/virtual/kvm/api.txt +6
-0+4.104 KVM_X86_GET_MCE_CAP_SUPPORTED + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: system ioctl +Parameters: u64 mce_cap (in/out)Shouldn't this be (out) only?
Correct. Fixed.
Quoted 44 lines
Quoted 44 lines
Documentation/virtual/kvm/api.txt +44
-0+Returns: 0 on success, -1 on error + +Returns supported MCE capabilities. The u64 mce_cap parameter +has the same format as the MSR_IA32_MCG_CAP register. Supported +capabilities will have the corresponding bits set. + +4.105 KVM_X86_SETUP_MCE + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: vcpu ioctl +Parameters: u64 mcg_cap (in) +Returns: 0 on success, + -EFAULT if u64 mcg_cap cannot be read, + -EINVAL if the requested number of banks is invalid, + -EINVAL if requested MCE capability is not supported. + +Initializes MCE support for use. The u64 mcg_cap parameter +has the same format as the MSR_IA32_MCG_CAP register and +specifies which capabilities should be enabled. The maximum +supported number of error-reporting banks can be retrieved when +checking for KVM_CAP_MCE. The supported capabilities can be +retrieved with KVM_X86_GET_MCE_CAP_SUPPORTED. + +4.106 KVM_X86_SET_MCE + +Capability: KVM_CAP_MCE +Architectures: x86 +Type: vcpu ioctl +Parameters: struct kvm_x86_mce (in) +Returns: 0 on success, + -EFAULT if struct kvm_x86_mce cannot be read, + -EINVAL if the bank number is invalid, + -EINVAL if VAL bit is not set in status field. + +Inject a machine check error (MCE) into the guest. The input +parameter is: + +struct kvm_x86_mce { + __u64 status; + __u64 addr; + __u64 misc; + __u64 mcg_status; + __u8 bank;
Quoted 8 lines
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3431
Quoted 6 lines
Documentation/virtual/kvm/api.txt +6
-0+ __u8 pad1[7]; + __u64 pad2[3]; +}; + +If the MCE being reported is an uncorrected error, KVM will +inject it as an MCE exception into the guest. If the guests/an MCE/a MCE/ ? (not a native speaker)
I'm not completely sure, but Intel's manual agrees with me so I'm keeping it.
Quoted 6 lines
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3435
Quoted 4 lines
Documentation/virtual/kvm/api.txt +4
-0+MCG_STATUS register reports that an MCE is in progress, KVM +causes an KVM_EXIT_SHUTDOWN vmexit. + +Otherwise, if the MCE is an corrected error, KVM will justs/an corrected/a corrected/ ? (not a native speaker)
You seem right about this one, so I've fixed it.
I'm not including your reviewed-by because I didn't apply all the changes you requested.
Quoted 13 lines
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3441
Quoted 8 lines
Documentation/virtual/kvm/api.txt +3
-0+store it in the corresponding bank (provided this bank is +not holding a previously reported uncorrected error). + 5. The kvm_run structure ------------------------Feel free to add
Reviewed-by David Hildenbrand <[email protected]>
2017-03-13 09:07-0400, Luiz Capitulino:
Quoted 11 lines
Quoted 6 lines · On Mon, 13 Mar 2017 09:44:56 +0100 David Hildenbrand <[email protected]> wrote:
Am 10.03.2017 um 17:44 schrieb Luiz Capitulino:
Documentation/virtual/kvm/api.txt struct kvm_ppc_resize_hpt { · line 3431
Quoted 3 lines
Signed-off-by Luiz Capitulino <[email protected]>Documentation/virtual/kvm/api.txt +2
-0+If the MCE being reported is an uncorrected error, KVM will +inject it as an MCE exception into the guest. If the guests/an MCE/a MCE/ ? (not a native speaker)
I'm not completely sure, but Intel's manual agrees with me so I'm keeping it.
The a|an rule is based on pronunciation and MCE starts with /ɛm/, so as another non-native speaker, I'd keep "an". :)