All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>, xen-devel@lists.xen.org
Cc: Tamas K Lengyel <tamas@tklengyel.com>
Subject: Re: VM_EVENT_FLAG_SET_REGISTERS and sync_vcpu_execstate()
Date: Mon, 8 Aug 2016 13:01:44 +0100	[thread overview]
Message-ID: <d7f40476-f693-665f-a30b-4256c5a7b662@citrix.com> (raw)
In-Reply-To: <10f6b977-8796-f140-4927-918642aa105b@bitdefender.com>

On 08/08/16 11:31, Razvan Cojocaru wrote:
> Hello,
>
> We've been mostly setting registers by using xc_vcpu_setcontext():
>
> https://github.com/razvan-cojocaru/libbdvmi/blob/master/src/bdvmixendriver.cpp#L504
>
> but lately trying to push as much of that as possible to the
> VM_EVENT_FLAG_SET_REGISTERS-related code (i.e. via the vm_event replies)
> to save processing time.
>
> So with the xc_vcpu_setcontext() call removed, I've found that there are
> cases where vm_event_set_registers() won't work properly unless I kept
> the xc_vcpu_getcontext() call. This would appear to be not because of
> anything that arch_get_info_guest() does (please see the implementation
> for XEN_DOMCTL_getvcpucontext), but because of the vcpu_pause() call, or
> more specifically, because of its calling sync_vcpu_execstate().
>
> So it would appear that a sync_vcpu_execstate(v) call is necessary at
> the start of vm_event_set_registers() for the vcpu struct instance to be
> synchronized with the current VCPU state.
>
> Any objections to a patch with this simple modification?

It would be helpful to identify exactly what is currently going wrong,
and why sync_vcpu_execstate(v) helps.

~Andrew

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

  reply	other threads:[~2016-08-08 12:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 10:31 VM_EVENT_FLAG_SET_REGISTERS and sync_vcpu_execstate() Razvan Cojocaru
2016-08-08 12:01 ` Andrew Cooper [this message]
2016-08-08 12:47   ` Razvan Cojocaru
2016-08-08 15:10     ` Razvan Cojocaru
2016-08-08 15:52       ` Tamas K Lengyel
2016-08-08 16:29         ` Razvan Cojocaru
2016-08-08 18:01           ` Tamas K Lengyel
2016-08-09  8:19             ` Razvan Cojocaru
2016-08-09  9:01               ` Razvan Cojocaru
2016-08-09  9:41           ` Tim Deegan
2016-08-09  9:46             ` Razvan Cojocaru
2016-08-09 17:19             ` Tamas K Lengyel

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=d7f40476-f693-665f-a30b-4256c5a7b662@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=tamas@tklengyel.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.