All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	KonradRzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH for-next 1/9] gcov: return ENOSYS for unimplemented gcov domctl
Date: Tue, 7 Nov 2017 09:41:58 +0000	[thread overview]
Message-ID: <20171107094158.3ldtjytd7iznuueh@dhcp-3-128.uk.xensource.com> (raw)
In-Reply-To: <5A005E4A020000780018C892@prv-mh.provo.novell.com>

On Mon, Nov 06, 2017 at 05:06:18AM -0700, Jan Beulich wrote:
> >>> On 06.11.17 at 12:16, <ian.jackson@eu.citrix.com> wrote:
> > Jan Beulich writes ("Re: [PATCH for-next 1/9] gcov: return ENOSYS for 
> > unimplemented gcov domctl"):
> >> On 26.10.17 at 11:19, <roger.pau@citrix.com> wrote:
> >> > --- a/xen/common/gcov/gcov.c
> >> > +++ b/xen/common/gcov/gcov.c
> >> > @@ -239,7 +239,7 @@ int sysctl_gcov_op(struct xen_sysctl_gcov_op *op)
> >> >          break;
> >> >  
> >> >      default:
> >> > -        ret = -EINVAL;
> >> > +        ret = -ENOSYS;
> >> >          break;
> >> >      }
> >> 
> >> Very certainly ENOSYS is not in any way better. Despite the many
> >> misuses of it, we've started enforcing that this wouldn't be spread.
> >> -EOPNOTSUPP may be fine here, but -EINVAL is suitable as well.
> >> -ENOSYS exclusively means that a _top level_ hypercall is
> >> unimplemented (i.e. with very few exceptions there should be
> >> exactly one place where it gets returned, which is in the main
> >> hypercall dispatch code).
> > 
> > The distinction between unimplemented status of a top-level hypercall
> > and unimplemented status of a sub-op is rarely useful to the caller.
> > 
> > Conversely, the distinction between an unimplemented facility, and a
> > facility which is exists but is being used improperly, is vitally
> > important to anyone who is trying to write compatibility code.
> > 
> > I don't mind if you want to insist on the former distinction,
> > reserving ENOSYS for top-level hypercalls and EOPNOTSUPP for other
> > functions.
> > 
> > But I absolutely do mind the use of EINVAL for "unsupported function".
> > I appreciate that much of the hypervisor has historically used EINVAL
> > this way, but this is (a) a pain for callers (b) evil, bad, and wrong
> > (c) unnecessary since EOPNOTSUPP is available.  We should at least not
> > perpetrate any more of this.  In an unreleased API we should change it
> > before release.

This API has actually been released since ~2013 IIRC, when it was
added to Xen.

> Okay, so EOPNOTSUPP is it then, which is also my preference
> (due to there being so many uses of EINVAL elsewhere). I've
> merely mentioned that EINVAL would be suitable since,
> technically speaking, the value in a "sub-operation" field being
> invalid is no different from this being the case for the value in
> any other field.

If I don't get any more comments I will re-send this patch separately
using EOPNOTSUPP instead of ENOSYS. I will also keep the Acks gathered
so far unless anyone objects.

Thanks, Roger.

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

  reply	other threads:[~2017-11-07  9:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171026091938.59247-1-roger.pau@citrix.com>
2017-10-26  9:19 ` [PATCH for-next 1/9] gcov: return ENOSYS for unimplemented gcov domctl Roger Pau Monne
2017-10-27 13:59   ` [PATCH for-4.10 " Ian Jackson
2017-10-27 14:00     ` Julien Grall
2017-11-06 10:31   ` [PATCH for-next " Jan Beulich
2017-11-06 11:16     ` Ian Jackson
2017-11-06 12:06       ` Jan Beulich
2017-11-07  9:41         ` Roger Pau Monné [this message]
2017-11-07 11:54           ` Wei Liu
2017-10-26  9:19 ` [PATCH for-next 2/9] gcov: rename folder and header to coverage Roger Pau Monne
2017-10-30 16:48   ` Wei Liu
2017-10-26  9:19 ` [PATCH for-next 3/9] gcov: rename sysctl and functions Roger Pau Monne
2017-10-30 16:48   ` Wei Liu
2017-11-07 17:13   ` Jan Beulich
2017-10-26  9:19 ` [PATCH for-next 4/9] gcov: introduce hooks for the sysctl Roger Pau Monne
2017-10-26 10:23   ` Andrew Cooper
2017-10-26  9:19 ` [PATCH for-next 5/9] coverage: introduce generic file Roger Pau Monne
2017-10-30 16:48   ` Wei Liu
2017-10-30 16:57     ` Roger Pau Monné
2017-11-08  8:02       ` Jan Beulich
2017-11-08  8:05   ` Jan Beulich
2017-10-26  9:19 ` [PATCH for-next 6/9] kconfig: add llvm coverage option Roger Pau Monne
2017-10-26 10:03   ` Wei Liu
2017-10-26 10:08     ` Roger Pau Monné
2017-10-26 10:10       ` Wei Liu
2017-11-08  8:13         ` Jan Beulich
2017-11-08  8:49           ` Roger Pau Monné
2017-11-08 11:07             ` Jan Beulich
2017-11-08 11:21               ` Wei Liu
2017-10-26 10:24   ` Andrew Cooper
2017-11-08  8:07     ` Jan Beulich
2017-11-08  8:16   ` Jan Beulich
2017-10-26  9:19 ` [PATCH for-next 7/9] coverage: introduce support for llvm profiling Roger Pau Monne
2017-10-26  9:19 ` [PATCH for-next 8/9] xsm: add bodge when compiling with llvm coverage support Roger Pau Monne
2017-10-26 15:12   ` Daniel De Graaf
2017-11-07 17:18   ` Jan Beulich
2017-10-26  9:19 ` [PATCH for-next 9/9] coverage: add documentation for LLVM coverage Roger Pau Monne
2017-10-30 16:48   ` Wei Liu
2017-10-30 16:58     ` Roger Pau Monné
     [not found] ` <20171026091938.59247-8-roger.pau@citrix.com>
2017-10-30 16:48   ` [PATCH for-next 7/9] coverage: introduce support for llvm profiling Wei Liu
2017-11-08  8:38   ` Jan Beulich
2017-11-08  8:56     ` Roger Pau Monné
     [not found]     ` <20171108085653.bcrszybk65ypiew7@dhcp-3-128.uk.xensource.com>
2017-11-08 11:08       ` Jan Beulich
2017-11-09  6:04         ` [llvm-dev] " Vedant Kumar

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=20171107094158.3ldtjytd7iznuueh@dhcp-3-128.uk.xensource.com \
    --to=roger.pau@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.