[Xen-devel] [PATCH 1/1] x86/arch: VM resume: avoid RDTSC emulation due to host clock drift

2019-09-02 Thread Edwin Török
get this output: ``` (XEN) [6.614703] Detected 2600.010 MHz processor. (XEN) [ 138.924342] TSC marked as reliable, warp = 0 (count=2) (XEN) [ 138.924346] dom1(hvm): mode=0,ofs=0xfffed01901016d18,khz=2600012,inc=2 ``` Signed-off-by: Edwin Török --- xen/arch/x86/time.c | 8 +++- 1 file cha

[Xen-devel] [PATCH 0/1] Avoiding RDTSC emulation due to host clock drift

2019-09-02 Thread Edwin Török
RDTSC emulation due to that. So far I have manually tested this on Intel(R) Xeon(R) CPU E5-2697 v3 and a Debian 9 guest, more tests pending. See the commit for more details. Edwin Török (1): x86/arch: VM resume: avoid RDTSC emulation due to host clock drift xen/arch/x86/time.c | 8 +++- 1

Re: [Xen-devel] [PATCH 1/1] x86/arch: VM resume: avoid RDTSC emulation due to host clock drift

2019-09-03 Thread Edwin Török
On 03/09/2019 08:54, Jan Beulich wrote: > On 02.09.2019 20:27, Edwin Török wrote: >> On a Intel(R) Xeon(R) CPU E5-2697 v3 @ 2.60GHz the host frequency drifts: >> ``` >> (XEN) [6.607693] Detected 2600.004 MHz processor. >> (XEN) [ 2674.213081] dom1(hvm): >>

Re: [Xen-devel] [PATCH 3/3] xen-init-dom0: set Dom0 UUID if requested

2018-11-15 Thread Edwin Török
On 14/11/2018 18:17, Wei Liu wrote: > Read from XEN_CONFIG_DIR/dom0-uuid. If it contains a valid UUID, set > it for Dom0. > > Signed-off-by: Wei Liu [snip] In general this looks good, however I am not familiar with libxl conventions, so just some generic comments below. > +static void get_dom0_

Re: [Xen-devel] [PATCH v2 3/3] xen-init-dom0: set Dom0 UUID if requested

2018-11-15 Thread Edwin Török
+++-- > 5 files changed, 67 insertions(+), 4 deletions(-) > create mode 100644 tools/examples/dom0-uuid I can't spot anything wrong here. Acked-by: Edwin Török Best regards, --Edwin ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

[PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket

2020-10-02 Thread Edwin Török
The readonly flag was propagated but ignored, so this was essentially equivalent to a RW socket. C xenstored is dropping the RO socket too, so drop it from oxenstored too. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml/xenstored/define.ml | 1

[PATCH v1 0/1] drop RO socket from oxenstored

2020-10-02 Thread Edwin Török
See https://lore.kernel.org/xen-devel/20201002154141.11677-6-jgr...@suse.com/T/#u Edwin Török (1): tools/ocaml/xenstored: drop the creation of the RO socket tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml/xenstored/define.ml | 1 - tools/ocaml/xenstored/xenstored.ml | 15

[PATCH v1 2/4] automation/: add Ubuntu:focal container

2020-11-17 Thread Edwin Török
Signed-off-by: Edwin Török --- automation/build/ubuntu/focal.dockerfile | 50 automation/scripts/containerize | 1 + 2 files changed, 51 insertions(+) create mode 100644 automation/build/ubuntu/focal.dockerfile diff --git a/automation/build/ubuntu

[PATCH v1 1/4] automation/scripts/containerize: fix DOCKER_CMD=podman

2020-11-17 Thread Edwin Török
On CentOS 8 with SELinux containerize doesn't work at all: Make sure that the source code and SSH agent directories are passed on with SELinux relabeling enabled. (`-security-opt label=disabled` would be another option) Signed-off-by: Edwin Török --- automation/scripts/containeriz

[PATCH v1 0/4] tools/ocaml/libs/xc: domid control at domain creation time

2020-11-17 Thread Edwin Török
ime. This is inefficient, but works. Long term it would be beneficial to switch to Dune as build system, which can do correct incremental builds with minimal configuration. I'll send a separate patch series for that. Edwin Török (4): automation/scripts/containerize: fix DOCKER_CMD=podman auto

[PATCH v1 3/4] Makefile: add build-tools-oxenstored

2020-11-17 Thread Edwin Török
As a convenience so that oxenstored patches can be compile-tested using upstream's build-system before submitting upstream. Signed-off-by: Edwin Török --- Makefile | 6 ++ tools/ocaml/Makefile | 8 2 files changed, 14 insertions(+) diff --git a/Makefile b/Mak

[PATCH v1 4/4] tools/ocaml/libs/xc: backward compatible domid control at domain creation time

2020-11-17 Thread Edwin Török
new version of xenopsd can choose to start using this, while old versions of xenopsd will keep building and using the old API. Controlling the domid can be useful during testing or migration. Signed-off-by: Edwin Török --- tools/ocaml/libs/xc/xenctrl.ml | 3 +++ tools/ocaml/libs/xc

[PATCH v2 1/2] automation/: add Ubuntu:focal container

2021-01-15 Thread Edwin Török
Signed-off-by: Edwin Török Acked-by: Doug Goldstein --- Changed since v1: * dropped python-dev and markdown --- automation/build/ubuntu/focal.dockerfile | 48 automation/scripts/containerize | 1 + 2 files changed, 49 insertions(+) create mode 100644

[PATCH v2 0/2] oxenstored build enhancements

2021-01-15 Thread Edwin Török
The patches were posted previously, this is a repost after the XSA series. For convenience here is a tree with all patch series applied: https://github.com/edwintorok/xen/pull/1 Edwin Török (2): automation/: add Ubuntu:focal container Makefile: add build-tools-oxenstored Makefile

[PATCH v2 2/2] Makefile: add build-tools-oxenstored

2021-01-15 Thread Edwin Török
As a convenience so that oxenstored patches can be compile-tested using upstream's build-system before submitting upstream. Signed-off-by: Edwin Török --- Changed since V1: * repost after XSA to avoid conflicts --- Makefile | 6 ++ tools/ocaml/Makefile | 8 2

[PATCH v2 3/8] docs/designs/xenstore-migration.md: clarify that deletes are recursive

2021-01-15 Thread Edwin Török
Signed-off-by: Edwin Török --- Changed since V1: * post publicly now that the XSA is out --- docs/designs/xenstore-migration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/designs/xenstore-migration.md b/docs/designs/xenstore-migration.md index 2ce2c836f5

[PATCH v2 2/8] Add workaround for xenstore-control flood issues

2021-01-15 Thread Edwin Török
There are alternative fixes for this, e.g. do the entire live update inside oxenstored and reply OK from the next oxenstored or an error. This requires some asynchronous handling there. Once that code is available we can revert this one. Signed-off-by: Edwin Török Reviewed-by: Pau Ruiz Safont

[PATCH v2 5/8] tools/ocaml/xenstored: Automatically resume when possible

2021-01-15 Thread Edwin Török
D and allow it to restart on success. This should make updating oxenstored as easy as: `systemctl stop -s SIGTERM xenstored` on a suitable xenstored version. Signed-off-by: Edwin Török Reviewed-by: Pau Ruiz Safont Reviewed-by: Christian Lindig --- Changed since V1: * post publicly now that the X

[PATCH v2 1/8] tools/xenstore: add live update command to xenstore-control

2021-01-15 Thread Edwin Török
From: Juergen Gross Add the "live-update" command to xenstore-control enabling updating xenstored to a new version in a running Xen system. With -c it is possible to pass a different command line to the new instance of xenstored. This will replace the command line used for the invocation of the

[PATCH v2 4/8] tools/ocaml/xenstored: only quit on SIGTERM when a reload is possible

2021-01-15 Thread Edwin Török
red via SIGTERM in the above situations. Also ignore domains marked as bad because oxenstored would never talk to them again. Signed-off-by: Edwin Török Reviewed-by: Pau Ruiz Safont Reviewed-by: Christian Lindig --- Changed since V1: * post publicly now that the XSA is out --- tools/

[PATCH v2 6/8] tools/ocaml/xenstored: add cooperative live-update command

2021-01-15 Thread Edwin Török
transactions, and no unprocess input or unflushed output. It is not yet possible to force the live-update. Signed-off-by: Edwin Török Reviewed-by: Pau Ruiz Safont Reviewed-by: Christian Lindig --- Changed since V1: * post publicly now that the XSA is out --- tools/ocaml/xenstored/process.ml | 112

[PATCH v2 1/2] tools/ocaml/xenstored: trim txhistory on xenbus reconnect

2021-01-15 Thread Edwin Török
Now there is a periodic History.trim running every 0.05s, so I don't think you can do much damage with it. But lets be safe an trim the transaction history anyway on reconnect. Signed-off-by: Edwin Török --- Changed since V1: * post publicly now that the XSA is out (not a security issue) -

[PATCH v1 2/5] tools/ocaml/xenstored: implement the live migration binary format

2021-01-15 Thread Edwin Török
OCaml 4.08+. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/disk.ml | 318 ++ 1 file changed, 318 insertions(+) diff --git a/tools/ocaml/xenstored/disk.ml b/tools/ocaml/xenstored/disk.ml index 4739967b61..595fdab54a 100644 --- a/tools/ocaml/xenstored/disk.ml

[PATCH v2 7/8] tools/ocaml/xenstored: start live update process

2021-01-15 Thread Edwin Török
Signed-off-by: Edwin Török Reviewed-by: Pau Ruiz Safont Reviewed-by: Christian Lindig --- Changed since V1: * post publicly now that the XSA is out --- tools/ocaml/xenstored/logging.ml | 3 +++ tools/ocaml/xenstored/process.ml | 8 +--- tools/ocaml/xenstored/xenstored.ml | 29

[PATCH v1 1/4] tools/ocaml/libs/xb: do not crash after xenbus is unmapped

2021-01-15 Thread Edwin Török
Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c. If due to a bug there were still references to the Xenbus and we attempt to use it then we crash. Raise an exception instead of crashing. (My initial version of fuzz testing had such a bug) Signed-off-by: Edwin Török --- tools

[PATCH v1 3/4] tools/ocaml/xenstored: reject invalid watch paths early

2021-01-15 Thread Edwin Török
`//`, which is an invalid path. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/connection.ml | 5 ++--- tools/ocaml/xenstored/connections.ml | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml index

[PATCH v1 3/5] tools/ocaml/xenstored: add binary dump format support

2021-01-15 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/xenstored/connection.ml | 63 + 1 file changed, 47 insertions(+), 16 deletions(-) diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml index 51041dde8e..1f9fe9e3b2 100644 --- a/tools/ocaml

[PATCH v4 3/4] tools/ocaml/xenstored: use more efficient node trees

2021-01-15 Thread Edwin Török
nd changing the listing order changed what key got dropped making the test fail) Signed-off-by: Edwin Török Acked-by: Christian Lindig --- Changed since V3: * repost after XSA to avoid conflicts --- tools/ocaml/xenstored/store.ml | 48 +++- tools/ocaml/xenstored/

[PATCH v1 2/4] tools/ocaml/xenstored: fix quota calculation for mkdir EEXIST

2021-01-15 Thread Edwin Török
oalesce" = 0; "stat_transaction_abort" = 0; "store" = /{n0} /tool{n0} /local{n0} ; "quota" = { "maxent" = 8192; "maxsize" = 2048; "cur" = (hashtbl (0, +3+))-2-)) } } Fatal error: exception Crowbar.TestFailure ``` This shows t

[PATCH v1 4/4] tools/ocaml/xenstored: mkdir conflicts were sometimes missed

2021-01-15 Thread Edwin Török
eding depending on timing. Or one transaction reading an entry, concluding it doesn't exist, do some other work based on that information and successfully commit even if another transaction creates the node via mkdir meanwhile. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/transaction.ml

[PATCH v1 5/5] Add structured fuzzing unit test

2021-01-15 Thread Edwin Török
ecf33a0d.ca...@citrix.com/ for previous discussion of OCaml version. Signed-off-by: Edwin Török --- tools/ocaml/Makefile | 19 + tools/ocaml/xenstored/process.ml | 12 +- tools/ocaml/xenstored/store.ml| 1 + tools/ocaml/xenstored/test

[PATCH v4 2/4] tools/ocaml/xenstored: backport find_opt/update from 4.06

2021-01-15 Thread Edwin Török
We are currently on OCaml 4.02 as minimum version. To make the followup optimizations compile backport these functions from OCaml 4.06. This implementation is less efficient than the one in the 4.06 standard library which has access to the internals of the Map. Signed-off-by: Edwin Török

[PATCH v2 2/2] tools/ocaml/libs/xc: backward compatible domid control at domain creation time

2021-01-15 Thread Edwin Török
keep building and using the old API. (The ABI will change, but that changes every time a function is introduced/removed or modified) Controlling the domid can be useful during testing or migration. Signed-off-by: Edwin Török Acked-by: Christian Lindig --- Changed since V1: * introduced an

[PATCH v1 4/5] tools/ocaml/xenstored: add support for binary format

2021-01-15 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/xenstored/perms.ml | 2 + tools/ocaml/xenstored/xenstored.ml | 201 - 2 files changed, 173 insertions(+), 30 deletions(-) diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml index e8a16221f8

[PATCH v4 1/4] tools/ocaml/xenstored: replace hand rolled GC with weak GC references

2021-01-15 Thread Edwin Török
o longer referenced OCaml's GC will drop it from the weak table: there is no need to manually do a mark-and-sweep, or to tell OCaml when to drop it. Signed-off-by: Edwin Török Acked-by: Christian Lindig --- Changed since V3: * repost after XSA to avoid conflicts --- tools/ocaml/xenstored/

[PATCH v1 1/5] tools/ocaml: add unit test skeleton with Dune build system

2021-01-15 Thread Edwin Török
t actually starting up the daemon in a unit test. Similarly argument parsing had to be delayed until after daemon startup. Also had to disable setrlimit when running as non-root in poll.ml. Signed-off-by: Edwin Török --- tools/ocaml/.gitignore | 2 + tools/ocam

[PATCH v2 8/8] tools/ocaml/xenstored: Implement live update for socket connections

2021-01-15 Thread Edwin Török
From: Edvin Torok Signed-off-by: Edwin Török Reviewed-by: Pau Ruiz Safont Reviewed-by: Christian Lindig --- Changed since V1 * post publicly now that the XSA is out --- tools/ocaml/xenstored/connection.ml | 25 +--- tools/ocaml/xenstored/parse_arg.ml | 4 ++ tools/ocaml/xenstored

[PATCH v4 4/4] tools/ocaml/xenstored: use more efficient tries

2021-01-15 Thread Edwin Török
No functional change, just an optimization. Signed-off-by: Edwin Török Acked-by: Christian Lindig --- Changed since V3: * repost after XSA to avoid conflicts --- tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml/xenstored/symbol.ml | 6 +-- tools/ocaml/xenstored/trie.ml

[PATCH v1 0/1] oxenstored: fix ABI breakage in reset watches

2020-07-15 Thread Edwin Török
f a suitable control/platform-feature-xs_reset_watches field is present in xenstore. Edwin Török (1): oxenstored: fix ABI breakage introduced in Xen 4.9.0 tools/ocaml/libs/xb/op.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1

[PATCH v1 1/1] oxenstored: fix ABI breakage introduced in Xen 4.9.0

2020-07-15 Thread Edwin Török
ble watch reset, we now see `reset watches` during kdump of a guest in xenstored-access.log. Signed-off-by: Edwin Török Tested-by: Igor Druzhinin --- tools/ocaml/libs/xb/op.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.

[PATCH v1 0/6] tools/ocaml/xenstored: simplify code

2020-08-14 Thread Edwin Török
the legacy select based code: I think every modern *nix should have a working poll(3) by now. This is a draft series, in need of more testing. Edwin Török (6): tools/ocaml/libs/xc: Fix ambiguous documentation comment tools/ocaml/xenstored: fix deprecation warning tools/ocaml/xenstored: replace

[PATCH v1 2/6] tools/ocaml/xenstored: fix deprecation warning

2020-08-14 Thread Edwin Török
``` File "xenstored/disk.ml", line 33, characters 9-23: 33 |let c = Char.lowercase c in ^^ (alert deprecated): Stdlib.Char.lowercase Use Char.lowercase_ascii instead. ``` Signed-off-by: Edwin Török --- tools/ocaml/xenstored/disk.ml | 2 +- 1 file

[PATCH v1 3/6] tools/ocaml/xenstored: replace hand rolled GC with weak GC references

2020-08-14 Thread Edwin Török
o longer referenced OCaml's GC will drop it from the weak table: there is no need to manually do a mark-and-sweep, or to tell OCaml when to drop it. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/connection.ml | 3 -- tools/ocaml/xenstored/history.ml| 14 -- tools/ocaml/xenst

[PATCH v1 4/6] tools/ocaml/xenstored: drop select based

2020-08-14 Thread Edwin Török
ch is inefficient. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/Makefile | 12 ++-- tools/ocaml/xenstored/parse_arg.ml | 7 ++- tools/ocaml/xenstored/{select.ml => poll.ml} | 14 ++ tools/ocaml/xenstored/{select.mli => pol

[PATCH v1 1/6] tools/ocaml/libs/xc: Fix ambiguous documentation comment

2020-08-14 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/libs/xc/xenctrl.mli | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli index 26ec7e59b1..f7f6ec570d 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli

[PATCH v1 5/6] tools/ocaml/xenstored: use more efficient node trees

2020-08-14 Thread Edwin Török
ev. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/store.ml | 46 +++- tools/ocaml/xenstored/symbol.ml | 4 +++ tools/ocaml/xenstored/symbol.mli | 3 +++ 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/tools/ocaml/xenstored/store.ml b/tools/

[PATCH v1 6/6] tools/ocaml/xenstored: use more efficient tries

2020-08-14 Thread Edwin Török
No functional change, just an optimization. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml/xenstored/trie.ml| 61 tools/ocaml/xenstored/trie.mli | 26 ++-- 3 files changed, 41 insertions(+), 48

[PATCH v2 1/6] tools/ocaml/libs/xc: Fix ambiguous documentation comment

2020-08-17 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/libs/xc/xenctrl.mli | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli index 26ec7e59b1..f7f6ec570d 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli

[PATCH v2 4/6] tools/ocaml/xenstored: drop select based socket watching

2020-08-17 Thread Edwin Török
ch is inefficient. Signed-off-by: Edwin Török --- Changed since v1: * fix commit title --- tools/ocaml/xenstored/Makefile | 12 ++-- tools/ocaml/xenstored/parse_arg.ml | 7 ++- tools/ocaml/xenstored/{select.ml => poll.ml} | 14 ++ too

[PATCH v2 3/6] tools/ocaml/xenstored: replace hand rolled GC with weak GC references

2020-08-17 Thread Edwin Török
o longer referenced OCaml's GC will drop it from the weak table: there is no need to manually do a mark-and-sweep, or to tell OCaml when to drop it. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/connection.ml | 3 -- tools/ocaml/xenstored/history.ml| 14 -- tools/ocaml/xenst

[PATCH v2 6/6] tools/ocaml/xenstored: use more efficient tries

2020-08-17 Thread Edwin Török
No functional change, just an optimization. Signed-off-by: Edwin Török --- Changed since v1: * fix missing 'set_node' in 'set' that got lost in conversion to map * simplify 'compare' function --- tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml

[PATCH v2 5/6] tools/ocaml/xenstored: use more efficient node trees

2020-08-17 Thread Edwin Török
ev. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/store.ml | 46 +++- tools/ocaml/xenstored/symbol.ml | 4 +++ tools/ocaml/xenstored/symbol.mli | 3 +++ 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/tools/ocaml/xenstored/store.ml b/tools/

[PATCH v2 0/6] tools/ocaml/xenstored: simplify code

2020-08-17 Thread Edwin Török
the legacy select based code: I think every modern *nix should have a working poll(3) by now. Changes since v1: * passed some testing * fix commit title on 'drop select based' * fix missing 'set_node' in 'set' that got lost in conversion to map * simplify 

[PATCH v2 2/6] tools/ocaml/xenstored: fix deprecation warning

2020-08-17 Thread Edwin Török
``` File "xenstored/disk.ml", line 33, characters 9-23: 33 |let c = Char.lowercase c in ^^ (alert deprecated): Stdlib.Char.lowercase Use Char.lowercase_ascii instead. ``` Signed-off-by: Edwin Török --- tools/ocaml/xenstored/disk.ml | 2 +- 1 file

[PATCH v3 4/6] tools/ocaml/xenstored: drop select based socket watching

2020-08-17 Thread Edwin Török
ch is inefficient. Signed-off-by: Edwin Török --- Changed since v1: * fix commit title --- tools/ocaml/xenstored/Makefile | 12 ++-- tools/ocaml/xenstored/parse_arg.ml | 7 ++- tools/ocaml/xenstored/{select.ml => poll.ml} | 14 ++ too

[PATCH v3 6/6] tools/ocaml/xenstored: use more efficient tries

2020-08-17 Thread Edwin Török
No functional change, just an optimization. Signed-off-by: Edwin Török --- Changed since v1: * fix missing 'set_node' in 'set' that got lost in conversion to map * simplify 'compare' function --- tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml

[PATCH v3 0/6] tools/ocaml/xenstored: simplify code

2020-08-17 Thread Edwin Török
elect based' * passed some testing Please ignore V2, something went wrong and V2 was nearly identical to V1, not matching what I had in my git tree. Edwin Török (6): tools/ocaml/libs/xc: Fix ambiguous documentation comment tools/ocaml/xenstored: fix deprecation warning tools/ocaml/xen

[PATCH v3 2/6] tools/ocaml/xenstored: fix deprecation warning

2020-08-17 Thread Edwin Török
``` File "xenstored/disk.ml", line 33, characters 9-23: 33 |let c = Char.lowercase c in ^^ (alert deprecated): Stdlib.Char.lowercase Use Char.lowercase_ascii instead. ``` Signed-off-by: Edwin Török --- tools/ocaml/xenstored/disk.ml | 2 +- 1 file

[PATCH v3 1/6] tools/ocaml/libs/xc: Fix ambiguous documentation comment

2020-08-17 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/libs/xc/xenctrl.mli | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli index 26ec7e59b1..f7f6ec570d 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli

[PATCH v3 5/6] tools/ocaml/xenstored: use more efficient node trees

2020-08-17 Thread Edwin Török
ev. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/store.ml | 46 +++- tools/ocaml/xenstored/symbol.ml | 4 +++ tools/ocaml/xenstored/symbol.mli | 3 +++ 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/tools/ocaml/xenstored/store.ml b/tools/

[PATCH v3 3/6] tools/ocaml/xenstored: replace hand rolled GC with weak GC references

2020-08-17 Thread Edwin Török
o longer referenced OCaml's GC will drop it from the weak table: there is no need to manually do a mark-and-sweep, or to tell OCaml when to drop it. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/connection.ml | 3 -- tools/ocaml/xenstored/history.ml| 14 -- tools/ocaml/xenst

[PATCH v4 3/4] tools/ocaml/xenstored: use more efficient node trees

2020-08-27 Thread Edwin Török
ev. Signed-off-by: Edwin Török Acked-by: Christian Lindig --- Changes since V3: * none, repost after preceding commits fix OCaml 4.02 compatibility --- tools/ocaml/xenstored/store.ml | 46 +++- tools/ocaml/xenstored/symbol.ml | 4 +++ tools/ocaml/xenstored/symbol.

[PATCH v4 1/4] tools/ocaml/xenstored: replace hand rolled GC with weak GC references

2020-08-27 Thread Edwin Török
o longer referenced OCaml's GC will drop it from the weak table: there is no need to manually do a mark-and-sweep, or to tell OCaml when to drop it. Signed-off-by: Edwin Török Acked-by: Christian Lindig --- Changes since V3: * replace String.equal with (=) for compatibility with 4.02 ---

[PATCH v4 2/4] Map: backport find_opt/update from 4.06

2020-08-27 Thread Edwin Török
We are currently on OCaml 4.02 as minimum version. To make the followup optimizations compile backport these functions from OCaml 4.06. This implementation is less efficient than the one in the 4.06 standard library which has access to the internals of the Map. Signed-off-by: Edwin Török

[PATCH v4 0/4] tools/ocaml/xenstored: simplify code

2020-08-27 Thread Edwin Török
://gitlab.com/edwintorok/xen/-/compare/master...for-upstream Edwin Török (4): tools/ocaml/xenstored: replace hand rolled GC with weak GC references Map: backport find_opt/update from 4.06 tools/ocaml/xenstored: use more efficient node trees tools/ocaml/xenstored: use more efficient tries tools

[PATCH v4 4/4] tools/ocaml/xenstored: use more efficient tries

2020-08-27 Thread Edwin Török
No functional change, just an optimization. Signed-off-by: Edwin Török Acked-by: Christian Lindig --- Changes since V3: * none, repost after previous commits fix compatibility with OCaml 4.02 --- tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml/xenstored/symbol.ml | 6 +-- tools

[PATCH v1 7/9] tools/ocaml/xenstored: don't store domU's mfn of ring page

2020-08-27 Thread Edwin Török
This is a port of the following C xenstored commit 122b52230aa5b79d65e18b8b77094027faa2f8e2 tools/xenstore: don't store domU's mfn of ring page in xenstored Backwards compat: accept a domain dump both with and without MFN. CC: Signed-off-by: Juergen Gross Signed-off-by: Edwin Török

[PATCH v1 5/9] tools/ocaml: safer Xenmmap interface

2020-08-27 Thread Edwin Török
Xenmmap.mmap_interface is created from multiple places: * via mmap(), which needs to be unmap()-ed * xc_map_foreign_range * xengnttab_map_grant_ref Signed-off-by: Edwin Török --- tools/ocaml/libs/mmap/xenmmap.ml | 14 -- tools/ocaml/libs/mmap/xenmmap.mli | 11 --- tools

[PATCH v1 6/9] tools/ocaml/xenstored: use gnttab instead of xenctrl's foreign_map_range

2020-08-27 Thread Edwin Török
Xenmmap interface (without it the code would build but the wrong unmap function would get called on domain destruction) CC: Andrew Cooper Signed-off-by: Edwin Török --- tools/ocaml/xenstored/domains.ml | 7 +-- tools/ocaml/xenstored/xenstored.ml | 3 ++- 2 files changed, 7 insertions

[PATCH v1 2/9] tools/ocaml/libs/mmap: allocate correct number of bytes

2020-08-27 Thread Edwin Török
ep using sizeof, but round up and convert to number of words. For OCaml 1 word = sizeof(value) The Wsize_bsize macro converts bytes to words. Signed-off-by: Edwin Török --- tools/ocaml/libs/mmap/xenmmap_stubs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/

[PATCH v1 3/9] tools/ocaml/libs/mmap: Expose stub_mmap_alloc

2020-08-27 Thread Edwin Török
for mapping bigarrays, and int64 for just the offset. Signed-off-by: Edwin Török --- tools/ocaml/libs/mmap/mmap_stubs.h| 4 +++- tools/ocaml/libs/mmap/xenmmap_stubs.c | 31 +-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/tools/ocaml/libs/mmap/mmap_stub

[PATCH v1 4/9] tools/ocaml/libs/xb: import gnttab stubs from mirage

2020-08-27 Thread Edwin Török
xenstored's use only which needs a way to grant map the xenstore ring without using xenctrl. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/Makefile | 11 ++- tools/ocaml/xenstored/gnt.ml | 60 +++ tools/ocaml/xenstored/gnt.mli| 86 ++

[PATCH v1 9/9] tools/ocaml/libs/mmap: Clean up unused read/write

2020-08-27 Thread Edwin Török
Xenmmap is only modified by the ring functions, these functions are unused. Signed-off-by: Edwin Török --- tools/ocaml/libs/mmap/xenmmap.ml | 5 tools/ocaml/libs/mmap/xenmmap.mli | 4 --- tools/ocaml/libs/mmap/xenmmap_stubs.c | 41 --- 3 files changed, 50

[PATCH v1 1/9] tools/ocaml: use common macros for manipulating mmap_interface

2020-08-27 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/libs/mmap/mmap_stubs.h| 7 +++ tools/ocaml/libs/mmap/xenmmap_stubs.c | 2 -- tools/ocaml/libs/xb/xs_ring_stubs.c | 14 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/ocaml/libs/mmap/mmap_stubs.h b

[PATCH v1 0/9] tools/ocaml: use gnttab instead of map_foreign_range

2020-08-27 Thread Edwin Török
om/edwintorok/xen/-/compare/master...for-upstream Edwin Török (9): tools/ocaml: use common macros for manipulating mmap_interface tools/ocaml/libs/mmap: allocate correct number of bytes tools/ocaml/libs/mmap: Expose stub_mmap_alloc tools/ocaml/libs/xb: import gnttab stubs from mirage tool

[PATCH v1 8/9] tools/ocaml/libs/mmap: mark mmap/munmap as blocking

2020-08-27 Thread Edwin Török
These functions can potentially take some time, so allow other OCaml code to proceed meanwhile (if any). Signed-off-by: Edwin Török --- tools/ocaml/libs/mmap/xenmmap_stubs.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/ocaml/libs/mmap/xenmmap_stubs.c

[PATCH v1 2/2] backup_ptes: fix leak on realloc failure

2023-02-24 Thread Edwin Török
From: Edwin Török >From `man 2 realloc`: `If realloc() fails, the original block is left untouched; it is not freed or moved.` Found using GCC -fanalyzer: ``` | 184 | backup->entries = realloc(backup-&g

[PATCH v1 0/2] fix memory leaks reported by GCC -fanalyzer

2023-02-24 Thread Edwin Török
From: Edwin Török Using GCC 12.2.1 with -fanalyzer it has shown some memory leaks: This is how I enabled -fanalyzer (adding it to CFLAGS for toplevel configure didn't seem to work): ``` CFLAGS += $(call cc-option,$(CC),-fanalyzer) ``` Note that there are more errors shown than fixed here

[PATCH v1 1/2] xc_core_arch_map_p2m_tree_rw: fix memory leak

2023-02-24 Thread Edwin Török
From: Edwin Török Prior to bd7a29c3d0 'out' would've always been executed and memory freed, but that commit changed it such that it returns early and leaks. Found using gcc 12.2.1 `-fanalyzer`: ``` xg_core_x86.c: In function ‘xc_core_arch_map_p2m_tree_rw’: xg_core_x86.c:300:5:

[PATCH] x86/msr: fix X2APIC_LAST

2022-07-26 Thread Edwin Török
introduced in Icelake, so this commit should be backported to Xen versions supporting Icelake. Backport: 4.13+ Signed-off-by: Edwin Török --- xen/arch/x86/include/asm/msr-index.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch

[PATCH v2] x86/msr: fix X2APIC_LAST

2022-07-26 Thread Edwin Török
architectural MSR. The new MSR in this range appears to have been introduced in Icelake, so this commit should be backported to Xen versions supporting Icelake. Backport: 4.13+ Signed-off-by: Edwin Török --- Notes: Changed since v1: * include version of Intel SDM where the change occured

[PATCH v1 7/7] tools/ocaml/libs/eventchn: do not leak event channels and OCaml 5.0 compat

2022-07-29 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/libs/eventchn/xeneventchn_stubs.c | 29 +-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/tools/ocaml/libs/eventchn/xeneventchn_stubs.c b/tools/ocaml/libs/eventchn/xeneventchn_stubs.c index f889a7a2e4..c0d57e2954 100644 --

[PATCH v1 0/7] tools/ocaml code and build cleanups

2022-07-29 Thread Edwin Török
https://github.com/edwintorok/xen/compare/private/edvint/public?expand=1 Edwin Török (7): tools/ocaml/Makefile: do not run ocamldep during make clean tools/ocaml/*/Makefile: generate paths.ml from configure tools/ocaml/*/dune: dune based build system tools/ocaml: Makefile to drive dune

[PATCH v1 2/7] tools/ocaml/*/Makefile: generate paths.ml from configure

2022-07-29 Thread Edwin Török
functional change. Signed-off-by: Edwin Török --- tools/configure | 4 +++- tools/configure.ac| 2 ++ tools/ocaml/libs/xs/Makefile | 5 - tools/ocaml/libs/xs/paths.ml.in | 1 + tools/ocaml/xenstored/Makefile| 5 - tools/ocaml/xenstored/paths.ml.in | 4

[PATCH v1 6/7] tools/ocaml/libs/xb: hide type of Xb.t

2022-07-29 Thread Edwin Török
lementation in the future without breaking code that relies on it. No functional change. Signed-off-by: Edwin Török --- tools/ocaml/libs/xb/xb.ml | 3 +++ tools/ocaml/libs/xb/xb.mli | 9 ++--- tools/ocaml/xenstored/connection.ml | 8 ++-- 3 files changed, 7 insertions(

[PATCH v1 3/7] tools/ocaml/*/dune: dune based build system

2022-07-29 Thread Edwin Török
Dune. Using version 2.1 of Dune build language here, because that is the one available in Ubuntu Focal (part of the CI here). No functional change. Signed-off-by: Edwin Török --- tools/.gitignore | 7 + tools/dune | 5 tools/dune-project

[PATCH v1 1/7] tools/ocaml/Makefile: do not run ocamldep during make clean

2022-07-29 Thread Edwin Török
ke clean -j8 -s Performance counter stats for 'make clean -j8 -s' (5 runs): 2.7325 +- 0.0138 seconds time elapsed ( +- 0.51% ) ``` No functional change. Signed-off-by: Edwin Török --- tools/ocaml/Makefile.rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/oca

[PATCH v1 4/7] tools/ocaml: Makefile to drive dune

2022-07-29 Thread Edwin Török
d it doesn't support including external files. But could be generated by configure? LD_LIBRARY_PATH needs to be set, because even with -Wl,-rpath executables wouldn't be able to run using the just-built libraries, unless we'd also link all the transitive dependencies of libs. No functional

[PATCH v1 5/7] tools/ocaml: fix compiler warnings

2022-07-29 Thread Edwin Török
Fix compiler warning about: * unused value * ambiguous documentation comment * non-principal type inference (compiler version dependent) No functional change. Signed-off-by: Edwin Török --- tools/ocaml/xenstored/connection.ml | 2 +- tools/ocaml/xenstored/process.ml| 5 +++-- 2 files

[RFC PATCH] tools/configure: require OCaml >= 4.06.1 for oxenstored

2022-07-29 Thread Edwin Török
-compilation using Dune. The unikernel itself also uses Solo5 instead of MiniOS, so the OCaml code in stubdom/ is probably stale. Signed-off-by: Edwin Török Cc: Christian Lindig --- tools/configure| 2 +- tools/configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools

[PATCH v1 3/5] tools/ocaml/libs/xc: add hvm_param_get binding

2022-11-30 Thread Edwin Török
should be performed on the OCaml side on it. (this is not a new problem with this binding, but worth mentioning given the difference in types) Signed-off-by: Edwin Török --- tools/ocaml/libs/xc/xenctrl.ml | 44 tools/ocaml/libs/xc/xenctrl.ml

[PATCH v1 5/5] CODING_STYLE: add .clang-format

2022-11-30 Thread Edwin Török
s to compile due to the missing uint32_t define. Does not yet reformat any code. No functional change. Signed-off-by: Edwin Török --- tools/ocaml/.clang-format | 9 + 1 file changed, 9 insertions(+) create mode 100644 tools/ocaml/.clang-format diff --git a/tools/ocaml/.clang-format b

[PATCH v1 1/5] CODING-STYLE: add .editorconfig to clarify indentation uses spaces

2022-11-30 Thread Edwin Török
hat do not (want to) use it. It also won't cause re-indentation of existing files when edited, only newly added lines would follow the convention. No functional change. Signed-off-by: Edwin Török --- .editorconfig | 20 1 file changed, 20 insertions(+) create mode 10064

[PATCH v1 4/5] tools/ocaml/libs/xb: add missing stdint.h

2022-11-30 Thread Edwin Török
xs_wire.h fails to compile without this, and a slight rearrangement of header includes (e.g. by clang-format) could cause the file to fail to compile. Be more robust and include the needed header file. --- tools/ocaml/libs/xb/xenbus_stubs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tool

[PATCH v1 0/5] OCaml bindings for hvm_param_get and xc_evtchn_status

2022-11-30 Thread Edwin Török
ither. It doesn't yet reformat anything with it, just allows someone that submits patches to use it if desired (e.g. on new code). Edwin Török (5): CODING-STYLE: add .editorconfig to clarify indentation uses spaces tools/ocaml/libs/xc: add binding to xc_evtchn_status tools/ocaml/li

[PATCH v1 2/5] tools/ocaml/libs/xc: add binding to xc_evtchn_status

2022-11-30 Thread Edwin Török
event channel port number from what it initially got booted with. The information provided here is similar to 'lstevtchn', but rather than parsing its output it queries the underlying API directly. Signed-off-by: Edwin Török --- tools/ocaml/libs/xc/xenctrl.ml | 14 +++ tools/oca

[PATCH v2 0/4] OCaml bindings for hvm_param_get and xc_evtchn_status

2022-12-02 Thread Edwin Török
Changes since v1: * dropped stdint.h patch, still being discussed on where to best fix it * addressed review comments (see individual patches' changes section) Edwin Török (4): CODING-STYLE: add .editorconfig to clarify indentation uses spaces tools/ocaml/libs/xc: add bindi

[PATCH v2 3/4] tools/ocaml/libs/xc: add hvm_param_get binding

2022-12-02 Thread Edwin Török
should be performed on the OCaml side on it. (this is not a new problem with this binding, but worth mentioning given the difference in types) Signed-off-by: Edwin Török --- Changes since v1: * drop accidental extra numbers in variant names * use 'val' instead of 'result' f

[PATCH v2 1/4] CODING-STYLE: add .editorconfig to clarify indentation uses spaces

2022-12-02 Thread Edwin Török
hat do not (want to) use it. It also won't cause re-indentation of existing files when edited, only newly added lines would follow the convention. No functional change. Signed-off-by: Edwin Török --- .editorconfig | 20 1 file changed, 20 insertions(+) create mode 10064

[PATCH v2 2/4] tools/ocaml/libs/xc: add binding to xc_evtchn_status

2022-12-02 Thread Edwin Török
ueries the underlying API directly. Signed-off-by: Edwin Török --- Changes since v1: * drop paragraph about where this is used * add comment about max port * use Xeneventchn.virq_t instead of int, add a dependency: xc -> eventchn * initialize struct without memset-ing first * use 2 CAMLreturn, I found

  1   2   >