All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/5] VMX: dump full host state
Date: Tue, 20 Jan 2015 17:19:11 +0000	[thread overview]
Message-ID: <54BE8E0F.4010905@citrix.com> (raw)
In-Reply-To: <54BE44B70200007800056F0A@mail.emea.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 4079 bytes --]

On 20/01/15 11:06, Jan Beulich wrote:
> A few host state fields did not get dumped so far. 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 - many of them haven't been needed anymore since the
> dropping of 32-bit support.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -1496,34 +1496,27 @@ void vmcs_dump_vcpu(struct vcpu *v)
>          printk("InterruptStatus = %04x\n", vmr16(GUEST_INTR_STATUS));
>  
>      printk("*** Host State ***\n");
> -    printk("RSP = 0x%016llx  RIP = 0x%016llx\n", 
> -           (unsigned long long)vmr(HOST_RSP),
> -           (unsigned long long)vmr(HOST_RIP));
> -    printk("CS=%04x DS=%04x ES=%04x FS=%04x GS=%04x SS=%04x TR=%04x\n",
> -           (uint16_t)vmr(HOST_CS_SELECTOR),
> -           (uint16_t)vmr(HOST_DS_SELECTOR),
> -           (uint16_t)vmr(HOST_ES_SELECTOR),
> -           (uint16_t)vmr(HOST_FS_SELECTOR),
> -           (uint16_t)vmr(HOST_GS_SELECTOR),
> -           (uint16_t)vmr(HOST_SS_SELECTOR),
> -           (uint16_t)vmr(HOST_TR_SELECTOR));
> -    printk("FSBase=%016llx GSBase=%016llx TRBase=%016llx\n",
> -           (unsigned long long)vmr(HOST_FS_BASE),
> -           (unsigned long long)vmr(HOST_GS_BASE),
> -           (unsigned long long)vmr(HOST_TR_BASE));
> -    printk("GDTBase=%016llx IDTBase=%016llx\n",
> -           (unsigned long long)vmr(HOST_GDTR_BASE),
> -           (unsigned long long)vmr(HOST_IDTR_BASE));
> -    printk("CR0=%016llx CR3=%016llx CR4=%016llx\n",
> -           (unsigned long long)vmr(HOST_CR0),
> -           (unsigned long long)vmr(HOST_CR3),
> -           (unsigned long long)vmr(HOST_CR4));
> -    printk("Sysenter RSP=%016llx CS:RIP=%04x:%016llx\n",
> -           (unsigned long long)vmr(HOST_SYSENTER_ESP),
> -           (int)vmr(HOST_SYSENTER_CS),
> -           (unsigned long long)vmr(HOST_SYSENTER_EIP));
> -    printk("Host PAT = 0x%08x%08x\n",
> -           (uint32_t)vmr(HOST_PAT_HIGH), (uint32_t)vmr(HOST_PAT));
> +    printk("RIP = 0x%016lx (%ps)  RSP = 0x%016lx\n",
> +           vmr(HOST_RIP), (void *)vmr(HOST_RIP), vmr(HOST_RSP));

Given the asm volatile, the compiler is unlikely to elide the second
read of HOST_RIP.  I suppose that this is debug code and it really
doesn't matter too much, but if it is used anywhere else it might be
worth pulling out into a local variable.

> +    printk("CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x TR=%04x\n",
> +           vmr16(HOST_CS_SELECTOR), vmr16(HOST_SS_SELECTOR),
> +           vmr16(HOST_DS_SELECTOR), vmr16(HOST_ES_SELECTOR),
> +           vmr16(HOST_FS_SELECTOR), vmr16(HOST_GS_SELECTOR),
> +           vmr16(HOST_TR_SELECTOR));
> +    printk("FSBase=%016lx GSBase=%016lx TRBase=%016lx\n",
> +           vmr(HOST_FS_BASE), vmr(HOST_GS_BASE), vmr(HOST_TR_BASE));
> +    printk("GDTBase=%016lx IDTBase=%016lx\n",
> +           vmr(HOST_GDTR_BASE), vmr(HOST_IDTR_BASE));
> +    printk("CR0=%016lx CR3=%016lx CR4=%016lx\n",
> +           vmr(HOST_CR0), vmr(HOST_CR3), vmr(HOST_CR4));
> +    printk("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
> +           vmr(HOST_SYSENTER_ESP),
> +           vmr32(HOST_SYSENTER_CS), vmr(HOST_SYSENTER_EIP));

vmr16() ?

~Andrew

> +    if ( vmexit_ctl & (VM_EXIT_LOAD_HOST_PAT | VM_EXIT_LOAD_HOST_EFER) )
> +        printk("EFER = 0x%016lx  PAT = 0x%016lx\n", vmr(HOST_EFER), vmr(HOST_PAT));
> +    if ( vmexit_ctl & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
> +        printk("PerfGlobCtl = 0x%016lx\n",
> +               vmr(HOST_PERF_GLOBAL_CTRL));
>  
>      printk("*** Control State ***\n");
>      printk("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n",
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 5003 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2015-01-20 17:50 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 [this message]
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
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=54BE8E0F.4010905@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.