* [PATCH 1/1] correctly handle VM Entry Exit reasons and also show them in trace.
@ 2010-04-18 6:35 Manish Regmi
2010-04-19 9:24 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Manish Regmi @ 2010-04-18 6:35 UTC (permalink / raw)
To: kvm; +Cc: avi
Hi,
When the vm exit reason is VM Entry failures it has leftmost bit set.
This patch
- clears the leftmost bit when copying to vmx->exit_reason. This will
make the checks like if ((vmx->exit_reason ==
EXIT_REASON_MCE_DURING_VMENTRY) valid in vmx_complete_interrupts.
- adds two more EXIT_REASONS 33 and 34 in vmx.h
- also adds them to exit reason strings.
Please let me know if there is anything missing or wrong. Thank you.
Signed-off-by: Manish Regmi <regmi.manish@gmail.com>
--------
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index fb9a080..9bf84db 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -251,6 +251,8 @@ enum vmcs_field {
#define EXIT_REASON_IO_INSTRUCTION 30
#define EXIT_REASON_MSR_READ 31
#define EXIT_REASON_MSR_WRITE 32
+#define EXIT_REASON_INVALID_GUEST_STATE 33
+#define EXIT_REASON_MSR_LOADING 34
#define EXIT_REASON_MWAIT_INSTRUCTION 36
#define EXIT_REASON_MONITOR_INSTRUCTION 39
#define EXIT_REASON_PAUSE_INSTRUCTION 40
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 7e2f8d5..e93be6f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3641,7 +3641,7 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
- vmx->exit_reason = vmcs_read32(VM_EXIT_REASON);
+ vmx->exit_reason = vmcs_read32(VM_EXIT_REASON) &
~VMX_EXIT_REASONS_FAILED_VMENTRY;
/* Handle machine checks before interrupts are enabled */
if ((vmx->exit_reason == EXIT_REASON_MCE_DURING_VMENTRY)
@@ -4057,6 +4057,8 @@ static const struct trace_print_flags
vmx_exit_reasons_str[] = {
_ER(IO_INSTRUCTION),
_ER(MSR_READ),
_ER(MSR_WRITE),
+ _ER(INVALID_GUEST_STATE),
+ _ER(MSR_LOADING),
_ER(MWAIT_INSTRUCTION),
_ER(MONITOR_INSTRUCTION),
_ER(PAUSE_INSTRUCTION),
---------------------------------------------------------------
regards
Manish Regmi
http://manish-cs.blogspot.com
http://ext2read.sf.net
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/1] correctly handle VM Entry Exit reasons and also show them in trace.
2010-04-18 6:35 [PATCH 1/1] correctly handle VM Entry Exit reasons and also show them in trace Manish Regmi
@ 2010-04-19 9:24 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-04-19 9:24 UTC (permalink / raw)
To: Manish Regmi; +Cc: kvm
On 04/18/2010 09:35 AM, Manish Regmi wrote:
> Hi,
> When the vm exit reason is VM Entry failures it has leftmost bit set.
> This patch
> - clears the leftmost bit when copying to vmx->exit_reason. This will
> make the checks like if ((vmx->exit_reason ==
> EXIT_REASON_MCE_DURING_VMENTRY) valid in vmx_complete_interrupts.
> - adds two more EXIT_REASONS 33 and 34 in vmx.h
> - also adds them to exit reason strings.
>
> Please let me know if there is anything missing or wrong. Thank you.
>
>
The patch is wordwrapped. Please use git send-email or equivalent.
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 7e2f8d5..e93be6f 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3641,7 +3641,7 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
>
> exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
>
> - vmx->exit_reason = vmcs_read32(VM_EXIT_REASON);
> + vmx->exit_reason = vmcs_read32(VM_EXIT_REASON)&
> ~VMX_EXIT_REASONS_FAILED_VMENTRY;
>
(here for example)
> /* Handle machine checks before interrupts are enabled */
> if ((vmx->exit_reason == EXIT_REASON_MCE_DURING_VMENTRY)
> @@ -4057,6 +4057,8 @@ static const struct trace_print_flags
> vmx_exit_reasons_str[] = {
> _ER(IO_INSTRUCTION),
> _ER(MSR_READ),
> _ER(MSR_WRITE),
> + _ER(INVALID_GUEST_STATE),
> + _ER(MSR_LOADING),
> _ER(MWAIT_INSTRUCTION),
> _ER(MONITOR_INSTRUCTION),
> _ER(PAUSE_INSTRUCTION),
>
Please split the new exit codes into a separate patch.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-19 9:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-18 6:35 [PATCH 1/1] correctly handle VM Entry Exit reasons and also show them in trace Manish Regmi
2010-04-19 9:24 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox