Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5443101rwb; Wed, 21 Sep 2022 07:56:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mTmhWjAc6KXLbzpMxNcsvFJAZtlZFcymmjdxg7Dq8xDMDpfZnV3ZzxPzKqdpVF8R1ReFH X-Received: by 2002:a17:903:2286:b0:178:349b:d21c with SMTP id b6-20020a170903228600b00178349bd21cmr5173556plh.71.1663772183341; Wed, 21 Sep 2022 07:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663772183; cv=none; d=google.com; s=arc-20160816; b=JcHc19NdGgsg9ce+pQte1HDiEj6nXhn6rxpzGNT9MxQCfi/7ay3axlrd6WBRUReCWl v10ECcakDxC7Eb0ALx54J/y9/YpuyBcNyrPxrSd5HiblvJPWEvgflUaTNnMHe1jE4fk2 Dic3VyhOHHkL2BzKiDaoGlk84aJoh2kvqo1olDUhClebpJvurWfQ2hAdhg8CmiBGil8z Clx+JeWQA08OMj1SUtye57O2ZqrfRee4Jiap+QFVNUJf8mmdvEj/jqAYUCJbAE3OB0Qo My2ZiRlcicQCdLZKxLGM0/LpvgE98GT9CgafDJcAGDKETZFTIsrIRC818WEjdfHEdULr X1Yw== 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=0XBrwwMbNnBfg1ftHECQH8gWW7XO3v7oLUVkzmgLBLU=; b=aM0be3UT10SfSQwBDMdghQxUgPd4eZDTJWnY90gn+QRYQwCo52jn+sqD4JiZ+jriku X4wNYRd+iaIhvS3JmxpqzL6vmxJoJ9ttZBGRGOHpreTkdLKBFSWS250dUO+JZUm4xGwi GPMl1tTq7ah49fNuXV1/pdOVp4XvK8CEEti23nvlXD/0mzaNLlx7G0raeTF8CvjXjdcz mm8wud/MHs6WFWGsNxflrtMdBgkxPC0ScrQG49TAOMKejiRnss13HmnUWgjzTBMETneW Y5g7JV7R4GDeuSOdEPk6pkwPRwX7rZ7XgpR1ztGoGkZRi1SaZIV7L7Ec0ZLA2WdoMmxk HgZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MdLgc5Ov; 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 o4-20020aa79784000000b00527d4769260si2571409pfp.332.2022.09.21.07.56.10; Wed, 21 Sep 2022 07:56:23 -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=MdLgc5Ov; 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 S230081AbiIUOyk (ORCPT + 99 others); Wed, 21 Sep 2022 10:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbiIUOyd (ORCPT ); Wed, 21 Sep 2022 10:54:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E1FF101A; Wed, 21 Sep 2022 07:54:31 -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 ams.source.kernel.org (Postfix) with ESMTPS id 20202B83028; Wed, 21 Sep 2022 14:54:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB35CC43143; Wed, 21 Sep 2022 14:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663772068; bh=nFP0scq5YobaddyVWT3m2QrQwK3XasOpsdihcJcMWvs=; h=From:To:Cc:Subject:Date:From; b=MdLgc5Ovj0cZhtRpiTEK/9khPOVzGA+itzCsItU4KhlP+/n2E3JFJdKNbEwIauGbK d2py0uUcAdjOzJo+Jll5zypItKWydiYwo5c3haJ20EPr2DyH23SCQHqcNIqp1qsvQu NYjzizfnHJ8bNPd0cxm4B7INClPDmffssYDBmCqgSkBx5e1P2d3kRJzWSKRp+hXwnQ u5e8xoZyc+BoadNPeCRFB+yqggN/Gig8tMK0k87ZkBLlMVBd+bKtbWdQZO+Jb1L9/n +f0+Pm2Ih7G+Z42OMgNORznBODbp0WRSIPq5RMYRf3I9JXhVk0CrhQ3nUZtGJHWfTV PVzY2ieNxH+Iw== 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 00/16] x86: head_64.S spring cleaning Date: Wed, 21 Sep 2022 16:54:06 +0200 Message-Id: <20220921145422.437618-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=2607; i=ardb@kernel.org; h=from:subject; bh=nFP0scq5YobaddyVWT3m2QrQwK3XasOpsdihcJcMWvs=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjKyWCyvtsYeIsjdqQWTxLVWqKcXc+MFORFb12WmtW 6JOLSkmJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYyslggAKCRDDTyI5ktmPJKoVC/ 4p1kCtUecDTAGcjgK8TjHwBQgP+f2J7wUVFQO4Ryhj6AChJp5Mhds3YKWdvngsRDJ/JYpNEXw/Sllu cvyVGhS9rcuE3Lzfe58J1JG5hoiY75I98w1QBmV+4L5vvuwVleQxB5NtRs9kuzOk7grXppVOWkEiWV 0gXHDms6oZO0j7iiS0HXPiqxnJIiyifij0V9d9aL/hA5uki9Fykub7rgEeWWAK1dAKKUA2GaLQCN1/ UUBFb5lrM7mLeGRr7PtlbpFJ2fDFaeXqGbfcqA+uOpTXK//7EH0Szaw/4tgTi5SLWFhMJqvm+urRfe 0Nsr0HH0Y9xvKxOX4eiCef4yw5b9mR3zcwVFl11bRy6UZ0S3+CrfguOyNASw7O5/Yhlq6W7aeX+ZGk YUqDGI1wqD6kka/rqFsy8m1Pt4EvepzzwJ8qtuNxLpnOvK63j1zGIU2zcFjWOiVmE8DF73bOzrMB8f xsW4KuLprOMEkEuem3KzkwnoF8LT1b+UBVp8uXbH2Ck3E= 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. I have been sitting on these patches since November, waiting for the right time to post them, i.e., after the SEV/SNP review had finished. This has yet to happen, so I'm posting them now instead. Please feel free to disregard for the time being, and propose a suitable timeframe to repost them if this is likely to conflict with ongoing work. 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 (16): 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 arch/x86/boot/compressed/Makefile | 8 +- arch/x86/boot/compressed/efi_mixed.S | 337 ++++++++++++++++++++ arch/x86/boot/compressed/efi_thunk_64.S | 195 ----------- arch/x86/boot/compressed/head_32.S | 4 - arch/x86/boot/compressed/head_64.S | 299 +---------------- arch/x86/boot/compressed/mem_encrypt.S | 152 ++++++++- drivers/firmware/efi/libstub/x86-stub.c | 2 +- 7 files changed, 496 insertions(+), 501 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