All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: linux-s390@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v4 08/10] KVM: s390: add functions to (un)register GISC with GISA
Date: Mon, 10 Dec 2018 14:51:51 +0000	[thread overview]
Message-ID: <20181210155151.327fbf9c.cohuck@redhat.com> (raw)
In-Reply-To: <481805e7-f654-e726-f64f-c661fd0744b0@linux.ibm.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1990 bytes --]

On Mon, 10 Dec 2018 15:37:47 +0100
Pierre Morel <pmorel@linux.ibm.com> wrote:

> On 10/12/2018 13:15, Michael Mueller wrote:
> > 
> > 
> > On 10.12.18 10:44, Cornelia Huck wrote:  
> >> On Mon, 10 Dec 2018 10:27:54 +0100
> >> Pierre Morel <pmorel@linux.ibm.com> wrote:
> >>  
> >>> On 03/12/2018 10:48, Michael Mueller wrote:  
> >>>>
> >>>>
> >>>> On 03.12.18 10:21, Cornelia Huck wrote:  
> >>>>> On Fri, 30 Nov 2018 15:32:13 +0100
> >>>>> Michael Mueller <mimu@linux.ibm.com> wrote:  
> >>>>>> +int kvm_s390_gisc_unregister(struct kvm *kvm, u32 gisc)
> >>>>>> +{
> >>>>>> +��� int rc = 0;
> >>>>>> +
> >>>>>> +��� if (!kvm->arch.gib_in_use)
> >>>>>> +������� return -ENODEV;
> >>>>>> +��� if (gisc > MAX_ISC)
> >>>>>> +������� return -EINVAL;
> >>>>>> +
> >>>>>> +��� spin_lock(&kvm->arch.iam_ref_lock);
> >>>>>> +��� if (kvm->arch.iam_ref_count[gisc] == 0) {
> >>>>>> +������� rc = -EFAULT;  
> >>>>> -EFAULT looks odd. -EINVAL?  
> >>>> sure  
> >>>
> >>> Can we find some errno return value which is not already used in this
> >>> function?  
> >>
> >> I'm not sure what would be a better fit here (-EINVAL if you try to
> >> unregister something that has never been registered seems reasonable).
> >>
> >> Also, I think it is quite reasonable if a function returns the same
> >> error for different reasons, as long as they are all the same class of
> >> error. In this case, both the caller using an out-of-rage gisc or a
> >> gisc that has never been registered indicate some internal mixup in how
> >> the caller handles the gisc.  
> > 
> > I think -EPERM is the right choice here. It is not permitted to
> > decrease the ref counter below zero.
> >   
> >>  
> >   
> To be anoying I would prefer
> -ERANGE if gisc > MAX_ISC
> 
> -EINVAL in the second case is OK for me

If you want different return codes, this one makes more sense to me.

> 
> and I also can agree with the argumentation of Conny.
> 
> 

       reply	other threads:[~2018-12-10 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <481805e7-f654-e726-f64f-c661fd0744b0@linux.ibm.com>
2018-12-10 14:51 ` Cornelia Huck [this message]
2018-11-30 14:32 [PATCH v4 08/10] KVM: s390: add functions to (un)register GISC with GISA Michael Mueller

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=20181210155151.327fbf9c.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.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.