From patchwork Thu Feb 10 15:09:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12742062 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 784DDC433FE for ; Thu, 10 Feb 2022 15:09:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243381AbiBJPJm (ORCPT ); Thu, 10 Feb 2022 10:09:42 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243340AbiBJPJl (ORCPT ); Thu, 10 Feb 2022 10:09:41 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 55DF8128 for ; Thu, 10 Feb 2022 07:09:42 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1F6811042; Thu, 10 Feb 2022 07:09:42 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C5BBA3F718; Thu, 10 Feb 2022 07:09:40 -0800 (PST) From: Alexandru Elisei To: pbonzini@redhat.com, thuth@redhat.com, drjones@redhat.com, varad.gautam@suse.com, zixuanwang@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [kvm-unit-tests PATCH 1/4] configure: Fix whitespaces for the --gen-se-header help text Date: Thu, 10 Feb 2022 15:09:40 +0000 Message-Id: <20220210150943.1280146-2-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220210150943.1280146-1-alexandru.elisei@arm.com> References: <20220210150943.1280146-1-alexandru.elisei@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Replace some of the tabs with spaces to display the help text for the --gen-se-header option like this: --gen-se-header=GEN_SE_HEADER Provide an executable to generate a PV header requires --host-key-document. (s390x-snippets only) instead of: --gen-se-header=GEN_SE_HEADER Provide an executable to generate a PV header requires --host-key-document. (s390x-snippets only) Signed-off-by: Alexandru Elisei --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 2d9c3e051103..0ac9c85502ff 100755 --- a/configure +++ b/configure @@ -58,7 +58,7 @@ usage() { a PVM image with 'genprotimg' (s390x only) --gen-se-header=GEN_SE_HEADER Provide an executable to generate a PV header - requires --host-key-document. (s390x-snippets only) + requires --host-key-document. (s390x-snippets only) --page-size=PAGE_SIZE Specify the page size (translation granule) (4k, 16k or 64k, default is 64k, arm64 only) From patchwork Thu Feb 10 15:09:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12742064 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41D82C4332F for ; Thu, 10 Feb 2022 15:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243419AbiBJPJn (ORCPT ); Thu, 10 Feb 2022 10:09:43 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243340AbiBJPJn (ORCPT ); Thu, 10 Feb 2022 10:09:43 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 49276D4 for ; Thu, 10 Feb 2022 07:09:44 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0F8BB1042; Thu, 10 Feb 2022 07:09:44 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B5FE13F718; Thu, 10 Feb 2022 07:09:42 -0800 (PST) From: Alexandru Elisei To: pbonzini@redhat.com, thuth@redhat.com, drjones@redhat.com, varad.gautam@suse.com, zixuanwang@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [kvm-unit-tests PATCH 2/4] configure: Restrict --target-efi to x86_64 Date: Thu, 10 Feb 2022 15:09:41 +0000 Message-Id: <20220210150943.1280146-3-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220210150943.1280146-1-alexandru.elisei@arm.com> References: <20220210150943.1280146-1-alexandru.elisei@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Setting the --target-efi option for any architecture but x86_64 results in an error while trying to compile the tests: $ ./configure --arch=arm64 --cross-prefix=aarch64-linux-gnu- --target-efi $ make clean && make Makefile:46: *** Cannot build aarch64 tests as EFI apps. Stop. Which might come as a surprise for users, as the help message for the configure script makes no mention of an architectur being incompatible with the option. Document that --target-efi applies only to the x86_64 architecture and check for illegal usage in the configure script, instead of failing later, at compile time. Signed-off-by: Alexandru Elisei --- Makefile | 4 ---- configure | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4f4ad235fe0c..5af17f129ced 100644 --- a/Makefile +++ b/Makefile @@ -40,11 +40,7 @@ OBJDIRS += $(LIBFDT_objdir) # EFI App ifeq ($(TARGET_EFI),y) -ifeq ($(ARCH_NAME),x86_64) EFI_ARCH = x86_64 -else -$(error Cannot build $(ARCH_NAME) tests as EFI apps) -endif EFI_CFLAGS := -DTARGET_EFI # The following CFLAGS and LDFLAGS come from: # - GNU-EFI/Makefile.defaults diff --git a/configure b/configure index 0ac9c85502ff..6620e78ec09c 100755 --- a/configure +++ b/configure @@ -74,7 +74,7 @@ usage() { pl011,mmio32,ADDR Specify a PL011 compatible UART at address ADDR. Supported register stride is 32 bit only. - --target-efi Boot and run from UEFI + --target-efi Boot and run from UEFI (x86_64 only) EOF exit 1 } @@ -177,6 +177,11 @@ else fi fi +if [ "$target_efi" ] && [ "$arch" != "x86_64" ]; then + echo "--target-efi is not supported for $arch" + usage +fi + if [ -z "$page_size" ]; then [ "$arch" = "arm64" ] && page_size="65536" [ "$arch" = "arm" ] && page_size="4096" From patchwork Thu Feb 10 15:09:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12742065 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 225D1C433FE for ; Thu, 10 Feb 2022 15:09:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243447AbiBJPJq (ORCPT ); Thu, 10 Feb 2022 10:09:46 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243443AbiBJPJo (ORCPT ); Thu, 10 Feb 2022 10:09:44 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D0FA6D4 for ; Thu, 10 Feb 2022 07:09:45 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A011DD6E; Thu, 10 Feb 2022 07:09:45 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 51F963F718; Thu, 10 Feb 2022 07:09:44 -0800 (PST) From: Alexandru Elisei To: pbonzini@redhat.com, thuth@redhat.com, drjones@redhat.com, varad.gautam@suse.com, zixuanwang@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [kvm-unit-tests PATCH 3/4] configure: Make the --target option available to all architectures Date: Thu, 10 Feb 2022 15:09:42 +0000 Message-Id: <20220210150943.1280146-4-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220210150943.1280146-1-alexandru.elisei@arm.com> References: <20220210150943.1280146-1-alexandru.elisei@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The arm and arm64 architectures got the --target option to support running with either qemu or kvmtool as the virtual machine manager. Make --target valid for the other architectures, in which case qemu will be the only valid target. Generating the $TARGET variable in config.mak regardless of the architecture will make adding support for another VMM to run_tests.sh easier. Suggested-by: Andrew Jones Signed-off-by: Alexandru Elisei --- configure | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 6620e78ec09c..2720b7efd64a 100755 --- a/configure +++ b/configure @@ -22,7 +22,7 @@ pretty_print_stacks=yes environ_default=yes u32_long= wa_divide= -target= +target=qemu errata_force=0 erratatxt="$srcdir/errata.txt" host_key_document= @@ -38,8 +38,8 @@ usage() { Options include: --arch=ARCH architecture to compile for ($arch) --processor=PROCESSOR processor to compile for ($arch) - --target=TARGET target platform that the tests will be running on (qemu or - kvmtool, default is qemu) (arm/arm64 only) + --target=TARGET target platform that the tests will be running on (default is qemu) + (qemu or kvmtool for arm and arm64, qemu for all other architectures) --cross-prefix=PREFIX cross compiler prefix --cc=CC c compiler to use ($cc) --cflags=FLAGS extra options to be passed to the c compiler @@ -168,14 +168,22 @@ arch_name=$arch [ "$arch" = "aarch64" ] && arch="arm64" [ "$arch_name" = "arm64" ] && arch_name="aarch64" -if [ -z "$target" ]; then - target="qemu" -else +case "$target" in +qemu) + # All architectures support qemu as the target. + ;; +kvmtool) + # Only arm and arm64 support running under kvmtool. if [ "$arch" != "arm64" ] && [ "$arch" != "arm" ]; then - echo "--target is not supported for $arch" + echo "--target=$target is not supported for $arch" usage fi -fi + ;; +*) + echo "--target=$target is not supported for $arch" + usage + ;; +esac if [ "$target_efi" ] && [ "$arch" != "x86_64" ]; then echo "--target-efi is not supported for $arch" @@ -369,10 +377,8 @@ GENPROTIMG=${GENPROTIMG-genprotimg} HOST_KEY_DOCUMENT=$host_key_document TARGET_EFI=$target_efi GEN_SE_HEADER=$gen_se_header +TARGET=$target EOF -if [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then - echo "TARGET=$target" >> config.mak -fi cat < lib/config.h #ifndef _CONFIG_H_ From patchwork Thu Feb 10 15:09:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12742066 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF1D1C433FE for ; Thu, 10 Feb 2022 15:09:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243461AbiBJPJw (ORCPT ); Thu, 10 Feb 2022 10:09:52 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243443AbiBJPJs (ORCPT ); Thu, 10 Feb 2022 10:09:48 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 71E0AB88 for ; Thu, 10 Feb 2022 07:09:47 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3F65D1042; Thu, 10 Feb 2022 07:09:47 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E3A453F718; Thu, 10 Feb 2022 07:09:45 -0800 (PST) From: Alexandru Elisei To: pbonzini@redhat.com, thuth@redhat.com, drjones@redhat.com, varad.gautam@suse.com, zixuanwang@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [kvm-unit-tests PATCH RFC 4/4] Rename --target-efi to --efi-payload Date: Thu, 10 Feb 2022 15:09:43 +0000 Message-Id: <20220210150943.1280146-5-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220210150943.1280146-1-alexandru.elisei@arm.com> References: <20220210150943.1280146-1-alexandru.elisei@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Now that the --target configure option is available to all architectures, rename --target-efi to --efi-payload to avoid confusion between the two. Signed-off-by: Alexandru Elisei --- Makefile | 6 +++--- configure | 16 ++++++++-------- lib/x86/acpi.c | 4 ++-- lib/x86/amd_sev.h | 4 ++-- lib/x86/asm/page.h | 8 ++++---- lib/x86/asm/setup.h | 4 ++-- lib/x86/setup.c | 4 ++-- lib/x86/vm.c | 12 ++++++------ scripts/runtime.bash | 4 ++-- x86/Makefile.common | 6 +++--- x86/Makefile.x86_64 | 6 +++--- x86/access_test.c | 2 +- x86/efi/README.md | 2 +- x86/efi/run | 2 +- x86/run | 4 ++-- 15 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index 5af17f129ced..cc4b37ac6152 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ LIBFDT_archive = $(LIBFDT_objdir)/libfdt.a OBJDIRS += $(LIBFDT_objdir) # EFI App -ifeq ($(TARGET_EFI),y) +ifeq ($(EFI_PAYLOAD),y) EFI_ARCH = x86_64 -EFI_CFLAGS := -DTARGET_EFI +EFI_CFLAGS := -DEFI_PAYLOAD # The following CFLAGS and LDFLAGS come from: # - GNU-EFI/Makefile.defaults # - GNU-EFI/apps/Makefile @@ -81,7 +81,7 @@ COMMON_CFLAGS += $(fno_stack_protector) COMMON_CFLAGS += $(fno_stack_protector_all) COMMON_CFLAGS += $(wno_frame_address) COMMON_CFLAGS += $(if $(U32_LONG_FMT),-D__U32_LONG_FMT__,) -ifeq ($(TARGET_EFI),y) +ifeq ($(EFI_PAYLOAD),y) COMMON_CFLAGS += $(EFI_CFLAGS) else COMMON_CFLAGS += $(fno_pic) $(no_pie) diff --git a/configure b/configure index 2720b7efd64a..95a44ac7ff44 100755 --- a/configure +++ b/configure @@ -29,7 +29,7 @@ host_key_document= gen_se_header= page_size= earlycon= -target_efi= +efi_payload= usage() { cat <<-EOF @@ -74,7 +74,7 @@ usage() { pl011,mmio32,ADDR Specify a PL011 compatible UART at address ADDR. Supported register stride is 32 bit only. - --target-efi Boot and run from UEFI (x86_64 only) + --efi-payload Boot and run from UEFI (x86_64 only) EOF exit 1 } @@ -142,8 +142,8 @@ while [[ "$1" = -* ]]; do --earlycon) earlycon="$arg" ;; - --target-efi) - target_efi=y + --efi-payload) + efi_payload=y ;; --help) usage @@ -185,8 +185,8 @@ kvmtool) ;; esac -if [ "$target_efi" ] && [ "$arch" != "x86_64" ]; then - echo "--target-efi is not supported for $arch" +if [ "$efi_payload" ] && [ "$arch" != "x86_64" ]; then + echo "--efi-payload is not supported for $arch" usage fi @@ -286,7 +286,7 @@ if [ -f "$srcdir/$testdir/run" ]; then fi testsubdir=$testdir -if [ -n "$target_efi" ]; then +if [ -n "$efi_payload" ]; then testsubdir=$testdir/efi fi @@ -375,7 +375,7 @@ U32_LONG_FMT=$u32_long WA_DIVIDE=$wa_divide GENPROTIMG=${GENPROTIMG-genprotimg} HOST_KEY_DOCUMENT=$host_key_document -TARGET_EFI=$target_efi +EFI_PAYLOAD=$efi_payload GEN_SE_HEADER=$gen_se_header TARGET=$target EOF diff --git a/lib/x86/acpi.c b/lib/x86/acpi.c index 1a82ced0b90f..dbdc3fb3da85 100644 --- a/lib/x86/acpi.c +++ b/lib/x86/acpi.c @@ -1,7 +1,7 @@ #include "libcflat.h" #include "acpi.h" -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD struct rsdp_descriptor *efi_rsdp = NULL; void set_efi_rsdp(struct rsdp_descriptor *rsdp) @@ -34,7 +34,7 @@ static struct rsdp_descriptor *get_rsdp(void) return rsdp; } -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ void* find_acpi_table_addr(u32 sig) { diff --git a/lib/x86/amd_sev.h b/lib/x86/amd_sev.h index 6a10f845daba..e513b82e1634 100644 --- a/lib/x86/amd_sev.h +++ b/lib/x86/amd_sev.h @@ -12,7 +12,7 @@ #ifndef _X86_AMD_SEV_H_ #define _X86_AMD_SEV_H_ -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD #include "libcflat.h" #include "desc.h" @@ -58,6 +58,6 @@ void setup_ghcb_pte(pgd_t *page_table); unsigned long long get_amd_sev_c_bit_mask(void); unsigned long long get_amd_sev_addr_upperbound(void); -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ #endif /* _X86_AMD_SEV_H_ */ diff --git a/lib/x86/asm/page.h b/lib/x86/asm/page.h index c25bc66b7aa4..bfa855cd3204 100644 --- a/lib/x86/asm/page.h +++ b/lib/x86/asm/page.h @@ -25,11 +25,11 @@ typedef unsigned long pgd_t; #define LARGE_PAGE_SIZE (1024 * PAGE_SIZE) #endif -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD /* lib/x86/amd_sev.c */ extern unsigned long long get_amd_sev_c_bit_mask(void); extern unsigned long long get_amd_sev_addr_upperbound(void); -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ #define PT_PRESENT_MASK (1ull << 0) #define PT_WRITABLE_MASK (1ull << 1) @@ -47,11 +47,11 @@ extern unsigned long long get_amd_sev_addr_upperbound(void); */ #define PT_ADDR_UPPER_BOUND_DEFAULT (51) -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD #define PT_ADDR_UPPER_BOUND (get_amd_sev_addr_upperbound()) #else #define PT_ADDR_UPPER_BOUND (PT_ADDR_UPPER_BOUND_DEFAULT) -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ #define PT_ADDR_LOWER_BOUND (PAGE_SHIFT) #define PT_ADDR_MASK GENMASK_ULL(PT_ADDR_UPPER_BOUND, PT_ADDR_LOWER_BOUND) diff --git a/lib/x86/asm/setup.h b/lib/x86/asm/setup.h index dbfb2a22bc1b..c0a1e0934dbb 100644 --- a/lib/x86/asm/setup.h +++ b/lib/x86/asm/setup.h @@ -3,7 +3,7 @@ unsigned long setup_tss(u8 *stacktop); -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD #include "x86/acpi.h" #include "x86/apic.h" #include "x86/processor.h" @@ -14,6 +14,6 @@ unsigned long setup_tss(u8 *stacktop); efi_status_t setup_efi(efi_bootinfo_t *efi_bootinfo); void setup_5level_page_table(void); -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ #endif /* _X86_ASM_SETUP_H_ */ diff --git a/lib/x86/setup.c b/lib/x86/setup.c index bbd34682b79e..64ea802d4f3d 100644 --- a/lib/x86/setup.c +++ b/lib/x86/setup.c @@ -167,7 +167,7 @@ void setup_multiboot(struct mbi_bootinfo *bi) initrd_size = mods->end - mods->start; } -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD /* From x86/efi/efistart64.S */ extern void load_idt(void); @@ -330,7 +330,7 @@ efi_status_t setup_efi(efi_bootinfo_t *efi_bootinfo) return EFI_SUCCESS; } -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ void setup_libcflat(void) { diff --git a/lib/x86/vm.c b/lib/x86/vm.c index 56be57be673a..110c2309defd 100644 --- a/lib/x86/vm.c +++ b/lib/x86/vm.c @@ -26,9 +26,9 @@ pteval_t *install_pte(pgd_t *cr3, pt_page = 0; memset(new_pt, 0, PAGE_SIZE); pt[offset] = virt_to_phys(new_pt) | PT_PRESENT_MASK | PT_WRITABLE_MASK | pte_opt_mask; -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD pt[offset] |= get_amd_sev_c_bit_mask(); -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ } pt = phys_to_virt(pt[offset] & PT_ADDR_MASK); } @@ -98,18 +98,18 @@ pteval_t *get_pte_level(pgd_t *cr3, void *virt, int pte_level) pteval_t *install_large_page(pgd_t *cr3, phys_addr_t phys, void *virt) { phys_addr_t flags = PT_PRESENT_MASK | PT_WRITABLE_MASK | pte_opt_mask | PT_PAGE_SIZE_MASK; -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD flags |= get_amd_sev_c_bit_mask(); -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ return install_pte(cr3, 2, virt, phys | flags, 0); } pteval_t *install_page(pgd_t *cr3, phys_addr_t phys, void *virt) { phys_addr_t flags = PT_PRESENT_MASK | PT_WRITABLE_MASK | pte_opt_mask; -#ifdef TARGET_EFI +#ifdef EFI_PAYLOAD flags |= get_amd_sev_c_bit_mask(); -#endif /* TARGET_EFI */ +#endif /* EFI_PAYLOAD */ return install_pte(cr3, 1, virt, phys | flags, 0); } diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 6d5fced94246..140f704ed2a0 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -82,7 +82,7 @@ function run() local accel="$8" local timeout="${9:-$TIMEOUT}" # unittests.cfg overrides the default - if [ "${TARGET_EFI}" == "y" ]; then + if [ "${EFI_PAYLOAD}" == "y" ]; then kernel=$(basename $kernel .flat) fi @@ -132,7 +132,7 @@ function run() last_line=$(premature_failure > >(tail -1)) && { skip=true - if [ "${TARGET_EFI}" == "y" ] && [[ "${last_line}" =~ "enabling apic" ]]; then + if [ "${EFI_PAYLOAD}" == "y" ] && [[ "${last_line}" =~ "enabling apic" ]]; then skip=false fi if [ ${skip} == true ]; then diff --git a/x86/Makefile.common b/x86/Makefile.common index ff02d9822321..b95a12372350 100644 --- a/x86/Makefile.common +++ b/x86/Makefile.common @@ -22,7 +22,7 @@ cflatobjs += lib/x86/acpi.o cflatobjs += lib/x86/stack.o cflatobjs += lib/x86/fault_test.o cflatobjs += lib/x86/delay.o -ifeq ($(TARGET_EFI),y) +ifeq ($(EFI_PAYLOAD),y) cflatobjs += lib/x86/amd_sev.o cflatobjs += lib/efi.o cflatobjs += x86/efi/reloc_x86_64.o @@ -44,7 +44,7 @@ KEEP_FRAME_POINTER := y FLATLIBS = lib/libcflat.a -ifeq ($(TARGET_EFI),y) +ifeq ($(EFI_PAYLOAD),y) .PRECIOUS: %.efi %.so %.so: %.o $(FLATLIBS) $(SRCDIR)/x86/efi/elf_x86_64_efi.lds $(cstart.o) @@ -89,7 +89,7 @@ tests-common = $(TEST_DIR)/vmexit.$(exe) $(TEST_DIR)/tsc.$(exe) \ # The following test cases are disabled when building EFI tests because they # use absolute addresses in their inline assembly code, which cannot compile # with the '-fPIC' flag -ifneq ($(TARGET_EFI),y) +ifneq ($(EFI_PAYLOAD),y) tests-common += $(TEST_DIR)/realmode.$(exe) endif diff --git a/x86/Makefile.x86_64 b/x86/Makefile.x86_64 index a3cb75ae5868..3765b3db1e08 100644 --- a/x86/Makefile.x86_64 +++ b/x86/Makefile.x86_64 @@ -1,7 +1,7 @@ cstart.o = $(TEST_DIR)/cstart64.o bits = 64 ldarch = elf64-x86-64 -ifeq ($(TARGET_EFI),y) +ifeq ($(EFI_PAYLOAD),y) exe = efi bin = so FORMAT = efi-app-x86_64 @@ -32,14 +32,14 @@ tests += $(TEST_DIR)/rdpru.$(exe) tests += $(TEST_DIR)/pks.$(exe) tests += $(TEST_DIR)/pmu_lbr.$(exe) -ifeq ($(TARGET_EFI),y) +ifeq ($(EFI_PAYLOAD),y) tests += $(TEST_DIR)/amd_sev.$(exe) endif # The following test cases are disabled when building EFI tests because they # use absolute addresses in their inline assembly code, which cannot compile # with the '-fPIC' flag -ifneq ($(TARGET_EFI),y) +ifneq ($(EFI_PAYLOAD),y) tests += $(TEST_DIR)/access_test.$(exe) tests += $(TEST_DIR)/svm.$(exe) tests += $(TEST_DIR)/vmx.$(exe) diff --git a/x86/access_test.c b/x86/access_test.c index ef1243f0c151..fe9ed840519e 100644 --- a/x86/access_test.c +++ b/x86/access_test.c @@ -10,7 +10,7 @@ int main(void) printf("starting test\n\n"); r = ac_test_run(PT_LEVEL_PML4); -#ifndef TARGET_EFI +#ifndef EFI_PAYLOAD /* * Not supported yet for UEFI, because setting up 5 * level page table requires entering real mode. diff --git a/x86/efi/README.md b/x86/efi/README.md index a39f509cd9aa..459c82dfcc5e 100644 --- a/x86/efi/README.md +++ b/x86/efi/README.md @@ -15,7 +15,7 @@ The following dependencies should be installed: To build: - ./configure --target-efi + ./configure --efi-payload make ### Run test cases with UEFI diff --git a/x86/efi/run b/x86/efi/run index ac368a59ba9f..9e77b51b9f3c 100755 --- a/x86/efi/run +++ b/x86/efi/run @@ -8,7 +8,7 @@ if [ $# -eq 0 ]; then fi if [ ! -f config.mak ]; then - echo "run './configure --target-efi && make' first. See ./configure -h" + echo "run './configure --efi-payload && make' first. See ./configure -h" exit 2 fi source config.mak diff --git a/x86/run b/x86/run index 582d1eda0fd9..58f81d4853f0 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 [ "${TARGET_EFI}" != y ]; then +if [ "${EFI_PAYLOAD}" != y ]; then command+=" -kernel" fi command="$(timeout_cmd) $command" -if [ "${TARGET_EFI}" = y ]; then +if [ "${EFI_PAYLOAD}" = 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