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

Re: [for-4.17 3/3] automation: Add a new job for testing boot time cpupools on arm64


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 5 Sep 2022 10:44:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AwDs2ed147tl2UT5ygQg74PPniA3YTFZLRnX5MVHE6o=; b=C/IY7D+/zaetrOW5aKAKO389REACpgw0mWSIU6OxSJ77fommDWaPVnisMC1m3iEKh7UGUPRHY9DeSerR7aU7ZYwdkDRdpA3CCx7g/aVnfop2y/JcOvnhgs01UUorUWjrTqef5Nwi1fT2nJ6w9JSjyhTJnYIdx04IBjtVPoavIqeAZkXZqhPRudiI4s0YNySsc6xvd6plEa/JGTgBcGdNLZ4RdACTdYO9WoNW6eU119OAa5aBS7cw3djhphvKMyq3g6C5ylCBbuCKTOJe8kLYdMuypvKWAwISMDPxrFZd4r8MInq0zmVl7zRAXyQBa/N2nEGhZ7qnf3mOgyqZAwwMFg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WlamoT03TVZfAQy1b1O06AxxseBENk/QEv+4k15SzhxOZ4AcGNudTnSvmlWi7qZ80O3oxXvbv/pQpAj59mhHmprWW6arUlzkSI02R1VOL+obt4j6nNclutLD2Yh/Kv8ryJcrK4Uqc2rj9c4plzn7gfVCVEmzA9+TzY2/4XlhZwhKBteVlBxLelPkbfvOsdQ9o75XiIkRdgORd49oVXWsdyB0UpsniJyvviN8oZw0de/nhYob6Ukc7rz4qXDMYMGNjfI1eGsKtQ6UUaUBS/ITCKx6trJoUDWghdO+geilP/qBBaRnp2WOiNmov4A09nheAWZ24AFOmU0w/aDfPNkXQw==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>
  • Delivery-date: Mon, 05 Sep 2022 08:44:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Stefano,

On 03/09/2022 01:49, Stefano Stabellini wrote:
> 
> 
> Currently this test fails with:
> 
> + fdtput binaries/virt-gicv2.dtb -p -t s /pl061@9030000 status disabled
> + [[ boot-cpupools == \b\o\o\t\-\c\p\u\p\o\o\l\s ]]
> ++ fdtget binaries/virt-gicv2.dtb -t x /cpus/cpu@1 phandle
> Error at 'phandle': FDT_ERR_NOTFOUND
My bad. The qemu version used by CI does not generate phandles for cpus.
So the fix is very straightforward and requires putting custom phandle for 
cpu@1.

diff --git a/automation/scripts/qemu-smoke-arm64.sh 
b/automation/scripts/qemu-smoke-arm64.sh
index c2184850293c..158d5665d71d 100755
--- a/automation/scripts/qemu-smoke-arm64.sh
+++ b/automation/scripts/qemu-smoke-arm64.sh
@@ -50,8 +50,9 @@ fdtput binaries/virt-gicv2.dtb -p -t s /pl061@9030000 status 
disabled
 
 if [[ "${test_variant}" == "boot-cpupools" ]]; then
     # Create cpupool node and assign it to domU0
-    cpu_phandle="$(fdtget binaries/virt-gicv2.dtb -t x /cpus/cpu@1 phandle)"
+    cpu_phandle="0xfffffe"
     cpupool_phandle="0xffffff"
+    fdtput binaries/virt-gicv2.dtb -p -t x /cpus/cpu@1 phandle $cpu_phandle
     fdtput binaries/virt-gicv2.dtb -p -t s /chosen/cpupool compatible 
xen,cpupool
     fdtput binaries/virt-gicv2.dtb -p -t x /chosen/cpupool cpupool-cpus 
$cpu_phandle
     fdtput binaries/virt-gicv2.dtb -p -t x /chosen/cpupool phandle 
$cpupool_phandle

> 
> Given my other comment below, I would leave this code as is.
> 
> 
>> +if [[ "${test_variant}" == "boot-cpupools" ]]; then
>> +    # Create cpupool node and assign it to domU0
>> +    cpu_phandle="$(fdtget binaries/virt-gicv2.dtb -t x /cpus/cpu@1 phandle)"
>> +    cpupool_phandle="0xffffff"
>> +    fdtput binaries/virt-gicv2.dtb -p -t s /chosen/cpupool compatible 
>> xen,cpupool
>> +    fdtput binaries/virt-gicv2.dtb -p -t x /chosen/cpupool cpupool-cpus 
>> $cpu_phandle
>> +    fdtput binaries/virt-gicv2.dtb -p -t x /chosen/cpupool phandle 
>> $cpupool_phandle
>> +    fdtput binaries/virt-gicv2.dtb -p -t x /chosen/domU0 domain-cpupool 
>> $cpupool_phandle
>> +
>> +    # Check if domU0 (id=1) is assigned to Pool-1
>> +    passed="${test_variant} test passed"
>> +    dom0_check="if xl list -c 1 | grep -q Pool-1; then echo ${passed}; fi"
>> +fi
> 
> I would prefer to keep the device tree editing here to a minimum and
> instead add boot-cpupool support in ImageBuilder and add CPUPOOL* config
> options to the existing config file for ImageBuilder created in this
> file below. This way, we keep this test cleaner and we help more the
> user by proving a way to set boot-cpupools more easily in general, also
> useful outside gitlab-ci.

I agree that ImageBuilder is a great tool. However, I would opt for keeping 
what I did because of the following:
- current release schedule (we could benefit from having a test for 4.17 
feature instead of waiting for the corresponding
  change to be done in ImageBuilder first and tested),
- test is already prepared and requires just a trivial fix,
- we should not enforce users willing to add tests to gitlab-ci to always 
prepare the ImageBuilder changes first.
  ImageBuilder is not meant to support all the features strictly because some 
of them require too much
  end-user knowledge and digging into device tree (it should stay as simple as 
possible),
- all in all we need to have a way to modify the dtb and fdtput is certainly 
better than sed as it does not
  require additional steps for decompilation/compilation and its commands look 
more clean than using sed transformation.

Let me know what you think.

On a side note, I can add boot-time cpupools support in ImageBuilder to my TODO 
list so that we can check if this is something
ImageBuilder should support. If yes, we can modify this test after the release.
I can already think of the following IB config options that would need to be 
introduced to properly support boot-time cpupools:
CPUPOOL[number] = "<list_of_cpus> <scheduler>" - to create cpupools
NUM_CPUPOOLS = "<number>" - to keep the number of created cpupools
DOMU_CPUPOOL[number] = "CPUPOOL[number]" - to assing domU to one of the created 
cpupools
So we already have 3 new options and the number of required sanity checks I can 
think of is significant.
Even then, we could easily trigger a failure e.g. if user assigns cpus of 
different type and does not pass hmp-unsafe=1.


~Michal



 


Rackspace

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