qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Viktor Prutyanov <viktor.prutyanov@virtuozzo.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, rkagan@virtuozzo.com,
	rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH v2] dump: add kernel_gs_base to QEMU CPU state
Date: Fri, 13 Jul 2018 19:12:52 -0300	[thread overview]
Message-ID: <20180713221252.GO914@localhost.localdomain> (raw)
In-Reply-To: <1531416567-13558-1-git-send-email-viktor.prutyanov@virtuozzo.com>

On Thu, Jul 12, 2018 at 08:29:27PM +0300, Viktor Prutyanov wrote:
> This patch adds field with content of KERNEL_GS_BASE MSR to QEMU note in
> ELF dump.
> 
> On Windows, if all vCPUs are running usermode tasks at the time the dump is
> created, this can be helpful in the discovery of guest system structures
> during conversion ELF dump to MEMORY.DMP dump.
> 
> Signed-off-by: Viktor Prutyanov <viktor.prutyanov@virtuozzo.com>
> ---
>  v2: keep version 1 in QEMUCPUState and document the extension procedure
> 
>  target/i386/arch_dump.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c
> index 35b55fc..cc8750f 100644
> --- a/target/i386/arch_dump.c
> +++ b/target/i386/arch_dump.c
> @@ -258,6 +258,12 @@ struct QEMUCPUState {
>      QEMUCPUSegment cs, ds, es, fs, gs, ss;
>      QEMUCPUSegment ldt, tr, gdt, idt;
>      uint64_t cr[5];
> +    /*
> +     * Fields below are optional and are being added at the end without
> +     * changing the version. External tools may identify their presence
> +     * by checking 'size' field.
> +     */
> +    uint64_t kernel_gs_base;
>  };
>  
>  typedef struct QEMUCPUState QEMUCPUState;
> @@ -315,6 +321,8 @@ static void qemu_get_cpustate(QEMUCPUState *s, CPUX86State *env)
>      s->cr[2] = env->cr[2];
>      s->cr[3] = env->cr[3];
>      s->cr[4] = env->cr[4];
> +
> +    s->kernel_gs_base = env->kernelgsbase;

This breaks i386-softmmu:

/home/travis/build/ehabkost/qemu/target/i386/arch_dump.c: In function ‘qemu_get_cpustate’:
/home/travis/build/ehabkost/qemu/target/i386/arch_dump.c:325:28: error: ‘CPUX86State’ has no member named ‘kernelgsbase’
     s->kernel_gs_base = env->kernelgsbase;
                            ^
make[1]: *** [target/i386/arch_dump.o] Error 1
make: *** [subdir-i386-softmmu] Error 2
make: *** Waiting for unfinished jobs....

-- 
Eduardo

      parent reply	other threads:[~2018-07-13 22:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-12 17:29 [Qemu-devel] [PATCH v2] dump: add kernel_gs_base to QEMU CPU state Viktor Prutyanov
2018-07-13 20:14 ` Eduardo Habkost
2018-07-13 22:12 ` Eduardo Habkost [this message]

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=20180713221252.GO914@localhost.localdomain \
    --to=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.com \
    --cc=rth@twiddle.net \
    --cc=viktor.prutyanov@virtuozzo.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).