Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4650732pxb; Tue, 28 Sep 2021 00:22:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfT2Lie7kiMAlWVNLWxAiGKdYP49TH6v1uGM3Qfq3nGE7xhNmfYF4paOPMgA4ETnloQGQD X-Received: by 2002:a17:90a:1944:: with SMTP id 4mr3707573pjh.221.1632813740393; Tue, 28 Sep 2021 00:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632813740; cv=none; d=google.com; s=arc-20160816; b=hDCVdAY3lwNh5nH7y9DGfSL8cadbxfbFcJUto0rZgLuEpoXocMgrQgDFHDUPale8E3 681S0FXhIU7/Vgo/Ch082jXbdhQGGfSK6/kDD/2DyuxLxBSPAInlCEQz6XPIR1Rs+kzu atoNOAgNU5tHHXqg2f0HWsNcAtlTxRBx4za0Zt1UojXk+yfEPt71DGxBP67hgrgSeNP/ V9JFgZ3F6i/iHxhfCLq3lOHokuGW0Rn7hmClIIIbDLHC9BSvKSBSmyk15rx2Wi66F+Dw G5SMx+Sc6eVurya8xq+hxRk4BsMC1BhiqIT5WpqNKsdYTu0XmyY25A0XhrF3hIzOYcI8 xkXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=H+Q1LxD/eLASJubSLEouNaEMZ2nfUv4so1i+8ePC6qI=; b=iotj+WGXdnFP3X4vhSeBfvQwY9Dpzj/cYySfe2NKmMJgBZEHjPOY8m42GiO+dZt/U+ FoCvo1/elQ2e1ZFAMxywnhbhup6L+0FK/MxRu+cB00nflLCqA+PfWI8DrnnlKGy02NF3 1S26BQrXBLdM+1cPM5yVZqvuu7cUXcckNvwDlnUUTWLLj5qpOR42fC5gFbMK4/NmCIgx jwYSzdl47nxYu2oAlfxb/2307+sUb0Io4KMg+R5viqkZu1lnO6v1pUS5NsKYB/QZszW2 3FNT0jCl7YsoWGKJh7kaqYwNH20V/UZdHW1X04OavGWTuZ1el5CU+lfc/NHR1Ruwr6nc TCOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KyFqPbfh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l184si22213901pge.558.2021.09.28.00.22.07; Tue, 28 Sep 2021 00:22:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KyFqPbfh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239222AbhI1HWb (ORCPT + 99 others); Tue, 28 Sep 2021 03:22:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:49706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239068AbhI1HWa (ORCPT ); Tue, 28 Sep 2021 03:22:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 16EFF61052; Tue, 28 Sep 2021 07:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632813651; bh=3/VYh1cvGM54Pp4563OgiGeaUEdkG80oWPlxS7UbG1g=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=KyFqPbfhRT40FZ4UGGI7ti7VxzCcWo1IXnC38NU7cP77hd1NiULpyDfTQ+ZjMOYW/ sMKQtIGbBb0GAd0iH0rhoZ8smzrw1iA0KxajEdbGXMltPYQqLJ5cav9iYkAbMqELZq InJaJcuOKdO9WcokGEOAhgg7ETfm+SsbcFky1lHZG3UbK8hXUlBnTlC2SwMoMJ4aZq wLfVmZ/0XpdkGtqISy7Ooscg77wMy82sIo041bnL413ES6KbUlAM70FoLRVp8amJGH Un5seG2vdL311sHZQs3MJCnNS5XthXeRkfjXSedJ/N98Mv5fQm6Lx4zbgNVG8AUonk wKkx5PlqCDqyg== Date: Tue, 28 Sep 2021 00:20:50 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Oleksandr Andrushchenko cc: Juergen Gross , Jan Beulich , Stefano Stabellini , "boris.ostrovsky@oracle.com" , "julien@xen.org" , "xen-devel@lists.xenproject.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v4 1/2] xen-pciback: prepare for the split for stub and PV In-Reply-To: <51e38ddc-49df-2e70-d094-71d045297ab1@epam.com> Message-ID: References: <20210927065822.350973-1-andr2000@gmail.com> <1cf5fbf3-6453-e258-3940-8b5bb96117b6@suse.com> <0b952b8d-0ebd-1c8c-84d4-f02e05bc2a2b@suse.com> <51e38ddc-49df-2e70-d094-71d045297ab1@epam.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-2095034342-1632813651=:5022" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-2095034342-1632813651=:5022 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 28 Sep 2021, Oleksandr Andrushchenko wrote: > On 28.09.21 09:59, Juergen Gross wrote: > > On 28.09.21 08:56, Oleksandr Andrushchenko wrote: > >> > >> On 28.09.21 09:42, Jan Beulich wrote: > >>> On 28.09.2021 06:18, Stefano Stabellini wrote: > >>>> On Mon, 27 Sep 2021, Juergen Gross wrote: > >>>>> On 27.09.21 09:35, Oleksandr Andrushchenko wrote: > >>>>>> On 27.09.21 10:26, Jan Beulich wrote: > >>>>>>> On 27.09.2021 08:58, Oleksandr Andrushchenko wrote: > >>>>>>>> From: Oleksandr Andrushchenko > >>>>>>>> > >>>>>>>> Currently PCI backend implements multiple functionalities at a time. > >>>>>>>> To name a few: > >>>>>>>> 1. It is used as a database for assignable PCI devices, e.g. xl > >>>>>>>>        pci-assignable-{add|remove|list} manipulates that list. So, > >>>>>>>> whenever > >>>>>>>>        the toolstack needs to know which PCI devices can be passed through > >>>>>>>>        it reads that from the relevant sysfs entries of the pciback. > >>>>>>>> 2. It is used to hold the unbound PCI devices list, e.g. when passing > >>>>>>>>        through a PCI device it needs to be unbound from the relevant > >>>>>>>> device > >>>>>>>>        driver and bound to pciback (strictly speaking it is not required > >>>>>>>>        that the device is bound to pciback, but pciback is again used as a > >>>>>>>>        database of the passed through PCI devices, so we can re-bind the > >>>>>>>>        devices back to their original drivers when guest domain shuts > >>>>>>>> down) > >>>>>>>> 3. Device reset for the devices being passed through > >>>>>>>> 4. Para-virtualised use-cases support > >>>>>>>> > >>>>>>>> The para-virtualised part of the driver is not always needed as some > >>>>>>>> architectures, e.g. Arm or x86 PVH Dom0, are not using backend-frontend > >>>>>>>> model for PCI device passthrough. For such use-cases make the very > >>>>>>>> first step in splitting the xen-pciback driver into two parts: Xen > >>>>>>>> PCI stub and PCI PV backend drivers. > >>>>>>>> > >>>>>>>> Signed-off-by: Oleksandr Andrushchenko > >>>>>>>> > >>>>>>>> > >>>>>>>> --- > >>>>>>>> Changes since v3: > >>>>>>>> - Move CONFIG_XEN_PCIDEV_STUB to the second patch > >>>>>>> I'm afraid this wasn't fully done: > >>>>>>> > >>>>>>>> --- a/drivers/xen/xen-pciback/Makefile > >>>>>>>> +++ b/drivers/xen/xen-pciback/Makefile > >>>>>>>> @@ -1,5 +1,6 @@ > >>>>>>>>      # SPDX-License-Identifier: GPL-2.0 > >>>>>>>>      obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o > >>>>>>>> +obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o > >>>>>>> While benign when added here, this addition still doesn't seem to > >>>>>>> belong here. > >>>>>> My bad. So, it seems without CONFIG_XEN_PCIDEV_STUB the change seems > >>>>>> > >>>>>> to be non-functional. With CONFIG_XEN_PCIDEV_STUB we fail to build on 32-bit > >>>>>> > >>>>>> architectures... > >>>>>> > >>>>>> What would be the preference here? Stefano suggested that we still define > >>>>>> > >>>>>> CONFIG_XEN_PCIDEV_STUB, but in disabled state, e.g. we add tristate to it > >>>>>> > >>>>>> in the second patch > >>>>>> > >>>>>> Another option is just to squash the two patches. > >>>>> Squashing would be fine for me. > >>>>    It is fine for me to squash the two patches. > >>>> > >>>> But in any case, wouldn't it be better to modify that specific change to: > >>>> > >>>> diff --git a/drivers/xen/xen-pciback/Makefile b/drivers/xen/xen-pciback/Makefile > >>>> index e2cb376444a6..e23c758b85ae 100644 > >>>> --- a/drivers/xen/xen-pciback/Makefile > >>>> +++ b/drivers/xen/xen-pciback/Makefile > >>>> @@ -1,6 +1,5 @@ > >>>>    # SPDX-License-Identifier: GPL-2.0 > >>>> -obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o > >>>> -obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o > >>>> +obj-$(CONFIG_XEN_PCI_STUB) += xen-pciback.o > >>> But that wouldn't allow the driver to be a module anymore, would it? > >> > >> Exactly. I forgot that when playing with module/built-in I was not able > >> > >> to control that anymore because CONFIG_XEN_PCI_STUB will always be > >> > >> in "y" state, thus even if you have CONFIG_XEN_PCIDEV_BACKEND=m > >> > >> you won't be able to build it as module. So, I will probably put a comment > >> > >> about that in the Makefile explaining the need for > >> > >> obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o > >> obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o > > > > In case the real split between both parts of xen-pciback is done this > > will be needed anyway. > > Yes, it will > > So, I'll put a comment in the Makefile: > > # N.B. This cannot be expressed with a single line using CONFIG_XEN_PCI_STUB > > # as it always remains in "y" state, thus preventing the driver to be built as > > # a module. > > obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o > obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o > > Will this be ok or needs some re-wording? I am fine with it and honestly that was the only comment I had so you can add my Reviewed-by: Stefano Stabellini --8323329-2095034342-1632813651=:5022--