All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Corneliu ZUZU <czuzu@bitdefender.com>, xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>,
	Tamas K Lengyel <tamas@tklengyel.com>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events
Date: Thu, 3 Mar 2016 18:15:11 +0200	[thread overview]
Message-ID: <56D8630F.5020009@bitdefender.com> (raw)
In-Reply-To: <1457014210-14552-1-git-send-email-czuzu@bitdefender.com>

On 03/03/2016 04:10 PM, Corneliu ZUZU wrote:
> Q2) About VM_EVENT_FLAG_DENY
> 
>   Q2.1)
>     Doesn't it require sync = 1 (i.e. the vcpu to be paused) to work?
>     If so, shouldn't we call vm_event_register_write_resume only after checking
>     that VM_EVENT_FLAG_VCPU_PAUSED flag is set (vm_event_resume). Moreover, if
>     we do that, wouldn't it be 'cleaner' to rename
>     vm_event_register_write_resume->vm_event_deny, check for the
>     VM_EVENT_FLAG_DENY flag in vm_event_resume instead and call vm_event_deny
>     from there after this check?

Yes, it does require the VCPU to be paused to work, and yes, it's a good
idea to check that that flag is set in the response.

Beyond that, I'd prefer we keep vm_event_register_write_resume()
because, while today all we do there is check that VM_EVENT_FLAG_DENY is
set, we might want do to other things as well there as well (for
example, maybe validate the content of some register). That was really
the point of the "bigger-named" function.

But that's just my opinion, if Tamas prefers your rename suggestion I'll
consider myself outnumbered.

>   Q2.2)
>     VM_EVENT_FLAG_DENY functionality is not implemented w/ this change-set.
>     What is done instead is that the control-register write is done *before*
>     sending the vm-event (vm_event_put_request). This way, the user can
>     override the written register value after receiving the vm-event, which
>     in effect provides the same flexibility as VM_EVENT_FLAG_DENY does.
>     Using this strategy instead would simplify both Xen's code and the libxc
>     user's code.
>     Thoughts?

That's how I initially did it with CR events, but with an application
dealing with huge numbers of events, an extra hypercall (to re-set the
register) can be quite expensive, so I had to rework it to the present
state. On these grounds I'm opposed to it - and for consistency I would
prefer that all register write events are pre-write events, and deniable
with a single vm_event reply.


HTH,
Razvan

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

  parent reply	other threads:[~2016-03-03 16:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 14:10 [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events Corneliu ZUZU
2016-03-03 14:11 ` [PATCH 1/1] arm/monitor vm-events: implement write-ctrlreg support Corneliu ZUZU
2016-03-03 16:02 ` [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events Corneliu ZUZU
2016-03-03 16:15 ` Razvan Cojocaru [this message]
2016-03-03 18:04   ` Corneliu ZUZU
2016-03-03 18:51     ` Razvan Cojocaru
2016-03-03 20:40       ` Corneliu ZUZU
2016-03-03 20:52         ` Razvan Cojocaru
2016-03-04 17:48 ` Corneliu ZUZU
2016-03-07  8:22 ` Corneliu ZUZU
2016-03-07  9:12   ` Tamas K Lengyel
2016-03-07  9:31     ` Corneliu ZUZU
2016-03-07  9:45       ` Tamas K Lengyel
2016-03-07 12:07         ` Corneliu ZUZU
2016-03-07 12:26           ` Corneliu ZUZU
2016-03-07 12:38     ` Andrew Cooper
2016-03-07 12:49       ` Corneliu ZUZU

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=56D8630F.5020009@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=czuzu@bitdefender.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=stefano.stabellini@citrix.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.