Re: [PATCH 1/4] Add .clang-format files to enable manual coding style checks

2025-03-04 Thread Oleksandr Andrushchenko
Hello, Roger! On 04.03.25 10:17, Roger Pau Monné wrote: On Mon, Mar 03, 2025 at 09:23:57PM +0200, Oleksandr Andrushchenko wrote: Hello, Roger! On 03.03.25 17:05, Roger Pau Monné wrote: On Sat, Mar 01, 2025 at 01:42:39PM +0200, Oleksandr Andrushchenko wrote: Disable coding style checks for

Re: [PATCH 1/4] Add .clang-format files to enable manual coding style checks

2025-03-03 Thread Oleksandr Andrushchenko
Hello, Roger! On 03.03.25 17:05, Roger Pau Monné wrote: On Sat, Mar 01, 2025 at 01:42:39PM +0200, Oleksandr Andrushchenko wrote: Disable coding style checks for the project, but xen/ folder: this is done by providing a global .clang-format at the top level which disables clang-format and only

[PATCH 3/4] [EXAMPLE] Changes done by clang-format to the previous commit

2025-03-01 Thread Oleksandr Andrushchenko
: xen/drivers/char/ns16550.c It is seen that only xen/ part of the patch was touched. The result can still be manually adjusted before committing. Signed-off-by: Oleksandr Andrushchenko --- xen/drivers/char/ns16550.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a

[PATCH 4/4] [EXAMPLE] Whole file code style formatting

2025-03-01 Thread Oleksandr Andrushchenko
This patch was produced by running clang-format on a file: clang-format -i xen/drivers/pci/pci.c Signed-off-by: Oleksandr Andrushchenko --- xen/drivers/pci/pci.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c index

[PATCH 0/4] clang-format with examples

2025-03-01 Thread Oleksandr Andrushchenko
are accepted all those comments can be removed. Stay safe, Oleksandr Andrushchenko [1] https://lists.xen.org/archives/html/xen-devel/2025-02/msg00800.html Oleksandr Andrushchenko (4): Add .clang-format files to enable manual coding style checks [EXAMPLE] Provide an example of a malformed pa

[PATCH 2/4] [EXAMPLE] Provide an example of a malformed patch

2025-03-01 Thread Oleksandr Andrushchenko
This patch touches tools/xl and xen/. clang-format, if applied, will only change xen/ part. Signed-off-by: Oleksandr Andrushchenko --- tools/xl/xl_info.c | 6 ++ xen/drivers/char/ns16550.c | 12 +--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/tools/xl

[PATCH 1/4] Add .clang-format files to enable manual coding style checks

2025-03-01 Thread Oleksandr Andrushchenko
-by: Oleksandr Andrushchenko Signed-off-by: Luca Fancellu --- .clang-format |5 + xen/.clang-format | 1380 + 2 files changed, 1385 insertions(+) create mode 100644 .clang-format create mode 100644 xen/.clang-format diff --git a/.clang-format b/.cl

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-25 Thread Oleksandr Andrushchenko
Hello, Jan! On 24.02.25 12:55, Jan Beulich wrote: On 23.02.2025 08:42, Oleksandr Andrushchenko wrote: On 20.02.25 03:34, Stefano Stabellini wrote: On Wed, 19 Feb 2025, Oleksandr Andrushchenko wrote: Yes, I do agree. But only if we talk about having an automated code style check now (which is

Re: [PATCH 1/2] code style: Format ns16550 driver

2025-02-22 Thread Oleksandr Andrushchenko
Hello, Jan! On 19.02.25 18:01, Jan Beulich wrote: On 19.02.2025 16:40, Oleksandr Andrushchenko wrote: On 19.02.25 16:05, Jan Beulich wrote: On 19.02.2025 14:52, Oleksandr Andrushchenko wrote: On 19.02.25 15:18, Jan Beulich wrote: On 19.02.2025 13:39, Oleksandr Andrushchenko wrote: On

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-22 Thread Oleksandr Andrushchenko
Hello, Stefano! On 20.02.25 03:34, Stefano Stabellini wrote: On Wed, 19 Feb 2025, Oleksandr Andrushchenko wrote: Yes, I do agree. But only if we talk about having an automated code style check now (which is definitely the goal at some time). Before that we could still use the tool to take all

Re: [PATCH 1/2] code style: Format ns16550 driver

2025-02-19 Thread Oleksandr Andrushchenko
On 19.02.25 16:05, Jan Beulich wrote: On 19.02.2025 14:52, Oleksandr Andrushchenko wrote: On 19.02.25 15:18, Jan Beulich wrote: On 19.02.2025 13:39, Oleksandr Andrushchenko wrote: On 17.02.25 12:20, Jan Beulich wrote: On 16.02.2025 11:21, Oleksandr Andrushchenko wrote: @@ -248,8 +249,9

Re: [PATCH 1/2] code style: Format ns16550 driver

2025-02-19 Thread Oleksandr Andrushchenko
Hello, Jan! On 19.02.25 14:39, Oleksandr Andrushchenko wrote: Hello, Jan! On 17.02.25 12:20, Jan Beulich wrote: On 16.02.2025 11:21, Oleksandr Andrushchenko wrote: --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -14,7 +14,7 @@    * abstracted.    */   #if defined

Re: [PATCH 1/2] code style: Format ns16550 driver

2025-02-19 Thread Oleksandr Andrushchenko
Hello, Jan! On 19.02.25 15:18, Jan Beulich wrote: On 19.02.2025 13:39, Oleksandr Andrushchenko wrote: On 17.02.25 12:20, Jan Beulich wrote: On 16.02.2025 11:21, Oleksandr Andrushchenko wrote: @@ -43,12 +43,12 @@ static struct ns16550 { int baud, clock_hz, data_bits, parity

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-19 Thread Oleksandr Andrushchenko
On 19.02.25 14:51, Oleksandr Andrushchenko wrote: Hello, Andrew! On 19.02.25 14:49, Andrew Cooper wrote: On 16/02/2025 5:11 pm, Oleksandr Andrushchenko wrote: Hello, Roger! Please find the branch with all the conversions [1]. Unfortunately I cannot provide a branch as seen with diff

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-19 Thread Oleksandr Andrushchenko
Hello, Jan! On 19.02.25 14:49, Jan Beulich wrote: On 19.02.2025 13:43, Oleksandr Andrushchenko wrote: Hello, Jan, Stefano! On 18.02.25 13:34, Jan Beulich wrote: On 18.02.2025 03:36, Stefano Stabellini wrote: On Mon, 17 Feb 2025, Jan Beulich wrote: On 16.02.2025 11:21, Oleksandr

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-19 Thread Oleksandr Andrushchenko
Hello, Andrew! On 19.02.25 14:49, Andrew Cooper wrote: On 16/02/2025 5:11 pm, Oleksandr Andrushchenko wrote: Hello, Roger! Please find the branch with all the conversions [1]. Unfortunately I cannot provide a branch as seen with diff --ignore-all-space as such a patch will not simply apply

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-19 Thread Oleksandr Andrushchenko
Hello, Grygorii! On 18.02.25 11:56, Grygorii Strashko wrote: On 16.02.25 12:21, Oleksandr Andrushchenko wrote: Hello, everybody! As agreed before [1] I am sending a series to show two samples of the formatting done with clang-format. The clang-format configuration can be found at [2]. It

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-19 Thread Oleksandr Andrushchenko
Hello, Jan, Stefano! On 18.02.25 13:34, Jan Beulich wrote: On 18.02.2025 03:36, Stefano Stabellini wrote: On Mon, 17 Feb 2025, Jan Beulich wrote: On 16.02.2025 11:21, Oleksandr Andrushchenko wrote: 1. Const string arrays reformatting In case the length of items change we might need to

Re: [PATCH 1/2] code style: Format ns16550 driver

2025-02-19 Thread Oleksandr Andrushchenko
Hello, Jan! On 17.02.25 12:20, Jan Beulich wrote: On 16.02.2025 11:21, Oleksandr Andrushchenko wrote: --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -14,7 +14,7 @@ * abstracted. */ #if defined(CONFIG_HAS_PCI) && defined(CONFIG_X86) -# define NS16550_PCI

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-16 Thread Oleksandr Andrushchenko
Hello, Roger! Please find the branch with all the conversions [1]. Unfortunately I cannot provide a branch as seen with diff --ignore-all-space as such a patch will not simply apply. Stay safe, Oleksandr Andrushchenko On 16.02.25 13:58, Andrew Cooper wrote: On 16/02/2025 10:21 am, Oleksandr

[PATCH 1/2] code style: Format ns16550 driver

2025-02-16 Thread Oleksandr Andrushchenko
Use .clang-format to format ns16550 driver. Signed-off-by: Oleksandr Andrushchenko --- xen/drivers/char/ns16550.c | 761 ++--- 1 file changed, 378 insertions(+), 383 deletions(-) diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index

[PATCH 0/2] code style exercise: Drivers folder samples

2025-02-16 Thread Oleksandr Andrushchenko
which cannot be handled by the tool now. Stay safe, Oleksandr Andrushchenko 1. Const string arrays reformatting In case the length of items change we might need to introduce a bigger change wrt new formatting of unaffected lines ==

[PATCH 2/2] code style: Format ACPI tables

2025-02-16 Thread Oleksandr Andrushchenko
Use .clang-format to format ACPI tables. Signed-off-by: Oleksandr Andrushchenko --- xen/drivers/acpi/tables.c | 809 -- 1 file changed, 435 insertions(+), 374 deletions(-) diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c index 20aed8929b86

Re: Coding Style Review and Automation

2025-02-12 Thread Oleksandr Andrushchenko
Hi, Grygorii, On 12.02.25 13:14, Grygorii Strashko wrote: Hi On 12.02.25 11:14, Roger Pau Monné wrote: On Tue, Feb 11, 2025 at 02:33:08PM -0800, Stefano Stabellini wrote: Hi Oleksandr, This morning, we had a discussion among maintainers, and the suggested approach moving forward is as follow

Re: Coding Style Review and Automation

2025-02-12 Thread Oleksandr Andrushchenko
r2000/xen/blob/clang/xen/.clang-format Cheers, Stefano On Mon, 10 Feb 2025, Oleksandr Andrushchenko wrote: Hello, everybody! What is the rationale behind introducing a tool to help with coding style verification? I will partially quote Viktor Mitin here [2]: "The Xen Project has a

Coding Style Review and Automation

2025-02-10 Thread Oleksandr Andrushchenko
becomes and will require a new round as new code comes in. I would love to hear from the community on this approach and finally get it done. Not busted. Stay safe, Oleksandr Andrushchenko [1] https://lore.kernel.org/xen-devel/1130763396.5603480.1492372859631.javamail.zim...@research.iiit.ac.in/T/

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 sa

[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 accord

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

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 no acce

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 = &msix->entries[i]; >>> Since this function is now called with the per-domain rwlock read >>> locked it's likely not appropriate t

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 no acce

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

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 mea

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 with

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 retriev

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: >>>> On 08.02.2

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 wr

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 wro

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 lock an

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: >>>>&g

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: What&#

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 b

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

  1   2   3   4   5   6   7   8   9   10   >