All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Jan Beulich <JBeulich@suse.com>, Tamas K Lengyel <tamas@tklengyel.com>
Cc: "wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH 2/2] xen: Introduce VM_EVENT_FLAG_SET_EIP
Date: Mon, 21 Sep 2015 12:05:26 +0300	[thread overview]
Message-ID: <55FFC856.5000906@bitdefender.com> (raw)
In-Reply-To: <55FFE19B02000078000A3D5E@prv-mh.provo.novell.com>

On 09/21/2015 11:53 AM, Jan Beulich wrote:
>>>> On 18.09.15 at 21:19, <tamas@tklengyel.com> wrote:
>> On Wed, Sep 16, 2015 at 12:12 PM, Razvan Cojocaru <rcojocaru@bitdefender.com 
>>> wrote:
>>> I have nothing in principle against having a SET_REGISTERS flag instead
>>> of a SET_EIP one, but I am unsure of how (and where) that would be best
>>> implemented. What do you have in mind? A handler similar to void
>>> vm_event_register_write_resume() where we set these registers for the
>>> respective vcpu? Is this even possible at vm_event response handling time?
>>>
>>
>> No, that function falls under a switch on rsp.reason, for which we have a
>> 1:1 unofficial and not really enforced rule to match the type of event that
>> was sent. This should fall under a flag on rsp.flags and be handled similar
>> to how vm_event_toggle_singlestep is.
> 
> I.e. I take this to mean that we should wait for a new patch
> rather than further looking at the current one.

Yes, I've already modified the first patch on Andrew Cooper's suggestion
(to switch from xc_domain_emulate_each_rep() to
xc_monitor_emulate_each_rep(), and gate the emulation disable condition
on mem_access_emulate_enable as well as mem_access_emulate_each_rep),
and I'm working on switching from SET_EIP to SET_REGISTERS as we speak,
after which I'll do a test run and send a new version, hopefully no
later than tomorrow.

For this patch, I'm slightly unsure if I should expect trouble for
trying to do it this way (I know I have to abstract that raw code away
for x86 and ARM in their respective functions, but let's just assume x86
for the example):

418         if ( rsp.flags & VM_EVENT_FLAG_VCPU_PAUSED )
419         {
420             if ( rsp.flags & VM_EVENT_FLAG_SET_REGISTERS )
421                 v->arch.user_regs.eip = rsp.data.regs.x86.rip;
422
423             if ( rsp.flags & VM_EVENT_FLAG_TOGGLE_SINGLESTEP )
424                 vm_event_toggle_singlestep(d, v);
425
426             vm_event_vcpu_unpause(v);
427         }

at the end of vm_event_resume() in common/vm_event.c. Looks like it
should be safe, but I'm not sure.


Thanks,
Razvan

      reply	other threads:[~2015-09-21  9:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15  9:19 [PATCH 0/2] Introspection optimization helpers Razvan Cojocaru
2015-09-15  9:19 ` [PATCH 1/2] xen, libxc: Introduced XEN_DOMCTL_emulate_each_rep Razvan Cojocaru
2015-09-15  9:51   ` Ian Campbell
2015-09-15 15:36   ` Julien Grall
2015-09-15 15:46     ` Razvan Cojocaru
2015-09-17 12:59   ` Andrew Cooper
2015-09-17 13:20     ` Razvan Cojocaru
2015-09-17 13:37       ` Andrew Cooper
2015-09-17 13:45         ` Razvan Cojocaru
2015-09-15  9:19 ` [PATCH 2/2] xen: Introduce VM_EVENT_FLAG_SET_EIP Razvan Cojocaru
2015-09-16 15:57   ` Tamas K Lengyel
2015-09-16 16:12     ` Razvan Cojocaru
2015-09-18 19:19       ` Tamas K Lengyel
2015-09-21  8:53         ` Jan Beulich
2015-09-21  9:05           ` Razvan Cojocaru [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=55FFC856.5000906@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --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.