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

Re: [PATCH for-4.15] tools/tests: Introduce a test for acquire_resource

  • To: Oleksandr <olekstysh@xxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 4 Feb 2021 15:44:24 +0000
  • 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=gajSxu+YPkD9OLVK68Ew0Ph8EwEK3azAMNN+Wd3s/EA=; b=g1uSzXfJUYsRPrwqECRwpkqKDEoZAhY86shlxbKzlsk9DH9tmwY8Wm2EBJRx+D22g8hv40POl5JyRvetEnunjN2yfH9gvI67cvkb0Ns5HqgPyPIFaxxJuNuq5CYrQsFKnFJSUroxy2tnhj3+XSk8+9LNrJA6yn4hJ9H97kfHekOqc9ajvFytTXrMfTiJkOlbVNLq44RFmuecYz+RvNf8N6RQtS4gNEwS6IEUOpuOkt7XyrGe7g1h36tBpAmjBmeDohoqFEkXj+/MDEjKCjLLCFMkIao9Jle6LO4cX8CrncbSdzxTFZCqBl7JVUPXnPX3oc2xIRVqG9ZOHtEt9yD/HQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IXgbBce77C1w1i8z+jgr7GaHCUmU0Ekn2io0Tgd6StsqLQsR3qNL8TxsxnJn+uzpkNCbkEGcUAA/dmdSe/ra0S2SSYH5zvEwURESzwagtx0X+cuhMEVl5KgQe6bEX1uYsvpLSiEopK7CB3NBhtBwqBtayw7zgO1deFc+7WMn/pDc2xKPTb0b9Ww6/n0RSJTlupbUfodW2TD7O5fcRzxYiDJQ09kf+0/yPDuSSKFznHSdun+ctwn2O7UQCi5wUksaQET2nRbqtLjwFnNTxB4QCh9uBTdACbtQg4MtHq0un7GqgYPUQdYHxO2A7UNgOdLuJAYmyngKN3lIpaI48ujECQ==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 04 Feb 2021 15:44:47 +0000
  • Ironport-sdr: C2USyzTDgFgdyWogLbozy1r19L28oH9JTvuGVD2/4YVkH6uNtYTZl7f3tOaRBds/1Q9tCgsP1R pSdd0/jaL9AnrAgTxmPHpH3kzV/6aTOg8Iydkuawzs3vX2SZjCzBeLD0hcJh2wXHucWCPhOPr3 VrTbQ2fcqYbtjRLOtepPM0vhVxjUKMCnP4sUxd5gOnGoafcM9nCbozm4k/CqU0yisXEZAXs6Ww 1fVQPscseI3RBSCBG+SuIuhpLwWb7ovKGyrlaArpOez0RKWQT5/WXWgMk8D7vEzcGuW7snlKsw QL0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04/02/2021 15:38, Oleksandr wrote:

Hi Andrew.
[Sorry for the possible format issues]

On Tue, Feb 2, 2021 at 9:10 PM Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
For now, simply try to map 40 frames of grant table.  This catches most of the
basic errors with resource sizes found and fixed through the 4.15 dev window.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Ian Jackson <iwj@xxxxxxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
CC: Oleksandr <olekstysh@xxxxxxxxx>

Fails against current staging:

  XENMEM_acquire_resource tests
  Test x86 PV
    d7: grant table
      Fail: Map 7 - Argument list too long
  Test x86 PVH
    d8: grant table
      Fail: Map 7 - Argument list too long

The fix has already been posted:
  [PATCH v9 01/11] xen/memory: Fix mapping grant tables with XENMEM_acquire_resource

and the fixed run is:

  XENMEM_acquire_resource tests
  Test x86 PV
    d7: grant table
  Test x86 PVH
    d8: grant table

ARM folk: would you mind testing this?  I'm pretty sure the create parameters
are suitable, but I don't have any way to test this.
Yes, as it was agreed on IRC, I will test this today's evening and inform about the results)

OK, well, I decided to test right away because going to be busy in the evening)

I am based on:
9dc687f x86/debug: fix page-overflow bug in dbg_rw_guest_mem

I noticed the error during building this test in my Yocto environment on Arm:

/media/b/build/build/tmp/work/x86_64-xt-linux/dom0-image-thin-initramfs/1.0-r0/repo/build/tmp/work/aarch64-poky-linux/xen/4.14.0+gitAUTOINC+e00e0f38c3-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/8.2.0/ld: test-resource.o: undefined reference to symbol 'xendevicemodel_open@@VERS_1.0'
/media/b/build/build/tmp/work/x86_64-xt-linux/dom0-image-thin-initramfs/1.0-r0/repo/build/tmp/work/aarch64-poky-linux/xen/4.14.0+gitAUTOINC+e00e0f38c3-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/8.2.0/ld: /media/b/build/build/tmp/work/x86_64-xt-linux/dom0-image-thin-initramfs/1.0-r0/repo/build/tmp/work/aarch64-poky-linux/xen/4.14.0+gitAUTOINC+e00e0f38c3-r0/git/tools/tests/resource/../../../tools/libs/devicemodel/libxendevicemodel.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:38: recipe for target 'test-resource' failed

I didn't investigate whether it is related or not. I just added as following:

diff --git a/tools/tests/resource/Makefile b/tools/tests/resource/Makefile
index 8a3373e..03b19ef 100644
--- a/tools/tests/resource/Makefile
+++ b/tools/tests/resource/Makefile
@@ -32,6 +32,7 @@ CFLAGS += $(APPEND_CFLAGS)
 LDFLAGS += $(LDLIBS_libxenctrl)
 LDFLAGS += $(LDLIBS_libxenforeignmemory)
+LDFLAGS += $(LDLIBS_libxendevicemodel)
 test-resource: test-resource.o

Urgh yes - I didn't fully strip out the libxendevicemodel uses.  I'll fix that, rather than having this test link against a library which it doesn't use (yet).

I got the following result without and with "[PATCH v9 01/11] xen/memory: Fix mapping grant tables with XENMEM_acquire_resource"

root@generic-armv8-xt-dom0:~# test-resource
XENMEM_acquire_resource tests
Test ARM
  d3: grant table
xenforeignmemory: error: ioctl failed: Invalid argument
    Fail: Get size: 22 - Invalid argument

Ah yes - you also need a bugfix in the dom0 kernel.  "xen/privcmd: allow fetching resource sizes" which is in mainline, and also backported to the LTS trees.

However, this did get past the bit I wasn't sure about for ARM, which is good.




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