From patchwork Thu Nov 30 03:29:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaoqin Huang X-Patchwork-Id: 13474044 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DzNQbfWH" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9225010D0 for ; Wed, 29 Nov 2023 19:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701315010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ww/G23VY72lofFkj/eKFHI/9f21iUPOtr0q5DiHkEsk=; b=DzNQbfWHJDwGuUfIQyHMJQ8cvrkWqyQf2+frhvOue2+jjvcPS99/O+EqzJQMD22tmalgg4 cFrO2ADk2aTrPaLCtlCOKikUZNvwOsDU8mSHTyvrTrPqw30tZbwoQofqlflLjr6idhdk8J FSKtVV+/uTD8CrqlvzA9bVBP/QQV6Ss= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-UC0XSGceN8aF_tBiCGLWKQ-1; Wed, 29 Nov 2023 22:30:06 -0500 X-MC-Unique: UC0XSGceN8aF_tBiCGLWKQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 928643C0008D; Thu, 30 Nov 2023 03:30:05 +0000 (UTC) Received: from virt-mtcollins-01.lab.eng.rdu2.redhat.com (virt-mtcollins-01.lab.eng.rdu2.redhat.com [10.8.1.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88D94112130C; Thu, 30 Nov 2023 03:30:05 +0000 (UTC) From: Shaoqin Huang To: Andrew Jones , kvmarm@lists.linux.dev Cc: Shaoqin Huang , Nico Boehr , Thomas Huth , Ricardo Koller , Sean Christopherson , Colton Lewis , Nikos Nikoleris , Nina Schoetterl-Glausch , kvm@vger.kernel.org Subject: [kvm-unit-tests PATCH v2 1/3] runtime: Fix the missing last_line Date: Wed, 29 Nov 2023 22:29:38 -0500 Message-Id: <20231130032940.2729006-2-shahuang@redhat.com> In-Reply-To: <20231130032940.2729006-1-shahuang@redhat.com> References: <20231130032940.2729006-1-shahuang@redhat.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 The last_line is deleted by the 2607d2d6 ("arm64: Add an efi/run script"). This lead to when SKIP test, the reason is missing. Fix the problem by adding last_line back. Fixes: 2607d2d6 ("arm64: Add an efi/run script") Signed-off-by: Shaoqin Huang Reviewed-by: Andrew Jones --- scripts/runtime.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index fc156f2f..c73fb024 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -149,7 +149,7 @@ function run() fi if [ ${skip} == true ]; then - print_result "SKIP" $testname "" "$last_line" + print_result "SKIP" $testname "" "$(tail -1 <<<"$log")" return 77 fi } From patchwork Thu Nov 30 03:29:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaoqin Huang X-Patchwork-Id: 13474042 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JYP7kThJ" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43FAA10CB for ; Wed, 29 Nov 2023 19:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701315010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NxZFFMDpBFfPPZndp5yBJyp7e8IUPc9SqT8KXrNXg6o=; b=JYP7kThJ7n3Y/XRq2OxPkChOuTc4+v8/rRqam8VdqEM9wbL9V96qJML6zmA4qUiM5zA7iw prscfUQiByYJxie7TCpxUsRnllmESA2VqlqZIM5wSBWir3uq5ADFY7i73L0LnhGUN5l0UX vjNFxiNy3Rq/34f+6nUdq62Heu6heo4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-261-O6XhYT-OPTO9OThdqPmiXw-1; Wed, 29 Nov 2023 22:30:06 -0500 X-MC-Unique: O6XhYT-OPTO9OThdqPmiXw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE750811E7B; Thu, 30 Nov 2023 03:30:05 +0000 (UTC) Received: from virt-mtcollins-01.lab.eng.rdu2.redhat.com (virt-mtcollins-01.lab.eng.rdu2.redhat.com [10.8.1.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id A66AF112130C; Thu, 30 Nov 2023 03:30:05 +0000 (UTC) From: Shaoqin Huang To: Andrew Jones , kvmarm@lists.linux.dev Cc: Shaoqin Huang , Thomas Huth , Nico Boehr , Colton Lewis , Nina Schoetterl-Glausch , Nikos Nikoleris , kvm@vger.kernel.org Subject: [kvm-unit-tests PATCH v2 2/3] runtime: arm64: Skip the migration tests when run on EFI Date: Wed, 29 Nov 2023 22:29:39 -0500 Message-Id: <20231130032940.2729006-3-shahuang@redhat.com> In-Reply-To: <20231130032940.2729006-1-shahuang@redhat.com> References: <20231130032940.2729006-1-shahuang@redhat.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 When running the migration tests on EFI, the migration will always fail since the efi/run use the vvfat format to run test, but the vvfat format does not support live migration. So those migration tests will always fail. Instead of waiting for fail everytime when run migration tests on EFI, skip those tests if running on EFI. Signed-off-by: Shaoqin Huang --- scripts/runtime.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index c73fb024..64d223e8 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -156,6 +156,10 @@ function run() cmdline=$(get_cmdline $kernel) if find_word "migration" "$groups"; then + if [ "{CONFIG_EFI}" == "y" ]; then + print_result "SKIP" $testname "" "migration tests are not supported with efi" + return 2 + fi cmdline="MIGRATION=yes $cmdline" fi if find_word "panic" "$groups"; then From patchwork Thu Nov 30 03:29:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaoqin Huang X-Patchwork-Id: 13474045 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="C9kh8hoF" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78A1410C3 for ; Wed, 29 Nov 2023 19:30:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701315009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WVR5GsqS24d6WcH08WD57szVg2J4c5+AD/A7s0nVVgU=; b=C9kh8hoFxqlX5hjgB0edwH+aWNhkej+v33/5Ffu/VQQEhRrZtZKpXWaxwraqWgm5IuJk/c jL9F+FATFVn5bR4VMIGXMtcK3p25kvUuBWTtHOJbD1V6JvZ0+mdCWp8PEnn7K6q7/4TcKJ hqlPmsAC0Qbgb3vOMTgO9yQK/0IvKwE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252-X35s0X4DPPaEUbYhyDvOvw-1; Wed, 29 Nov 2023 22:30:06 -0500 X-MC-Unique: X35s0X4DPPaEUbYhyDvOvw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D361E3814945; Thu, 30 Nov 2023 03:30:05 +0000 (UTC) Received: from virt-mtcollins-01.lab.eng.rdu2.redhat.com (virt-mtcollins-01.lab.eng.rdu2.redhat.com [10.8.1.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5FBD112130C; Thu, 30 Nov 2023 03:30:05 +0000 (UTC) From: Shaoqin Huang To: Andrew Jones , kvmarm@lists.linux.dev Cc: Shaoqin Huang , Alexandru Elisei , Eric Auger , Nikos Nikoleris , Ricardo Koller , kvm@vger.kernel.org Subject: [kvm-unit-tests PATCH v2 3/3] arm64: efi: Make running tests on EFI can be parallel Date: Wed, 29 Nov 2023 22:29:40 -0500 Message-Id: <20231130032940.2729006-4-shahuang@redhat.com> In-Reply-To: <20231130032940.2729006-1-shahuang@redhat.com> References: <20231130032940.2729006-1-shahuang@redhat.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Currently running tests on EFI in parallel can cause part of tests to fail, this is because arm/efi/run script use the EFI_CASE to create the subdir under the efi-tests, and the EFI_CASE is the filename of the test, when running tests in parallel, the multiple tests exist in the same filename will execute at the same time, which will use the same directory and write the test specific things into it, this cause chaotic and make some tests fail. For example, if we running the pmu-sw-incr and pmu-chained-counters and other pmu tests on EFI at the same time, the EFI_CASE will be pmu. So they will write their $cmd_args to the $EFI/TEST/pmu/startup.nsh at the same time, which will corrupt the startup.nsh file. And we can get the log which outputs: * pmu-sw-incr.log: - ABORT: pmu: Unknown sub-test 'pmu-mem-acce' * pmu-chained-counters.log - ABORT: pmu: Unknown sub-test 'pmu-mem-access-reliab' And the efi-tests/pmu/startup.nsh: @echo -off setvar fdtfile -guid 97ef3e03-7329-4a6a-b9ba-6c1fdcc5f823 -rt =L"dtb" pmu.efi pmu-mem-access-reliability setvar fdtfile -guid 97ef3e03-7329-4a6a-b9ba-6c1fdcc5f823 -rt =L"dtb" pmu.efi pmu-chained-sw-incr As you can see, when multiple tests write to the same startup.nsh file, it causes the issue. To Fix this issue, use the testname instead of the filename to create the subdir under the efi-tests. We use the EFI_TESTNAME to replace the EFI_CASE in script. Since every testname is specific, now the tests can be run parallel. It also considers when user directly use the arm/efi/run to run test, in this case, still use the filename. Besides, replace multiple $EFI_TEST/$EFI_CASE to the $EFI_CASE_DIR, this makes the script looks more clean and we don'e need to replace many EFI_CASE to EFI_TESTNAME. Signed-off-by: Shaoqin Huang Reviewed-by: Andrew Jones --- arm/efi/run | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arm/efi/run b/arm/efi/run index 6872c337..03bfbef4 100755 --- a/arm/efi/run +++ b/arm/efi/run @@ -24,6 +24,8 @@ fi : "${EFI_SRC:=$TEST_DIR}" : "${EFI_UEFI:=$DEFAULT_UEFI}" : "${EFI_TEST:=efi-tests}" +: "${EFI_TESTNAME:=$TESTNAME}" +: "${EFI_TESTNAME:=$(basename $1 .efi)}" : "${EFI_CASE:=$(basename $1 .efi)}" : "${EFI_VAR_GUID:=97ef3e03-7329-4a6a-b9ba-6c1fdcc5f823}" @@ -56,20 +58,20 @@ if [ "$EFI_CASE" = "_NO_FILE_4Uhere_" ]; then EFI_CASE=dummy fi -: "${EFI_CASE_DIR:="$EFI_TEST/$EFI_CASE"}" +: "${EFI_CASE_DIR:="$EFI_TEST/$EFI_TESTNAME"}" mkdir -p "$EFI_CASE_DIR" -cp "$EFI_SRC/$EFI_CASE.efi" "$EFI_TEST/$EFI_CASE/" -echo "@echo -off" > "$EFI_TEST/$EFI_CASE/startup.nsh" +cp "$EFI_SRC/$EFI_CASE.efi" "$EFI_CASE_DIR/" +echo "@echo -off" > "$EFI_CASE_DIR/startup.nsh" if [ "$EFI_USE_DTB" = "y" ]; then qemu_args+=(-machine acpi=off) FDT_BASENAME="dtb" - $(EFI_RUN=y $TEST_DIR/run -machine dumpdtb="$EFI_TEST/$EFI_CASE/$FDT_BASENAME" "${qemu_args[@]}") - echo "setvar fdtfile -guid $EFI_VAR_GUID -rt =L\"$FDT_BASENAME\"" >> "$EFI_TEST/$EFI_CASE/startup.nsh" + $(EFI_RUN=y $TEST_DIR/run -machine dumpdtb="$EFI_CASE_DIR/$FDT_BASENAME" "${qemu_args[@]}") + echo "setvar fdtfile -guid $EFI_VAR_GUID -rt =L\"$FDT_BASENAME\"" >> "$EFI_CASE_DIR/startup.nsh" fi -echo "$EFI_CASE.efi" "${cmd_args[@]}" >> "$EFI_TEST/$EFI_CASE/startup.nsh" +echo "$EFI_CASE.efi" "${cmd_args[@]}" >> "$EFI_CASE_DIR/startup.nsh" EFI_RUN=y $TEST_DIR/run \ -bios "$EFI_UEFI" \ - -drive file.dir="$EFI_TEST/$EFI_CASE/",file.driver=vvfat,file.rw=on,format=raw,if=virtio \ + -drive file.dir="$EFI_CASE_DIR/",file.driver=vvfat,file.rw=on,format=raw,if=virtio \ "${qemu_args[@]}"