All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Tamas K Lengyel <tamas@tklengyel.com>, Jan Beulich <JBeulich@suse.com>
Cc: "wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.co>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Keir Fraser <keir@xen.org>
Subject: Re: [PATCH V2 2/2] xen: Introduce VM_EVENT_FLAG_SET_REGISTERS
Date: Tue, 22 Sep 2015 18:39:27 +0300	[thread overview]
Message-ID: <5601762F.50803@bitdefender.com> (raw)
In-Reply-To: <CABfawh=6jLd+Os821Qxy357L8gYmN5PWG5BSBTa1=yyRVa1o6Q@mail.gmail.com>

On 09/22/2015 06:34 PM, Tamas K Lengyel wrote:
> 
> 
> On Tue, Sep 22, 2015 at 9:19 AM, Jan Beulich <JBeulich@suse.com
> <mailto:JBeulich@suse.com>> wrote:
> 
>     >>> On 21.09.15 at 15:31, <rcojocaru@bitdefender.com <mailto:rcojocaru@bitdefender.com>> wrote:
>     > A previous version of this patch dealing with support for skipping
>     > the current instruction when a vm_event response requested it
>     > computed the instruction length in the hypervisor, adding non-trivial
>     > code dependencies. This patch allows a userspace vm_event client to
>     > simply request that the guest's EIP is set to an arbitary value,
>     > computed by the introspection application. In the future, other
>     > registers can also be set via a vm_event reply by using this flag.
>     > The VCPU needs to be paused for this flag to take effect.
>     >
>     > Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com <mailto:rcojocaru@bitdefender.com>>
>     >
>     > ---
>     > Changes since V1:
>     >  - Renamed the patch (VM_EVENT_FLAG_SET_EIP ->
>     >    VM_EVENT_FLAG_SET_REGISTERS).
>     >  - As suggested by Tamas Lengyel, EIP is now being set via a dedicated
>     >    generic vm_event_set_registers() function that can be extended to
>     >    set other registers in the future.
> 
>     Isn't it a bad move to call the thing "set registers" but have it set
>     just EIP? If going forward you were to add more registers, you'd
>     need new flags anyway I suppose, and hence the public interface
>     part of this should be reverted (while the other internal
>     abstraction seems fine to me).
> 
>     Jan
> 
> 
> IMHO you should just add setting all registers included in the snapshot
> here rather then postpone it to a later patch.

Right, but setting some of the registers in the reply has side-effects
(such as the control registers), so I thought it better to not just try
to copy them if it's not needed (though I suppose we could check if the
new value differs from the old and only set it if it is at least).


Thanks,
Razvan

  reply	other threads:[~2015-09-22 15:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21 13:31 [PATCH V2 0/2] Introspection optimization helpers Razvan Cojocaru
2015-09-21 13:31 ` [PATCH V2 1/2] xen, libxc: Fine grained control of REP emulation optimizations Razvan Cojocaru
2015-09-22 15:17   ` Jan Beulich
2015-09-22 15:28     ` Razvan Cojocaru
2015-09-22 15:39       ` Jan Beulich
2015-09-22 15:41         ` Razvan Cojocaru
2015-09-25 15:34   ` Ian Campbell
2015-09-21 13:31 ` [PATCH V2 2/2] xen: Introduce VM_EVENT_FLAG_SET_REGISTERS Razvan Cojocaru
2015-09-22 15:19   ` Jan Beulich
2015-09-22 15:34     ` Tamas K Lengyel
2015-09-22 15:39       ` Razvan Cojocaru [this message]
2015-09-22 15:35     ` Razvan Cojocaru
2015-09-22 15:39       ` Tamas K Lengyel
2015-09-21 13:58 ` [PATCH V2 0/2] Introspection optimization helpers Razvan Cojocaru
2015-09-21 14:52   ` Julien Grall

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=5601762F.50803@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.co \
    --cc=tamas@tklengyel.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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.