Re: [VirtIO] Support for various devices in Xen

2024-04-29 Thread Viresh Kumar
On 30-04-24, 03:11, Andrei Cherechesu wrote: > Are there any other virtio device types you managed to test so far > besides these ones (over virtio-mmio/virtio-grant)? Has anyone > tested the rust-vmm vhost-device backends from Viresh with Xen? I have tested them earlier with Xen emulated with

Re: [PATCH] libxl: Add "grant_usage" parameter for virtio disk devices

2024-02-02 Thread Viresh Kumar
On 02-02-24, 12:49, Oleksandr Tyshchenko wrote: > diff --git a/docs/man/xl-disk-configuration.5.pod.in > b/docs/man/xl-disk-configuration.5.pod.in > index bc945cc517..3c035456d5 100644 > --- a/docs/man/xl-disk-configuration.5.pod.in > +++ b/docs/man/xl-disk-configuration.5.pod.in > @@ -404,6

Re: [VirtIO] Support for various devices in Xen

2024-01-11 Thread Viresh Kumar
+ Few Linaro folks. Hi Andrei, On 11-01-24, 15:32, Andrei Cherechesu (OSS) wrote: > Hello, > > As I've mentioned in previous discussion threads in the xen-devel > community, we are running Xen 4.17 (uprev to 4.18 in progress) on NXP > S32G automotive processors (Cortex-A53 cores) and we wanted

[PATCH V4 3/4] xen: evtchn: Allow shared registration of IRQ handers

2023-10-16 Thread Viresh Kumar
after all the users are gone. Signed-off-by: Viresh Kumar --- drivers/xen/events/events_base.c | 3 ++- drivers/xen/evtchn.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index c7715f8bd452

[PATCH V4 0/4] xen: privcmd: Add ioeventfd and fix irqfd support

2023-10-16 Thread Viresh Kumar
s as well. Viresh Kumar (4): xen: Make struct privcmd_irqfd's layout architecture independent xen: irqfd: Use _IOW instead of the internal _IOC() macro xen: evtchn: Allow shared registration of IRQ handers xen: privcmd: Add support for ioeventfd drivers/xen/Kconfig | 8 +- dr

[PATCH V4 4/4] xen: privcmd: Add support for ioeventfd

2023-10-16 Thread Viresh Kumar
implementations for KVM, etc.. This also copies ioreq.h header file (only struct ioreq and related macros) from Xen's source tree (Top commit 5d84f07fe6bf ("xen/pci: drop remaining uses of bool_t")). Signed-off-by: Viresh Kumar --- drivers/xen/Kconfig | 8 +- drivers/xen

[PATCH V4 2/4] xen: irqfd: Use _IOW instead of the internal _IOC() macro

2023-10-16 Thread Viresh Kumar
pport for irqfd") Reported-by: Arnd Bergmann Closes: https://lore.kernel.org/all/268a2031-63b8-4c7d-b1e5-8ab83ca80...@app.fastmail.com/ Signed-off-by: Viresh Kumar --- include/uapi/xen/privcmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/xen/privcmd.

[PATCH V4 1/4] xen: Make struct privcmd_irqfd's layout architecture independent

2023-10-16 Thread Viresh Kumar
to avoid the pointers altogether. Fixes: f8941e6c4c71 ("xen: privcmd: Add support for irqfd") Reported-by: Arnd Bergmann Closes: https://lore.kernel.org/all/268a2031-63b8-4c7d-b1e5-8ab83ca80...@app.fastmail.com/ Signed-off-by: Viresh Kumar --- drivers/xen/privcmd.c | 2 +- includ

Re: [Stratos-dev] [PATCH V3 2/2] xen: privcmd: Add support for ioeventfd

2023-10-10 Thread Viresh Kumar
Hi Bill, On Tue, 10 Oct 2023 at 18:52, Bill Mills wrote: > On 10/9/23 7:29 AM, Viresh Kumar via Stratos-dev wrote: > > -config XEN_PRIVCMD_IRQFD > > - bool "Xen irqfd support" > > +config XEN_PRIVCMD_EVENTFD > > + bool "Xen Ioeventfd and i

[PATCH V3 1/2] xen: evtchn: Allow shared registration of IRQ handers

2023-10-09 Thread Viresh Kumar
after all the users are gone. Signed-off-by: Viresh Kumar --- drivers/xen/events/events_base.c | 3 ++- drivers/xen/evtchn.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index c7715f8bd452

[PATCH V3 2/2] xen: privcmd: Add support for ioeventfd

2023-10-09 Thread Viresh Kumar
implementations for KVM, etc.. This also copies ioreq.h header file (only struct ioreq and related macros) from Xen's source tree (Top commit 5d84f07fe6bf ("xen/pci: drop remaining uses of bool_t")). Signed-off-by: Viresh Kumar --- drivers/xen/Kconfig | 8 +- drivers/xen

[PATCH V3 0/2] xen: privcmd: Add ioeventfd support

2023-10-09 Thread Viresh Kumar
valid info. - Use u64 type for addr. - Add comments for use of barriers. - Use spin lock instead of mutex as we need to use them in irq handler. - Add a warning when kioreq is getting freed and ioeventfds list isn't empty. - Use struct_size(). - Validate number of vcpus as well. Viresh Kumar (2):

Re: [PATCH 2/2] xen: privcmd: Add support for ioeventfd

2023-10-09 Thread Viresh Kumar
On 09-10-23, 10:40, Alex Bennée wrote: > I thought generally sync points act as full barriers. Doing a bunch of > grepping I think ends at: > > static __always_inline bool __mutex_unlock_fast(struct mutex *lock) > { > unsigned long curr = (unsigned long)current; > >

[PATCH V2 1/2] xen: evtchn: Allow shared registration of IRQ handers

2023-10-05 Thread Viresh Kumar
after all the users are gone. Signed-off-by: Viresh Kumar --- drivers/xen/events/events_base.c | 3 ++- drivers/xen/evtchn.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index c7715f8bd452

[PATCH V2 2/2] xen: privcmd: Add support for ioeventfd

2023-10-05 Thread Viresh Kumar
implementations for KVM, etc.. This also copies ioreq.h header file (only struct ioreq and related macros) from Xen's source tree (Top commit 5d84f07fe6bf ("xen/pci: drop remaining uses of bool_t")). Signed-off-by: Viresh Kumar --- drivers/xen/Kconfig | 8 +- drivers/xen

[PATCH V2 0/2] xen: privcmd: Add ioeventfd support

2023-10-05 Thread Viresh Kumar
ype for addr. - Add comments for use of barriers. - Use spin lock instead of mutex as we need to use them in irq handler. - Add a warning when kioreq is getting freed and ioeventfds list isn't empty. - Use struct_size(). - Validate number of vcpus as well. Viresh Kumar (2): xen: evtchn: Allow sha

Re: [PATCH 2/2] xen: privcmd: Add support for ioeventfd

2023-10-05 Thread Viresh Kumar
On 29-09-23, 07:46, Juergen Gross wrote: > This is populated from a __u64 field. Maybe make it uint64_t? Checkpatch warns about this, will use u64 instead. CHECK: Prefer kernel type 'u64' over 'uint64_t' #124: FILE: drivers/xen/privcmd.c:1097: + uint64_t addr; -- viresh

Re: [PATCH 2/2] xen: privcmd: Add support for ioeventfd

2023-10-05 Thread Viresh Kumar
On 29-09-23, 07:46, Juergen Gross wrote: > On 29.08.23 14:29, Viresh Kumar wrote: > > +static irqreturn_t ioeventfd_interrupt(int irq, void *dev_id) > > +{ > > + struct ioreq_port *port = dev_id; > > + struct privcmd_kernel_ioreq *kioreq = port->kioreq; > &

Re: [PATCH 0/2] xen: privcmd: Add ioeventfd support

2023-09-26 Thread Viresh Kumar
On 29-08-23, 17:59, Viresh Kumar wrote: > Hello, > > Now that irqfd support (backend to guest interrupt) is already merged, this > series solves the other part of the problem, i.e. ioeventfd (guest to backend > interrupt). > > More details inside the commits. Can someone he

[PATCH 1/2] xen: evtchn: Allow shared registration of IRQ handers

2023-08-29 Thread Viresh Kumar
after all the users are gone. Signed-off-by: Viresh Kumar --- drivers/xen/events/events_base.c | 1 + drivers/xen/evtchn.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index c7715f8bd452

[PATCH 2/2] xen: privcmd: Add support for ioeventfd

2023-08-29 Thread Viresh Kumar
implementations for KVM, etc.. This also copies ioreq.h header file (only struct ioreq and related macros) from Xen's source tree (Top commit 5d84f07fe6bf ("xen/pci: drop remaining uses of bool_t")). Signed-off-by: Viresh Kumar --- drivers/xen/Kconfig | 8 +- drivers/xen

[PATCH 0/2] xen: privcmd: Add ioeventfd support

2023-08-29 Thread Viresh Kumar
Hello, Now that irqfd support (backend to guest interrupt) is already merged, this series solves the other part of the problem, i.e. ioeventfd (guest to backend interrupt). More details inside the commits. -- Viresh Viresh Kumar (2): xen: evtchn: Allow shared registration of IRQ handers

[PATCH V5] xen: privcmd: Add support for irqfd

2023-08-22 Thread Viresh Kumar
). This patch adds support to inject a specific interrupt to guest using the eventfd mechanism, by preventing the extra context switch. Inspired by existing implementations for KVM, etc.. Signed-off-by: Viresh Kumar --- V4->V5 - Drop "default m" and update description in Kconfig. - Drop I

Re: [PATCH V4] xen: privcmd: Add support for irqfd

2023-08-16 Thread Viresh Kumar
On 25-07-23, 16:27, Viresh Kumar wrote: > Xen provides support for injecting interrupts to the guests via the > HYPERVISOR_dm_op() hypercall. The same is used by the Virtio based > device backend implementations, in an inefficient manner currently. > > Generally, the

Re: [PATCH] libxl: Add missing libxl__virtio_devtype to device_type_tbl array

2023-07-26 Thread Viresh Kumar
create.c > index 393c535579..c91059d713 100644 > --- a/tools/libs/light/libxl_create.c > +++ b/tools/libs/light/libxl_create.c > @@ -1887,6 +1887,7 @@ const libxl__device_type *device_type_tbl[] = { > __dtdev_devtype, > __vdispl_devtype, > __vsnd_devtype, > +

[PATCH V4] xen: privcmd: Add support for irqfd

2023-07-25 Thread Viresh Kumar
). This patch adds support to inject a specific interrupt to guest using the eventfd mechanism, by preventing the extra context switch. Inspired by existing implementations for KVM, etc.. Signed-off-by: Viresh Kumar --- V3->V4 - Drop the imported definitions to hvm/dm_op.h. - Make the caller p

Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header

2023-07-25 Thread Viresh Kumar
On 25-07-23, 09:18, Jan Beulich wrote: > I question that use, btw, but it is not up to me to decide whether to > accept such a layering violation in Linux. dm-op is, as its name says, > for device models to use. Your intended use doesn't fall in that > category, aiui. Imo the present contents of

Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header

2023-07-25 Thread Viresh Kumar
On 25-07-23, 09:04, Jan Beulich wrote: > On 25.07.2023 08:47, Viresh Kumar wrote: > > +struct xen_dm_op { > > +uint32_t op; > > +uint32_t pad; > > +union { > > +struct xen_dm_op_create_ioreq_server create_ioreq_server; > > +

[PATCH V3 2/2] xen: privcmd: Add support for irqfd

2023-07-25 Thread Viresh Kumar
). This patch adds support to inject a specific interrupt to guest using the eventfd mechanism, by preventing the extra context switch. Inspired by existing implementations for KVM, etc.. Signed-off-by: Viresh Kumar --- V2.1->V3 - No changes V2->V2.1 - Select EVENTFD from Kconfig V1->V2:

[PATCH V3 1/2] xen: Update dm_op.h from Xen public header

2023-07-25 Thread Viresh Kumar
r kernel coding guidelines). - Removed some not-so-useful comments. Signed-off-by: Viresh Kumar --- V2->V3: - Updated commit log with more details. V1->V2: - New commit. include/xen/interface/hvm/dm_op.h | 445 ++ 1 file changed, 445 insertions(+) diff --g

Re: [PATCH V2 2/2] xen: privcmd: Add support for irqfd

2023-07-21 Thread Viresh Kumar
tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: > https://github.com/intel-lab-lkp/linux/commits/Viresh-Kumar/xen-privcmd-Add-support-for-i

[PATCH V2.1 2/2] xen: privcmd: Add support for irqfd

2023-07-21 Thread Viresh Kumar
). This patch adds support to inject a specific interrupt to guest using the eventfd mechanism, by preventing the extra context switch. Inspired by existing implementations for KVM, etc.. Signed-off-by: Viresh Kumar --- V2->V2.1 - Select EVENTFD from Kconfig V1->V2: - Improve error handling. -

Re: [PATCH V4] libxl: arm: Add grant_usage parameter for virtio devices

2023-07-21 Thread Viresh Kumar
On 06-07-23, 12:59, Viresh Kumar wrote: > Currently, the grant mapping related device tree properties are added if > the backend domain is not Dom0. While Dom0 is privileged and can do > foreign mapping for the entire guest memory, it is still desired for > Dom0 to access guest's memo

Re: [PATCH] xen: privcmd: Add support for irqfd

2023-07-20 Thread Viresh Kumar
On 13-07-23, 14:40, Oleksandr Tyshchenko wrote: > Viresh, great work! Thanks Oleksandr. > Do you perhaps have corresponding users-space (virtio backend) example > adopted for that feature (I would like to take a look at it if possible)? This is taken care by the xen-vhost-frontend Rust crate

[PATCH V2 2/2] xen: privcmd: Add support for irqfd

2023-07-20 Thread Viresh Kumar
). This patch adds support to inject a specific interrupt to guest using the eventfd mechanism, by preventing the extra context switch. Inspired by existing implementations for KVM, etc.. Signed-off-by: Viresh Kumar --- V1->V2: - Improve error handling. - Remove the unnecessary us

[PATCH V2 1/2] xen: Update dm_op.h from Xen public header

2023-07-20 Thread Viresh Kumar
Update the definitions in dm_op.h from Xen public header. Signed-off-by: Viresh Kumar --- V1->V2: - New commit. include/xen/interface/hvm/dm_op.h | 445 ++ 1 file changed, 445 insertions(+) diff --git a/include/xen/interface/hvm/dm_op.h b/include/xen/interface/

[PATCH] xen: privcmd: Add support for irqfd

2023-07-12 Thread Viresh Kumar
). This patch adds support to inject a specific interrupt to guest using the eventfd mechanism, by preventing the extra context switch. Inspired by existing implementations for KVM, etc.. Signed-off-by: Viresh Kumar --- drivers/xen/privcmd.c | 285 - include

[PATCH V4] libxl: arm: Add grant_usage parameter for virtio devices

2023-07-06 Thread Viresh Kumar
. This commit adds the "grant_usage" parameter for virtio devices, which provides better control over the functionality. Signed-off-by: Viresh Kumar Reviewed-by: Anthony PERARD --- V3.1->V4: - Added Reviewed-by tags. - Other patches from the series are already applied. - No code chang

Re: [PATCH V3.1] libxl: arm: Add grant_usage parameter for virtio devices

2023-06-30 Thread Viresh Kumar
On 30-06-23, 09:40, Julien Grall wrote: > The patch is missing an ack from the golang maintainers. I noticed you > didn't CC them (done now). Ahh, thanks. > In the future, I would suggest to use one of the scripts in the repo to find > the appropriate maintainers: > *

Re: [PATCH V3.1] libxl: arm: Add grant_usage parameter for virtio devices

2023-06-29 Thread Viresh Kumar
On 13-06-23, 11:48, Anthony PERARD wrote: > On Tue, Jun 13, 2023 at 11:32:16AM +0530, Viresh Kumar wrote: > > Currently, the grant mapping related device tree properties are added if > > the backend domain is not Dom0. While Dom0 is privileged and can do > > foreign mapping

[PATCH V3.1] libxl: arm: Add grant_usage parameter for virtio devices

2023-06-13 Thread Viresh Kumar
. This commit adds the "grant_usage" parameter for virtio devices, which provides better control over the functionality. Signed-off-by: Viresh Kumar --- V3->V3.1: - Print "0" or "1" in xenstore instead of "True" or "False" for grant_usage. docs

Re: [PATCH V3 3/3] libxl: arm: Add grant_usage parameter for virtio devices

2023-06-02 Thread Viresh Kumar
On 02-06-23, 08:25, Erik Schilling wrote: > > diff --git a/tools/golang/xenlight/helpers.gen.go > > b/tools/golang/xenlight/helpers.gen.go > > index 0a203d22321f..bf846dca8ec0 100644 > > --- a/tools/golang/xenlight/helpers.gen.go > > +++ b/tools/golang/xenlight/helpers.gen.go > > @@ -1792,6

[PATCH V3 1/3] libxl: virtio: Remove unused frontend nodes

2023-06-01 Thread Viresh Kumar
to the libxl_virtio.c file. Signed-off-by: Viresh Kumar --- tools/libs/light/libxl_virtio.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/libs/light/libxl_virtio.c b/tools/libs/light/libxl_virtio.c index faada49e184e..f8a78e22d156 100644 --- a/tools/libs/light

[PATCH V3 3/3] libxl: arm: Add grant_usage parameter for virtio devices

2023-06-01 Thread Viresh Kumar
. This commit adds the "grant_usage" parameter for virtio devices, which provides better control over the functionality. Signed-off-by: Viresh Kumar --- docs/man/xl.cfg.5.pod.in | 8 tools/golang/xenlight/helpers.gen.go | 6 ++ tools/golang/xenlight/types.gen

[PATCH V3 0/3] libxl: Make grants configurable for virtio devices

2023-06-01 Thread Viresh Kumar
nts. V1->V2: - Instead of just 0 or 1, the argument can take multiple values now and control the functionality in a better way. - Update .gen.go files as well. - Don't add nodes under frontend path. Viresh Kumar (3): libxl: virtio: Remove unused frontend nodes libxl

[PATCH V3 2/3] libxl: Call libxl__virtio_devtype.set_default() early enough

2023-06-01 Thread Viresh Kumar
like disk, etc. Suggested-by: Anthony PERARD Signed-off-by: Viresh Kumar --- tools/libs/light/libxl_create.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c index ec8eab02c207..36770af6d4ff 100644

Re: [PATCH V2 2/2] libxl: arm: Add grant_usage parameter for virtio devices

2023-05-15 Thread Viresh Kumar
On 12-05-23, 11:43, Anthony PERARD wrote: > On Thu, May 11, 2023 at 01:20:43PM +0530, Viresh Kumar wrote: > > diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in > > index 24ac92718288..0405f6efe62a 100644 > > --- a/docs/man/xl.cfg.5.pod.in > > +++

[PATCH V2 2/2] libxl: arm: Add grant_usage parameter for virtio devices

2023-05-11 Thread Viresh Kumar
. This commit adds the "grant_usage" parameter for virtio devices, which provides better control over the functionality. Signed-off-by: Viresh Kumar --- V1->V2: - Instead of just 0 or 1, the argument can take multiple values now and control the functionality in a better way. - U

[PATCH V2 1/2] libxl: virtio: Remove unused frontend nodes

2023-05-11 Thread Viresh Kumar
The libxl_virtio file works for only PV devices and the nodes under the frontend path are not used by anyone. Remove them. While at it, also add a comment to the file describing what devices this file is used for. Signed-off-by: Viresh Kumar --- V2: New patch. tools/libs/light/libxl_virtio.c

Re: [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0

2023-05-11 Thread Viresh Kumar
On 09-05-23, 16:05, Anthony PERARD wrote: > I guess the way virtio devices are implemented in libxl suggest to me > that the are just Xen PV devices. So I guess some documentation in the > tree would be useful, maybe some comments in libxl_virtio.c. Our use case is just PV devices, not sure if

Re: [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0

2023-05-07 Thread Viresh Kumar
On 05-05-23, 16:11, Oleksandr Tyshchenko wrote: > I was going to propose an idea, but I have just realized that you already > voiced it here [1] )) > So what you proposed there sounds reasonable to me. > > I will just rephrase it according to my understanding: > > We probably need to consider

Re: [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0

2023-05-05 Thread Viresh Kumar
Hi Anthony, On 02-05-23, 15:44, Anthony PERARD wrote: > > diff --git a/tools/libs/light/libxl_virtio.c > > b/tools/libs/light/libxl_virtio.c > > index faada49e184e..e1f15344ef97 100644 > > --- a/tools/libs/light/libxl_virtio.c > > +++ b/tools/libs/light/libxl_virtio.c > > @@ -48,11 +48,13 @@

Re: [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0

2023-05-05 Thread Viresh Kumar
On 05-04-23, 05:12, Viresh Kumar wrote: > On 04-04-23, 21:16, Oleksandr Tyshchenko wrote: > > ok, probably makes sense > > While testing both foreign and grant mappings I stumbled upon another > related problem. How do I control the creation of iommu node from > gue

[PATCH V3 1/2] docs: Allow generic virtio device types to contain device-id

2023-04-06 Thread Viresh Kumar
e. The complete list of virtio device ids is mentioned here: https://docs.oasis-open.org/virtio/virtio/v1.2/cs01/virtio-v1.2-cs01.html#x1-2160005 Update documentation to support that as well. Fixes: dd54ea500be8 ("docs: add documentation for generic virtio devices") Signed-

[PATCH V3 2/2] libxl: fix matching of generic virtio device

2023-04-06 Thread Viresh Kumar
The strings won't be an exact match, as we are only looking to match the prefix here, i.e. "virtio,device". This is already done properly in libxl_virtio.c file, lets do the same here too. Fixes: 43ba5202e2ee ("libxl: add support for generic virtio device") Signed-off-by: Vi

Re: [PATCH V2 1/2] docs: Allow generic virtio device types to contain device-id

2023-04-05 Thread Viresh Kumar
On 05-04-23, 11:15, Jan Beulich wrote: > On 05.04.2023 10:51, Viresh Kumar wrote: > > --- a/docs/man/xl.cfg.5.pod.in > > +++ b/docs/man/xl.cfg.5.pod.in > > @@ -1608,8 +1608,10 @@ example, "type=virtio,device22" for the I2C device, > > whose device-t

Re: [PATCH V2 1/2] docs: Allow generic virtio device types to contain device-id

2023-04-05 Thread Viresh Kumar
imal format for N. Author: Viresh Kumar Date: Wed Apr 5 05:36:19 2023 +0530 docs: Allow generic virtio device types to contain device-id For generic virtio devices, where we don't need to add compatible or other special DT properties, the type field is set to "virtio,device".

Re: [PATCH V3 0/2] qemu: vhost-user: Support Xen memory mapping quirks

2023-04-05 Thread Viresh Kumar
On 09-03-23, 14:20, Viresh Kumar wrote: > Hello, > > This patchset tries to update the vhost-user protocol to make it support > special > memory mapping required in case of Xen hypervisor. > > The first patch is mostly cleanup and second one introduces a new xen specif

[PATCH V2 2/2] libxl: fix matching of generic virtio device

2023-04-04 Thread Viresh Kumar
The strings won't be an exact match, as we are only looking to match the prefix here, i.e. "virtio,device". This is already done properly in libxl_virtio.c file, lets do the same here too. Fixes: 43ba5202e2ee ("libxl: add support for generic virtio device") Signed-off-by: Vire

[PATCH V2 1/2] docs: Allow generic virtio device types to contain device-id

2023-04-04 Thread Viresh Kumar
stem device. Update documentation to support that as well. Fixes: dd54ea500be8 ("docs: add documentation for generic virtio devices") Signed-off-by: Viresh Kumar --- V1->V2: New patch. docs/man/xl.cfg.5.pod.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/man/

Re: [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0

2023-04-04 Thread Viresh Kumar
On 04-04-23, 21:16, Oleksandr Tyshchenko wrote: > ok, probably makes sense While testing both foreign and grant mappings I stumbled upon another related problem. How do I control the creation of iommu node from guest configuration file, irrespective of the domain backend is running at ? This is

[PATCH] libxl: arm: Allow grant mappings for backends running on Dom0

2023-03-30 Thread Viresh Kumar
adds another parameter for virtio devices, with which they can do forced grant mappings irrespective of the backend domain id. Signed-off-by: Viresh Kumar --- docs/man/xl.cfg.5.pod.in | 4 tools/libs/light/libxl_arm.c | 21 - tools/libs/light/libxl_types.idl

[PATCH] libxl: fix matching of generic virtio device

2023-03-30 Thread Viresh Kumar
The strings won't be an exact match, and we are only looking to match the prefix here, i.e. "virtio,device". This is already done properly in libxl_virtio.c file, lets do the same here too. Signed-off-by: Viresh Kumar --- tools/libs/light/libxl_arm.c | 12 1 file

Re: [PATCH V3 0/2] qemu: vhost-user: Support Xen memory mapping quirks

2023-03-14 Thread Viresh Kumar
On 09-03-23, 14:20, Viresh Kumar wrote: > Hello, > > This patchset tries to update the vhost-user protocol to make it support > special > memory mapping required in case of Xen hypervisor. > > The first patch is mostly cleanup and second one introduces a new xen specific &

Re: [PATCH V2] docs: vhost-user: Add Xen specific memory mapping support

2023-03-09 Thread Viresh Kumar
On 07-03-23, 11:22, Stefan Hajnoczi wrote: > VHOST_USER_IOTLB_MSG probably isn't necessary because address > translation is not required. It will also reduce performance by adding > extra communication. > > Instead, you could change the 1 memory region : 1 mmap relationship that > existing

[PATCH V3 1/2] docs: vhost-user: Define memory region separately

2023-03-09 Thread Viresh Kumar
t; to "multiple memory regions description", to avoid potential confusion around similar names. And define single region before multiple ones. This is just a documentation optimization, the protocol remains the same. Signed-off-by: Viresh Kumar --- docs/interop/vhost-user.rst | 39 +

[PATCH V3 0/2] qemu: vhost-user: Support Xen memory mapping quirks

2023-03-09 Thread Viresh Kumar
define which memory regions are impacted by this change. - Allow VHOST_USER_SET_XEN_MMAP to be called multiple times. - Additional Bit(2) property in flags. Viresh Kumar (2): docs: vhost-user: Define memory region separately docs: vhost-user: Add Xen specific memory mapping support docs/i

[PATCH V3 2/2] docs: vhost-user: Add Xen specific memory mapping support

2023-03-09 Thread Viresh Kumar
themselves. Signed-off-by: Viresh Kumar --- docs/interop/vhost-user.rst | 21 + 1 file changed, 21 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index 1720d681264d..5a070adbc1aa 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop

Re: [PATCH V2] docs: vhost-user: Add Xen specific memory mapping support

2023-03-06 Thread Viresh Kumar
On 06-03-23, 10:34, Stefan Hajnoczi wrote: > On Mon, Mar 06, 2023 at 04:40:24PM +0530, Viresh Kumar wrote: > > +Xen mmap description > > + > > + > > ++---+---+ > > +| flags | domid | > > ++---+---+ > > + > >

[PATCH V2] docs: vhost-user: Add Xen specific memory mapping support

2023-03-06 Thread Viresh Kumar
' message type to provide the additional information to the back-end. Signed-off-by: Viresh Kumar --- V1->V2: - Make the custom mmap feature Xen specific, instead of being generic. - Clearly define which memory regions are impacted by this change. - Allow VHOST_USER_SET_XEN_MMAP to be cal

Re: [virtio-dev] [RFC QEMU] docs: vhost-user: Add custom memory mapping support

2023-03-03 Thread Viresh Kumar
On 01-03-23, 10:47, Stefan Hajnoczi wrote: > Resend - for some reason my email didn't make it out. How about this (will send a formal patch later). Author: Viresh Kumar Date: Tue Feb 21 14:36:30 2023 +0530 docs: vhost-user: Add Xen specific memory mapping support The current mo

Re: [virtio-dev] [RFC QEMU] docs: vhost-user: Add custom memory mapping support

2023-03-02 Thread Viresh Kumar
On 01-03-23, 12:29, Stefan Hajnoczi wrote: > What is the advantage over defining separate messages? Separate messages > are cleaner and more typesafe. I thought we wanted to keep single message for one kind of functionality, which is mmap related quirks here. And so it would be better if we can

Re: [Discussion] Xen grants and access permissions

2023-02-21 Thread Viresh Kumar
On 20-02-23, 07:13, Juergen Gross wrote: > There are no permission flags in Xen PV device protocols either. The kind of a > mapping (RO or RW) in the backend is selected via the I/O operation: in case > it > is a write type operation (guest writing data to a device), the related grants > are

[RFC QEMU] docs: vhost-user: Add custom memory mapping support

2023-02-21 Thread Viresh Kumar
mapping requirements. When this feature is negotiated, the front-end can send the 'VHOST_USER_CUSTOM_MMAP' message type to provide the additional information to the back-end. Signed-off-by: Viresh Kumar --- docs/interop/vhost-user.rst | 32 1 file changed, 32

[Discussion] Xen grants and access permissions

2023-02-16 Thread Viresh Kumar
Hi Oleksandr, As you already know, I am looking at how we can integrate the Xen grants work in our implementation of Rust based Xen vhost frontend [1]. The hypervisor independent vhost-user backends [2] talk to xen-vhost-frontend using the standard vhost-user protocol [3]. Every memory region

Re: [PATCH] xen/grant-dma-iommu: Implement a dummy probe_device() callback

2023-02-08 Thread Viresh Kumar
x that by adding a dummy callback. > > Looks like the release_device() callback is not mandatory to be > implemented as IOMMU framework makes sure that callback is initialized > before dereferencing. > > Reported-by: Viresh Kumar > Signed-off-by: Oleksandr Tyshchenko > --- > d

Re: [PATCH] libxl: virtio: Fix build error for 32-bit platforms

2022-12-15 Thread Viresh Kumar
On 15-12-22, 17:33, Anthony PERARD wrote: > For those virtio one in particular, it's probably ok. libxl doesn't > mind, and hopefully the consumer of those don't mind either. FWIW, the consumer in this case, Rust based xen-vhost-frontent [1] implementation, did break and I still need to fix it to

Re: [xen-unstable-smoke test] 175226: regressions - FAIL

2022-12-15 Thread Viresh Kumar
On 15-12-22, 08:34, Julien Grall wrote: > This build breakage was introduced by "libxl: add support for generic virtio > device". %lu will likely want to be switched to PRIx64. > > Viresh, we need to unblock OSStest (our CI) as soon as possible. So can you > look at it and confirm the rest of the

[PATCH] libxl: virtio: Fix build error for 32-bit platforms

2022-12-15 Thread Viresh Kumar
pport for generic virtio device") Signed-off-by: Viresh Kumar --- Couldn't test on 32-bit platforms yet, but works fine for 64 bit one. tools/libs/light/libxl_virtio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libs/light/libxl_virtio.c b/tools/libs/light/libxl_virt

Re: Virtio-disk updates for latest Xen ?

2022-12-14 Thread Viresh Kumar
On 14-12-22, 17:01, Oleksandr Tyshchenko wrote: > Today I had a chance to check virtio-disk on my H/W using new Xen branch > which does include Juergen's series with commit 3a96013a3e17 > ("tools/xenstore: reduce number of watch events"). > > Very interesting, but I didn't manage to reproduce an

Re: [PATCH V10 0/3] toolstack support for generic virtio devices on Arm

2022-12-14 Thread Viresh Kumar
On 14-12-22, 09:21, Jan Beulich wrote: > On 14.12.2022 06:19, Viresh Kumar wrote: > > This patchset adds toolstack support for I2C, GPIO and generic virtio > > devices. > > This is inspired from the work done by Oleksandr for the Disk device. > > > > This is deve

[PATCH V10 3/3] docs: Add documentation for generic virtio devices

2022-12-13 Thread Viresh Kumar
This patch updates xl.cfg man page with details of generic Virtio device related information. Signed-off-by: Viresh Kumar Reviewed-by: Anthony PERARD Reviewed-by: Oleksandr Tyshchenko --- docs/man/xl.cfg.5.pod.in | 33 + 1 file changed, 33 insertions(+) diff

[PATCH V10 1/3] libxl: Add support for generic virtio device

2022-12-13 Thread Viresh Kumar
neric virtio devices is also added, which just need a MMIO node but not any special DT properties, for such devices the user needs to pass "virtio,device" in the "type" string. The parsing of generic virtio device configurations will be done in a separate commit. Signed-off-by: V

[PATCH V10 2/3] xl: Add support to parse generic virtio device

2022-12-13 Thread Viresh Kumar
This patch adds basic support for parsing generic Virtio backend. An example of domain configuration for mmio based Virtio I2C device is: virtio = ["type=virtio,device22,transport=mmio"] Signed-off-by: Viresh Kumar Reviewed-by: Anthony PERARD --- tools/xl/xl_pa

[PATCH V10 0/3] toolstack support for generic virtio devices on Arm

2022-12-13 Thread Viresh Kumar
ng to changes in Oleksandr's patches from sometime back. - Minor cleanups. V1->V2: - Patches 3/6 and 4/6 are new. - Patches 5/6 and 6/6 updated based on the above two patches. - Added link to the bindings for I2C and GPIO. - Rebased over latest master branch. Thanks. -- Viresh [1] https:/

Re: [PATCH V9 1/3] libxl: Add support for generic virtio device

2022-12-13 Thread Viresh Kumar
On 13-12-22, 13:45, Oleksandr Tyshchenko wrote: > On 13.12.22 12:08, Viresh Kumar wrote: > > +/* Virtio device types */ > > +#define VIRTIO_DEVICE_TYPE_GENERIC "virtio,device" > > +#define VIRTIO_DEVICE_TYPE_GPIO "virtio,device22" > > +#defin

Re: [PATCH V9 1/3] libxl: Add support for generic virtio device

2022-12-13 Thread Viresh Kumar
On 13-12-22, 12:14, Jan Beulich wrote: > Please can you arrange tags in time order, which would mean R-b past any > S-o-b? I'll try to remember to swap them while committing, but in the > future please save committers from needing to do so. I was confused if Reviewed-by's should be after of

[PATCH V9 2/3] xl: Add support to parse generic virtio device

2022-12-13 Thread Viresh Kumar
This patch adds basic support for parsing generic Virtio backend. An example of domain configuration for mmio based Virtio I2C device is: virtio = ["type=virtio,device22,transport=mmio"] Signed-off-by: Viresh Kumar --- tools/xl/xl_parse.c | 81 ++

[PATCH V9 3/3] docs: Add documentation for generic virtio devices

2022-12-13 Thread Viresh Kumar
This patch updates xl.cfg man page with details of generic Virtio device related information. Reviewed-by: Anthony PERARD Signed-off-by: Viresh Kumar --- docs/man/xl.cfg.5.pod.in | 33 + 1 file changed, 33 insertions(+) diff --git a/docs/man/xl.cfg.5.pod.in b

[PATCH V9 0/3] toolstack support for generic virtio devices on Arm

2022-12-13 Thread Viresh Kumar
and 6/6 updated based on the above two patches. - Added link to the bindings for I2C and GPIO. - Rebased over latest master branch. Thanks. -- Viresh [1] https://lore.kernel.org/xen-devel/20220414092358.kepxbmnrtycz7mhe@vireshk-i7/ Viresh Kumar (3): libxl: Add support for generic virt

[PATCH V9 1/3] libxl: Add support for generic virtio device

2022-12-13 Thread Viresh Kumar
: Anthony PERARD Reviewed-by: Oleksandr Tyshchenko Signed-off-by: Viresh Kumar --- tools/libs/light/Makefile | 1 + tools/libs/light/libxl_arm.c | 100 +++ tools/libs/light/libxl_create.c | 4 + tools/libs/light/libxl_internal.h |

[PATCH V8 2/3] xl: Add support to parse generic virtio device

2022-12-12 Thread Viresh Kumar
This patch adds basic support for parsing generic Virtio backend. An example of domain configuration for mmio based Virtio I2C device is: virtio = ["type=virtio,device22,transport=mmio"] Signed-off-by: Viresh Kumar --- tools/ocaml/libs/xl/genwrap.py | 1 + tools/xl/xl_parse.c

[PATCH V8 0/3] toolstack support for generic virtio devices on Arm

2022-12-12 Thread Viresh Kumar
anch. Thanks. -- Viresh [1] https://lore.kernel.org/xen-devel/20220414092358.kepxbmnrtycz7mhe@vireshk-i7/ Viresh Kumar (3): libxl: Add support for generic virtio device xl: Add support to parse generic virtio device docs: Add documentation for generic virtio devices docs/man/xl.cfg.5.pod

[PATCH V8 3/3] docs: Add documentation for generic virtio devices

2022-12-12 Thread Viresh Kumar
This patch updates xl.cfg man page with details of generic Virtio device related information. Signed-off-by: Viresh Kumar --- docs/man/xl.cfg.5.pod.in | 33 + 1 file changed, 33 insertions(+) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index

[PATCH V8 1/3] libxl: Add support for generic virtio device

2022-12-12 Thread Viresh Kumar
neric virtio devices is also added, which just need a MMIO node but not any special DT properties, for such devices the user needs to pass "virtio,device" in the "type" string. The parsing of generic virtio device configurations will be done in a separate commit. Signed-off

Re: [PATCH V7 1/3] libxl: Add support for generic virtio device

2022-12-08 Thread Viresh Kumar
On 08-12-22, 18:06, Anthony PERARD wrote: > Nit: Something like: > const char check[] = "virtio,device"; > const size_t checkl = sizeof(check) - 1; > ... strncmp(tmp, check, checkl)... > (or just strncmp(tmp, check, sizeof(check)-1)) > would avoid issue with both string

[PATCH V7 0/3] toolstack support for generic virtio devices on Arm

2022-12-06 Thread Viresh Kumar
el.org/xen-devel/20220414092358.kepxbmnrtycz7mhe@vireshk-i7/ [2] https://xenbits.xen.org/gitweb/?p=people/julieng/xen-unstable.git;a=shortlog;h=refs/heads/for-next/4.18 Viresh Kumar (3): libxl: Add support for generic virtio device xl: Add support to parse generic virtio device docs: Add doc

[PATCH V7 2/3] xl: Add support to parse generic virtio device

2022-12-06 Thread Viresh Kumar
This patch adds basic support for parsing generic Virtio backend. An example of domain configuration for mmio based Virtio I2C device is: virtio = ["type=virtio,device22,transport=mmio"] Signed-off-by: Viresh Kumar --- tools/ocaml/libs/xl/genwrap.py | 1 + tools/oca

[PATCH V7 3/3] docs: Add documentation for generic virtio devices

2022-12-06 Thread Viresh Kumar
This patch updates xl.cfg man page with details of generic Virtio device related information. Signed-off-by: Viresh Kumar --- docs/man/xl.cfg.5.pod.in | 28 1 file changed, 28 insertions(+) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index

[PATCH V7 1/3] libxl: Add support for generic virtio device

2022-12-06 Thread Viresh Kumar
neric virtio devices is also added, which just need a MMIO node but not any special DT properties, for such devices the user needs to pass "virtio,devices" in the "type" string. The parsing of generic virtio device configurations will be done in a separate commit. Signed-off

  1   2   >