[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




Hi Andrew


On 04.02.21 17:44, Andrew Cooper wrote:
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)
 LDFLAGS += $(APPEND_LDFLAGS)
 
 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.

Well, my dom0 Linux is old)

uname -a
Linux generic-armv8-xt-dom0 4.14.75-ltsi-yocto-tiny #1 SMP PREEMPT Thu Nov 5 10:52:32 UTC 2020 aarch64 GNU/Linux
so I use ported "xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE".
I didn't find "xen/privcmd: allow fetching resource sizes" for my Linux version, so I backported it by myself.

So, 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
  d7: grant table
(XEN) grant_table.c:1854:d0v1 Expanding d7 grant table from 1 to 32 frames
(XEN) grant_table.c:1854:d0v1 Expanding d7 grant table from 32 to 40 frames

[I didn't test without your patch]


Hope that helps.



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

~Andrew
-- 
Regards,

Oleksandr Tyshchenko

 


Rackspace

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