[PATCH v6 17/25] docs/man: fix xl(1) documentation for 'pci' operations

2020-12-08 Thread Paul Durrant
From: Paul Durrant Currently the documentation completely fails to mention the existence of PCI_SPEC_STRING. This patch tidies things up, specifically clarifying that 'pci-assignable-add/remove' take arguments where as 'pci-attach/detach' take arguments (which will be enforced in a subsequent

[PATCH v6 16/25] docs/man: improve documentation of PCI_SPEC_STRING...

2020-12-08 Thread Paul Durrant
From: Paul Durrant ... and prepare for adding support for non-positional parsing of 'bdf' and 'vslot' in a subsequent patch. Also document 'BDF' as a first-class parameter type and fix the documentation to state that the default value of 'rdm_policy' is actually 'strict', not 'relaxed', as can

RE: [PATCH V3 17/23] xen/ioreq: Introduce domain_has_ioreq_server()

2020-12-08 Thread Paul Durrant
> -Original Message- > From: Oleksandr > Sent: 08 December 2020 16:57 > To: Paul Durrant > Cc: Jan Beulich ; Oleksandr Tyshchenko > ; Stefano > Stabellini ; Julien Grall ; Volodymyr > Babchuk > ; Andrew Cooper ; > George Dunlap > ; Ian Jackson ; Wei Li

[PATCH v6 08/25] libxl: stop using aodev->device_config in libxl__device_pci_add()...

2020-12-08 Thread Paul Durrant
From: Paul Durrant ... to hold a pointer to the device. There is already a 'pci' field in 'pci_add_state' so simply use that from the start. This also allows the 'pci' (#3) argument to be dropped from do_pci_add(). NOTE: This patch also changes the type of the 'pci_domid' field

[PATCH v6 06/25] libxl: s/detatched/detached in libxl_pci.c

2020-12-08 Thread Paul Durrant
From: Paul Durrant Simply spelling correction. Purely cosmetic fix. Signed-off-by: Paul Durrant Reviewed-by: Oleksandr Andrushchenko Acked-by: Wei Liu --- Cc: Ian Jackson --- tools/libs/light/libxl_pci.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff

[PATCH v6 05/25] libxl: add/recover 'rdm_policy' to/from PCI backend in xenstore

2020-12-08 Thread Paul Durrant
From: Paul Durrant Other parameters, such as 'msitranslate' and 'permissive' are dealt with but 'rdm_policy' appears to be have been completely missed. Signed-off-by: Paul Durrant Reviewed-by: Oleksandr Andrushchenko Acked-by: Wei Liu --- Cc: Ian Jackson --- tools/libs/light/libxl_pci.c

[PATCH v6 04/25] libxl: Make sure devices added by pci-attach are reflected in the config

2020-12-08 Thread Paul Durrant
From: Paul Durrant Currently libxl__device_pci_add_xenstore() is broken in that does not update the domain's configuration for the first device added (which causes creation of the overall backend area in xenstore). This can be easily observed by running 'xl list -l' after adding a single device

[PATCH v6 01/25] libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X

2020-12-08 Thread Paul Durrant
From: Paul Durrant The seemingly arbitrary use of 'pci' and 'pcidev' in the code in libxl_pci.c is confusing and also compromises use of some macros used for other device types. Indeed it seems that DEFINE_DEVICE_TYPE_STRUCT_X exists solely because of this duality. This patch purges use

[PATCH v6 09/25] libxl: generalise 'driver_path' xenstore access functions in libxl_pci.c

2020-12-08 Thread Paul Durrant
From: Paul Durrant For the purposes of re-binding a device to its previous driver libxl__device_pci_assignable_add() writes the driver path into xenstore. This path is then read back in libxl__device_pci_assignable_remove(). The functions that support this writing to and reading from xenstore

[PATCH v6 07/25] libxl: remove extraneous arguments to do_pci_remove() in libxl_pci.c

2020-12-08 Thread Paul Durrant
From: Paul Durrant Both 'domid' and 'pci' are available in 'pci_remove_state' so there is no need to also pass them as separate arguments. Signed-off-by: Paul Durrant Reviewed-by: Oleksandr Andrushchenko Acked-by: Wei Liu --- Cc: Ian Jackson --- tools/libs/light/libxl_pci.c | 9

[PATCH v6 03/25] libxl: make libxl__device_list() work correctly for LIBXL__DEVICE_KIND_PCI...

2020-12-08 Thread Paul Durrant
From: Paul Durrant ... devices. Currently there is an assumption built into libxl__device_list() that device backends are fully enumarated under the '/libxl' path in xenstore. This is not the case for PCI backend devices, which are only properly enumerated under '/local/domain/0/backend

[PATCH v6 00/25] xl / libxl: named PCI pass-through devices

2020-12-08 Thread Paul Durrant
From: Paul Durrant Paul Durrant (25): libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X xl: s/pcidev/pci where possible libxl: make libxl__device_list() work correctly for LIBXL__DEVICE_KIND_PCI... libxl: Make sure devices added by pci-attach are reflected in the config

[PATCH v6 02/25] xl: s/pcidev/pci where possible

2020-12-08 Thread Paul Durrant
From: Paul Durrant To improve naming consistency, replaces occurrences of 'pcidev' with 'pci'. The only remaining use of the term should be in relation to 'libxl_domain_config' where there are fields named 'pcidevs' and 'num_pcidevs'. Purely cosmetic. No functional change. Signed-off-by: Paul

RE: [PATCH V3 11/23] xen/ioreq: Move x86's io_completion/io_req fields to struct vcpu

2020-12-07 Thread Paul Durrant
> -Original Message- > From: Oleksandr > Sent: 07 December 2020 21:00 > To: Jan Beulich ; Paul Durrant > Cc: Oleksandr Tyshchenko ; Andrew Cooper > ; > Roger Pau Monné ; Wei Liu ; George Dunlap > ; Ian Jackson ; Julien Grall > ; Stefano > Stabellini

RE: [PATCH v5 18/23] libxlu: introduce xlu_pci_parse_spec_string()

2020-12-07 Thread Paul Durrant
> -Original Message- > From: Wei Liu > Sent: 04 December 2020 11:34 > To: Paul Durrant > Cc: xen-devel@lists.xenproject.org; Paul Durrant ; Ian > Jackson > ; Wei Liu ; Anthony PERARD > > Subject: Re: [PATCH v5 18/23] libxlu: introduce xlu_pci_parse_spec_s

RE: [PATCH v5 01/23] xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X

2020-12-07 Thread Paul Durrant
> -Original Message- [snip] > > > > > > > > This is going to break libxl callers because the name "pcidev" is > > > > visible from the public header. > > > > > > > > I agree this is confusing and inconsistent, but we didn't go extra > > > > length to maintain the inconsistency for no

RE: [PATCH V3 08/23] xen/ioreq: Move x86's ioreq_server to struct domain

2020-12-07 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 07 December 2020 12:05 > To: Oleksandr Tyshchenko ; Paul Durrant > Cc: Oleksandr Tyshchenko ; Andrew Cooper > ; > George Dunlap ; Ian Jackson ; > Julien Grall > ; Stefano Stabellini ; Wei Liu > ; Ro

RE: [PATCH v5 19/23] libxl: modify libxl_device_pci_assignable_add/remove/list/list_free()...

2020-12-04 Thread Paul Durrant
> -Original Message- > From: Wei Liu > Sent: 04 December 2020 11:36 > To: Paul Durrant > Cc: xen-devel@lists.xenproject.org; Paul Durrant ; > Christian Lindig > ; Ian Jackson ; Wei Liu > ; David Scott > ; Anthony PERARD > Subject: Re:

RE: [PATCH v5 01/23] xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X

2020-12-04 Thread Paul Durrant
> -Original Message- > From: Wei Liu > Sent: 04 December 2020 11:22 > To: p...@xen.org > Cc: 'Wei Liu' ; xen-devel@lists.xenproject.org; 'Paul Durrant' > ; > 'Oleksandr Andrushchenko' ; 'Ian Jackson' > ; > 'Anthony PERARD' > Subject: Re: [PATCH v5 0

RE: [PATCH v5 01/23] xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X

2020-12-04 Thread Paul Durrant
> -Original Message- > From: Wei Liu > Sent: 04 December 2020 11:13 > To: Paul Durrant > Cc: xen-devel@lists.xenproject.org; Paul Durrant ; > Oleksandr Andrushchenko > ; Ian Jackson ; Wei > Liu ; Anthony > PERARD > Subject: Re: [PATCH v5 01/23] xl /

[PATCH v5 10/11] viridian: add a new '_HVMPV_ex_processor_masks' bit into HVM_PARAM_VIRIDIAN...

2020-12-04 Thread Paul Durrant
From: Paul Durrant ... and advertise ExProcessorMasks support if it is set. Support is advertised by setting bit 11 in CPUID:4004:EAX. Signed-off-by: Paul Durrant --- Cc: Wei Liu Cc: Jan Beulich Cc: Andrew Cooper Cc: "Roger Pau Monné" Cc: George Dunlap Cc: Ian Jackson

[PATCH v5 11/11] xl / libxl: add 'ex_processor_mask' into 'libxl_viridian_enlightenment'

2020-12-04 Thread Paul Durrant
From: Paul Durrant Adding the new value into the enumeration makes it immediately available to xl, so this patch adjusts the xl.cfg(5) documentation accordingly. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD --- docs/man/xl.cfg.5.pod.in | 8

[PATCH v5 09/11] viridian: log initial invocation of each type of hypercall

2020-12-04 Thread Paul Durrant
From: Paul Durrant To make is simpler to observe which viridian hypercalls are issued by a particular Windows guest, this patch adds a per-domain mask to track them. Each type of hypercall causes a different bit to be set in the mask and when the bit transitions from clear to set, a log line

[PATCH v5 07/11] viridian: add ExProcessorMasks variants of the flush hypercalls

2020-12-04 Thread Paul Durrant
From: Paul Durrant The Microsoft Hypervisor TLFS specifies variants of the already implemented HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST hypercalls that take a 'Virtual Processor Set' as an argument rather than a simple 64-bit mask. This patch adds a new hvcall_flush_ex() function to implement

[PATCH v5 08/11] viridian: add ExProcessorMasks variant of the IPI hypercall

2020-12-04 Thread Paul Durrant
From: Paul Durrant A previous patch introduced variants of the flush hypercalls that take a 'Virtual Processor Set' as an argument rather than a simple 64-bit mask. This patch introduces a similar variant of the HVCALL_SEND_IPI hypercall (HVCALL_SEND_IPI_EX). NOTE

[PATCH v5 06/11] viridian: use softirq batching in hvcall_ipi()

2020-12-04 Thread Paul Durrant
From: Paul Durrant vlapic_ipi() uses a softirq batching mechanism to improve the efficiency of sending a IPIs to large number of processors. This patch modifies send_ipi() (the worker function called by hvcall_ipi()) to also make use of the mechanism when there multiple bits set

[PATCH v5 04/11] viridian: introduce a per-cpu hypercall_vpmask and accessor functions...

2020-12-04 Thread Paul Durrant
From: Paul Durrant ... and make use of them in hvcall_flush()/need_flush(). Subsequent patches will need to deal with virtual processor masks potentially wider than 64 bits. Thus, to avoid using too much stack, this patch introduces global per-cpu virtual processor masks and converts

[PATCH v5 05/11] viridian: use hypercall_vpmask in hvcall_ipi()

2020-12-04 Thread Paul Durrant
From: Paul Durrant A subsequent patch will need to IPI a mask of virtual processors potentially wider than 64 bits. A previous patch introduced per-cpu hypercall_vpmask to allow hvcall_flush() to deal with such wide masks. This patch modifies the implementation of hvcall_ipi() to make use

[PATCH v5 03/11] viridian: move IPI hypercall implementation into separate function

2020-12-04 Thread Paul Durrant
From: Paul Durrant This patch moves the implementation of HVCALL_SEND_IPI that is currently inline in viridian_hypercall() into a new hvcall_ipi() function. The new function returns Xen errno values similarly to hvcall_flush(). Hence the errno translation code in viridial_hypercall

[PATCH v5 01/11] viridian: don't blindly write to 32-bit registers if 'mode' is invalid

2020-12-04 Thread Paul Durrant
From: Paul Durrant If hvm_guest_x86_mode() returns something other than 8 or 4 then viridian_hypercall() will return immediately but, on the way out, will write back status as if 'mode' was 4. This patch simply makes it leave the registers alone. NOTE: The formatting of the 'out' label

[PATCH v5 02/11] viridian: move flush hypercall implementation into separate function

2020-12-04 Thread Paul Durrant
From: Paul Durrant This patch moves the implementation of HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST that is currently inline in viridian_hypercall() into a new hvcall_flush() function. The new function returns Xen erro values which are then dealt with appropriately. A return value of -ERESTART

[PATCH v5 00/11] viridian: add support for ExProcessorMasks

2020-12-04 Thread Paul Durrant
From: Paul Durrant Paul Durrant (11): viridian: don't blindly write to 32-bit registers if 'mode' is invalid viridian: move flush hypercall implementation into separate function viridian: move IPI hypercall implementation into separate function viridian: introduce a per-cpu

RE: [PATCH v4 00/11] viridian: add support for ExProcessorMasks

2020-12-04 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 04 December 2020 08:12 > To: Wei Liu ; Paul Durrant > Cc: Paul Durrant ; xen-devel@lists.xenproject.org > Subject: Re: [PATCH v4 00/11] viridian: add support for ExProcessorMasks > > Wei, > > On 02.12.

RE: [PATCH v5 1/4] domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_evtchn_fifo, ...

2020-12-04 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 04 December 2020 07:53 > To: p...@xen.org > Cc: 'Paul Durrant' ; 'Eslam Elnikety' > ; 'Ian Jackson' > ; 'Wei Liu' ; 'Anthony PERARD' > ; 'Andrew > Cooper' ; 'George Dunlap' > ; 'Julien Grall' > ;

RE: [PATCH v5 1/4] domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_evtchn_fifo, ...

2020-12-03 Thread Paul Durrant
> -Original Message- [snip] > > All of the hunks above point out a scalability issue if we were to > follow this route for even just a fair part of new sub-ops, and I > suppose you've noticed this with the next patch presumably touching > all the same places again.

RE: [PATCH v5 1/4] domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_evtchn_fifo, ...

2020-12-03 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 03 December 2020 15:57 > To: p...@xen.org > Cc: 'Paul Durrant' ; 'Eslam Elnikety' > ; 'Ian Jackson' > ; 'Wei Liu' ; 'Anthony PERARD' > ; 'Andrew > Cooper' ; 'George Dunlap' > ; 'Julien Grall' > ;

RE: [PATCH v5 1/4] domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_evtchn_fifo, ...

2020-12-03 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 03 December 2020 15:23 > To: Paul Durrant > Cc: Paul Durrant ; Eslam Elnikety ; > Ian Jackson > ; Wei Liu ; Anthony PERARD > ; Andrew Cooper > ; George Dunlap ; Julien > Grall ; > Stefano Stabellini ; Ch

[PATCH v5 19/23] libxl: modify libxl_device_pci_assignable_add/remove/list/list_free()...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... to use 'libxl_pci_bdf' rather than 'libxl_device_pci'. This patch modifies the API and callers accordingly. It also modifies several internal functions in libxl_pci.c that support the API to also use 'libxl_pci_bdf'. NOTE: The OCaml bindings are adjusted to contain

[PATCH v5 21/23] xl / libxl: support naming of assignable devices

2020-12-03 Thread Paul Durrant
From: Paul Durrant This patch modifies libxl_device_pci_assignable_add() to take an optional 'name' argument, which (if supplied) is saved into xenstore and can hence be used to refer to the now-assignable BDF in subsequent operations. To facilitate this, a new

[PATCH v5 22/23] docs/man: modify xl-pci-configuration(5) to add 'name' field to PCI_SPEC_STRING

2020-12-03 Thread Paul Durrant
From: Paul Durrant Since assignable devices can be named, a subsequent patch will support use of a PCI_SPEC_STRING containing a 'name' parameter instead of a 'bdf'. In this case the name will be used to look up the 'bdf' in the list of assignable (or assigned) devices. Signed-off-by: Paul

[PATCH v5 17/23] libxl: introduce 'libxl_pci_bdf' in the idl...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... and use in 'libxl_device_pci' This patch is preparatory work for restricting the type passed to functions that only require BDF information, rather than passing a 'libxl_device_pci' structure which is only partially filled. In this patch only the minimal mechanical

[PATCH v5 15/23] docs/man: improve documentation of PCI_SPEC_STRING...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... and prepare for adding support for non-positional parsing of 'bdf' and 'vslot' in a subsequent patch. Also document 'BDF' as a first-class parameter type and fix the documentation to state that the default value of 'rdm_policy' is actually 'strict', not 'relaxed', as can

[PATCH v5 16/23] docs/man: fix xl(1) documentation for 'pci' operations

2020-12-03 Thread Paul Durrant
From: Paul Durrant Currently the documentation completely fails to mention the existence of PCI_SPEC_STRING. This patch tidies things up, specifically clarifying that 'pci-assignable-add/remove' take arguments where as 'pci-attach/detach' take arguments (which will be enforced in a subsequent

[PATCH v5 14/23] docs/man: extract documentation of PCI_SPEC_STRING from the xl.cfg manpage...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... and put it into a new xl-pci-configuration(5) manpage, akin to the xl-network-configration(5) and xl-disk-configuration(5) manpages. This patch moves the content of the section verbatim. A subsequent patch will improve the documentation, once it is in its new location

[PATCH v5 11/23] libxl: make sure callers of libxl_device_pci_list() free the list after use

2020-12-03 Thread Paul Durrant
From: Paul Durrant A previous patch introduced libxl_device_pci_list_free() which should be used by callers of libxl_device_pci_list() to properly dispose of the exported 'libxl_device_pci' types and the free the memory holding them. Whilst all current callers do ensure the memory is freed, only

[PATCH v5 20/23] docs/man: modify xl(1) in preparation for naming of assignable devices

2020-12-03 Thread Paul Durrant
From: Paul Durrant A subsequent patch will introduce code to allow a name to be specified to 'xl pci-assignable-add' such that the assignable device may be referred to by than name in subsequent operations. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu --- docs/man/xl.1.pod.in

[PATCH v5 10/23] libxl: remove get_all_assigned_devices() from libxl_pci.c

2020-12-03 Thread Paul Durrant
From: Paul Durrant Use of this function is a very inefficient way to check whether a device has already been assigned. This patch adds code that saves the domain id in xenstore at the point of assignment, and removes it again when the device id de-assigned (or the domain is destroyed

[PATCH v5 18/23] libxlu: introduce xlu_pci_parse_spec_string()

2020-12-03 Thread Paul Durrant
From: Paul Durrant This patch largely re-writes the code to parse a PCI_SPEC_STRING and enters it via the newly introduced function. The new parser also deals with 'bdf' and 'vslot' as non-positional paramaters, as per the documentation in xl-pci-configuration(5). The existing xlu_pci_parse_bdf

[PATCH v5 23/23] xl / libxl: support 'xl pci-attach/detach' by name

2020-12-03 Thread Paul Durrant
From: Paul Durrant This patch adds a 'name' field into the idl for 'libxl_device_pci' and libxlu_pci_parse_spec_string() is modified to parse the new 'name' parameter of PCI_SPEC_STRING detailed in the updated documention in xl-pci-configuration(5). If the 'name' field is non-NULL then both

[PATCH v5 12/23] libxl: add libxl_device_pci_assignable_list_free()...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... to be used by callers of libxl_device_pci_assignable_list(). Currently there is no API for callers of libxl_device_pci_assignable_list() to free the list. The xl function pciassignable_list() calls libxl_device_pci_dispose() on each element of the returned list

[PATCH v5 13/23] libxl: use COMPARE_PCI() macro is_pci_in_array()...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... rather than an open-coded equivalent. This patch tidies up the is_pci_in_array() function, making it take a single 'libxl_device_pci' argument rather than separate domain, bus, device and function arguments. The already-available COMPARE_PCI() macro can then be used

[PATCH v5 08/23] libxl: generalise 'driver_path' xenstore access functions in libxl_pci.c

2020-12-03 Thread Paul Durrant
From: Paul Durrant For the purposes of re-binding a device to its previous driver libxl__device_pci_assignable_add() writes the driver path into xenstore. This path is then read back in libxl__device_pci_assignable_remove(). The functions that support this writing to and reading from xenstore

[PATCH v5 09/23] libxl: remove unnecessary check from libxl__device_pci_add()

2020-12-03 Thread Paul Durrant
From: Paul Durrant The code currently checks explicitly whether the device is already assigned, but this is actually unnecessary as assigned devices do not form part of the list returned by libxl_device_pci_assignable_list() and hence the libxl_pci_assignable() test would have already failed

[PATCH v5 05/23] libxl: s/detatched/detached in libxl_pci.c

2020-12-03 Thread Paul Durrant
From: Paul Durrant Simply spelling correction. Purely cosmetic fix. Signed-off-by: Paul Durrant Reviewed-by: Oleksandr Andrushchenko --- Cc: Ian Jackson Cc: Wei Liu --- tools/libs/light/libxl_pci.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git

[PATCH v5 06/23] libxl: remove extraneous arguments to do_pci_remove() in libxl_pci.c

2020-12-03 Thread Paul Durrant
From: Paul Durrant Both 'domid' and 'pci' are available in 'pci_remove_state' so there is no need to also pass them as separate arguments. Signed-off-by: Paul Durrant Reviewed-by: Oleksandr Andrushchenko --- Cc: Ian Jackson Cc: Wei Liu --- tools/libs/light/libxl_pci.c | 9 - 1 file

[PATCH v5 02/23] libxl: make libxl__device_list() work correctly for LIBXL__DEVICE_KIND_PCI...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... devices. Currently there is an assumption built into libxl__device_list() that device backends are fully enumarated under the '/libxl' path in xenstore. This is not the case for PCI backend devices, which are only properly enumerated under '/local/domain/0/backend

[PATCH v5 07/23] libxl: stop using aodev->device_config in libxl__device_pci_add()...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... to hold a pointer to the device. There is already a 'pci' field in 'pci_add_state' so simply use that from the start. This also allows the 'pci' (#3) argument to be dropped from do_pci_add(). NOTE: This patch also changes the type of the 'pci_domid' field

[PATCH v5 00/23] xl / libxl: named PCI pass-through devices

2020-12-03 Thread Paul Durrant
From: Paul Durrant Paul Durrant (23): xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X libxl: make libxl__device_list() work correctly for LIBXL__DEVICE_KIND_PCI... libxl: Make sure devices added by pci-attach are reflected in the config libxl: add/recover

[PATCH v5 04/23] libxl: add/recover 'rdm_policy' to/from PCI backend in xenstore

2020-12-03 Thread Paul Durrant
From: Paul Durrant Other parameters, such as 'msitranslate' and 'permissive' are dealt with but 'rdm_policy' appears to be have been completely missed. Signed-off-by: Paul Durrant Reviewed-by: Oleksandr Andrushchenko --- Cc: Ian Jackson Cc: Wei Liu --- tools/libs/light/libxl_pci.c | 9

[PATCH v5 03/23] libxl: Make sure devices added by pci-attach are reflected in the config

2020-12-03 Thread Paul Durrant
From: Paul Durrant Currently libxl__device_pci_add_xenstore() is broken in that does not update the domain's configuration for the first device added (which causes creation of the overall backend area in xenstore). This can be easily observed by running 'xl list -l' after adding a single device

[PATCH v5 01/23] xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X

2020-12-03 Thread Paul Durrant
From: Paul Durrant The seemingly arbitrary use of 'pci' and 'pcidev' in the code in libxl_pci.c is confusing and also compromises use of some macros used for other device types. Indeed it seems that DEFINE_DEVICE_TYPE_STRUCT_X exists solely because of this duality. This patch purges use

RE: [PATCH v5 0/4] Xen ABI feature control

2020-12-03 Thread Paul Durrant
> -Original Message- > From: Jürgen Groß > Sent: 03 December 2020 13:15 > To: Paul Durrant ; xen-devel@lists.xenproject.org > Cc: Paul Durrant ; Andrew Cooper > ; Anthony PERARD > ; Christian Lindig ; > David Scott > ; George Dunlap ; Ian Jackson >

RE: [PATCH v4 03/23] libxl: Make sure devices added by pci-attach are reflected in the config

2020-12-03 Thread Paul Durrant
> -Original Message- > From: Oleksandr Andrushchenko > Sent: 01 December 2020 13:12 > To: Paul Durrant ; xen-devel@lists.xenproject.org > Cc: Paul Durrant ; Ian Jackson ; > Wei Liu ; > Anthony PERARD > Subject: Re: [PATCH v4 03/23] libxl: Make sure dev

RE: [PATCH v4 01/23] xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X

2020-12-03 Thread Paul Durrant
> -Original Message- > From: Oleksandr Andrushchenko > Sent: 01 December 2020 12:33 > To: Paul Durrant ; xen-devel@lists.xenproject.org > Cc: Paul Durrant ; Ian Jackson ; > Wei Liu ; > Anthony PERARD > Subject: Re: [PATCH v4 01/23] xl / libxl:

[PATCH v5 2/4] domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_evtchn_upcall, ...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ...to control the visibility of the per-vCPU upcall feature for HVM guests. Commit 04447f4453c0 ("x86/hvm: add per-vcpu evtchn upcalls") added a mechanism by which x86 HVM guests can register a vector for each vCPU which will be used by Xen to signal even

[PATCH v5 4/4] xl: introduce a 'xen-abi-features' option...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... to control which features of the Xen ABI are enabled in 'libxl_domain_build_info', and hence exposed to the guest. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD v5: - New in v5 --- docs/man/xl.cfg.5.pod.in | 50

[PATCH v5 0/4] Xen ABI feature control

2020-12-03 Thread Paul Durrant
From: Paul Durrant This series was previously called "evtchn: Introduce a per-guest knob to control FIFO ABI". It is been extensively re-worked and extended to cover another ABI feature. Paul Durrant (4): domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_evtchn_fifo, ..

[PATCH v5 1/4] domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_evtchn_fifo, ...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ...to control the visibility of the FIFO event channel operations (EVTCHNOP_init_control, EVTCHNOP_expand_array, and EVTCHNOP_set_priority) to the guest. These operations were added to the public header in commit d2d50c2f308f ("evtchn: add FIFO-based event channe

[PATCH v5 3/4] libxl: introduce a 'libxl_xen_abi_features' enumeration...

2020-12-03 Thread Paul Durrant
From: Paul Durrant ... and bitmaps to enable or disable fetaures. This patch adds a new 'libxl_xen_abi_features' enumeration into the IDL which specifies features of the Xen ABI which may be optionally enabled or disabled via new 'feature_enable' and 'feature_disable' bitaps added

RE: [PATCH v4 01/11] viridian: don't blindly write to 32-bit registers is 'mode' is invalid

2020-12-02 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 02 December 2020 09:29 > To: Paul Durrant > Cc: Paul Durrant ; Wei Liu ; Andrew Cooper > ; Roger Pau Monné ; > xen-devel@lists.xenproject.org > Subject: Re: [PATCH v4 01/11] viridian: don't blindly write to 32-b

[PATCH v4 08/11] viridian: add ExProcessorMasks variant of the IPI hypercall

2020-12-02 Thread Paul Durrant
From: Paul Durrant A previous patch introduced variants of the flush hypercalls that take a 'Virtual Processor Set' as an argument rather than a simple 64-bit mask. This patch introduces a similar variant of the HVCALL_SEND_IPI hypercall (HVCALL_SEND_IPI_EX). NOTE

[PATCH v4 09/11] viridian: log initial invocation of each type of hypercall

2020-12-02 Thread Paul Durrant
From: Paul Durrant To make is simpler to observe which viridian hypercalls are issued by a particular Windows guest, this patch adds a per-domain mask to track them. Each type of hypercall causes a different bit to be set in the mask and when the bit transitions from clear to set, a log line

[PATCH v4 07/11] viridian: add ExProcessorMasks variants of the flush hypercalls

2020-12-02 Thread Paul Durrant
From: Paul Durrant The Microsoft Hypervisor TLFS specifies variants of the already implemented HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST hypercalls that take a 'Virtual Processor Set' as an argument rather than a simple 64-bit mask. This patch adds a new hvcall_flush_ex() function to implement

[PATCH v4 06/11] viridian: use softirq batching in hvcall_ipi()

2020-12-02 Thread Paul Durrant
From: Paul Durrant vlapic_ipi() uses a softirq batching mechanism to improve the efficiency of sending a IPIs to large number of processors. This patch modifies send_ipi() (the worker function called by hvcall_ipi()) to also make use of the mechanism when there multiple bits set

[PATCH v4 02/11] viridian: move flush hypercall implementation into separate function

2020-12-02 Thread Paul Durrant
From: Paul Durrant This patch moves the implementation of HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST that is currently inline in viridian_hypercall() into a new hvcall_flush() function. The new function returns Xen erro values which are then dealt with appropriately. A return value of -ERESTART

[PATCH v4 03/11] viridian: move IPI hypercall implementation into separate function

2020-12-02 Thread Paul Durrant
From: Paul Durrant This patch moves the implementation of HVCALL_SEND_IPI that is currently inline in viridian_hypercall() into a new hvcall_ipi() function. The new function returns Xen errno values similarly to hvcall_flush(). Hence the errno translation code in viridial_hypercall

[PATCH v4 05/11] viridian: use hypercall_vpmask in hvcall_ipi()

2020-12-02 Thread Paul Durrant
From: Paul Durrant A subsequent patch will need to IPI a mask of virtual processors potentially wider than 64 bits. A previous patch introduced per-cpu hypercall_vpmask to allow hvcall_flush() to deal with such wide masks. This patch modifies the implementation of hvcall_ipi() to make use

[PATCH v4 04/11] viridian: introduce a per-cpu hypercall_vpmask and accessor functions...

2020-12-02 Thread Paul Durrant
From: Paul Durrant ... and make use of them in hvcall_flush()/need_flush(). Subsequent patches will need to deal with virtual processor masks potentially wider than 64 bits. Thus, to avoid using too much stack, this patch introduces global per-cpu virtual processor masks and converts

[PATCH v4 01/11] viridian: don't blindly write to 32-bit registers is 'mode' is invalid

2020-12-02 Thread Paul Durrant
From: Paul Durrant If hvm_guest_x86_mode() returns something other than 8 or 4 then viridian_hypercall() will return immediately but, on the way out, will write back status as if 'mode' was 4. This patch simply makes it leave the registers alone. NOTE: The formatting of the 'out' label

[PATCH v4 00/11] viridian: add support for ExProcessorMasks

2020-12-02 Thread Paul Durrant
From: Paul Durrant Paul Durrant (11): viridian: don't blindly write to 32-bit registers is 'mode' is invalid viridian: move flush hypercall implementation into separate function viridian: move IPI hypercall implementation into separate function viridian: introduce a per-cpu

RE: [EXTERNAL] [PATCH v3 00/13] viridian: add support for ExProcessorMasks...

2020-12-01 Thread Paul Durrant
Wei, I'll likely send a v4 to address the style nit Jan picked up in patch #1 but the rest should be stable now. Could you have a look over it? Thanks, Paul > -Original Message- > From: Paul Durrant > Sent: 24 November 2020 19:08 > To: xen-devel@lists.xenproj

RE: [PATCH v4] IOMMU: make DMA containment of quarantined devices optional

2020-11-30 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 30 November 2020 11:59 > To: p...@xen.org > Cc: 'Andrew Cooper' ; 'Kevin Tian' > ; xen- > de...@lists.xenproject.org > Subject: Re: [PATCH v4] IOMMU: make DMA containment of quarantined devices > optional >

RE: [PATCH v4] IOMMU: make DMA containment of quarantined devices optional

2020-11-30 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 27 November 2020 16:46 > To: xen-devel@lists.xenproject.org > Cc: Andrew Cooper ; Paul Durrant ; > Kevin Tian > > Subject: [PATCH v4] IOMMU: make DMA containment of quarantined devices > optional > &g

RE: [PATCH v4 1/3] domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_disable_fifo, ...

2020-11-25 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 25 November 2020 09:20 > To: Paul Durrant > Cc: Paul Durrant ; Eslam Elnikety ; > Christian Lindig > ; David Scott ; Ian Jackson > ; Wei > Liu ; Andrew Cooper ; George Dunlap > ; > Julien Grall ;

[PATCH v3 13/13] x86: replace open-coded occurrences of sizeof_field()...

2020-11-24 Thread Paul Durrant
From: Paul Durrant ... with macro evaluations, now that it is available. A recent patch imported the sizeof_field() macro from Linux. This patch makes use of it in places where the construct is currently open-coded. Signed-off-by: Paul Durrant --- Cc: Jun Nakajima Cc: Kevin Tian Cc: Jan

[PATCH v3 12/13] xl / libxl: add 'ex_processor_mask' into 'libxl_viridian_enlightenment'

2020-11-24 Thread Paul Durrant
From: Paul Durrant Adding the new value into the enumeration makes it immediately available to xl, so this patch adjusts the xl.cfg(5) documentation accordingly. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD --- docs/man/xl.cfg.5.pod.in | 8

[PATCH v3 10/13] viridian: log initial invocation of each type of hypercall

2020-11-24 Thread Paul Durrant
From: Paul Durrant To make is simpler to observe which viridian hypercalls are issued by a particular Windows guest, this patch adds a per-domain mask to track them. Each type of hypercall causes a different bit to be set in the mask and when the bit transitions from clear to set, a log line

[PATCH v3 11/13] viridian: add a new '_HVMPV_ex_processor_masks' bit into HVM_PARAM_VIRIDIAN...

2020-11-24 Thread Paul Durrant
From: Paul Durrant ... and advertise ExProcessorMasks support if it is set. Support is advertised by setting bit 11 in CPUID:4004:EAX. Signed-off-by: Paul Durrant --- Cc: Wei Liu Cc: Jan Beulich Cc: Andrew Cooper Cc: "Roger Pau Monné" Cc: George Dunlap Cc: Ian Jackson

[PATCH v4 3/3] xl: add 'disable_evtchn_fifo' boolean option into xl.cfg(5) ...

2020-11-24 Thread Paul Durrant
From: Paul Durrant ...to set the value of the 'disable_evtchn_fifo' flag in libxl_domain_build_info. Signed-off-by: Paul Durrant Signed-off-by: Eslam Elnikety --- Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD v4: - New in v4 --- docs/man/xl.cfg.5.pod.in | 8 tools/xl

[PATCH v4 2/3] libxl: add a 'disable_fifo_evtchn' flag to libxl_domain_build_info ...

2020-11-24 Thread Paul Durrant
From: Paul Durrant ...to control setting the domain create flag XEN_DOMCTL_CDF_disable_fifo. Signed-off-by: Paul Durrant Signed-off-by: Eslam Elnikety --- Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD v4: - New in v4 --- tools/include/libxl.h| 8 tools/libs/light

[PATCH v4 1/3] domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_disable_fifo, ...

2020-11-24 Thread Paul Durrant
From: Paul Durrant ...to control the visibility of the FIFO event channel operations (EVTCHNOP_init_control, EVTCHNOP_expand_array, and EVTCHNOP_set_priority) to the guest. These operations were added to the public header in commit d2d50c2f308f ("evtchn: add FIFO-based event channe

[PATCH v4 0/3] evtchn: Introduce a per-guest knob to control FIFO ABI

2020-11-24 Thread Paul Durrant
From: Paul Durrant This series is the next version of what was originally a single patch sent by Eslam Elnikety . I have re-based and slightly expanded the modifications. Paul Durrant (3): domctl: introduce a new domain create flag, XEN_DOMCTL_CDF_disable_fifo, ... libxl: add

[PATCH v3 09/13] viridian: add ExProcessorMasks variant of the IPI hypercall

2020-11-24 Thread Paul Durrant
From: Paul Durrant A previous patch introduced variants of the flush hypercalls that take a 'Virtual Processor Set' as an argument rather than a simple 64-bit mask. This patch introduces a similar variant of the HVCALL_SEND_IPI hypercall (HVCALL_SEND_IPI_EX). NOTE

[PATCH v3 07/13] xen/include: import sizeof_field() macro from Linux stddef.h

2020-11-24 Thread Paul Durrant
From: Paul Durrant Co-locate it with the definition of offsetof() (since this is also in stddef.h in the Linux kernel source). This macro will be needed in a subsequent patch. Signed-off-by: Paul Durrant Acked-by: Jan Beulich --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc

[PATCH v3 08/13] viridian: add ExProcessorMasks variants of the flush hypercalls

2020-11-24 Thread Paul Durrant
From: Paul Durrant The Microsoft Hypervisor TLFS specifies variants of the already implemented HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST hypercalls that take a 'Virtual Processor Set' as an argument rather than a simple 64-bit mask. This patch adds a new hvcall_flush_ex() function to implement

[PATCH v3 01/13] viridian: don't blindly write to 32-bit registers is 'mode' is invalid

2020-11-24 Thread Paul Durrant
From: Paul Durrant If hvm_guest_x86_mode() returns something other than 8 or 4 then viridian_hypercall() will return immediately but, on the way out, will write back status as if 'mode' was 4. This patch simply makes it leave the registers alone. NOTE: The formatting of the 'out' label

[PATCH v3 06/13] viridian: use softirq batching in hvcall_ipi()

2020-11-24 Thread Paul Durrant
From: Paul Durrant vlapic_ipi() uses a softirq batching mechanism to improve the efficiency of sending a IPIs to large number of processors. This patch modifies send_ipi() (the worker function called by hvcall_ipi()) to also make use of the mechanism when there multiple bits set

[PATCH v3 05/13] viridian: use hypercall_vpmask in hvcall_ipi()

2020-11-24 Thread Paul Durrant
From: Paul Durrant A subsequent patch will need to IPI a mask of virtual processors potentially wider than 64 bits. A previous patch introduced per-cpu hypercall_vpmask to allow hvcall_flush() to deal with such wide masks. This patch modifies the implementation of hvcall_ipi() to make use

[PATCH v3 04/13] viridian: introduce a per-cpu hypercall_vpmask and accessor functions...

2020-11-24 Thread Paul Durrant
From: Paul Durrant ... and make use of them in hvcall_flush()/need_flush(). Subsequent patches will need to deal with virtual processor masks potentially wider than 64 bits. Thus, to avoid using too much stack, this patch introduces global per-cpu virtual processor masks and converts

[PATCH v3 02/13] viridian: move flush hypercall implementation into separate function

2020-11-24 Thread Paul Durrant
From: Paul Durrant This patch moves the implementation of HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST that is currently inline in viridian_hypercall() into a new hvcall_flush() function. The new function returns Xen erro values which are then dealt with appropriately. A return value of -ERESTART

<    1   2   3   4   5   6   7   8   9   10   >