[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 00/17] live update and gnttab patches


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Edwin Torok <edvin.torok@xxxxxxxxxx>
  • Date: Wed, 12 May 2021 10:10:23 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=49NqqAUb/f9b6xqL4ZGzsx4JsxgsR90+zv1EeNS7iPY=; b=TZvbzof4XqULQvsJQ/APICaHRVQ+9Wl0P+79ZHWaysCb+FaroPpDN7buYltL/Acyz7oj7W4MCSiSgo/B/LPDEjUhLzw4wKFt1bmtigE6sNjj3IZ2Fqbh91eMUnY7wWOeVq7Xpr29zMnwwlm+DXbQDKXP+6SjSgXhhysUTOC0MJC5vKiKbP0OmGnD1mZKejb7l501DjN3UGEc1o7+v0PWTjuyfmMtjOwvTGbsXpgnArVX++G3wwns0aiXv7IiDI1oPxfSzfMKgaKJ54Ma8+l5GWeljpc4hJMiXdSBkNYVSodg3L4f11n8zOhPLmRQfFNwVrzgaTiH2YMXx9J1GxVt+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cHThLjmNj+xxCTjWhtrtIO7bKKS+QQkfnv4lACqjyIa3632imPkyhEKDSnBEVpl34ACdU3ohqXrIoc2p0t800UFTSdM1ZcfGuhFEUuIDMC1dngq+K6TUMxceODJBsw5Du/VtB1gMwm2RtYQtaVp9x6RFs6r+SbOScpUG2qVX3yY3Yypuz50SL0luMQvAMfEGbXW3wF8q+bTeFRfw0HOhSKVorn7zxZH5wLgLhZSbk+xF1QDj2LMJscGhyfetncuUZa2A4R9R3dXNa2Sl8zskNhLOE/kVQS0vsNYFEFx6PxguBlsHRMzXixnxPx2MgfhaOwl63uPkZfFERgCRlCOXUg==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "julien@xxxxxxx" <julien@xxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "jgross@xxxxxxxx" <jgross@xxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>, "iwj@xxxxxxxxxxxxxx" <iwj@xxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "dave@xxxxxxxxxx" <dave@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>
  • Delivery-date: Wed, 12 May 2021 10:10:50 +0000
  • Ironport-hdrordr: A9a23:VtM9D6yYanLDy87x7+gHKrPw1r1zdoMgy1knxilNoHxuH/BwWf rPoB17726RtN91YhsdcL+7V5VoLUmzyXcX2/h1AV7BZniEhILAFugLgbcKqweKJ8SUzJ8+6U 4PSclD4N2bNykGsS75ijPIb+rJFrO8gd+VbeS19QYScelzAZsQiDuQkmygYzZLrA8tP+teKL OsovBpihCHYnotYsGyFhA+LpL+T42iruOeXfYebSRXkDWzsQ==
  • Ironport-sdr: Olt9xyHhBEzydiYP+HW1aDS1aNiVqnilQRkVblpWh3dgudQY4lSKsZcrsppoPSkbB+zgdJdun1 DnEMM4QvxBLznD/HnepiaBF8dEsLxWmIbz/fU8NFebRVVA3acMqfyoymJ/+w3hPU1XyfNYtxtQ +YOobRbOx2iTpcBh9P60/uwi3byR8JWH+b8na7PZhjJQ9a5xXgGGB1H5XYeDT4LeiJkl0EvYrZ ujDlsHhLEodELYnVCdeO//HjVvHCiOHhozCtb9mr5sNyOzZ14HY3MZM9uMv9MUidDCmvWptjLU 7lg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXRpBYbSP9+kXyy06RGaCma1VeS6retOQAgADsBAA=
  • Thread-topic: [PATCH v2 00/17] live update and gnttab patches

On Tue, 2021-05-11 at 21:05 +0100, Andrew Cooper wrote:
> On 11/05/2021 19:05, Edwin Török wrote:
> > These patches have been posted previously.
> > The gnttab patches (tools/ocaml/libs/mmap) were not applied at the
> > time
> > to avoid conflicts with an in-progress XSA.
> > The binary format live-update and fuzzing patches were not applied
> > because it was too close to the next Xen release freeze.
> > 
> > The patches depend on each-other: live-update only works correctly
> > when the gnttab
> > patches are taken too (MFN is not part of the binary live-update
> > stream),
> > so they are included here as a single series.
> > The gnttab patches replaces one use of libxenctrl with stable
> > interfaces, leaving one unstable
> > libxenctrl interface used by oxenstored.
> > 
> > The 'vendor external dependencies' may be optional, it is useful to
> > be part
> > of a patchqueue in a specfile so that you can build everything
> > without external dependencies,
> > but might as well commit it so everyone has it easily available not
> > just XenServer.
> > 
> > Note that the live-update fuzz test doesn't yet pass, it is still
> > able to find bugs.
> > However the reduced version with a fixed seed used as a unit test
> > does pass,
> > so it is useful to have it committed, and further improvements can
> > be made later
> > as more bugs are discovered and fixed.
> > 
> > Edwin Török (17):
> >   docs/designs/xenstore-migration.md: clarify that deletes are
> > recursive
> >   tools/ocaml: add unit test skeleton with Dune build system
> >   tools/ocaml: vendor external dependencies for convenience
> >   tools/ocaml/xenstored: implement the live migration binary format
> >   tools/ocaml/xenstored: add binary dump format support
> >   tools/ocaml/xenstored: add support for binary format
> >   tools/ocaml/xenstored: validate config file before live update
> >   Add structured fuzzing unit test
> >   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/mmap: mark mmap/munmap as blocking
> >   tools/ocaml/libs/xb: import gnttab stubs from mirage
> >   tools/ocaml: safer Xenmmap interface
> >   tools/ocaml/xenstored: use gnttab instead of xenctrl's
> >     foreign_map_range
> >   tools/ocaml/xenstored: don't store domU's mfn of ring page
> >   tools/ocaml/libs/mmap: Clean up unused read/write
> 
> Gitlab CI reports failures across the board in Debian Stretch 32-bit
> builds.  All logs
> https://gitlab.com/xen-project/patchew/xen/-/pipelines/301146112 but
> the
> tl;dr seems to be:
> 
> File "disk.ml", line 179, characters 26-37:
> Error: Integer literal exceeds the range of representable integers of
> type int

Thanks, this should fix it, I refreshed my git tree (there is also a
fix there for the older version of Make):
https://gitlab.com/xen-project/patchew/xen/-/pipelines/301146112

Not sure whether it is worth continuing to support 32-bit i686 builds,
any modern Intel/AMD CPU would be 64-bit capable, but perhaps 32-bit is
still popular in the ARM world and keeping 32-bit Intel supported is
the easiest way to build-test it?

diff --git a/tools/ocaml/xenstored/disk.ml
b/tools/ocaml/xenstored/disk.ml
index 59794324e1..b7678af87f 100644
--- a/tools/ocaml/xenstored/disk.ml
+++ b/tools/ocaml/xenstored/disk.ml
@@ -176,7 +176,7 @@ let write store =
            output_byte ch i
 
        let w32 ch v =
-           assert (v >= 0 && v <= 0xFFFF_FFFF);
+           assert (v >= 0 && Int64.of_int v <= 0xFFFF_FFFFL);
            output_binary_int ch v
 
        let pos = pos_out
@@ -213,7 +213,7 @@ let write store =
 
        let r32 t =
            (* read unsigned 32-bit int *)
-           let r = input_binary_int t land 0xFFFF_FFFF in
+           let r = Int64.logand (Int64.of_int (input_binary_int t))
0xFFFF_FFFFL |> Int64.to_int in
            assert (r >= 0);
            r
 
@@ -293,7 +293,7 @@ module LiveRecord = struct
        write_record t Type.global_data 8 @@ fun b ->
        O.w32 b (FD.to_int rw_sock);
                 (* TODO: this needs a unit test/live update test too!
*)
-       O.w32 b 0xFFFF_FFFF
+       O.w32 b 0x3FFF_FFFF
 
    let read_global_data t ~len f =
        read_expect t "global_data" 8 len;
> 
> ~Andrew

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.