[PATCH v5 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t

2025-07-17 Thread Andrii Sultanov
453 424 -29 _hvm_dpci_msi_eoi160 128 -32 amd_iommu_get_supported_ivhd_type 86 30 -56 parse_ivrs_table39663830-136 Signed-off-by: Andrii Sultanov --- Changes in V5: * Dropped PCI_BDF usage inside

[PATCH v5 1/3] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-07-17 Thread Andrii Sultanov
65 -80 Resolves: https://gitlab.com/xen-project/xen/-/issues/198 Reported-by: Andrew Cooper Signed-off-by: Andrii Sultanov --- Changes in V5: * Simplified a comparison in find_iommu_from_bdf_cap * Changed get_iommu_*capabilities to take pci_sbdf_t Changes in V4: * Dropped references to the order

[PATCH v5 2/3] drivers: Change find_iommu_for_device function to take pci_sbdf_t, simplify code

2025-07-17 Thread Andrii Sultanov
parse_ivmd_block13391312 -27 Signed-off-by: Andrii Sultanov Acked-by: Jan Beulich Reviewed-by: Denis Mukhin --- Changes in V5: * Added a Reviewed-by tag Changes in V4: * After amendments to the previous commit which increased improvements there, this

[PATCH v5 0/3] drivers: Simplify handling of pci_sbdf_t in passthrough/amd

2025-07-17 Thread Andrii Sultanov
From: Andrii Sultanov Step-by-step, use pci_sbdf_t directly where appropriate instead of handling seg and bdf separately. This removes conversions, reduces code size and simplifies code in general. Andrii Sultanov (3): drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

Re: [PATCH 0/4] Allows Secure Boot for Kexec

2025-05-06 Thread Andrii Sultanov
The 2nd and 3rd patches got lost somewhere and do not seem to be shown on lore, at the very least.

[PATCH v4 0/3] drivers: Simplify handling of pci_sbdf_t in passthrough/amd

2025-04-15 Thread Andrii Sultanov
Step-by-step, use pci_sbdf_t directly where appropriate instead of handling seg and bdf separately. This removes conversions, reduces code size and simplifies code in general. Andrii Sultanov (3): drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code drivers: Change

[PATCH v4 1/3] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-04-14 Thread Andrii Sultanov
From: Andrii Sultanov Following on from 250d87dc3ff9 ("x86/msi: Change __msi_set_enable() to take pci_sbdf_t"), make struct amd_iommu contain pci_sbdf_t directly instead of specifying seg+bdf separately and regenerating sbdf_t from them, which simplifies code. Bloat-o-meter reports:

[PATCH v4 2/3] drivers: Change find_iommu_for_device function to take pci_sbdf_t, simplify code

2025-04-14 Thread Andrii Sultanov
From: Andrii Sultanov Following a similar change to amd_iommu struct, change the find_iommu_for_device function to take pci_sbdf_t as a single parameter. This removes conversions in the majority of cases. Bloat-o-meter reports (on top of the first patch in the series): add/remove: 0/0 grow

[PATCH v4 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t

2025-04-14 Thread Andrii Sultanov
From: Andrii Sultanov Following a similar change to amd_iommu struct, make two more structs take pci_sbdf_t directly instead of seg and bdf separately. This lets us drop several conversions from the latter to the former and simplifies several comparisons and assignments. Bloat-o-meter reports

[PATCH v3 2/3] drivers: Change find_iommu_for_device function to take pci_sbdf_t, simplify code

2025-04-05 Thread Andrii Sultanov
-24 parse_ivmd_block13391312 -27 _hvm_dpci_msi_eoi168 133 -35 Signed-off-by: Andrii Sultanov Acked-by: Jan Beulich --- Changes in V3: * Amended commit message * As the previous patch dropped the aliasing of seg and bdf

[PATCH v3 1/3] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-03-18 Thread Andrii Sultanov
-by: Andrew Cooper Signed-off-by: Andrii Sultanov --- Changes in V3: * Dropped the union with seg+bdf/pci_sbdf_t to avoid aliasing, renamed all users appropriately Changes in V2: * Split single commit into several patches * Added the commit title of the referenced patch * Dropped brackets

[PATCH v3 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t

2025-03-18 Thread Andrii Sultanov
Following a similar change to amd_iommu struct, make two more structs take pci_sbdf_t directly instead of seg and bdf separately. This lets us drop several conversions from the latter to the former and simplifies several comparisons and assignments. Signed-off-by: Andrii Sultanov --- This

[PATCH v3 0/3] drivers: Simplify handling of pci_sbdf_t in passthrough/amd

2025-03-18 Thread Andrii Sultanov
Step-by-step, use pci_sbdf_t directly where appropriate instead of handling seg and bdf separately. This removes conversions, reduces code size and simplifies code in general. Andrii Sultanov (3): drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code drivers: Change

[PATCH v2 1/3] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-03-16 Thread Andrii Sultanov
17451665 -80 Resolves: https://gitlab.com/xen-project/xen/-/issues/198 Reported-by: Andrew Cooper Signed-off-by: Andrii Sultanov --- Changes in V2: * Split single commit into several patches * Added the commit title of the referenced patch * Dropped brackets around &(iommu->

[PATCH v2 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t

2025-03-16 Thread Andrii Sultanov
Following a similar change to amd_iommu struct, make two more structs take pci_sbdf_t directly instead of seg and bdf separately. This lets us drop several conversions from the latter to the former and simplifies several comparisons and assignments. Signed-off-by: Andrii Sultanov --- This

[PATCH v2 2/3] drivers: Change find_iommu_for_device function to take pci_sbdf_t, simplify code

2025-03-16 Thread Andrii Sultanov
amd_iommu_msi_msg_update_ire 472 448 -24 parse_ivmd_block13391312 -27 _hvm_dpci_msi_eoi168 133 -35 Signed-off-by: Andrii Sultanov --- > This avoids splitting a single argument into two registers And adds a few conversions int

[PATCH v2 0/3] drivers: Simplify handling of pci_sbdf_t in passthrough/amd

2025-03-16 Thread Andrii Sultanov
Step-by-step, use pci_sbdf_t directly where appropriate instead of handling seg and bdf separately. This removes conversions, reduces code size and simplifies code in general. Andrii Sultanov (3): drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code drivers: Change

[PATCH v1] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-03-13 Thread Andrii Sultanov
17451665 -80 ``` Resolves: https://gitlab.com/xen-project/xen/-/issues/198 Reported-by: Andrew Cooper Signed-off-by: Andrii Sultanov --- xen/drivers/passthrough/amd/iommu.h | 29 +-- xen/drivers/passthrough/amd/iommu_acpi.c| 24 - xen/drivers

Re: [PATCH] docs: fix INTRODUCE description in xenstore.txt

2025-03-05 Thread Andrii Sultanov
Unrelated to the contents of this patch, but talking about docs/misc/xenstore.txt: it also mentions GET/SET_QUOTA calls, but these are not part of the xs_wire.h, and instead can only be used as sub-arguments to CONTROL calls.

Re: [PATCH v2 1/1] tools/ocaml: Fix oxenstored build warning

2025-02-14 Thread Andrii Sultanov
, 2025 at 3:42 PM Andrew Cooper wrote: > On 14/02/2025 3:24 pm, Andrii Sultanov wrote: > > OCaml, in preparation for a renaming of the error string associated with > > conversion failure in 'int_of_string' functions, started to issue this > > warning: > > ``` >

[PATCH v2 0/1] Fix OCaml build warning

2025-02-14 Thread Andrii Sultanov
Acked-by: Christian Lindig Andrii Sultanov (1): tools/ocaml: Fix oxenstored build warning tools/ocaml/xenstored/Makefile | 1 + tools/ocaml/xenstored/perms.ml | 2 +- tools/ocaml/xenstored/poll.ml | 2 +- tools/ocaml/xenstored/process.ml | 18 +- tools/ocaml

[PATCH v2 1/1] tools/ocaml: Fix oxenstored build warning

2025-02-14 Thread Andrii Sultanov
instead create our own stable ConversionFailure exception that's raised on the None case in 'int_of_string_opt'. 'c_int_of_string' is safe and does not raise such exceptions. Signed-off-by: Andrii Sultanov Acked-by: Christian Lindig --- Changes since v1: * Revert loggi

[PATCH v1 0/1] Fix OCaml build warning

2025-02-13 Thread Andrii Sultanov
Andrii Sultanov (1): tools/ocaml: Fix oxenstored build warning tools/ocaml/xenstored/Makefile | 1 + tools/ocaml/xenstored/perms.ml | 2 +- tools/ocaml/xenstored/poll.ml | 2 +- tools/ocaml/xenstored/process.ml | 18 +- tools/ocaml/xenstored/utils.ml | 10

[PATCH v1 1/1] tools/ocaml: Fix oxenstored build warning

2025-02-13 Thread Andrii Sultanov
instead create our own stable ConversionFailure exception that's raised on the None case in 'int_of_string_opt'. 'c_int_of_string' is safe and does not raise such exceptions. Reported-by: Andrew Cooper Signed-off-by: Andrii Sultanov --- tools/ocaml/xenstored/Makefile

[PATCH v2 0/1] Fix rpath handling in OCaml's Makefile.rules

2024-12-09 Thread Andrii Sultanov
y did not actually get rid of the absolute rpath, pass -L directly to the linker as well - Credit the original reporter Andrii Sultanov (1): tools/ocaml: Specify rpath correctly for ocamlmklib tools/ocaml/Makefile.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.39.5

[PATCH v2 1/1] tools/ocaml: Specify rpath correctly for ocamlmklib

2024-12-09 Thread Andrii Sultanov
directly to the compiler with -ccopt instead. Also pass -L directly to the linker with -ldopt. This prevents embedding absolute paths from buildtime into binary's RPATH. Fixes: f7b4e4558b42 ("tools/ocaml: Fix OCaml libs rules") Reported-by: Fernando Rodrigues Tested-by: Fernando Rodrig

Re: [PATCH v1 0/1] Fix rpath handling in OCaml's Makefile.rules

2024-12-09 Thread Andrii Sultanov
DO NOT COMMIT - this patch is not correct, and I will send an updated version later. On Mon, Dec 9, 2024 at 3:16 PM Andrii Sultanov wrote: > As reported by Nix's Xen team, OCaml stub libs would embed an absolute > rpath in the binaries, which was picked up on by patchelf. This is a &

[PATCH v1 1/1] tools/ocaml: Specify rpath correctly for ocamlmklib

2024-12-09 Thread Andrii Sultanov
directly to the compiler with -ccopt instead. This prevents embedding absolute paths from buildtime into binary's RPATH. Fixes: f7b4e4558b42 ("tools/ocaml: Fix OCaml libs rules") Signed-off-by: Andrii Sultanov --- tools/ocaml/Makefile.rules | 4 ++-- 1 file changed, 2 insertions

[PATCH v1 0/1] Fix rpath handling in OCaml's Makefile.rules

2024-12-09 Thread Andrii Sultanov
As reported by Nix's Xen team, OCaml stub libs would embed an absolute rpath in the binaries, which was picked up on by patchelf. This is a symptom of improper handling of -rpath-link in the first place, so correct that and get rid of the issue. Andrii Sultanov (1): tools/ocaml: Specify

[QUESTION] tools/xenstored: Best way to proceed with the protocol modification

2024-10-30 Thread Andrii Sultanov
Hello, (CC-ing Jürgen as the original author of the xenstored partial directory patches: https://lore.kernel.org/xen-devel/20161205074853.13268-1-jgr...@suse.com/) I'm investigating implementing XS_DIRECTORY_PART support in Oxenstored, and have come by a possible issue - the protocol specifies th

[PATCH v1 1/1] ocaml/libs: Remove xsd_glue_dev package, also install plugin_interface_v1.a

2024-10-09 Thread Andrii Sultanov
xsd_glue_dev packaging is inconsistent with the rest of OCaml packages and isn't actually necessary. .a is needed alongside compiled bytecode files during linking and was missed in the initial oxenstore plugin work. Specify OCAMLCFLAGS along with OCAMLOPTFLAGS. Signed-off-by: Andrii Sul

[PATCH v1 0/1] Oxenstored packaging fixes

2024-10-09 Thread Andrii Sultanov
the host. Andrii Sultanov (1): ocaml/libs: Remove xsd_glue_dev package, also install plugin_interface_v1.a tools/ocaml/libs/xsd_glue/Makefile | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.39.5

[PATCH v3 0/3] tools/ocaml: Stabilize domain_getinfo for Oxenstored

2024-09-09 Thread Andrii Sultanov
as well: https://gitlab.com/xen-project/people/asultanov/xen/-/pipelines/1445699231 The patch series has also been tested manually. Andrii Sultanov (3): ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo tools/oxenstored: Load the plugin for Xenctrl.domain_getinfo

[PATCH v3 2/3] tools/oxenstored: Load the plugin for Xenctrl.domain_getinfo

2024-09-09 Thread Andrii Sultanov
(New oxenstored can run in an environment with only V1 of the plugin). The plugin is not switched to as of yet, the old Xenctrl stubs are still used. Signed-off-by: Andrii Sultanov Acked-by: Christian Lindig --- * This commit is a result of the split of one oxenstored commit into two. * R

[PATCH v3 3/3] tools/oxenstored: Switch to using the plugin for Xenctrl.domain_getinfo

2024-09-09 Thread Andrii Sultanov
Also run 'make format' on the file to reformat an adjacent block of code correctly. Signed-off-by: Andrii Sultanov Acked-by: Christian Lindig --- * This commit is a result of the split of one oxenstored commit into two. tools/ocaml/xenstored/domains.ml | 51 -

[PATCH v3 1/3] ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo

2024-09-09 Thread Andrii Sultanov
interface would need to be issued. Signed-off-by: Andrii Sultanov Acked-by: Christian Lindig --- * Reformat files appropriately * Rename all instances of 'xenstoredglue', 'xenstored_glue', 'xsglue' to 'xsd_glue' for consistency * Remove _v1 suffix fro

Re: [PATCH v2 2/3] ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo

2024-09-06 Thread Andrii Sultanov
y much for the rest, I will submit a new version of the patch series shortly. On Fri, Sep 6, 2024 at 2:38 PM Andrew Cooper wrote: > On 03/09/2024 12:44 pm, Andrii Sultanov wrote: > > This plugin intends to hide the unstable Xenctrl interface under a > > stable one. In case of the

[PATCH v2 3/3] tools/oxenstored: Use the plugin for Xenctrl.domain_getinfo

2024-09-03 Thread Andrii Sultanov
exist (New oxenstored can run in an environment with only V1 of the plugin). Signed-off-by: Andrii Sultanov --- Config.mk | 2 +- configure | 7 m4/paths.m4 | 4 ++ tools/configure | 7 tools/

[PATCH v2 0/3] tools/ocaml: Stabilize domain_getinfo for Oxenstored

2024-09-03 Thread Andrii Sultanov
ing...plugin-v3 V2 passed the Gitlab CI: https://gitlab.com/xen-project/people/asultanov/xen/-/pipelines/1437391764 It was also tested on some hosts. Andrii Sultanov (3): tools/ocaml: Build infrastructure for OCaml dynamic libraries ocaml/libs: Implement a dynamically-loaded plugin for

[PATCH v2 2/3] ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo

2024-09-03 Thread Andrii Sultanov
interface would need to be issued. Signed-off-by: Andrii Sultanov --- tools/ocaml/Makefile | 1 + tools/ocaml/libs/Makefile | 2 +- tools/ocaml/libs/xenstoredglue/META.in| 4 + tools/ocaml/libs/xenstoredglue/Makefile | 46

[PATCH v2 1/3] tools/ocaml: Build infrastructure for OCaml dynamic libraries

2024-09-03 Thread Andrii Sultanov
Dynamic libraries in OCaml require an additional compilation step on top of the already specified steps for static libraries. Add an appropriate template to Makefile.rules. Signed-off-by: Andrii Sultanov --- tools/ocaml/Makefile.rules | 17 - 1 file changed, 16 insertions(+), 1

Re: [PATCH v1 2/4] ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo

2024-08-27 Thread Andrii Sultanov
> It seems that location for ocaml libs is in $(OCAMLDESTDIR), any reason > to deviate from that? OCAMLDESTDIR is only defined in tools/ocaml/common.make, and is unavailable at the top-level directories level of the autoconf infrastructure (which generates the paths.ml file), as far as I understan

[PATCH v1 1/4] tools/ocaml/common.make: Remove '-cc $(CC)' flag from OCAMLOPTFLAGS

2024-08-22 Thread Andrii Sultanov
This flag does not work as assumed and will not pass options (such as -shared) to the C compiler: https://github.com/ocaml/ocaml/issues/12284 Signed-off-by: Andrii Sultanov --- tools/ocaml/common.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ocaml/common.make b

[PATCH v1 3/4] tools/oxenstored: Use the plugin for Xenctrl.domain_getinfo

2024-08-22 Thread Andrii Sultanov
exist (New oxenstored can run in an environment with only V1 of the plugin). Signed-off-by: Andrii Sultanov --- Config.mk | 2 +- configure | 7 m4/paths.m4 | 4 ++ tools/configure | 7 tools/

[PATCH v1 2/4] ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo

2024-08-22 Thread Andrii Sultanov
interface would need to be issued. Signed-off-by: Andrii Sultanov --- tools/ocaml/Makefile | 1 + tools/ocaml/Makefile.rules| 17 +- tools/ocaml/libs/Makefile | 2 +- tools/ocaml/libs/xenstoredglue/META.in| 4 + tools

[PATCH v1 0/4] Stabilize Oxenstored's interface with

2024-08-22 Thread Andrii Sultanov
e: https://gitlab.com/xen-project/people/asultanov/xen/-/compare/staging...staging?from_project_id=2336572 Andrii Sultanov (4): tools/ocaml/common.make: Remove '-cc $(CC)' flag from OCAMLOPTFLAGS ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo

[PATCH v1 4/4] Makefile.rules: Fix OCaml libs

2024-08-22 Thread Andrii Sultanov
This commit upstreams the pre-existing patch from https://github.com/xenserver/xen.pg/blob/XS-8/patches/fix-ocaml-libs.patch Signed-off-by: Andrii Sultanov --- tools/ocaml/Makefile.rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ocaml/Makefile.rules b/tools