Re: [PATCH] arm: dom0less: add TEE support

2024-05-29 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > Can you clarify whether this is intended for the next release cycle? Well, I don't think that this patch should be committed ASAP if this is what you are asking about. > On 29/05/2024 21:43, Volodymyr Babchuk wrote: >> Al

[PATCH] arm: dom0less: add TEE support

2024-05-29 Thread Volodymyr Babchuk
Allow to provide TEE type for a Dom0less guest via "xen,tee" property. Create appropriate nodes in the guests' device tree and initialize tee subsystem for it. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/dom0less-build.c | 69 +++ xen/arch/arm/i

Re: [PATCH 2/3] drivers: serial: add Qualcomm GENI-based serial driver

2024-04-02 Thread Volodymyr Babchuk
Hi Michal, Michal Orzel writes: > Hello, > > On 29/03/2024 01:08, Volodymyr Babchuk wrote: >> >> >> Generic Interface (GENI) is a newer interface for low speed interfaces >> like UART, I2C or SPI. This patch adds the simple driver for the UART >> ins

[PATCH 1/3] arm: smmu: allow SMMU to have more IRQs than context banks

2024-03-28 Thread Volodymyr Babchuk
I encountered platform, namely Qualcomm SA8155P where SMMU-compatible IO-MMU advertises more context IQRs than there are context banks. This should not be an issue, we need to relax the check in the SMMU driver to allow such configuration. Signed-off-by: Volodymyr Babchuk --- xen/drivers

[PATCH 2/3] drivers: serial: add Qualcomm GENI-based serial driver

2024-03-28 Thread Volodymyr Babchuk
. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/Kconfig.debug | 19 +- xen/arch/arm/arm64/debug-qcom.inc| 76 +++ xen/arch/arm/include/asm/qcom-uart.h | 48 + xen/drivers/char/Kconfig | 8 + xen/drivers/char/Makefile| 1 + xen/drivers/char/qcom

[PATCH 0/3] Add experimental support for Qualcomm SA8155P SoC

2024-03-28 Thread Volodymyr Babchuk
. Volodymyr Babchuk (3): arm: smmu: allow SMMU to have more IRQs than context banks drivers: serial: add Qualcomm GENI-based serial driver arm: platform: qcom: add basic support SA8155P SoC xen/arch/arm/Kconfig.debug | 19 +- xen/arch/arm/arm64/debug-qcom.inc| 76 +++ xen/arch

[PATCH 3/3] arm: platform: qcom: add basic support SA8155P SoC

2024-03-28 Thread Volodymyr Babchuk
right now (with Linux 6.8) even on baremetal setup the driver fails anyways, because it does not know how to work with this SoC. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/qcom.c | 77 + 2 files changed, 78

[RFC,FUTURE 0/3] Make vSBDF configurable by toolstack

2023-12-13 Thread Volodymyr Babchuk
omctl - specifically for allocating vSBDFs. But then there would be two domctls that are capable of allocating vSBDFs: assign_device and this new call... So yeah, I am open for suggestions. [1] https://lore.kernel.org/all/d6a58e73-da51-40f1-a2f7-576274945...@xen.org/ Volodymyr Babchuk (3): dom

[RFC,FUTURE 3/3] tools: libxl: use "vslot" parameter when assigning a PCI device

2023-12-13 Thread Volodymyr Babchuk
Now, when "assign_device" domctl supports providing a virtual SBDF, we can leverage "vslot" option from PCI_SPEC_STRING and pass user requested function number to the hypervisor. Signed-off-by: Volodymyr Babchuk --- tools/libs/light/libxl_pci.c | 7 ++- 1 file changed

[RFC,FUTURE 2/3] tools: libxc: add virtual_sbdf parameter to xc_assign_device

2023-12-13 Thread Volodymyr Babchuk
Now, when "assign_device" domctl supports virtual_sbdf option, make it available to libxc users. This is an optional parameter, if it is not provided, xc_assign_device() will ask hypervisor to allocate a free vSBDF. Signed-off-by: Volodymyr Babchuk -- This clearly breaks libxc API. S

[RFC,FUTURE 1/3] domctl/pci: add ability to provide/request a virtual SBDF

2023-12-13 Thread Volodymyr Babchuk
desired vSBDF and hypervisor will try to use it, if it is free and falls into permitted range. [1] https://lore.kernel.org/all/d6a58e73-da51-40f1-a2f7-576274945...@xen.org/ Signed-off-by: Volodymyr Babchuk --- tools/libs/ctrl/xc_domain.c | 1 + xen/drivers/passthrough/pci.c | 17

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-12 Thread Volodymyr Babchuk
Hi Stefan, Stefan Hajnoczi writes: > On Tue, 12 Dec 2023 at 10:36, Volodymyr Babchuk > wrote: >> >> Hi Anthony >> >> Anthony PERARD writes: >> >> > On Fri, Dec 08, 2023 at 02:49:27PM -0800, Stefano Stabellini wrote: >> >> On Fri, 8 D

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-12 Thread Volodymyr Babchuk
Hi Anthony Anthony PERARD writes: > On Fri, Dec 08, 2023 at 02:49:27PM -0800, Stefano Stabellini wrote: >> On Fri, 8 Dec 2023, Daniel P. Berrangé wrote: >> > On Thu, Dec 07, 2023 at 11:12:48PM +, Michael Young wrote: >> > > Builds of qemu-8.2.0rc2 with xen-4.18.0 are currently failing >> >

Re: [PATCH v11 06/17] vpci/header: rework exit path in init_bars

2023-12-04 Thread Volodymyr Babchuk
Hello Jan, Jan Beulich writes: > On 02.12.2023 02:27, Volodymyr Babchuk wrote: >> Introduce "fail" label in init_bars() function to have the centralized >> error return path. This is the pre-requirement for the future changes >> in this function. >> >&g

Re: [PATCH v11 09/17] rangeset: add rangeset_empty() function

2023-12-04 Thread Volodymyr Babchuk
Hi Jan, Jan Beulich writes: > On 02.12.2023 02:27, Volodymyr Babchuk wrote: >> This function can be used when user wants to remove all rangeset >> entries but do not want to destroy rangeset itself. > > I have to admit that I'm not happy with the name: We're not cons

[PATCH v4 3/6] xen: decouple generic xen code from legacy backends codebase

2023-12-01 Thread Volodymyr Babchuk
all, what should be done in the future anyways. But right now this patch moves us one step close to have QEMU build without legacy Xen backends. Signed-off-by: Volodymyr Babchuk --- In v4: - New in v4, previous was part of "xen: add option to disable legacy backends" - Do not

[PATCH v4 6/6] xen_arm: Add virtual PCIe host bridge support

2023-12-01 Thread Volodymyr Babchuk
-off-by: Volodymyr Babchuk --- Changes in v3: - Use QOM properties instead of reading from XenStore - Remove unneeded includes - Move pcie_* fields into "struct cfg" Changes in v2: - Renamed virtio_pci_host to pcie_host entries in XenStore, because there is nothing specific to

[RFC PATCH v4 4/6] xen: add option to disable legacy backends

2023-12-01 Thread Volodymyr Babchuk
/html/qemu-devel/2023-11/msg05022.html Signed-off-by: Volodymyr Babchuk --- I am not sure if I made correct changes to build system, so this patch is tagged as RFC. Changes in v3: - New patch in v3 --- hw/9pfs/meson.build | 4 +++- hw/display/meson.build| 4 +++- hw

[PATCH v4 2/6] xen: backends: don't overwrite XenStore nodes created by toolstack

2023-12-01 Thread Volodymyr Babchuk
n't created by Xen toolstack. If they were created by toolstack, then it is toolstack's job to do proper clean-up. Suggested-by: Paul Durrant Suggested-by: David Woodhouse Co-Authored-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk Reviewed-by: David Woodhouse --- Changes in

[PATCH v4 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-12-01 Thread Volodymyr Babchuk
From: David Woodhouse This allows a XenDevice implementation to know whether it was created by QEMU, or merely discovered in XenStore after the toolstack created it. This will allow us to create frontend/backend nodes only when we should, rather than unconditionally attempting to overwrite them

[PATCH v11 07/17] vpci/header: implement guest BAR register handlers

2023-12-01 Thread Volodymyr Babchuk
returning default ~0 on read may confuse guest OS. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk --- In v11: - Access guest_addr after adjusting for MEM64_HI bar in guest_bar_write() - guest bar handlers renamed and now _mem_ part to denote that they are handling only

[PATCH v11 03/17] vpci: use per-domain PCI lock to protect vpci structure

2023-12-01 Thread Volodymyr Babchuk
rposes. Suggested-by: Roger Pau Monné Suggested-by: Jan Beulich Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk --- Changes in v11: - Fixed commit message regarding possible spinlocks - Removed parameter from allocate_and_map_msi_pirq(), which was added in the prev ver

[PATCH v11 00/17] PCI devices passthrough on Arm, part 3

2023-12-01 Thread Volodymyr Babchuk
t: add RANGESETF_no_print flag vpci/header: handle p2m range sets per BAR vpci/header: program p2m with guest BAR view vpci/header: emulate PCI_COMMAND register for guests vpci: add initial support for virtual PCI bus topology xen/arm: translate virtual PCI bus topology for guests xen/ar

[PATCH v11 01/17] pci: msi: pass pdev to pci_enable_msi() function

2023-12-01 Thread Volodymyr Babchuk
. Also, in most cases caller already has pointer to pdev, so we can avoid an extra list walk. Signed-off-by: Volodymyr Babchuk --- In v11: - Made pdev parameter very first in pci_enable_msi() and friends. - Extended the commit message - Added check for pdev into ns16550 driver - Replaced hard

[PATCH v11 08/17] rangeset: add RANGESETF_no_print flag

2023-12-01 Thread Volodymyr Babchuk
. Suggested-by: Jan Beulich Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk Reviewed-by: Jan Beulich --- Since v5: - comment indentation (Jan) Since v1: - update BUG_ON with new flag - simplify the definition of the flags --- xen/common/rangeset.c | 5 - xen

[PATCH v11 11/17] vpci/header: program p2m with guest BAR view

2023-12-01 Thread Volodymyr Babchuk
mapped, while for domUs the BARs are mapped at the requested guest address without modifying the BAR address in the device PCI config space. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk --- In v11: - Add vmsix_guest_table_addr() and vmsix_guest_table_base() functions

[PATCH v11 06/17] vpci/header: rework exit path in init_bars

2023-12-01 Thread Volodymyr Babchuk
Introduce "fail" label in init_bars() function to have the centralized error return path. This is the pre-requirement for the future changes in this function. This patch does not introduce functional changes. Signed-off-by: Volodymyr Babchuk Suggested-by: Roger Pau Monné Acked-by:

[PATCH v11 17/17] arm/vpci: honor access size when returning an error

2023-12-01 Thread Volodymyr Babchuk
are writing 0x in the target register. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/vpci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/vpci.c b/xen/arch/arm/vpci.c index b6ef440f17..05a479096e 100644 --- a/xen/arch/arm/vpci.c +++ b/xen

[PATCH v11 13/17] vpci: add initial support for virtual PCI bus topology

2023-12-01 Thread Volodymyr Babchuk
. Please note, that at the moment only function 0 of a multifunction device can be passed through. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk --- In v11: - Fixed code formatting - Removed bogus write_unlock() call - Fixed type for new_dev_number In v10: - Removed ASSERT

[PATCH v11 14/17] xen/arm: translate virtual PCI bus topology for guests

2023-12-01 Thread Volodymyr Babchuk
in the physical topology, e.g. it can't be mapped to some physical host bridge. So, all access to the host bridge itself needs to be trapped and emulated. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk --- In v11: - Fixed format issues - Added ASSERT_UNREACHABLE() to the dummy

[PATCH v11 02/17] pci: introduce per-domain PCI rwlock

2023-12-01 Thread Volodymyr Babchuk
by the said lock). In case both the newly introduced per-domain rwlock and the pcidevs lock is taken, the latter must be acquired first. Suggested-by: Roger Pau Monné Suggested-by: Jan Beulich Signed-off-by: Volodymyr Babchuk Reviewed-by: Roger Pau Monné --- Changes in v10: - pdev->dom

[PATCH v11 16/17] xen/arm: vpci: permit access to guest vpci space

2023-12-01 Thread Volodymyr Babchuk
From: Stewart Hildebrand Move iomem_caps initialization earlier (before arch_domain_create()). Signed-off-by: Stewart Hildebrand Signed-off-by: Volodymyr Babchuk --- Changes in v10: * fix off-by-one * also permit access to GUEST_VPCI_PREFETCH_MEM_ADDR Changes in v9: * new patch This is sort

[PATCH v11 15/17] xen/arm: account IO handlers for emulated PCI MSI-X

2023-12-01 Thread Volodymyr Babchuk
-by: Oleksandr Andrushchenko Acked-by: Julien Grall Signed-off-by: Volodymyr Babchuk --- This actually moved here from the part 2 of the prep work for PCI passthrough on Arm as it seems to be the proper place for it. Since v5: - optimize with IS_ENABLED(CONFIG_HAS_PCI_MSI) since VPCI_MAX_VIRT_DEV

[PATCH v11 09/17] rangeset: add rangeset_empty() function

2023-12-01 Thread Volodymyr Babchuk
This function can be used when user wants to remove all rangeset entries but do not want to destroy rangeset itself. Signed-off-by: Volodymyr Babchuk --- Changes in v11: - Now the function only empties rangeset, without removing it from domain's list Changes in v10: - New in v10

[PATCH v11 05/17] vpci: add hooks for PCI device assign/de-assign

2023-12-01 Thread Volodymyr Babchuk
-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk --- In v11: - Call vpci_assign_device() in "deassign_device" if IOMMU call "reassign_device" was successful. In v10: - removed HAS_VPCI_GUEST_SUPPORT checks - HAS_VPCI_GUEST_SUPPORT config option (in Kconfi

[PATCH v11 10/17] vpci/header: handle p2m range sets per BAR

2023-12-01 Thread Volodymyr Babchuk
are no longer removed if the creation of the mappings in vpci_process_pending() fails, as that's unlikely to lead to a functional device in any case. This is in preparation of making non-identity mappings in p2m for the MMIOs. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk

[PATCH v11 04/17] vpci: restrict unhandled read/write operations for guests

2023-12-01 Thread Volodymyr Babchuk
sure only hardware domain can access the hardware directly and restrict guests from doing so. Suggested-by: Roger Pau Monné Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk Reviewed-by: Roger Pau Monné --- Since v9: - removed stray formatting change - added Roger's R-b

[PATCH v11 12/17] vpci/header: emulate PCI_COMMAND register for guests

2023-12-01 Thread Volodymyr Babchuk
LE bit. In our case, we prohibit a guest to change value of this bit if MSI(X) is enabled. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk --- It is better to rework this patch using new register handling tools that Stewart Hildenbrand upstreaming right now. In v11: -

Re: [PATCH v10 12/17] vpci/header: emulate PCI_COMMAND register for guests

2023-11-30 Thread Volodymyr Babchuk
Hi Roger, Stewart, Roger Pau Monné writes: > On Thu, Oct 12, 2023 at 10:09:18PM +0000, Volodymyr Babchuk wrote: >> From: Oleksandr Andrushchenko >> >> Xen and/or Dom0 may have put values in PCI_COMMAND which they expect >> to remain unaltered. PCI_COMMAND_SERR b

Re: [PATCH v10 13/17] vpci: add initial support for virtual PCI bus topology

2023-11-28 Thread Volodymyr Babchuk
Hi Roger, Roger Pau Monné writes: > On Wed, Nov 22, 2023 at 01:18:32PM -0800, Stefano Stabellini wrote: >> On Wed, 22 Nov 2023, Roger Pau Monné wrote: >> > On Tue, Nov 21, 2023 at 05:12:15PM -0800, Stefano Stabellini wrote: >> > > Let me expand on this. Like I wrote above, I think it is

Re: [PATCH v10 03/17] vpci: use per-domain PCI lock to protect vpci structure

2023-11-28 Thread Volodymyr Babchuk
Hi Roger Thank you for the review. Roger Pau Monné writes: > On Thu, Oct 12, 2023 at 10:09:15PM +0000, Volodymyr Babchuk wrote: >> From: Oleksandr Andrushchenko >> >> Use a previously introduced per-domain read/write lock to check >> whether vpci

Re: [EXTERNAL] [PATCH v3 2/5] xen: backends: don't overwrite XenStore nodes created by toolstack

2023-11-27 Thread Volodymyr Babchuk
Hi David, Thank you for the review David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Fri, 2023-11-24 at 23:24 +, Volodymyr Babchuk wrote: >> Xen PV devices in QEMU can be created in two ways: either by QEMU >> itself, if they were passed via command line, o

Re: [RFC PATCH v3 3/5] xen: add option to disable legacy backends

2023-11-27 Thread Volodymyr Babchuk
Hi David, "Woodhouse, David" writes: > [[S/MIME Signed Part:Undecided]] > On Fri, 2023-11-24 at 23:24 +, Volodymyr Babchuk wrote: >> This patch makes legacy backends optional. As was discussed at [1] >> this is a solution to a problem when we can't run QEMU a

[RFC PATCH v3 3/5] xen: add option to disable legacy backends

2023-11-24 Thread Volodymyr Babchuk
of course. [1] https://lists.gnu.org/archive/html/qemu-devel/2023-11/msg05022.html Signed-off-by: Volodymyr Babchuk --- I am not sure if I made correct changes to the build system, thus this patch is tagged as RFC. Changes in v3: - New patch in v3 --- accel/xen/xen-all.c | 13 +++

[PATCH v3 1/5] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-24 Thread Volodymyr Babchuk
From: David Woodhouse This allows a XenDevice implementation to know whether it was created by QEMU, or merely discovered in XenStore after the toolstack created it. This will allow us to create frontend/backend nodes only when we should, rather than unconditionally attempting to overwrite them

[PATCH v3 2/5] xen: backends: don't overwrite XenStore nodes created by toolstack

2023-11-24 Thread Volodymyr Babchuk
n't created by Xen toolstack. If they were created by toolstack, then it is toolstack's job to do proper clean-up. Suggested-by: Paul Durrant Suggested-by: David Woodhouse Co-Authored-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- Changes in v3: - Rephrased the commit mess

[PATCH v3 5/5] xen_arm: Add virtual PCIe host bridge support

2023-11-24 Thread Volodymyr Babchuk
-off-by: Volodymyr Babchuk --- Changes in v3: - Use QOM properties instead of reading from XenStore - Remove unneeded includes - Move pcie_* fields into "struct cfg" Changes in v2: - Renamed virtio_pci_host to pcie_host entries in XenStore, because there is nothing specific to

Re: [PATCH v2 6/6] xen_arm: Add virtual PCIe host bridge support

2023-11-24 Thread Volodymyr Babchuk
Hi Igor, Thank you for the review, Igor Mammedov writes: > On Tue, 21 Nov 2023 22:10:28 + > Volodymyr Babchuk wrote: > >> From: Oleksandr Tyshchenko >> >> The bridge is needed for virtio-pci support, as QEMU can emulate the >> whole bridge with

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-23 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > On 23 November 2023 12:17:57 GMT, Volodymyr Babchuk > wrote: >> >>Hi David, >> >>David Woodhouse writes: >>> Which PV backends do you care about? We already have net, block and console >>> converted. >

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-23 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > On 23 November 2023 11:54:01 GMT, Volodymyr Babchuk > wrote: >> >>Hi Paul, >> >>Paul Durrant writes: >> >>> On 23/11/2023 00:07, Volodymyr Babchuk wrote: >>>> Hi, >>>> Volodymyr Ba

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-23 Thread Volodymyr Babchuk
Hi Paul, Paul Durrant writes: > On 23/11/2023 00:07, Volodymyr Babchuk wrote: >> Hi, >> Volodymyr Babchuk writes: >> >>> Hi Stefano, >>> >>> Stefano Stabellini writes: >>> >>>> On Wed, 22 Nov 2023, David Woodhouse wro

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-23 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Thu, 2023-11-23 at 09:28 +, Paul Durrant wrote: >> On 23/11/2023 00:07, Volodymyr Babchuk wrote: >> > >> > Hi, >> > >> > Volodymyr Babchuk writes: >> &

Re: [PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-22 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Tue, 2023-11-21 at 22:10 +, Volodymyr Babchuk wrote: >> >> --- a/hw/xen/xen-operations.c >> +++ b/hw/xen/xen-operations.c >> @@ -300,6 +300,18 @@ static bool libxenstore_creat

Re: [PATCH v2 6/6] xen_arm: Add virtual PCIe host bridge support

2023-11-22 Thread Volodymyr Babchuk
Hi Vikram, Vikram Garhwal writes: > Hi Volodymyr, > Thank you sharing this patch. I have few comments below > On Wed, Nov 22, 2023 at 02:39:46PM -0800, Stefano Stabellini wrote: >> +Vikram >> >> On Tue, 21 Nov 2023, Volodymyr Babchuk wrote: >

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread Volodymyr Babchuk
Hi, Volodymyr Babchuk writes: > Hi Stefano, > > Stefano Stabellini writes: > >> On Wed, 22 Nov 2023, David Woodhouse wrote: >>> On Wed, 2023-11-22 at 15:09 -0800, Stefano Stabellini wrote: >>> > On Wed, 22 Nov 2023, David Woodhouse wrote: >>>

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread Volodymyr Babchuk
Hi David, "Woodhouse, David" writes: > On Wed, 2023-11-22 at 17:05 +, Paul Durrant wrote: >> On 21/11/2023 22:10, Volodymyr Babchuk wrote: >> > From: David Woodhouse >> > >> > This allows a XenDevice implementation to know whether it

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread Volodymyr Babchuk
wrote: >> > > > On Wed, 22 Nov 2023, Paul Durrant wrote: >> > > > > On 21/11/2023 22:10, Volodymyr Babchuk wrote: >> > > > > > From: Oleksandr Tyshchenko >> > > > > > >> > > > > > Instead of forcing t

Re: [PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-22 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Tue, 2023-11-21 at 22:10 +, Volodymyr Babchuk wrote: >> >> --- a/hw/xen/xen-operations.c >> +++ b/hw/xen/xen-operations.c >> @@ -300,6 +300,18 @@ static bool libxenstore_creat

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread Volodymyr Babchuk
Paul Durrant writes: > On 21/11/2023 22:10, Volodymyr Babchuk wrote: >> From: David Woodhouse >> This allows a XenDevice implementation to know whether it was >> created >> by QEMU, or merely discovered in XenStore after the toolstack created >> it. This

Re: [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-22 Thread Volodymyr Babchuk
Hi Paul, Paul Durrant writes: > On 21/11/2023 22:10, Volodymyr Babchuk wrote: >> was created by QEMU >> Xen PV devices in QEMU can be created in two ways: either by QEMU >> itself, if they were passed via command line, or by Xen toolstack. In >> the latter case,

Re: [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-22 Thread Volodymyr Babchuk
Hi Philippe, Philippe Mathieu-Daudé writes: > Hi Volodymyr, > > On 21/11/23 23:10, Volodymyr Babchuk wrote: >> was created by QEMU > > Please do not split lines between subject and content. Rewrite the > full line. Preferably restrict the subject to 72 chars. I tr

[PATCH v2 6/6] xen_arm: Add virtual PCIe host bridge support

2023-11-21 Thread Volodymyr Babchuk
run in different domains and serve virtio-pci devices for the same guest should use different host bridge resources for Xen to distinguish. The rule for the guest device-tree generation is one PCI host bridge per backend domain. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr

[PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-21 Thread Volodymyr Babchuk
ore entries during device teardown only if they weren't created by Xen toolstack. If they were created by toolstack, then it is toolstack's job to do proper clean-up. Suggested-by: Paul Durrant Suggested-by: David Woodhouse Co-Authored-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babc

[PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-21 Thread Volodymyr Babchuk
will make specific implementation to get original owner of an entry and pass it back to set_permissions() call. Please note, that XenStore inherits permissions, so even if entry is newly created by, it already has the owner set to match owner of entry at previous level. Signed-off-by: Volodym

[PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-21 Thread Volodymyr Babchuk
e required directories in advance. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/xen/xen_pvdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index c5ad71e8dc..42bdd4f6c8 100644 --- a/hw/xen/xen_pvdev.c ++

[PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-21 Thread Volodymyr Babchuk
From: David Woodhouse This allows a XenDevice implementation to know whether it was created by QEMU, or merely discovered in XenStore after the toolstack created it. This will allow us to create frontend/backend nodes only when we should, rather than unconditionally attempting to overwrite them

Re: [PATCH v10 13/17] vpci: add initial support for virtual PCI bus topology

2023-11-20 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > On Fri, 17 Nov 2023, Volodymyr Babchuk wrote: >> > On Fri, 17 Nov 2023, Volodymyr Babchuk wrote: >> >> Hi Julien, >> >> >> >> Julien Grall writes: >> >> >> >> > Hi Volodymyr

[PATCH] xenstored: use correct conversion specifier in the tracing function

2023-11-20 Thread Volodymyr Babchuk
Previous change to xenstored used "%d" to format conn->id while in fact conn->id has "unsigned int" type, so "%u" should be used. Fixes: 97f8555acbf3 ("xenstored: print domain id in traces") Signed-off-by: Volodymyr Babchuk --- tools/xenstored/co

Re: [PATCH] xenstored: print domain id in traces

2023-11-20 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > On 16/11/2023 20:56, Volodymyr Babchuk wrote: >> It is very helpful to see domain id why analyzing xenstored >> traces. Especially when you are trying to understand which exactly >> domain performs an action.

Re: [PATCH v10 13/17] vpci: add initial support for virtual PCI bus topology

2023-11-17 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > On Fri, 17 Nov 2023, Volodymyr Babchuk wrote: >> Hi Julien, >> >> Julien Grall writes: >> >> > Hi Volodymyr, >> > >> > On 17/11/2023 14:09, Volodymyr Babchuk wrote: >> >> Hi Stefa

Re: [PATCH v10 13/17] vpci: add initial support for virtual PCI bus topology

2023-11-17 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > On 17/11/2023 14:09, Volodymyr Babchuk wrote: >> Hi Stefano, >> Stefano Stabellini writes: >> >>> On Fri, 17 Nov 2023, Volodymyr Babchuk wrote: >>>>> I still think, no matter the BDF a

Re: [PATCH v10 13/17] vpci: add initial support for virtual PCI bus topology

2023-11-17 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > On Fri, 17 Nov 2023, Volodymyr Babchuk wrote: >> > I still think, no matter the BDF allocation scheme, that we should try >> > to avoid as much as possible to have two different PCI Root Complex >> > emulators. Ideally w

Re: [RFC PATCH 2/6] xen/public: arch-arm: reserve resources for virtio-pci

2023-11-16 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > On Thu, 16 Nov 2023, Volodymyr Babchuk wrote: >> Hi Stefano, >> >> Stefano Stabellini writes: >> >> > + Stewart, Vikram >> > >> > On Wed, 15 Nov 2023, Oleksandr Tyshchenko wrote: >> >>

Re: [PATCH v10 13/17] vpci: add initial support for virtual PCI bus topology

2023-11-16 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > On Thu, 16 Nov 2023, Julien Grall wrote: >> IIUC, this means that Xen will allocate the BDF. I think this will become a >> problem quite quickly as some of the PCI may need to be assigned at a >> specific >> vBDF (I have the intel graphic card in

[PATCH] xenstored: print domain id in traces

2023-11-16 Thread Volodymyr Babchuk
It is very helpful to see domain id why analyzing xenstored traces. Especially when you are trying to understand which exactly domain performs an action. Signed-off-by: Volodymyr Babchuk --- tools/xenstored/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools

Re: [RFC PATCH 2/6] xen/public: arch-arm: reserve resources for virtio-pci

2023-11-16 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > On 16/11/2023 15:26, Stewart Hildebrand wrote: >> On 11/16/23 10:12, Julien Grall wrote: >>> Hi Volodymyr, >>> >>> On 16/11/2023 15:07, Volodymyr Babchuk wrote: >>>> With my vPCI patch series in place, hyperv

Re: [RFC PATCH 2/6] xen/public: arch-arm: reserve resources for virtio-pci

2023-11-16 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > + Stewart, Vikram > > On Wed, 15 Nov 2023, Oleksandr Tyshchenko wrote: >> On 15.11.23 14:33, Julien Grall wrote: >> > Thanks for adding support for virtio-pci in Xen. I have some questions. >> > >> > On 15/11/2023 11:26, Sergiy Kibrik wrote: >> >>

Re: [PATCH v1 4/7] xen_pvdev: Do not assume Dom0 when creating a directrory

2023-11-14 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Fri, 2023-11-10 at 20:42 +, Volodymyr Babchuk wrote: >> From: Oleksandr Tyshchenko >> >> Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to save >> the previous owner of

Re: [PATCH v1 1/7] xen-block: Do not write frontend nodes

2023-11-14 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > On 11 November 2023 16:51:22 GMT-05:00, Andrew Cooper > wrote: >>On 11/11/2023 8:18 pm, David Woodhouse wrote: >>> On 11 November 2023 08:43:40 GMT-05:00, Andrew Cooper >>> wrote: Furthermore, the control domain doesn't always have the domid of 0.

Re: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner

2023-11-13 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Sat, 2023-11-11 at 11:01 +, David Woodhouse wrote: >> >> > --- a/hw/xen/xen-operations.c >> > +++ b/hw/xen/xen-operations.c >> > @@ -300,6 +300,18 @@ static bool libxenstore_create(struct qemu_xs_handle >> > *h,

Re: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner

2023-11-13 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Fri, 2023-11-10 at 20:42 +, Volodymyr Babchuk wrote: >> Add option to preserve owner when creating an entry in Xen Store. This >> may be needed in cases when Qemu is working as device mo

Re: [PATCH v1 7/7] xen_arm: Add basic virtio-pci support

2023-11-13 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Fri, 2023-11-10 at 20:42 +, Volodymyr Babchuk wrote: >> From: Oleksandr Tyshchenko >> >> This patch adds basic virtio-pci support for xen_arm machine. > > Why only xen_arm? Couldn't t

[PATCH v1 4/7] xen_pvdev: Do not assume Dom0 when creating a directrory

2023-11-10 Thread Volodymyr Babchuk
to create required directories in advance. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/xen/xen_pvdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index c5ad71e8dc..42bdd4f6c8 100644 --- a/hw/xen/xen_pvd

[PATCH v1 7/7] xen_arm: Add basic virtio-pci support

2023-11-10 Thread Volodymyr Babchuk
guest should use different host bridge resources for Xen to distinguish. The rule for the guest device-tree generation is one PCI host bridge per backend domain. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/arm/xen_arm.c| 186

[PATCH v1 1/7] xen-block: Do not write frontend nodes

2023-11-10 Thread Volodymyr Babchuk
, this is not really needed, probably it is just a leftover and all xen_device_frontend_printf() instances should go away completely. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/block/xen-block.c | 11 +++ hw/xen/xen-bus.c | 2 +- 2 files changed, 8

[PATCH v1 3/7] xen: xenstore: add possibility to preserve owner

2023-11-10 Thread Volodymyr Babchuk
will make specific implementation to get original owner of an entry and pass it back to set_permissions() call. Signed-off-by: Volodymyr Babchuk --- hw/i386/kvm/xen_xenstore.c | 18 ++ hw/xen/xen-operations.c | 12 include/hw/xen/xen_backend_ops.h | 2 +

[PATCH v1 2/7] xen-bus: Do not destroy frontend/backend directories

2023-11-10 Thread Volodymyr Babchuk
that here, this is not really needed, probably it is just a leftover and all xs_node_destroy() instances should go away completely. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/xen/xen-bus.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git

[PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed

2023-11-10 Thread Volodymyr Babchuk
e. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/xen/xen-bus.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 75474d4b43..6e7ec3af64 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -519,6 +519,10 @@ s

Re: [PATCH v10 12/17] vpci/header: emulate PCI_COMMAND register for guests

2023-10-13 Thread Volodymyr Babchuk
Volodymyr Babchuk writes: > From: Oleksandr Andrushchenko > > Xen and/or Dom0 may have put values in PCI_COMMAND which they expect > to remain unaltered. PCI_COMMAND_SERR bit is a good example: while the > guest's view of this will want to be zero initially, the host having se

Re: [PATCH v10 09/17] rangeset: add rangeset_empty() function

2023-10-13 Thread Volodymyr Babchuk
Hi Stewart, Stewart Hildebrand writes: > On 10/12/23 18:09, Volodymyr Babchuk wrote: >> This function can be used when user wants to remove all rangeset >> entries but do not want to destroy rangeset itself. >> >> Signed-off-by: Volodymyr Babchuk >&

Re: [PATCH v10 15/17] xen/arm: account IO handlers for emulated PCI MSI-X

2023-10-13 Thread Volodymyr Babchuk
Julien, Julien Grall writes: > Hi, > > On 13/10/2023 14:06, Volodymyr Babchuk wrote: >> Hi Julien, >> Julien Grall writes: >> >>> Hi Volodymyr, >>> >>> On 12/10/2023 23:09, Volodymyr Babchuk wrote: >>>> From: Oleksandr Andru

Re: [PATCH v10 15/17] xen/arm: account IO handlers for emulated PCI MSI-X

2023-10-13 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > On 12/10/2023 23:09, Volodymyr Babchuk wrote: >> 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 handler

[PATCH v10 15/17] xen/arm: account IO handlers for emulated PCI MSI-X

2023-10-12 Thread Volodymyr Babchuk
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-by:

[PATCH v10 17/17] arm/vpci: honor access size when returning an error

2023-10-12 Thread Volodymyr Babchuk
are writing 0x in the target register. Signed-off-by: Volodymyr Babchuk --- xen/arch/arm/vpci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/vpci.c b/xen/arch/arm/vpci.c index 3521d5bc2f..f1e434a5db 100644 --- a/xen/arch/arm/vpci.c +++ b/xen

[PATCH v10 13/17] vpci: add initial support for virtual PCI bus topology

2023-10-12 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Assign SBDF to the PCI devices being passed through with bus 0. The resulting topology is where PCIe devices reside on the bus 0 of the root complex itself (embedded endpoints). This implementation is limited to 32 devices which are allowed on a single PCI bus.

[PATCH v10 14/17] xen/arm: translate virtual PCI bus topology for guests

2023-10-12 Thread Volodymyr Babchuk
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

[PATCH v10 16/17] xen/arm: vpci: permit access to guest vpci space

2023-10-12 Thread Volodymyr Babchuk
From: Stewart Hildebrand Move iomem_caps initialization earlier (before arch_domain_create()). Signed-off-by: Stewart Hildebrand --- Changes in v10: * fix off-by-one * also permit access to GUEST_VPCI_PREFETCH_MEM_ADDR Changes in v9: * new patch This is sort of a follow-up to:

[PATCH v10 02/17] pci: introduce per-domain PCI rwlock

2023-10-12 Thread Volodymyr Babchuk
by the said lock). In case both the newly introduced per-domain rwlock and the pcidevs lock is taken, the later must be acquired first. Suggested-by: Roger Pau Monné Suggested-by: Jan Beulich Signed-off-by: Volodymyr Babchuk --- Changes in v10: - pdev->domain is assigned after removing fro

[PATCH v10 04/17] vpci: restrict unhandled read/write operations for guests

2023-10-12 Thread Volodymyr Babchuk
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 v10 12/17] vpci/header: emulate PCI_COMMAND register for guests

2023-10-12 Thread Volodymyr Babchuk
LE bit. In our case, we prohibit a guest to change value of this bit if MSI(X) is enabled. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Volodymyr Babchuk --- In v10: - Added cf_check attribute to guest_cmd_read - Removed warning about non-zero cmd - Updated comment MSI code regardin

  1   2   3   4   5   6   7   >