Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6099859rwb; Tue, 22 Nov 2022 08:46:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf598ax5EVmaoKLnleuemAIcKzpORfpyY+hbFPFOA08Vt4rtBj/RIbuJxhdSsCLCynMbIzOC X-Received: by 2002:aa7:d1c5:0:b0:461:dd11:c1bd with SMTP id g5-20020aa7d1c5000000b00461dd11c1bdmr21184269edp.406.1669135581928; Tue, 22 Nov 2022 08:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669135581; cv=none; d=google.com; s=arc-20160816; b=fEa+TqlZqJhfrMMf9H3vcm1zhw2FH/XVEhSd0EzeZNTJLJ07ytHY3I51cO2h7p/BHx MKyHYTFMOK8WwAZ6Dq+XVEOC6UbylRV9dKWVLYdgWfm6uyuwON5hAP25CO6cIYG7rGPi fzoTlJVxGisj+h9354isMxxB8H/9S5Rj1JhJN7tv0kW6HnB3CvI0nU14yQYU4oot9sES Hm3faQU0Dn1xcPlRw2Yxqja3Boh10IVwt5Q95rhxqhLqZv3hQDQG+j2Elo2nlDFeqhpK ViLoE4woIikIProEeloTlK8Be3brQVJtxip53L955cQbg66XlcpEry6Gi7ylV5JKMJEI COig== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=LQJEWeHMUYXC5jA7A4NFvAG3gyLAb69RdMZVCTHum7I=; b=rkMGXpNd3BlxqK4teRU8zV9Lj+/4dJh4pfLPJaYBLISLP0IbO+zsQgvOVlvU251y2m Fc5tiGhVd6CMTW1xgjidMw7Wek4UVoaf+UbWyXGvaxpTc5ZDqsM8zes7TmnuiEVEi0m/ UkzGaUo1jfR/s0ptDrCv0gRqBA0pbNaJuavyVU+DkuDwSD3CQ1w/Qsv+2Gw6++HpdC2q BFepO3tzqYIIr+0eKvEM0shg1LLUp33YGudJhz0T1hONfbDV7c27RvfaAXSWoXWcCg68 BeRDO8qBpynvjDH2WmwDg8CYaZQQ2C9lgyCNZLejdzY7AKeiLIh8yJSIDbIYGlfjE77s 2FVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P7hYBIN9; 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 b12-20020a056402278c00b004588af9ea19si13132481ede.166.2022.11.22.08.45.59; Tue, 22 Nov 2022 08:46:21 -0800 (PST) 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=P7hYBIN9; 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 S234201AbiKVQKk (ORCPT + 90 others); Tue, 22 Nov 2022 11:10:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233560AbiKVQKe (ORCPT ); Tue, 22 Nov 2022 11:10:34 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6FF77298F; Tue, 22 Nov 2022 08:10:33 -0800 (PST) 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 6E97061740; Tue, 22 Nov 2022 16:10:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13C93C433D6; Tue, 22 Nov 2022 16:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669133432; bh=Z021xpI5RSbF29MWnGe2CWEQ37RxLNV97kkgLst3V1U=; h=From:To:Cc:Subject:Date:From; b=P7hYBIN9Ur5LNSCuVSQsExrVrBLdUAVCWxg92efiq1GpoUjiT5HlKJwkqdJUHEJrD VV+K17AoIk5aW7WXP2FWLx56I3KaWe2FlS1hXAxihFRBy7OF7HzOugIMRHgAO5pz4T 9BByOGOiKehnbM6/3Bp+ymvmUrGxek+F1Q48BMM6NR51lometsJWoPcfcasx9tphLV 44lb9q4CMH2K5hhOoi80JxhjBQvrhIlcsjwzHs3mu/ncqw0MqvyoUxoZheIl8mdAml nRzlQ0bZbyZlrxOcrXUSpDl2tyqzw2EvRq886fY0zXLV69Pkj4hXgi6XClViLXbY90 Ysw/iouQ7CgRA== 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 v3 00/17] x86: head_64.S spring cleaning Date: Tue, 22 Nov 2022 17:10:00 +0100 Message-Id: <20221122161017.2426828-1-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2681; i=ardb@kernel.org; h=from:subject; bh=Z021xpI5RSbF29MWnGe2CWEQ37RxLNV97kkgLst3V1U=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjfPRN2as7fjkYpXTig4cgqVqr6u5KGCC0Gjd6XlH+ ue1+e96JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY3z0TQAKCRDDTyI5ktmPJBWXDA CYSEcUI1Ht+tU7Cddz5l1hF2EiMYNSXNPCJ/Inw+OtBgltnWndZAjmpi9gStZLZ2uyFoUsC++pwlJu z1ElBVz3Ebd8XBbbS4rwPZ9+aLyO7j/YwH4+byKXKSahLZpklYWor+3Ha5bMeiWVoFAHRUnzoWZ20s e4lCDVwtQ4yVdoCXaOiopy6KHSYDA6/M2PPRJz/0aSU62/2Mujl+wrVqcS3R508OvkVWpgujxGSf3K 5VHWexl59bG7jaagji3qtCC2ErK1+g3TBdBSxkxvdHZEN10kabu89q1p5Z2spi64iDz9HYr8t6K2YK FNeHSFEfRQBu7cjax++V2605ErC6xHGxekuUUXDdRUqmM/EE46tviWC8i26UDTegZmmSwFCXn2rOal 9k30JMwOqtX+xXl/meEudUvW4Zi3YSztAhnmied/bCJ51pyV7vAU40TKLjI4mOJkDXLt9aATCliayn rudbrUq9JZAv8Q7D28mE7XEGZvPbRApKkmNV9rjFRG9Hk= 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 After doing some cleanup work on the EFI code in head_64.S, the mixed mode code in particular, I noticed that the memory encryption pieces could use some attention as well, so I cleaned that up too. Changes since v2: - add some clarifying comments to the EFI mixed mode changes - include patch to make the EFI handover protocol optional that was sent out separately before - rebase onto tip/master Changes since v1: - at Boris's request, split the patches into smaller ones that are easier to review Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Michael Roth Ard Biesheuvel (17): x86/compressed: efi-mixed: rename efi_thunk_64.S to efi-mixed.S x86/compressed: efi-mixed: move 32-bit entrypoint code into .text section x86/compressed: efi-mixed: move bootargs parsing out of 32-bit startup code x86/compressed: efi-mixed: move efi32_pe_entry into .text section x86/compressed: efi-mixed: move efi32_entry out of head_64.S x86/compressed: efi-mixed: move efi32_pe_entry() out of head_64.S x86/compressed: efi: merge multiple definitions of image_offset into one x86/compressed: efi-mixed: simplify IDT/GDT preserve/restore x86/compressed: avoid touching ECX in startup32_set_idt_entry() x86/compressed: pull global variable ref up into startup32_load_idt() x86/compressed: move startup32_load_idt() into .text section x86/compressed: move startup32_load_idt() out of head_64.S x86/compressed: move startup32_check_sev_cbit() into .text x86/compressed: move startup32_check_sev_cbit() out of head_64.S x86/compressed: adhere to calling convention in get_sev_encryption_bit() x86/compressed: only build mem_encrypt.S if AMD_MEM_ENCRYPT=y efi: x86: Make the deprecated EFI handover protocol optional arch/x86/Kconfig | 17 + arch/x86/boot/compressed/Makefile | 8 +- arch/x86/boot/compressed/efi_mixed.S | 351 ++++++++++++++++++++ arch/x86/boot/compressed/efi_thunk_64.S | 195 ----------- arch/x86/boot/compressed/head_32.S | 4 - arch/x86/boot/compressed/head_64.S | 303 +---------------- arch/x86/boot/compressed/mem_encrypt.S | 152 ++++++++- arch/x86/boot/header.S | 2 +- arch/x86/boot/tools/build.c | 2 + drivers/firmware/efi/libstub/x86-stub.c | 2 +- 10 files changed, 533 insertions(+), 503 deletions(-) create mode 100644 arch/x86/boot/compressed/efi_mixed.S delete mode 100644 arch/x86/boot/compressed/efi_thunk_64.S -- 2.35.1