Re: [PATCH] drm/xen: Add missing VM_DONTEXPAND flag in mmap callback

2022-06-19 Thread Oleksandr Andrushchenko
hich triggers the WARNING. > > Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Oleksandr Andrushchenko > --- > This patch eliminates a WARNING which occurs during running any user space > application over drm (weston, modetest, etc) using PV Display frontend > in Xen guest (i

[PATCH 3/4] vpci: use pcidevs locking to protect MMIO handlers

2022-02-16 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko vPCI MMIO handlers are accessing pdevs without protecting this access with pcidevs_{lock|unlock}. This is not a problem as of now as these are only used by Dom0. But, towards vPCI is used also for guests, we need to properly protect pdev and pdev->vpci from be

[PATCH 1/4] pci: add rwlock to pcidevs_lock machinery

2022-02-16 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Currently pcidevs lock is a global recursive spinlock which is fine for the existing use cases. It is used to both protect pdev instances themselves from being removed while in use and to make sure the update of the relevant pdev properties is synchronized. Moving

[PATCH 4/4] vpci: resolve possible clash while removing BAR overlaps

2022-02-16 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko modify_bars checks if the mapping of the BAR memory has already been done when mapping other device's BARs or, while unmapping, are still in use by other devices. With the existing locking scheme it is possible that there are other devices trying to do the same

[PATCH 2/4] vpci: restrict unhandled read/write operations for guests

2022-02-16 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko A guest would be able to read and write those registers which are not emulated and have no respective vPCI handlers, so it will be possible for it to access the hardware directly. In order to prevent a guest from reads and writes from/to the unhandled registers make

[PATCH 0/4] Yet another pci/vpci locking re-work

2022-02-16 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Hello, all! This is a yet another attempt to re-work the existing pci/vpci locking scheme towards vPCI is going to be used for guests. For more details on the previous attempts and their flaws please see [1], [2]. This work is based on the idea that it is possible

[PATCH v2] tools: remove xenstore entries on vchan server closure

2022-02-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko vchan server creates XenStore entries to advertise its event channel and ring, but those are not removed after the server quits. Add additional cleanup step, so those are removed, so clients do not try to connect to a non-existing server. Signed-off-by: Oleksandr

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 18:18, Jan Beulich wrote: > On 15.02.2022 16:46, Oleksandr Andrushchenko wrote: >> Question: can anyone please explain why pcidevs is a recursive lock? > Well, assuming you did look at the change making it so, can you be a > little more specific with your question?

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 14:56, Jan Beulich wrote: > On 15.02.2022 13:44, Oleksandr Andrushchenko wrote: >> On 15.02.22 13:54, Oleksandr Andrushchenko wrote: >>> On 15.02.22 13:50, Jan Beulich wrote: >>>> On 15.02.2022 12:45, Oleksandr Andrushchenko wrote: >>>>>

Re: [PATCH] tools: remove xenstore entries on vchan server closure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 16:41, Jason Andryuk wrote: > On Fri, Dec 10, 2021 at 7:35 AM Oleksandr Andrushchenko > wrote: >> From: Oleksandr Andrushchenko >> >> vchan server creates XenStore entries to advertise its event channel and >> ring, but those are not removed

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 14:49, Jan Beulich wrote: > On 15.02.2022 12:54, Oleksandr Andrushchenko wrote: >> On 15.02.22 13:50, Jan Beulich wrote: >>> On 15.02.2022 12:45, Oleksandr Andrushchenko wrote: >>>> I'm on your side, I just want to hear that we all agree pcidevs >>

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 13:54, Oleksandr Andrushchenko wrote: > > On 15.02.22 13:50, Jan Beulich wrote: >> On 15.02.2022 12:45, Oleksandr Andrushchenko wrote: >>> I'm on your side, I just want to hear that we all agree pcidevs >>> needs to be converted into rwlock according w

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 13:50, Jan Beulich wrote: > On 15.02.2022 12:45, Oleksandr Andrushchenko wrote: >> I'm on your side, I just want to hear that we all agree pcidevs >> needs to be converted into rwlock according with the plan you >> suggested and at least now it seems to be a

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 13:39, Roger Pau Monné wrote: > On Tue, Feb 15, 2022 at 11:12:23AM +0000, Oleksandr Andrushchenko wrote: >> >> On 15.02.22 12:48, Roger Pau Monné wrote: >>> On Tue, Feb 15, 2022 at 10:11:35AM +0200, Oleksandr Andrushchenko wrote: >>&g

Re: [PATCH] tools: remove xenstore entries on vchan server closure

2022-02-15 Thread Oleksandr Andrushchenko
Anthony, could you please take a look? Thank you in advance, Oleksandr On 10.12.21 14:35, Oleksandr Andrushchenko wrote: > From: Oleksandr Andrushchenko > > vchan server creates XenStore entries to advertise its event channel and > ring, but those are not removed after the server

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 12:48, Roger Pau Monné wrote: > On Tue, Feb 15, 2022 at 10:11:35AM +0200, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko >> >> Introduce a per-domain read/write lock to check whether vpci is present, >> so we are sure there are

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 12:48, Roger Pau Monné wrote: > On Tue, Feb 15, 2022 at 10:11:35AM +0200, Oleksandr Andrushchenko wrote: > @@ -911,7 +914,11 @@ int vpci_msix_arch_print(const struct vpci_msix *msix) >> struct pci_dev *pdev = msix->pdev; >> >>

Re: [PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 10:11, Oleksandr Andrushchenko wrote: > From: Oleksandr Andrushchenko > > @@ -171,8 +173,24 @@ static int __init apply_map(struct domain *d, const > struct pci_dev *pdev, > struct map_data data = { .d = d, .map = true }; > int rc; > > +A

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
On 15.02.22 10:30, Roger Pau Monné wrote: > On Mon, Feb 14, 2022 at 02:00:26PM +0000, Oleksandr Andrushchenko wrote: >> /* >> * FIXME: apply_map is called from dom0 specific init code when >> * system_state < SYS_STATE_active, so there is no race condition >>

[PATCH v2] vpci: introduce per-domain lock to protect vpci structure

2022-02-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Introduce a per-domain read/write lock to check whether vpci is present, so we are sure there are no accesses to the contents of the vpci struct if not. This lock can be used (and in a few cases is used right away) so that vpci removal can be performed while holding

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 16:31, Jan Beulich wrote: > On 14.02.2022 15:26, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 16:19, Jan Beulich wrote: >>> On 09.02.2022 14:36, Oleksandr Andrushchenko wrote: >>>> @@ -410,14 +428,37 @@ static void vpci_write_hel

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 16:19, Jan Beulich wrote: > On 09.02.2022 14:36, Oleksandr Andrushchenko wrote: >> @@ -410,14 +428,37 @@ static void vpci_write_helper(const struct pci_dev >> *pdev, >>r->private); >> } >> >> +static bool vpci_he

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 15:48, Jan Beulich wrote: > On 14.02.2022 14:27, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 15:22, Jan Beulich wrote: >>> On 14.02.2022 14:13, Oleksandr Andrushchenko wrote: >>>> On 14.02.22 14:57, Jan Beulich wrote: >>>>>

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 15:22, Jan Beulich wrote: > On 14.02.2022 14:13, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 14:57, Jan Beulich wrote: >>> On 14.02.2022 12:37, Oleksandr Andrushchenko wrote: >>>> On 14.02.22 13:25, Roger Pau Monné wrote: >>>>>

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 14:57, Jan Beulich wrote: > On 14.02.2022 12:37, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 13:25, Roger Pau Monné wrote: >>> On Mon, Feb 14, 2022 at 11:15:27AM +, Oleksandr Andrushchenko wrote: >>>> On 14.02.22 13:11, Roger Pau Monné wro

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 13:25, Roger Pau Monné wrote: > On Mon, Feb 14, 2022 at 11:15:27AM +0000, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 13:11, Roger Pau Monné wrote: >>> On Mon, Feb 14, 2022 at 10:53:43AM +, Oleksandr Andrushchenko wrote: >>>> On 1

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 13:11, Roger Pau Monné wrote: > On Mon, Feb 14, 2022 at 10:53:43AM +0000, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 12:34, Roger Pau Monné wrote: >>> On Mon, Feb 14, 2022 at 09:36:39AM +, Oleksandr Andrushchenko wrote: >>>> On 1

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 12:34, Roger Pau Monné wrote: > On Mon, Feb 14, 2022 at 09:36:39AM +0000, Oleksandr Andrushchenko wrote: >> >> On 11.02.22 13:40, Roger Pau Monné wrote: >>> + >>>>>> for ( i = 0; i < msix->max_entries; i++ ) >>>>

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 11.02.22 13:40, Roger Pau Monné wrote: > + for ( i = 0; i < msix->max_entries; i++ ) { const struct vpci_msix_entry *entry = >entries[i]; >>> Since this function is now called with the per-domain rwlock read >>> locked it's likely not appropriate to

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 10:47, Roger Pau Monné wrote: > On Mon, Feb 14, 2022 at 06:33:07AM +0000, Oleksandr Andrushchenko wrote: >> >> On 11.02.22 17:44, Roger Pau Monné wrote: >>> On Fri, Feb 11, 2022 at 12:13:38PM +, Oleksandr Andrushchenko wrote: >>>> On 1

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-13 Thread Oleksandr Andrushchenko
On 11.02.22 17:44, Roger Pau Monné wrote: > On Fri, Feb 11, 2022 at 12:13:38PM +0000, Oleksandr Andrushchenko wrote: >> >> On 11.02.22 13:40, Roger Pau Monné wrote: >>> On Fri, Feb 11, 2022 at 07:27:39AM +, Oleksandr Andrushchenko wrote: >>>> Hi, Roger! &g

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-11 Thread Oleksandr Andrushchenko
On 11.02.22 13:51, Roger Pau Monné wrote: > On Fri, Feb 11, 2022 at 08:46:59AM +0000, Oleksandr Andrushchenko wrote: >> >> On 10.02.22 18:16, Roger Pau Monné wrote: >>> On Wed, Feb 09, 2022 at 03:36:27PM +0200, Oleksandr Andrushchenko wrote: >>&g

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-11 Thread Oleksandr Andrushchenko
On 11.02.22 13:40, Roger Pau Monné wrote: > On Fri, Feb 11, 2022 at 07:27:39AM +0000, Oleksandr Andrushchenko wrote: >> Hi, Roger! >> >> On 10.02.22 18:16, Roger Pau Monné wrote: >>> On Wed, Feb 09, 2022 at 03:36:27PM +0200, Oleksandr Andrushchenko wrote: >

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-11 Thread Oleksandr Andrushchenko
On 10.02.22 18:16, Roger Pau Monné wrote: > On Wed, Feb 09, 2022 at 03:36:27PM +0200, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko >> >> Introduce a per-domain read/write lock to check whether vpci is present, >> so we are sure there are

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-10 Thread Oleksandr Andrushchenko
Hi, Roger! On 10.02.22 18:16, Roger Pau Monné wrote: > On Wed, Feb 09, 2022 at 03:36:27PM +0200, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko >> >> Introduce a per-domain read/write lock to check whether vpci is present, >> so we are sure there are

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-10 Thread Oleksandr Andrushchenko
On 10.02.22 15:36, Jan Beulich wrote: > On 10.02.2022 13:54, Oleksandr Andrushchenko wrote: >> On 07.02.22 16:31, Jan Beulich wrote: >>> On 07.02.2022 15:17, Oleksandr Andrushchenko wrote: >>> But: What's still missing here then is the separation of guest and host

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-10 Thread Oleksandr Andrushchenko
On 07.02.22 16:31, Jan Beulich wrote: > On 07.02.2022 15:17, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 14:54, Jan Beulich wrote: >>> On 07.02.2022 13:51, Oleksandr Andrushchenko wrote: >>>> On 07.02.22 14:38, Jan Beulich wrote: >>>>>

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-10 Thread Oleksandr Andrushchenko
On 07.02.22 16:31, Jan Beulich wrote: > On 07.02.2022 15:17, Oleksandr Andrushchenko wrote: > But: What's still missing here then is the separation of guest and host > views. When we set INTx behind the guest's back, it shouldn't observe the > bit set. Or is this meant to be anothe

Re: [PATCH v6 05/13] vpci: add hooks for PCI device assign/de-assign

2022-02-10 Thread Oleksandr Andrushchenko
On 10.02.22 11:22, Jan Beulich wrote: > On 10.02.2022 09:21, Oleksandr Andrushchenko wrote: >> >> On 08.02.22 13:25, Oleksandr Andrushchenko wrote: >>> On 08.02.22 13:00, Jan Beulich wrote: >>>> On 08.02.2022 11:52, Oleksandr Andrushchenko wrote: >>

Re: [PATCH v6 05/13] vpci: add hooks for PCI device assign/de-assign

2022-02-10 Thread Oleksandr Andrushchenko
On 08.02.22 13:25, Oleksandr Andrushchenko wrote: > > On 08.02.22 13:00, Jan Beulich wrote: >> On 08.02.2022 11:52, Oleksandr Andrushchenko wrote: >>> This smells like we first need to fix the existing code, so >>> pdev->domain is not assigned by specific IOMMU

Re: [RFC v2 5/8] xen/arm: introduce SCMI-SMC mediator driver

2022-02-09 Thread Oleksandr Andrushchenko
Hi, Oleksii! On 08.02.22 20:00, Oleksii Moisieiev wrote: > This is the implementation of SCI interface, called SCMI-SMC driver, > which works as the mediator between XEN Domains and Firmware (SCP, ATF etc). > This allows devices from the Domains to work with clocks, resets and > power-domains

Re: [RFC v2 2/8] libs: libxenhypfs - handle blob properties

2022-02-09 Thread Oleksandr Andrushchenko
On 09.02.22 16:01, Jan Beulich wrote: > On 09.02.2022 14:47, Oleksandr Andrushchenko wrote: >> Hi, Oleksii! >> >> On 08.02.22 20:00, Oleksii Moisieiev wrote: >>> libxenhypfs will return blob properties as is. This output can be used >>> to retr

Re: [RFC v2 2/8] libs: libxenhypfs - handle blob properties

2022-02-09 Thread Oleksandr Andrushchenko
Hi, Oleksii! On 08.02.22 20:00, Oleksii Moisieiev wrote: > libxenhypfs will return blob properties as is. This output can be used > to retrieve information from the hypfs. Caller is responsible for > parsing property value. > > Signed-off-by: Oleksii Moisieiev > --- > tools/libs/hypfs/core.c |

[PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-09 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Introduce a per-domain read/write lock to check whether vpci is present, so we are sure there are no accesses to the contents of the vpci struct if not. This lock can be used (and in a few cases is used right away) so that vpci removal can be performed while holding

Re: [PATCH v6 09/13] vpci/header: emulate PCI_COMMAND register for guests

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 16:09, Roger Pau Monné wrote: > On Tue, Feb 08, 2022 at 11:29:07AM +0000, Oleksandr Andrushchenko wrote: >> >> On 08.02.22 13:11, Roger Pau Monné wrote: >>> On Tue, Feb 08, 2022 at 09:58:40AM +, Oleksandr Andrushchenko wrote: >>>>

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 15:38, Roger Pau Monné wrote: > On Tue, Feb 08, 2022 at 11:13:41AM +0000, Oleksandr Andrushchenko wrote: >> >> On 08.02.22 12:50, Roger Pau Monné wrote: >>> On Tue, Feb 08, 2022 at 07:35:34AM +, Oleksandr Andrushchenko

Re: [PATCH v6 09/13] vpci/header: emulate PCI_COMMAND register for guests

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 13:11, Roger Pau Monné wrote: > On Tue, Feb 08, 2022 at 09:58:40AM +0000, Oleksandr Andrushchenko wrote: >> >> On 08.02.22 11:52, Jan Beulich wrote: >>> On 08.02.2022 10:38, Oleksandr Andrushchenko wrote: >>>> On 08.02.22 11:33, Jan Beulich wrote:

Re: [PATCH v6 05/13] vpci: add hooks for PCI device assign/de-assign

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 13:00, Jan Beulich wrote: > On 08.02.2022 11:52, Oleksandr Andrushchenko wrote: >> This smells like we first need to fix the existing code, so >> pdev->domain is not assigned by specific IOMMU implementations, >> but instead controlled by the code which relie

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 12:50, Roger Pau Monné wrote: > On Tue, Feb 08, 2022 at 07:35:34AM +0000, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 18:44, Oleksandr Andrushchenko wrote: >>> On 07.02.22 18:37, Jan Beulich wrote: >>>> On 07.02.2022 17:21, Oleksandr Andrushc

Re: [PATCH v6 05/13] vpci: add hooks for PCI device assign/de-assign

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 12:29, Jan Beulich wrote: > On 08.02.2022 11:22, Oleksandr Andrushchenko wrote: >> >> On 08.02.22 12:09, Jan Beulich wrote: >>> On 08.02.2022 10:55, Oleksandr Andrushchenko wrote: >>>> On 08.02.22 11:44, Jan Beulich wrote: >>>>>

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 12:11, Roger Pau Monné wrote: > On Mon, Feb 07, 2022 at 05:37:49PM +0100, Jan Beulich wrote: >> On 07.02.2022 17:21, Oleksandr Andrushchenko wrote: >>> >>> On 07.02.22 18:15, Jan Beulich wrote: >>>> On 07.02.2022 17:07, Oleksandr Andrushche

Re: [PATCH v6 06/13] vpci/header: implement guest BAR register handlers

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 12:15, Jan Beulich wrote: > On 08.02.2022 10:57, Oleksandr Andrushchenko wrote: >> On 08.02.22 11:48, Jan Beulich wrote: >>> On 08.02.2022 10:31, Oleksandr Andrushchenko wrote: >>>> On 08.02.22 11:25, Roger Pau Monné wrote: >>>>> On Fri

Re: [PATCH v6 05/13] vpci: add hooks for PCI device assign/de-assign

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 12:09, Jan Beulich wrote: > On 08.02.2022 10:55, Oleksandr Andrushchenko wrote: >> >> On 08.02.22 11:44, Jan Beulich wrote: >>> On 08.02.2022 10:27, Oleksandr Andrushchenko wrote: >>>> On 08.02.22 11:13, Jan Beulich wrote: >>>>>

Re: [PATCH v6 09/13] vpci/header: emulate PCI_COMMAND register for guests

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 11:52, Jan Beulich wrote: > On 08.02.2022 10:38, Oleksandr Andrushchenko wrote: >> >> On 08.02.22 11:33, Jan Beulich wrote: >>> On 08.02.2022 09:13, Oleksandr Andrushchenko wrote: >>>> On 04.02.22 16:25, Jan Beulich wrote: >>>>>

Re: [PATCH v6 06/13] vpci/header: implement guest BAR register handlers

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 11:48, Jan Beulich wrote: > On 08.02.2022 10:31, Oleksandr Andrushchenko wrote: >> On 08.02.22 11:25, Roger Pau Monné wrote: >>> On Fri, Feb 04, 2022 at 08:34:52AM +0200, Oleksandr Andrushchenko wrote: >>>> @@ -516,6 +594,11 @@ static int

Re: [PATCH v6 05/13] vpci: add hooks for PCI device assign/de-assign

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 11:44, Jan Beulich wrote: > On 08.02.2022 10:27, Oleksandr Andrushchenko wrote: >> On 08.02.22 11:13, Jan Beulich wrote: >>> On 08.02.2022 09:32, Oleksandr Andrushchenko wrote: >>>> On 07.02.22 18:28, Jan Beulich wrote: >>>>> On 04

Re: [PATCH v6 09/13] vpci/header: emulate PCI_COMMAND register for guests

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 11:33, Jan Beulich wrote: > On 08.02.2022 09:13, Oleksandr Andrushchenko wrote: >> On 04.02.22 16:25, Jan Beulich wrote: >>> On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >>>> --- a/xen/drivers/vpci/header.c >>>> +++ b/xen/drivers/vpci

Re: [PATCH v6 06/13] vpci/header: implement guest BAR register handlers

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 11:25, Roger Pau Monné wrote: > On Fri, Feb 04, 2022 at 08:34:52AM +0200, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko >> >> Add relevant vpci register handlers when assigning PCI device to a domain >> and remove those when de-as

Re: [PATCH v6 05/13] vpci: add hooks for PCI device assign/de-assign

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 11:13, Jan Beulich wrote: > On 08.02.2022 09:32, Oleksandr Andrushchenko wrote: >> On 07.02.22 18:28, Jan Beulich wrote: >>> On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >>>> @@ -1507,6 +1511,8 @@ static int assign_device(struct domain *d, u16 se

Re: [PATCH v6 04/13] vpci: restrict unhandled read/write operations for guests

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 11:05, Roger Pau Monné wrote: > On Tue, Feb 08, 2022 at 08:00:28AM +0000, Oleksandr Andrushchenko wrote: >> On 04.02.22 16:24, Oleksandr Andrushchenko wrote: >>> On 04.02.22 16:11, Jan Beulich wrote: >>>> On 04.02.2022 07:34, Oleksandr Andrushchenko

Re: [PATCH v6 04/13] vpci: restrict unhandled read/write operations for guests

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 11:04, Jan Beulich wrote: > On 08.02.2022 09:00, Oleksandr Andrushchenko wrote: >> On 04.02.22 16:24, Oleksandr Andrushchenko wrote: >>> On 04.02.22 16:11, Jan Beulich wrote: >>>> On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >>>>&g

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 10:57, Jan Beulich wrote: > On 08.02.2022 08:35, Oleksandr Andrushchenko wrote: >> 1.1. Semi read lock upgrade in modify bars >> -- >> In this case both vpci_read and vpci_write take a read l

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-08 Thread Oleksandr Andrushchenko
On 08.02.22 10:53, Jan Beulich wrote: > On 07.02.2022 17:44, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 18:37, Jan Beulich wrote: >>> On 07.02.2022 17:21, Oleksandr Andrushchenko wrote: >>>> On 07.02.22 18:15, Jan Beulich wrote: >>>>>

Re: [PATCH v6 05/13] vpci: add hooks for PCI device assign/de-assign

2022-02-08 Thread Oleksandr Andrushchenko
On 07.02.22 18:28, Jan Beulich wrote: > On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >> @@ -1507,6 +1511,8 @@ static int assign_device(struct domain *d, u16 seg, u8 >> bus, u8 devfn, u32 flag) >> pci_to_dev(pdev), flag); >&g

Re: [PATCH v6 09/13] vpci/header: emulate PCI_COMMAND register for guests

2022-02-08 Thread Oleksandr Andrushchenko
On 04.02.22 16:25, Jan Beulich wrote: > On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >> --- a/xen/drivers/vpci/header.c >> +++ b/xen/drivers/vpci/header.c >> @@ -454,6 +454,22 @@ static void cmd_write(const struct pci_dev *pdev, >> unsigned int reg, >>

Re: [PATCH v6 06/13] vpci/header: implement guest BAR register handlers

2022-02-08 Thread Oleksandr Andrushchenko
On 07.02.22 19:06, Jan Beulich wrote: > On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >> +static uint32_t guest_bar_ignore_read(const struct pci_dev *pdev, >> + unsigned int reg, void *data) >> +{ >> +return 0

Re: [PATCH v6 04/13] vpci: restrict unhandled read/write operations for guests

2022-02-08 Thread Oleksandr Andrushchenko
On 04.02.22 16:24, Oleksandr Andrushchenko wrote: > > On 04.02.22 16:11, Jan Beulich wrote: >> On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >>> A guest can read and write those registers which are not emulated and >>> have no respective vPCI handlers, so it ca

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 18:44, Oleksandr Andrushchenko wrote: > > On 07.02.22 18:37, Jan Beulich wrote: >> On 07.02.2022 17:21, Oleksandr Andrushchenko wrote: >>> On 07.02.22 18:15, Jan Beulich wrote: >>>> On 07.02.2022 17:07, Oleksandr Andrushchenko wrote: >>&

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 18:37, Jan Beulich wrote: > On 07.02.2022 17:21, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 18:15, Jan Beulich wrote: >>> On 07.02.2022 17:07, Oleksandr Andrushchenko wrote: >>>> On 07.02.22 17:26, Jan Beulich wrote: >>>>

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 18:15, Jan Beulich wrote: > On 07.02.2022 17:07, Oleksandr Andrushchenko wrote: >> On 07.02.22 17:26, Jan Beulich wrote: >>> 1b. Make vpci_write use write lock for writes to command register and BARs >>> only; keep using the read lock for all other writes.

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 17:26, Jan Beulich wrote: > On 07.02.2022 16:11, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 16:35, Oleksandr Andrushchenko wrote: >>> On 07.02.22 16:27, Roger Pau Monné wrote: >>>> On Mon, Feb 07, 2022 at 03:11:03PM +0100, Jan Beulich wrote:

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 17:28, Jan Beulich wrote: > On 07.02.2022 16:14, Oleksandr Andrushchenko wrote: >> On 07.02.22 17:05, Jan Beulich wrote: >>> On 07.02.2022 15:46, Oleksandr Andrushchenko wrote: >>>> On 07.02.22 16:31, Jan Beulich wrote: >>>>> But: Wha

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 17:05, Jan Beulich wrote: > On 07.02.2022 15:46, Oleksandr Andrushchenko wrote: >> On 07.02.22 16:31, Jan Beulich wrote: >>> But: What's still missing here then is the separation of guest and host >>> views. When we set INTx behind the guest's back, it sh

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 16:35, Oleksandr Andrushchenko wrote: > > On 07.02.22 16:27, Roger Pau Monné wrote: >> On Mon, Feb 07, 2022 at 03:11:03PM +0100, Jan Beulich wrote: >>> On 07.02.2022 14:53, Oleksandr Andrushchenko wrote: >>>> On 07.02.22 14:46, Roger Pau Monné wr

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 16:31, Jan Beulich wrote: > On 07.02.2022 15:17, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 14:54, Jan Beulich wrote: >>> On 07.02.2022 13:51, Oleksandr Andrushchenko wrote: >>>> On 07.02.22 14:38, Jan Beulich wrote: >>>>>

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 16:27, Roger Pau Monné wrote: > On Mon, Feb 07, 2022 at 03:11:03PM +0100, Jan Beulich wrote: >> On 07.02.2022 14:53, Oleksandr Andrushchenko wrote: >>> On 07.02.22 14:46, Roger Pau Monné wrote: >>>> I think the per-domain rwlock seems like a good option.

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 16:11, Jan Beulich wrote: > On 07.02.2022 14:53, Oleksandr Andrushchenko wrote: >> On 07.02.22 14:46, Roger Pau Monné wrote: >>> I think the per-domain rwlock seems like a good option. I would do >>> that as a pre-patch. >> It is. But it seems it

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 16:19, Roger Pau Monné wrote: > On Mon, Feb 07, 2022 at 01:53:34PM +0000, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 14:46, Roger Pau Monné wrote: >>> On Mon, Feb 07, 2022 at 11:08:39AM +, Oleks

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 14:54, Jan Beulich wrote: > On 07.02.2022 13:51, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 14:38, Jan Beulich wrote: >>> On 07.02.2022 12:27, Oleksandr Andrushchenko wrote: >>>> On 07.02.22 09:29, Jan Beulich wrote: >>>>>

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 14:46, Roger Pau Monné wrote: > On Mon, Feb 07, 2022 at 11:08:39AM +0000, Oleksandr Andrushchenko wrote: >> Hello, >> >> On 04.02.22 16:57, Roger Pau Monné wrote: >>> On Fri, Feb 04, 2022 at 02:43:07PM +, Oleksandr Andrushchenko wrote: >>&

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 14:34, Jan Beulich wrote: > On 07.02.2022 12:08, Oleksandr Andrushchenko wrote: >> 1. vpci_{read|write} are not protected with pcidevs_lock and can run in >> parallel with pci_remove_device which can remove pdev after vpci_{read|write} >> acquired the pdev p

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 14:38, Jan Beulich wrote: > On 07.02.2022 12:27, Oleksandr Andrushchenko wrote: >> >> On 07.02.22 09:29, Jan Beulich wrote: >>> On 04.02.2022 15:37, Oleksandr Andrushchenko wrote: >>>> On 04.02.22 16:30, Jan Beulich wrote: >>>>>

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-07 Thread Oleksandr Andrushchenko
On 07.02.22 09:29, Jan Beulich wrote: > On 04.02.2022 15:37, Oleksandr Andrushchenko wrote: >> On 04.02.22 16:30, Jan Beulich wrote: >>> On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >>>> Reset the command register when assigning a PCI device to a guest:

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-07 Thread Oleksandr Andrushchenko
Hello, On 04.02.22 16:57, Roger Pau Monné wrote: > On Fri, Feb 04, 2022 at 02:43:07PM +0000, Oleksandr Andrushchenko wrote: >> >> On 04.02.22 15:06, Roger Pau Monné wrote: >>> On Fri, Feb 04, 2022 at 12:53:20PM +, Oleksandr Andrushchenko wrote: >>>>

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 15:06, Roger Pau Monné wrote: > On Fri, Feb 04, 2022 at 12:53:20PM +0000, Oleksandr Andrushchenko wrote: >> >> On 04.02.22 14:47, Jan Beulich wrote: >>> On 04.02.2022 13:37, Oleksandr Andrushchenko wrote: >>>> On 04.02.22 13:37, Jan Beulich wrote:

Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 16:30, Jan Beulich wrote: > On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >> Reset the command register when assigning a PCI device to a guest: >> according to the PCI spec the PCI_COMMAND register is typically all 0's >> after reset. > It's not enti

Re: [PATCH v6 04/13] vpci: restrict unhandled read/write operations for guests

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 16:11, Jan Beulich wrote: > On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >> A guest can read and write those registers which are not emulated and >> have no respective vPCI handlers, so it can access the HW directly. > I don't think this describes the present

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 14:47, Jan Beulich wrote: > On 04.02.2022 13:37, Oleksandr Andrushchenko wrote: >> >> On 04.02.22 13:37, Jan Beulich wrote: >>> On 04.02.2022 12:13, Roger Pau Monné wrote: >>>> On Fri, Feb 04, 2022 at 11:49:18AM +0100, Jan Beulich wrote:

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 13:37, Jan Beulich wrote: > On 04.02.2022 12:13, Roger Pau Monné wrote: >> On Fri, Feb 04, 2022 at 11:49:18AM +0100, Jan Beulich wrote: >>> On 04.02.2022 11:12, Oleksandr Andrushchenko wrote: >>>> On 04.02.22 11:15, Jan Beulich wrote: >&g

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 13:13, Roger Pau Monné wrote: > On Fri, Feb 04, 2022 at 11:49:18AM +0100, Jan Beulich wrote: >> On 04.02.2022 11:12, Oleksandr Andrushchenko wrote: >>> On 04.02.22 11:15, Jan Beulich wrote: >>>> On 04.02.2022 09:58, Oleksandr Andrushchenko wrote: >&g

Re: [PATCH v6 01/13] xen/pci: arm: add stub for is_memory_hole

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 13:00, Julien Grall wrote: > > > On 04/02/2022 10:35, Oleksandr Andrushchenko wrote: >> >> >> On 04.02.22 11:57, Julien Grall wrote: >>> Hi, >>> >>> On 04/02/2022 09:47, Oleksandr Andrushchenko wrote: >>>>>&g

Re: [PATCH v6 01/13] xen/pci: arm: add stub for is_memory_hole

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 11:57, Julien Grall wrote: > Hi, > > On 04/02/2022 09:47, Oleksandr Andrushchenko wrote: >>>> Could you please help me with the exact message you would like to see? >>> >>> Here a summary of the discussion (+ some my follow-up thoughts)

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-04 Thread Oleksandr Andrushchenko
Hi, Jan! On 04.02.22 11:15, Jan Beulich wrote: > On 04.02.2022 09:58, Oleksandr Andrushchenko wrote: >> On 04.02.22 09:52, Jan Beulich wrote: >>> On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >>>> @@ -285,6 +286,12 @@ static int modify_bars(const struct pci

Re: [PATCH v6 01/13] xen/pci: arm: add stub for is_memory_hole

2022-02-04 Thread Oleksandr Andrushchenko
On 04.02.22 11:41, Julien Grall wrote: > On 04/02/2022 09:01, Oleksandr Andrushchenko wrote: >> On 04.02.22 10:51, Julien Grall wrote: >>> Hi, >>> >>> On 04/02/2022 06:34, Oleksandr Andrushchenko wrote: >>>> From: Oleksandr Andrushchenko >>&

Re: [PATCH v6 01/13] xen/pci: arm: add stub for is_memory_hole

2022-02-04 Thread Oleksandr Andrushchenko
Hi, Julien! On 04.02.22 10:51, Julien Grall wrote: > Hi, > > On 04/02/2022 06:34, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko >> >> Add a stub for is_memory_hole which is required for PCI passthrough >> on Arm. >> >> Signed-off

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-04 Thread Oleksandr Andrushchenko
Hi, Jan! On 04.02.22 09:52, Jan Beulich wrote: > On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >> @@ -285,6 +286,12 @@ static int modify_bars(const struct pci_dev *pdev, >> uint16_t cmd, bool rom_only) >> continue; >> } >>

Re: [PATCH v6 12/13] xen/arm: translate virtual PCI bus topology for guests

2022-02-04 Thread Oleksandr Andrushchenko
Hi, Jan! On 04.02.22 09:56, Jan Beulich wrote: > On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: >> --- a/xen/drivers/vpci/vpci.c >> +++ b/xen/drivers/vpci/vpci.c >> @@ -168,6 +168,35 @@ static void vpci_remove_virtual_device(struct domain *d, >> pdev-

Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci

2022-02-04 Thread Oleksandr Andrushchenko
Hi, Jan! On 04.02.22 09:52, Jan Beulich wrote: > On 04.02.2022 07:34, Oleksandr Andrushchenko wrote: > > At the first glance this simply looks like another unjustified (in the > description) change, as you're not converting anything here but you > actually add locking

[PATCH v6 13/13] xen/arm: account IO handlers for emulated PCI MSI-X

2022-02-03 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko At the moment, we always allocate an extra 16 slots for IO handlers (see MAX_IO_HANDLER). So while adding IO trap handlers for the emulated MSI-X registers we need to explicitly tell that we have additional IO handlers, so those are accounted. Signed-off

[PATCH v6 12/13] xen/arm: translate virtual PCI bus topology for guests

2022-02-03 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko There are three originators for the PCI configuration space access: 1. The domain that owns physical host bridge: MMIO handlers are there so we can update vPCI register handlers with the values written by the hardware domain, e.g. physical view of the registers vs

  1   2   3   4   5   6   7   8   9   10   >