All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/11] OCaml fixes
@ 2022-12-16 18:25 Edwin Török
  2022-12-16 18:25 ` [PATCH v4 01/11] tools/ocaml/libs/{xb, mmap}: use Data_abstract_val wrapper Edwin Török
                   ` (11 more replies)
  0 siblings, 12 replies; 23+ messages in thread
From: Edwin Török @ 2022-12-16 18:25 UTC (permalink / raw)
  To: xen-devel
  Cc: Edwin Török, Christian Lindig, David Scott, Wei Liu,
	Anthony PERARD, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall, Stefano Stabellini

From: Edwin Török <edwin.torok@cloud.com>

Various OCaml fixes, some of which got Acked already.

Note: the Data_abstract_val got Acked but not yet commited because we thought
there might be a better way with finalizers/etc.
It is not possible to use finalizers here but there is a new followup patch in
this series that detects use-after-free and raises an exception without
trigerring undefined behaviour or crashes (see 'xb: check for unmapped ring').

The formatting patch was controversial during the 4.17 freeze, but master is
open now, and both the maintainer and myself agree with it,
so I think we should be able to do it now.
I've split it up into 2: add the formatting rules, and the actual formatting,
so that it is easier to redo the formatting patch when this gets backported.

I think we should just commit it rather than worry that there might be more
bugfixes to come after and attempt to rebase the bugfixes without the
formatting patch (introducing bugs in the process), especially that one of the
patches not yet posted to fix use of enter/leave changes quite a significant
part of all C stubs, and I don't have a way of developing those patches without
the formatting patch.

The rest are various bugfixes to the C bindings, and I have more to send
after I've tested them
(almost all uses of enter/leave blocking section are
wrong because they access OCaml values in non-safe ways with _H,
but the GC may have already moved them which would cause a crash,
that changes a lot of bindings and needs more testing before sending out,
and I've got a few more OCaml 5 fixes too).

Edwin Török (11):
  tools/ocaml/libs/{xb, mmap}: use Data_abstract_val wrapper
  tools/ocaml/xenstored/Makefile: use ocamldep -sort for linking order
  CODING_STYLE(tools/ocaml): add 'make format' and remove tabs
  tools/ocaml: run "make format"
  CODING-STYLE(tools/ocaml): add .editorconfig to clarify indentation
    uses spaces
  tools/ocaml: add .clang-format
  fixup! tools/ocaml/xenctrl: OCaml 5 support, fix use-after-free
  tools/ocaml/libs/mmap: mark mmap/munmap as blocking and raise
    Unix_error on failure
  tools/ocaml/libs/xb: check for unmapped ring before accessing it
  tools/ocaml/xenstored: validate config file before live update
  tools/ocaml/libs/xb: drop Xs_ring.write

 .editorconfig                                 |   20 +
 tools/ocaml/.clang-format                     |    9 +
 tools/ocaml/Makefile                          |    5 +
 tools/ocaml/libs/eventchn/xeneventchn_stubs.c |  194 +-
 tools/ocaml/libs/mmap/mmap_stubs.h            |    8 +-
 tools/ocaml/libs/mmap/xenmmap.ml              |    2 +-
 tools/ocaml/libs/mmap/xenmmap.mli             |    4 +-
 tools/ocaml/libs/mmap/xenmmap_stubs.c         |  123 +-
 tools/ocaml/libs/xb/op.ml                     |   76 +-
 tools/ocaml/libs/xb/packet.ml                 |   30 +-
 tools/ocaml/libs/xb/partial.ml                |   48 +-
 tools/ocaml/libs/xb/xb.ml                     |  416 ++--
 tools/ocaml/libs/xb/xb.mli                    |  106 +-
 tools/ocaml/libs/xb/xenbus_stubs.c            |   50 +-
 tools/ocaml/libs/xb/xs_ring.ml                |   31 +-
 tools/ocaml/libs/xb/xs_ring_stubs.c           |  221 +-
 tools/ocaml/libs/xc/xenctrl.ml                |  326 +--
 tools/ocaml/libs/xc/xenctrl.mli               |   12 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c           | 1556 ++++++-------
 tools/ocaml/libs/xentoollog/caml_xentoollog.h |    6 +-
 .../ocaml/libs/xentoollog/xentoollog_stubs.c  |  196 +-
 tools/ocaml/libs/xl/xenlight_stubs.c          | 2022 ++++++++---------
 tools/ocaml/libs/xs/queueop.ml                |   48 +-
 tools/ocaml/libs/xs/xs.ml                     |  220 +-
 tools/ocaml/libs/xs/xs.mli                    |   46 +-
 tools/ocaml/libs/xs/xsraw.ml                  |  300 +--
 tools/ocaml/libs/xs/xst.ml                    |   76 +-
 tools/ocaml/libs/xs/xst.mli                   |   20 +-
 tools/ocaml/test/dmesg.ml                     |   26 +-
 tools/ocaml/test/list_domains.ml              |    4 +-
 tools/ocaml/test/raise_exception.ml           |    4 +-
 tools/ocaml/test/xtl.ml                       |   28 +-
 tools/ocaml/xenstored/Makefile                |    6 +-
 tools/ocaml/xenstored/config.ml               |  156 +-
 tools/ocaml/xenstored/connection.ml           |  578 ++---
 tools/ocaml/xenstored/connections.ml          |  294 +--
 tools/ocaml/xenstored/disk.ml                 |  218 +-
 tools/ocaml/xenstored/domain.ml               |  116 +-
 tools/ocaml/xenstored/domains.ml              |  298 +--
 tools/ocaml/xenstored/event.ml                |   28 +-
 tools/ocaml/xenstored/history.ml              |   62 +-
 tools/ocaml/xenstored/logging.ml              |  478 ++--
 tools/ocaml/xenstored/packet.ml               |   20 +-
 tools/ocaml/xenstored/parse_arg.ml            |  132 +-
 tools/ocaml/xenstored/perms.ml                |  216 +-
 tools/ocaml/xenstored/poll.ml                 |   68 +-
 tools/ocaml/xenstored/poll.mli                |    4 +-
 tools/ocaml/xenstored/process.ml              | 1210 +++++-----
 tools/ocaml/xenstored/quota.ml                |   74 +-
 tools/ocaml/xenstored/select_stubs.c          |   62 +-
 tools/ocaml/xenstored/stdext.ml               |  190 +-
 tools/ocaml/xenstored/store.ml                |  752 +++---
 tools/ocaml/xenstored/symbol.ml               |    2 +-
 tools/ocaml/xenstored/syslog.ml               |   48 +-
 tools/ocaml/xenstored/syslog_stubs.c          |   68 +-
 tools/ocaml/xenstored/systemd_stubs.c         |   10 +-
 tools/ocaml/xenstored/transaction.ml          |  352 +--
 tools/ocaml/xenstored/trie.ml                 |  222 +-
 tools/ocaml/xenstored/trie.mli                |   22 +-
 tools/ocaml/xenstored/utils.ml                |  146 +-
 tools/ocaml/xenstored/xenstored.ml            |  987 ++++----
 61 files changed, 6569 insertions(+), 6483 deletions(-)
 create mode 100644 .editorconfig
 create mode 100644 tools/ocaml/.clang-format

--
2.34.1



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-12-19 13:33 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-16 18:25 [PATCH v4 00/11] OCaml fixes Edwin Török
2022-12-16 18:25 ` [PATCH v4 01/11] tools/ocaml/libs/{xb, mmap}: use Data_abstract_val wrapper Edwin Török
2022-12-16 22:40   ` Andrew Cooper
2022-12-19  9:06     ` Edwin Torok
2022-12-16 18:25 ` [PATCH v4 02/11] tools/ocaml/xenstored/Makefile: use ocamldep -sort for linking order Edwin Török
2022-12-16 18:25 ` [PATCH v4 03/11] CODING_STYLE(tools/ocaml): add 'make format' and remove tabs Edwin Török
2022-12-19  9:55   ` Christian Lindig
2022-12-19 11:52   ` Anthony PERARD
2022-12-19 13:32     ` Edwin Torok
2022-12-16 18:25 ` [PATCH v4 04/11] tools/ocaml: run "make format" Edwin Török
2022-12-16 18:25 ` [PATCH v4 05/11] CODING-STYLE(tools/ocaml): add .editorconfig to clarify indentation uses spaces Edwin Török
2022-12-19  9:59   ` Christian Lindig
2022-12-16 18:25 ` [PATCH v4 06/11] tools/ocaml: add .clang-format Edwin Török
2022-12-19 12:03   ` Anthony PERARD
2022-12-19 13:21     ` Edwin Torok
2022-12-16 18:25 ` [PATCH v4 07/11] fixup! tools/ocaml/xenctrl: OCaml 5 support, fix use-after-free Edwin Török
2022-12-16 18:25 ` [PATCH v4 08/11] tools/ocaml/libs/mmap: mark mmap/munmap as blocking and raise Unix_error on failure Edwin Török
2022-12-16 18:25 ` [PATCH v4 09/11] tools/ocaml/libs/xb: check for unmapped ring before accessing it Edwin Török
2022-12-16 18:25 ` [PATCH v4 10/11] tools/ocaml/xenstored: validate config file before live update Edwin Török
2022-12-19  9:37   ` Christian Lindig
2022-12-19  9:57     ` Edwin Torok
2022-12-16 18:25 ` [PATCH v4 11/11] tools/ocaml/libs/xb: drop Xs_ring.write Edwin Török
2022-12-19 10:54 ` [PATCH v4 00/11] OCaml fixes Christian Lindig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.