Messages in this thread | | | From | Andy Shevchenko <> | Date | Fri, 31 Jul 2020 12:41:06 +0300 | 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@redhat.com> wrote: > Andy Shevchenko <andy.shevchenko@gmail.com> writes: > > On Thu, Jul 30, 2020 at 10:37 PM Julia Suvorova <jusual@redhat.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
| |