[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vfp8aabZo_NW78kM-OLLKDgK1CwvLZNwmPZyQgaw6bXtQ@mail.gmail.com>
Date: Fri, 31 Jul 2020 12:41:06 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: Julia Suvorova <jusual@...hat.com>,
"open list:VFIO DRIVER" <kvm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Bjorn Helgaas <helgaas@...nel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Matthew Wilcox <willy@...radead.org>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] KVM: x86: Use MMCONFIG for all PCI config space accesses
On Fri, Jul 31, 2020 at 12:22 PM Vitaly Kuznetsov <vkuznets@...hat.com> wrote:
> Andy Shevchenko <andy.shevchenko@...il.com> writes:
> > On Thu, Jul 30, 2020 at 10:37 PM Julia Suvorova <jusual@...hat.com> wrote:
...
> >> +static int __init kvm_pci_arch_init(void)
> >> +{
> >> + if (raw_pci_ext_ops &&
> >> + return 0;
> >> + }
> >
> >> + return 1;
> >
> > Hmm... I don't remember what positive codes means there. Perhaps you
> > need to return a rather error code?
>
> If I'm reading the code correctly,
>
> pci_arch_init() has the following:
>
> if (x86_init.pci.arch_init && !x86_init.pci.arch_init())
> return 0;
>
>
> so returning '1' here means 'continue' and this seems to be
> correct. (E.g. Hyper-V's hv_pci_init() does the same). What I'm not sure
> about is 'return 0' above as this will result in skipping the rest of
> pci_arch_init(). Was this desired or should we return '1' in both cases?
I think it depends what you want. In complex cases we recognize three
possibilities
-ERRNO: function failed, we have to stop and bailout with error from callee
0: function OK, stop and return 0
1: function OK, continue the rest in callee
Do we have needs in this or is the current enough for all (exist) callees?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists