Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-25 Thread Volodymyr Babchuk
Hi Roger, Roger Pau Monné writes: > On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: >> From: Oleksandr Andrushchenko >> >> Use a previously introduced per-domain read/write lock to check >> whether vpci is present, so we are sure there are no accesses to the >> contents of

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-21 Thread Roger Pau Monné
On Wed, Sep 20, 2023 at 03:16:00PM -0400, Stewart Hildebrand wrote: > On 9/19/23 11:39, Roger Pau Monné wrote: > > On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: > >> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c > >> index 1edc7f1e91..545a27796e 100644 >

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-21 Thread Roger Pau Monné
On Thu, Sep 21, 2023 at 09:42:08AM +0200, Jan Beulich wrote: > On 20.09.2023 15:56, Stewart Hildebrand wrote: > > On 9/20/23 04:09, Roger Pau Monné wrote: > >> On Tue, Sep 19, 2023 at 12:20:39PM -0400, Stewart Hildebrand wrote: > >>> On 9/19/23 11:39, Roger Pau Monné wrote: > On Tue, Aug 29,

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-21 Thread Jan Beulich
On 20.09.2023 15:56, Stewart Hildebrand wrote: > On 9/20/23 04:09, Roger Pau Monné wrote: >> On Tue, Sep 19, 2023 at 12:20:39PM -0400, Stewart Hildebrand wrote: >>> On 9/19/23 11:39, Roger Pau Monné wrote: On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: > diff --git

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-20 Thread Stewart Hildebrand
On 9/19/23 11:39, Roger Pau Monné wrote: > On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: >> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c >> index 1edc7f1e91..545a27796e 100644 >> --- a/xen/arch/x86/hvm/vmx/vmx.c >> +++ b/xen/arch/x86/hvm/vmx/vmx.c >> @@

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-20 Thread Stewart Hildebrand
On 9/20/23 04:09, Roger Pau Monné wrote: > On Tue, Sep 19, 2023 at 12:20:39PM -0400, Stewart Hildebrand wrote: >> On 9/19/23 11:39, Roger Pau Monné wrote: >>> On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-20 Thread Roger Pau Monné
On Tue, Sep 19, 2023 at 05:55:42PM +0200, Jan Beulich wrote: > On 19.09.2023 17:39, Roger Pau Monné wrote: > > On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: > >> @@ -2908,7 +2908,13 @@ int allocate_and_map_msi_pirq(struct domain *d, int > >> index, int *pirq_p, > >> > >>

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-20 Thread Roger Pau Monné
On Tue, Sep 19, 2023 at 12:20:39PM -0400, Stewart Hildebrand wrote: > On 9/19/23 11:39, Roger Pau Monné wrote: > > On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: > >> diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c > >> index 8f2b59e61a..a0733bb2cb 100644 > >> ---

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-19 Thread Stewart Hildebrand
On 9/19/23 11:39, Roger Pau Monné wrote: > On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: >> diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c >> index 8f2b59e61a..a0733bb2cb 100644 >> --- a/xen/drivers/vpci/msi.c >> +++ b/xen/drivers/vpci/msi.c >> @@ -318,15 +321,28

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-19 Thread Jan Beulich
On 19.09.2023 17:39, Roger Pau Monné wrote: > On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: >> @@ -2908,7 +2908,13 @@ int allocate_and_map_msi_pirq(struct domain *d, int >> index, int *pirq_p, >> >> msi->irq = irq; >> >> -pcidevs_lock(); >> +/* >> + * If

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-09-19 Thread Roger Pau Monné
On Tue, Aug 29, 2023 at 11:19:42PM +, Volodymyr Babchuk wrote: > From: Oleksandr Andrushchenko > > Use a previously introduced 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

[PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

2023-08-29 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Use a previously introduced 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