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

2022-02-15 Thread Jan Beulich
On 15.02.2022 17:28, Oleksandr Andrushchenko wrote: > 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 >>

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? Are you perhaps

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

2022-02-15 Thread Jan Beulich
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? Are you perhaps suggesting the original reason has disappeared,

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: > I'm on your side, I just want to hear that we

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

2022-02-15 Thread Jan Beulich
On 15.02.2022 13:56, Oleksandr Andrushchenko wrote: > 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

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 needs to be converted into rwlock

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

2022-02-15 Thread Jan Beulich
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: I'm on your side, I just want to hear that we all agree pcidevs needs to be converted

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

2022-02-15 Thread Jan Beulich
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 >>> needs to be converted into rwlock according with the plan you >>> suggested and

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 with the plan you >>> suggested

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 an acceptable solution. >

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

2022-02-15 Thread Jan Beulich
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 an acceptable solution. I'd like to express worries though about the

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 +, 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: From: Oleksandr Andrushchenko

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

2022-02-15 Thread Roger Pau Monné
On Tue, Feb 15, 2022 at 11:12:23AM +, 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: > >> From: Oleksandr Andrushchenko > >> > >> Introduce a per-domain read/write lock to check

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 no accesses to the contents of the

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 Roger Pau Monné
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 no accesses to the contents of the vpci struct > if not. This lock can be used (and in

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; > > +

[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