From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Kevin Tian <kevin.tian@intel.com>,
Eddie Dong <eddie.dong@intel.com>,
Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH 3/5] VMX: dump further control state
Date: Tue, 20 Jan 2015 17:39:09 +0000 [thread overview]
Message-ID: <54BE92BD.3030200@citrix.com> (raw)
In-Reply-To: <54BE44D60200007800056F0E@mail.emea.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 5932 bytes --]
On 20/01/15 11:06, Jan Beulich wrote:
> A few relevant control state fields did not get dumped so far; in
> particular, VM_ENTRY_INSTRUCTION_LEN got printed twice (instead of also
> printing VM_EXIT_INSTRUCTION_LEN). Where suitable (to reduce the amount
> of output) make some of the dumping conditional upon guest settings
> (this isn't required for correctness as vmr() already uses
> __vmread_safe(), i.e. it is fine to access non-existing fields).
>
> Also drop casts.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -1520,31 +1520,35 @@ void vmcs_dump_vcpu(struct vcpu *v)
>
> printk("*** Control State ***\n");
> printk("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n",
> - (uint32_t)vmr(PIN_BASED_VM_EXEC_CONTROL),
> - (uint32_t)vmr(CPU_BASED_VM_EXEC_CONTROL),
> - (uint32_t)vmr(SECONDARY_VM_EXEC_CONTROL));
> + vmr32(PIN_BASED_VM_EXEC_CONTROL),
> + vmr32(CPU_BASED_VM_EXEC_CONTROL),
> + vmr32(SECONDARY_VM_EXEC_CONTROL));
> printk("EntryControls=%08x ExitControls=%08x\n", vmentry_ctl, vmexit_ctl);
> - printk("ExceptionBitmap=%08x\n",
> - (uint32_t)vmr(EXCEPTION_BITMAP));
> + printk("ExceptionBitmap=%08x PFECmask=%08x PFECmatch=%08x\n",
> + vmr32(EXCEPTION_BITMAP),
> + vmr32(PAGE_FAULT_ERROR_CODE_MASK),
> + vmr32(PAGE_FAULT_ERROR_CODE_MATCH));
> printk("VMEntry: intr_info=%08x errcode=%08x ilen=%08x\n",
> - (uint32_t)vmr(VM_ENTRY_INTR_INFO),
> - (uint32_t)vmr(VM_ENTRY_EXCEPTION_ERROR_CODE),
> - (uint32_t)vmr(VM_ENTRY_INSTRUCTION_LEN));
> + vmr32(VM_ENTRY_INTR_INFO),
> + vmr32(VM_ENTRY_EXCEPTION_ERROR_CODE),
> + vmr32(VM_ENTRY_INSTRUCTION_LEN));
> printk("VMExit: intr_info=%08x errcode=%08x ilen=%08x\n",
> - (uint32_t)vmr(VM_EXIT_INTR_INFO),
> - (uint32_t)vmr(VM_EXIT_INTR_ERROR_CODE),
> - (uint32_t)vmr(VM_ENTRY_INSTRUCTION_LEN));
> - printk(" reason=%08x qualification=%08x\n",
> - (uint32_t)vmr(VM_EXIT_REASON),
> - (uint32_t)vmr(EXIT_QUALIFICATION));
> + vmr32(VM_EXIT_INTR_INFO),
> + vmr32(VM_EXIT_INTR_ERROR_CODE),
> + vmr32(VM_EXIT_INSTRUCTION_LEN));
> + printk(" reason=%08x qualification=%016lx\n",
> + vmr32(VM_EXIT_REASON), vmr(EXIT_QUALIFICATION));
> printk("IDTVectoring: info=%08x errcode=%08x\n",
> - (uint32_t)vmr(IDT_VECTORING_INFO),
> - (uint32_t)vmr(IDT_VECTORING_ERROR_CODE));
> - printk("TPR Threshold = 0x%02x\n",
> - (uint32_t)vmr(TPR_THRESHOLD));
> + vmr32(IDT_VECTORING_INFO), vmr32(IDT_VECTORING_ERROR_CODE));
> printk("TSC Offset = 0x%016lx\n", vmr(TSC_OFFSET));
> - printk("EPT pointer = 0x%08x%08x\n",
> - (uint32_t)vmr(EPT_POINTER_HIGH), (uint32_t)vmr(EPT_POINTER));
> + if ( (v->arch.hvm_vmx.exec_control & CPU_BASED_TPR_SHADOW) ||
> + (vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT) )
> + printk("TPR Threshold = 0x%02x PostedIntrVec = 0x%02x\n",
> + vmr32(TPR_THRESHOLD), vmr16(POSTED_INTR_NOTIFICATION_VECTOR));
> + if ( (v->arch.hvm_vmx.secondary_exec_control &
> + SECONDARY_EXEC_ENABLE_EPT) )
> + printk("EPT pointer = 0x%016lx EPTP index = 0x%04x\n",
> + vmr(EPT_POINTER), vmr16(EPTP_INDEX));
> n = vmr32(CR3_TARGET_COUNT);
> for ( i = 0; i + 1 < n; i += 2 )
> printk("CR3 target%u=%016lx target%u=%016lx\n",
> @@ -1552,8 +1556,14 @@ void vmcs_dump_vcpu(struct vcpu *v)
> i + 1, vmr(CR3_TARGET_VALUE(i + 1)));
> if ( i < n )
> printk("CR3 target%u=%016lx\n", i, vmr(CR3_TARGET_VALUE(i)));
> - printk("Virtual processor ID = 0x%04x\n",
> - (uint32_t)vmr(VIRTUAL_PROCESSOR_ID));
> + if ( v->arch.hvm_vmx.secondary_exec_control &
> + SECONDARY_EXEC_PAUSE_LOOP_EXITING )
> + printk("PLE Gap=%08x Window=%08x\n",
> + vmr32(PLE_GAP), vmr32(PLE_WINDOW));
> + if ( v->arch.hvm_vmx.secondary_exec_control &
> + (SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_VMFUNC) )
> + printk("Virtual processor ID = 0x%04x VMfunc controls = %016lx\n",
> + vmr16(VIRTUAL_PROCESSOR_ID), vmr(VMFUNC_CONTROL));
>
> vmx_vmcs_exit(v);
> }
> --- a/xen/include/asm-x86/hvm/vmx/vmcs.h
> +++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
> @@ -213,6 +213,7 @@ extern u32 vmx_vmentry_control;
> #define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY 0x00000200
> #define SECONDARY_EXEC_PAUSE_LOOP_EXITING 0x00000400
> #define SECONDARY_EXEC_ENABLE_INVPCID 0x00001000
> +#define SECONDARY_EXEC_ENABLE_VMFUNC 0x00002000
> #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING 0x00004000
> extern u32 vmx_secondary_exec_control;
>
> @@ -306,6 +307,7 @@ extern u64 vmx_basic_msr;
> enum vmcs_field {
> VIRTUAL_PROCESSOR_ID = 0x00000000,
> POSTED_INTR_NOTIFICATION_VECTOR = 0x00000002,
> + EPTP_INDEX = 0x00000004,
> GUEST_ES_SELECTOR = 0x00000800,
> GUEST_CS_SELECTOR = 0x00000802,
> GUEST_SS_SELECTOR = 0x00000804,
> @@ -342,6 +344,7 @@ enum vmcs_field {
> APIC_ACCESS_ADDR_HIGH = 0x00002015,
> PI_DESC_ADDR = 0x00002016,
> PI_DESC_ADDR_HIGH = 0x00002017,
> + VMFUNC_CONTROL = 0x00002018,
> EPT_POINTER = 0x0000201a,
> EPT_POINTER_HIGH = 0x0000201b,
> EOI_EXIT_BITMAP0 = 0x0000201c,
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 6674 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-01-20 18:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-20 10:58 [PATCH 0/5] VMX: assorted adjustments Jan Beulich
2015-01-20 11:05 ` [PATCH 1/5] VMX: dump full guest state Jan Beulich
2015-01-20 17:03 ` Andrew Cooper
2015-01-21 10:33 ` Jan Beulich
2015-01-22 4:40 ` Tian, Kevin
2015-01-22 11:56 ` Jan Beulich
2015-01-20 11:06 ` [PATCH 2/5] VMX: dump full host state Jan Beulich
2015-01-20 17:19 ` Andrew Cooper
2015-01-21 10:39 ` Jan Beulich
2015-01-22 4:40 ` Tian, Kevin
2015-01-20 11:06 ` [PATCH 3/5] VMX: dump further control state Jan Beulich
2015-01-20 17:39 ` Andrew Cooper [this message]
2015-01-22 4:41 ` Tian, Kevin
2015-01-20 11:07 ` [PATCH 4/5] VMX: drop VMCS *_HIGH enumerators Jan Beulich
2015-01-20 17:57 ` Andrew Cooper
2015-01-21 10:41 ` Jan Beulich
2015-01-22 4:41 ` Tian, Kevin
2015-01-20 11:08 ` [PATCH 5/5] VMX: use cached "current" where available Jan Beulich
2015-01-20 18:03 ` Andrew Cooper
2015-01-22 4:44 ` Tian, Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54BE92BD.3030200@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=eddie.dong@intel.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.