Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp765449rwb; Thu, 6 Oct 2022 04:20:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6l4rUSazbw21Dla1L5hDsg2bV8xzDHaM4ML2rXqZowVvS6fCL1t7mMJwycVUGeoc3sjqcy X-Received: by 2002:a05:6402:278b:b0:458:d5af:aaa0 with SMTP id b11-20020a056402278b00b00458d5afaaa0mr4037899ede.91.1665055243813; Thu, 06 Oct 2022 04:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665055243; cv=none; d=google.com; s=arc-20160816; b=SKD9JJjDgIFZ6QZKNnCCL4UoRIO9eoXV/9zTCHFKATWJtoFj/yCzkrMhVbEBtv+At0 gBQOPFZpLtYAdVbMPBa0YKYdi4gZUkwio6OhOk/j/r1+Ac2XIDQl25PXeuJEy5yEuZvN wej0w6W8qCqBFG9x3Z5EOisG9ahzogTlNGv4UBuK9rMV77bcJRIoEBzIIEXXFUyaKxgb 174a7mwKGz2o8fId/Ls3Hgjb9BRnNwsuvrDsV85NrEyl/ANwaiAMJdH/i6at5TSHCMwi hkZ7rnIUJR0uchJV2eG97AsRbI+4pNyx/7EkrnMmPoE+kSZf31HBf0FAdF7cmdJE5MFR /IDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+pCJrtOwK+Uo2UQpXTLUgG0fyVzkU2Sjv8mXeksdilA=; b=NyjfkKX2jMsgufdNQ1pCKP108Yh3b6z4oC7KFMUBPzh5u5Ri9pbi7xH/JIxyZMjgZI kA9pXFTebWsHXYByjgPPwcAqcfDj9Xdq3gj7pqfbH4t1xO63R3mlIfUCGCuXQig8NkBE wQn/IBkGHaUGE/AIvKxFOy3dliF5jfq5ai7Xpl1Vxenixs0OCiOK1+vIqPYvRlfqUUse HF8O11zYxI83tlctcgeLHMJXHBT9rT8w/2BEg+w3IITFeStCahwcg2ogC2dKY5NxL14I ThxopwYWxIpY+/mrffnGR20MFEXxZJByvhehZeWAn/c5kZMSz0YCE6INfFQHom3QgiTn qbzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=L+dsRHI8; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kw10-20020a170907770a00b0077e9417b5a7si15115199ejc.938.2022.10.06.04.20.18; Thu, 06 Oct 2022 04:20:43 -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=@alien8.de header.s=dkim header.b=L+dsRHI8; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbiJFKm3 (ORCPT + 99 others); Thu, 6 Oct 2022 06:42:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbiJFKm0 (ORCPT ); Thu, 6 Oct 2022 06:42:26 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE9BC8C446; Thu, 6 Oct 2022 03:42:24 -0700 (PDT) Received: from zn.tnic (p200300ea9733e732329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e732:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 497A11EC0628; Thu, 6 Oct 2022 12:42:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1665052939; 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:in-reply-to:in-reply-to: references:references; bh=+pCJrtOwK+Uo2UQpXTLUgG0fyVzkU2Sjv8mXeksdilA=; b=L+dsRHI8jyAjyyVmODg/+gLiUkxWMamXrTnkeNjcGuJgn4kuABa+mkwCpkheF4i+9Mzd8a z1jVTF9427aKhpiJnS770wCeW2Vj84/x3vzsyMTCfjYPM7hGxDU4wPOM3ZLtbkYPje2HjV yLDZFYkFncHSpqRoEFmj+SibM7Qt7Wg= Date: Thu, 6 Oct 2022 12:42:13 +0200 From: Borislav Petkov To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , Michael Roth Subject: Re: [PATCH v2 02/16] x86/compressed: efi-mixed: move 32-bit entrypoint code into .text section Message-ID: References: <20220921145422.437618-1-ardb@kernel.org> <20220921145422.437618-3-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220921145422.437618-3-ardb@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Wed, Sep 21, 2022 at 04:54:08PM +0200, Ard Biesheuvel wrote: > Move the code that stores the arguments passed to the EFI entrypoint > into the .text section, so that it can be moved into a separate > compilation unit in a subsequent patch. > > Signed-off-by: Ard Biesheuvel > --- > arch/x86/boot/compressed/head_64.S | 34 ++++++++++++-------- > 1 file changed, 20 insertions(+), 14 deletions(-) > > diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S > index d33f060900d2..1ba2fc2357e6 100644 > --- a/arch/x86/boot/compressed/head_64.S > +++ b/arch/x86/boot/compressed/head_64.S > @@ -303,24 +303,28 @@ SYM_FUNC_START(efi32_stub_entry) > popl %ecx > popl %edx > popl %esi > + jmp efi32_entry > +SYM_FUNC_END(efi32_stub_entry) > > + .text > +SYM_FUNC_START_LOCAL(efi32_entry) > call 1f > -1: pop %ebp > - subl $ rva(1b), %ebp > - > - movl %esi, rva(efi32_boot_args+8)(%ebp) > -SYM_INNER_LABEL(efi32_pe_stub_entry, SYM_L_LOCAL) > - movl %ecx, rva(efi32_boot_args)(%ebp) > - movl %edx, rva(efi32_boot_args+4)(%ebp) > - movb $0, rva(efi_is64)(%ebp) > +1: pop %ebx I'm guessing according to the EFI mixed mode calling convention, %ebx is not a live register which gets overwritten here...? Looking at efi32_pe_entry() from where this is called, %ebx looks live. What am I missing? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette