From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B59B1C433EF for ; Sun, 31 Oct 2021 07:13:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 99D4160230 for ; Sun, 31 Oct 2021 07:13:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230209AbhJaHQH (ORCPT ); Sun, 31 Oct 2021 03:16:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44368 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbhJaHQG (ORCPT ); Sun, 31 Oct 2021 03:16:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635664415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=suAtYmJ7OQZiL5jR324hSERM5cwi98PPFWVwsXXFWhQ=; b=f7qrA5j4tzUq+QnA46wAMU9JfHfSvgRiuvTBaDkqwe8VgLdQKcAD0u0Y+MD69kMa/nCpz6 Z7BBvakzdm1JVhTlN5NnQ01pv+uBaOyPvi2WCNcln2R1vmlrCoOifhXGuziRIzvlXNHz6A EdT5KNUYMu4Kk8rum1UwS4LhNxQa9BA= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-335-vcwMNVKOMjyvcHIofjoO9w-1; Sun, 31 Oct 2021 03:13:33 -0400 X-MC-Unique: vcwMNVKOMjyvcHIofjoO9w-1 Received: by mail-ed1-f70.google.com with SMTP id f21-20020a0564021e9500b003dd77985601so12897850edf.9 for ; Sun, 31 Oct 2021 00:13:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=suAtYmJ7OQZiL5jR324hSERM5cwi98PPFWVwsXXFWhQ=; b=qmAsP7bNxuDIDRHMGD+rwtp1puO/PqzvYMQnvz9DgZGHZYvbhXoHFcaplqirIBxr3g +OUHL5YCtSJxnqqNnA9EjbquipeW2squZ2npXaEee/6h+hqLsTqe8AU2ZJFt9+lOmyAN 3OWgRedIx950Du2iXMXLDeYOMYsGLaX2sfHuz7qTg3ol1AZCQdlo3uVNkW7Rj/2l6z8R 11aTp8JqpcLacnYDaea/UqXwQpjznU6K6fjywSkFOqwhjFt8n/BmZ5GhGQrZ3i8/66W3 LReufBeS+606U/mJKQlGifyr02wNtkjeiBnlnfDSvl9jNMnbrHf4SwsqqtYRfUphtmO/ 6vbw== X-Gm-Message-State: AOAM5326Og1FQ9Xyb6Fu4eA9WDl2GMNa1wJJ4iz5MA7FJiBjDym/GdFc zRe6Zrx3olsCr3b+zcZOVCbpE1lEQCPuZDtlfT4KzpanNnKBIEt/iDJ0jaZ/0vWWviROjP584Qp xGUhaD9uHCYcS X-Received: by 2002:a05:6402:42d4:: with SMTP id i20mr29730211edc.337.1635664412380; Sun, 31 Oct 2021 00:13:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzydojA163WgKAw0lu6/M2WcCJ9GCa+mKvQQKb1CbM1/ZslrZG5dTGD52Zhk0SdkTLIi6GHFw== X-Received: by 2002:a05:6402:42d4:: with SMTP id i20mr29730181edc.337.1635664412165; Sun, 31 Oct 2021 00:13:32 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id s26sm4062964edq.6.2021.10.31.00.13.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 31 Oct 2021 00:13:31 -0700 (PDT) Message-ID: <969294ed-444b-3806-af2d-b94ed9eded80@redhat.com> Date: Sun, 31 Oct 2021 08:13:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [kvm-unit-tests PATCH v1 6/7] scripts: Generalize EFI check Content-Language: en-US To: Zixuan Wang , kvm@vger.kernel.org, drjones@redhat.com Cc: marcorr@google.com, erdemaktas@google.com, rientjes@google.com, seanjc@google.com, brijesh.singh@amd.com, Thomas.Lendacky@amd.com, varad.gautam@suse.com, jroedel@suse.de, bp@suse.de References: <20211031055634.894263-1-zxwang42@gmail.com> <20211031055634.894263-7-zxwang42@gmail.com> From: Paolo Bonzini In-Reply-To: <20211031055634.894263-7-zxwang42@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 31/10/21 06:56, Zixuan Wang wrote: > From: Marc Orr > > Previously, the scripts distinguish between seabios and UEFI via a > hard-coded env var in the EFI run script, `arch/x86/efi/run`. > Furthermore, this var is passed to the x86 run script, `arch/x86/run`, > and then not available in other scripts (or to other architectures). > > Replace the previous approach with a common helper function to check > whether the repo has been configured to run under EFI. The helper does > this by probing the `config.mak` file generated by `configure`. It should be possible to just use [ "${TARGET_EFI}" == "y" ] as the test: diff --git a/x86/efi/run b/x86/efi/run index 922b266..aacc691 100755 --- a/x86/efi/run +++ b/x86/efi/run @@ -52,7 +52,6 @@ popd || exit 2 # run in UEFI, some test cases, e.g. `x86/pmu.c`, require more free memory. A # simple fix is to increase the QEMU default memory size to 256MiB so that # UEFI's largest allocatable memory region is large enough. -EFI_RUN=y \ "$TEST_DIR/run" \ -drive file="$EFI_UEFI",format=raw,if=pflash,readonly=on \ -drive file.dir="$EFI_TEST/$EFI_CASE/",file.driver=vvfat,file.rw=on,format=raw,if=virtio \ diff --git a/x86/run b/x86/run index 4eba2b9..0a4dda9 100755 --- a/x86/run +++ b/x86/run @@ -39,12 +39,12 @@ fi command="${qemu} --no-reboot -nodefaults $pc_testdev -vnc none -serial stdio $pci_testdev" command+=" -machine accel=$ACCEL" -if ! [ "$EFI_RUN" ]; then +if [ ${TARGET_EFI} != "y" ]; then command+=" -kernel" fi command="$(timeout_cmd) $command" -if [ "$EFI_RUN" ]; then +if [ ${TARGET_EFI} = "y" ]; then # Set ENVIRON_DEFAULT=n to remove '-initrd' flag for QEMU (see # 'scripts/arch-run.bash' for more details). This is because when using # UEFI, the test case binaries are passed to QEMU through the disk Paolo