All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: "Lengyel, Tamas" <tlengyel@novetta.com>, Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	keir@xen.org, stefano.stabellini@citrix.com,
	Ian Campbell <ian.campbell@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2] x86/vm_event: toggle singlestep from vm_event response
Date: Mon, 6 Jul 2015 20:03:35 +0300	[thread overview]
Message-ID: <559AB4E7.1040506@bitdefender.com> (raw)
In-Reply-To: <CAD33N+5eXyU4G1YtOuHXe=MG=yNPUT8tu-sXX9DeZU9pBjiVkA@mail.gmail.com>

On 07/06/2015 07:26 PM, Lengyel, Tamas wrote:
> 
> 
> On Mon, Jul 6, 2015 at 11:54 AM, Jan Beulich <JBeulich@suse.com
> <mailto:JBeulich@suse.com>> wrote:
> 
>     >>> On 06.07.15 at 17:35, <tlengyel@novetta.com
>     <mailto:tlengyel@novetta.com>> wrote:
>     > On Mon, Jul 6, 2015 at 11:26 AM, Jan Beulich <JBeulich@suse.com
>     <mailto:JBeulich@suse.com>> wrote:
>     >
>     >> >>> On 30.06.15 at 16:40, <tlengyel@novetta.com
>     <mailto:tlengyel@novetta.com>> wrote:
>     >> > On Tue, Jun 30, 2015 at 10:18 AM, Andrew Cooper <
>     >> andrew.cooper3@citrix.com <mailto:andrew.cooper3@citrix.com>>
>     >> > wrote:
>     >> >
>     >> >> On 30/06/15 15:11, Tamas K Lengyel wrote:
>     >> >> > diff --git a/xen/include/public/vm_event.h
>     >> >> b/xen/include/public/vm_event.h
>     >> >> > index 577e971..b8c3dde 100644
>     >> >> > --- a/xen/include/public/vm_event.h
>     >> >> > +++ b/xen/include/public/vm_event.h
>     >> >> > @@ -44,9 +44,15 @@
>     >> >> >   *  paused
>     >> >> >   * VCPU_PAUSED in a response signals to unpause the vCPU
>     >> >> >   */
>     >> >> > -#define VM_EVENT_FLAG_VCPU_PAUSED     (1 << 0)
>     >> >> > -/* Flags to aid debugging mem_event */
>     >> >> > -#define VM_EVENT_FLAG_FOREIGN         (1 << 1)
>     >> >> > +#define VM_EVENT_FLAG_VCPU_PAUSED       (1 << 0)
>     >> >> > +/* Flag to aid debugging mem_event */
>     >> >> > +#define VM_EVENT_FLAG_FOREIGN           (1 << 1)
>     >> >> > +/*
>     >> >> > + * Toggle singlestepping on vm_event response.
>     >> >> > + * Requires the vCPU to be paused already (synchronous
>     events only).
>     >> >> > + * Only supported on Intel CPUs with MTF capability.
>     >> >>
>     >> >> This sentence shouldn't be in the public API.  It is a
>     limitation of the
>     >> >> current implementation, not of the API, and could be removed with
>     >> >> further development.
>     >> >>
>     >> >
>     >> > I disagree because there is no error condition returned if a
>     user tries
>     >> to
>     >> > use it on non-Intel hw, so the only option a user would have to
>     figure
>     >> out
>     >> > why it's not working is reading the Xen source. IMHO the public API
>     >> should
>     >> > describe the limitations as that's what potential users will
>     read first.
>     >> > When we have hardware other then Intel that supports something
>     like this,
>     >> > we can remove the comment.
>     >>
>     >> FWIW I agree with Andrew, and if on non-Intel hardware there's
>     >> no error (or other indication) being returned, that's actually an
>     >> issue to be fixed imo.
>     >
>     > There is no opportunity for that, the current API does not provide a
>     > mechanism to signal failure on things that were requested on the vm_event
>     > response. Creating such a mechanism is beyond the scope of this patch and I
>     > don't think it's necessary. IMHO the comment makes it clear that this will
>     > only work on Intel hardware which suffices for now.
> 
>     You're the maintainer of the code in question, so I won't (and
>     can't) enforce Andrew's and my view.
> 
>     Jan
> 
> 
> Unless Razvan have a different opinion on the matter (although he
> already Acked it), I think it's good as is.

I don't mind just having the comment for now, so for what it's worth I
stand by my ack.

Having said that (and with the understading that it is beyond the scope
of this patch), a way to validate things like these is a good idea. I
wonder if, in a future patch, we could not have ./configure detect these
things and simply disable the relevant VM_EVENT_FLAG constants with
#if(n)defs, for example. That way, you wouldn't be able to compile code
that wouldn't work silently on platforms where that is the case.


Regards,
Razvan

  reply	other threads:[~2015-07-06 17:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 14:11 [PATCH v2] x86/vm_event: toggle singlestep from vm_event response Tamas K Lengyel
2015-06-30 14:18 ` Andrew Cooper
2015-06-30 14:40   ` Lengyel, Tamas
2015-07-06 15:26     ` Jan Beulich
2015-07-06 15:35       ` Lengyel, Tamas
2015-07-06 15:54         ` Jan Beulich
2015-07-06 16:26           ` Lengyel, Tamas
2015-07-06 17:03             ` Razvan Cojocaru [this message]
2015-07-06 17:08               ` Lengyel, Tamas
2015-07-06 17:17                 ` Andrew Cooper
2015-07-06 17:29                   ` Razvan Cojocaru
2015-07-06 17:36                     ` Lengyel, Tamas
2015-07-06 17:45                       ` Andrew Cooper
2015-07-06 17:44                     ` Andrew Cooper
2015-07-07  6:20               ` Jan Beulich
2015-07-07  6:26                 ` Razvan Cojocaru
2015-07-07  9:27 ` Jan Beulich
2015-07-07 11:56   ` Lengyel, Tamas

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=559AB4E7.1040506@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tlengyel@novetta.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.