Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5446548rwb; Wed, 21 Sep 2022 07:59:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kRt3PuXsYp1l1GgjyyKoFsZA3fdkiv3AOU98nSOaBtiX1+EWvK/pVczXgUNrLZIsjfV4F X-Received: by 2002:a17:902:d2d0:b0:178:329d:a5ed with SMTP id n16-20020a170902d2d000b00178329da5edmr5246478plc.142.1663772355823; Wed, 21 Sep 2022 07:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663772355; cv=none; d=google.com; s=arc-20160816; b=QDNYk2aGg6wFvvHjW7iE9/jJfAM5bZCRisuII0SuvOTWZKRdg0uBxlsrUbmoS9HiIe jFcIBYInamuQaj5+9YTNArJJQj7v1L2Urh78LN9+6E6DB0gDZK14IrDiVVEbV512LBgk 73FlPKR0BtjicSZvuc88BDkLhtyaBMo7kXA9hs04OpBaJ0IhHrrqAOcL0oFxaAEO9XyE ex/XN6O2E5yVsaMhEJSyeLp/Zibzu6HggTOW52VosqEN/+hhZl7FljSPVgBfipwqKMhS PEEc6FkjAaNvCxBp85nPZAIaSSFgtvMCtHxHxWgPwpVG7CN3B3qBV8ZlhIVhUQKyrTKZ WQSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AfoEUhqAxp9iz1fMgW7AAZ9F0AA9n8RBvbzpzVSV17U=; b=Yc5tOs8rm/ow/WfgERh1Ec/dADLeTL7PVB6whNINh0YLhXjZI69M3Jj0GMR8jVTAee QKDFM0sJPPT/zj91PQbiUcjdXHsTgYI1poggOjI55ZgAjBFgIN9Cqj9OLgZ3LW5bH7dJ szurlssPwqMJr5T16ZC8iS4QK+kEBaxNFlhsg9WFxGLaJdmsgM9qqOibKx1QX1hOsxfr 8rKrYfHFmxDB9h+/erUge/zmmyCOfB48Jlg9cKCFjAWLfB2+K8w2+GR94cAT54q/6mU/ Sr0NMQVCIKtyaJDuW2LaMaOthU9QFxnClIX2Yh56uwR//o0pbrpm2rT9j1+YXxu0NjP7 6iKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QpQax4iC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a056a00194a00b00535e3dc1519si3479587pfk.64.2022.09.21.07.59.03; Wed, 21 Sep 2022 07:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QpQax4iC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230371AbiIUO43 (ORCPT + 99 others); Wed, 21 Sep 2022 10:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbiIUOzo (ORCPT ); Wed, 21 Sep 2022 10:55:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A56E3DF3E; Wed, 21 Sep 2022 07:55:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EEA28630B7; Wed, 21 Sep 2022 14:55:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85B6DC433C1; Wed, 21 Sep 2022 14:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663772105; bh=GRNNjfUheFArH6xmtKiNIrGEgX9ISMmOlJTsXW58G4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QpQax4iCtvqh4Pjn9EIgCg6fV8z7Huc8qi3177mlVPjdX/5j102xc8lnXi1FuZJ7n 7QiDK90wxJ5NvsRlmpBOtCYLcF0MJntbkfLTsBz47dR+PYt2grC/O9CPS8ofiDxDg5 x4ZRgXj8sesitU17ieNGiS/RoMg29lOzVpVyTEUG0o3GuuhdK34QNbSzmc6cVGh9N6 +O4uu1NMNi9VxULOKqmn9LryoIUGk7JvjjVdkpSBEwyhiqQnRTg2rVBjzeJDbE0AHZ FwO15MHP5ulW17hog/83B6EV6DxgT4+pZAqxcPNzIWid7BV1ZBxpl/JczN+r3BNc/e GiwqG2Vp5keJw== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Michael Roth Subject: [PATCH v2 16/16] x86/compressed: only build mem_encrypt.S if AMD_MEM_ENCRYPT=y Date: Wed, 21 Sep 2022 16:54:22 +0200 Message-Id: <20220921145422.437618-17-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220921145422.437618-1-ardb@kernel.org> References: <20220921145422.437618-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1495; i=ardb@kernel.org; h=from:subject; bh=GRNNjfUheFArH6xmtKiNIrGEgX9ISMmOlJTsXW58G4w=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjKyWdPEfMguby108NnEU4ECQAoQlEPvzEoskygBGm DmjkjkGJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYyslnQAKCRDDTyI5ktmPJHaCDA CBzRJ/f+ONa/8lKnHtS45mqVY0PNhPpMcNSIF0rWi9pYZ7/owkxS6suGK6sB1Eoh6ADuyp7zG58INx 1k8WV6Sqw7aXPtCwZS2ORxNr6tUMHuV2nbT8NHDaZ+8XIm/nydZDX2upasFV5cecjiVe2atUNRJyPR b04oXqIelv8CLa6HrWFgch9TUR4vzD8i/G7lZ9ukgnTp6kJECePzPtltF4fGG6QvvEECo69gTWSRYw bJ7A8ITo8jWzr8cmkFzvxo4/Dxqi3QJ26Sx/0Er9ufnelgEmzFEZMidBMloB4lv2QT927M3RiDsRJA +pZ59SWDLuAFXSfksxO3Hkp5oVrlIHHjdfiv/qOJqnc1IBBi8CJcuS25sc+EZUlYoGTzrI66JlZtNB aj4+y0rV/dVNow5ES+J37PFYbuaEUeCeHboe58aTzolli32VmgS+Hr7IKVmhYiZF2TID3aY7m9FhPB pU1IKq0LjYG9Y6ObussierX2LdMbDMYULxPYzldFJbogI= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid building the mem_encrypt.o object if memory encryption support is not enabled to begin with. Signed-off-by: Ard Biesheuvel --- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/boot/compressed/mem_encrypt.S | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index d6dbb46696a2..9aad9ddcf3b4 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -99,7 +99,7 @@ vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/kaslr.o ifdef CONFIG_X86_64 vmlinux-objs-y += $(obj)/ident_map_64.o vmlinux-objs-y += $(obj)/idt_64.o $(obj)/idt_handlers_64.o - vmlinux-objs-y += $(obj)/mem_encrypt.o + vmlinux-objs-$(CONFIG_AMD_MEM_ENCRYPT) += $(obj)/mem_encrypt.o vmlinux-objs-y += $(obj)/pgtable_64.o vmlinux-objs-$(CONFIG_AMD_MEM_ENCRYPT) += $(obj)/sev.o endif diff --git a/arch/x86/boot/compressed/mem_encrypt.S b/arch/x86/boot/compressed/mem_encrypt.S index e69674588a31..32f7cc8a8625 100644 --- a/arch/x86/boot/compressed/mem_encrypt.S +++ b/arch/x86/boot/compressed/mem_encrypt.S @@ -307,7 +307,6 @@ SYM_FUNC_END(startup32_check_sev_cbit) .data -#ifdef CONFIG_AMD_MEM_ENCRYPT .balign 8 SYM_DATA(sme_me_mask, .quad 0) SYM_DATA(sev_status, .quad 0) @@ -323,4 +322,3 @@ SYM_DATA_START_LOCAL(boot32_idt_desc) .word . - boot32_idt - 1 .long 0 SYM_DATA_END(boot32_idt_desc) -#endif -- 2.35.1