Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2453402ybf; Mon, 2 Mar 2020 08:58:14 -0800 (PST) X-Google-Smtp-Source: ADFU+vuj2CJ8T7ItltRosITVa32lpgGfoUCJ+amfgn9UY4zsJ3Q1+0Zayfy8GmAirutdT7HhAdZ6 X-Received: by 2002:a9d:76d6:: with SMTP id p22mr95982otl.37.1583168294114; Mon, 02 Mar 2020 08:58:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583168294; cv=none; d=google.com; s=arc-20160816; b=WEF0K5bxE6r/BoQaVYR4f5na1wEqTMct+OxDKA9saieyT7i+nDDUUYJAnU+1gsJ0oz Gm/GZEMj69flwi3LhxIomO0mAmxco4MnJfzMqVn2Z/VNqPZyy4gTZJjMKVMwn+00gT+I iTTx+u7KuNvhIh/V/CgxQUSs/EYWCbMusbcGsTAmn5qyVR9KNDEZ/lJp4iiMY9C+lOvM ZdbaRnCdgi9TTSUG+lDg8eVB2dh+7UIgJKHGB4EY5oScDWs8T6LLlPtJg6YMBCV+1TqT +e7VydxXNbBHmCH650YM5qj0MuTa3DBLlaiqnqCNY+PJemUqE4egBhlcwR1UvyJECDzJ PHvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3R0SXG9wcDfmta3hIQNo+INKvUNhA76zRxucR7o+af8=; b=yPC1xD9PiJvUfLsW5UlImUki9wHojUBOI/am6uI3XTqD5UWhPNjb1442aADuU5NmJZ GyOVhGwUi66PbXadXl15BAgpxyZgEIZcQu+6YJ6Dg3xmvXEx0ZfRT5NKkC2ncMkqJVIU H+RUgtGQYwhDk+WCzcqyGVuYgtAZBYOKGYG1ncN2BN7ua7VZ4ug+UScUIQNRTD3i8GHd odURRFSPXuYJKM/Rlxfvjg5ik+Wi9XIICweNfWhziB7KIYk7FpBTEFBHBIza0HrOPRFC TDve/e5m0CDnMK6ZLhPHKPWWy46wmdlMYtbrPsrCWYaqRMYo0dnABXX7PHj2kph8EBqv aiCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IGt2LFhu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h201si2837482oib.214.2020.03.02.08.58.02; Mon, 02 Mar 2020 08:58:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IGt2LFhu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727445AbgCBQ5R (ORCPT + 99 others); Mon, 2 Mar 2020 11:57:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:51304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbgCBQ5R (ORCPT ); Mon, 2 Mar 2020 11:57:17 -0500 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DEF0B24677 for ; Mon, 2 Mar 2020 16:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583168237; bh=Rl4Y+FKJZ07cu7tnpiZX3HBhxfOMhi3eofy2/idg9pI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IGt2LFhuNtND1KUEJ7iwPF56n9xate40cL3N5mLsXlkkLrN717o6RJR2rUtPIt/P3 IwYTFG+lvC6BeuLJGwsKpANo42qItGTmFd+vkGaLxtfFbjJugiLRKkJCnZIFTj7by+ NGd0fH6jSC/0/Ms0J/ZcOEUDMsUwn8W6sZJRyrag= Received: by mail-wr1-f53.google.com with SMTP id y17so620741wrn.6 for ; Mon, 02 Mar 2020 08:57:16 -0800 (PST) X-Gm-Message-State: ANhLgQ23zCEO/c/nc0DO9o5aULda4sm7pZFPvZrzxBBKxMkC3cnUuG4D wLLgGeLgcuk2w6J5FdClEWSsTw0F3/c5X23hpc1Spw== X-Received: by 2002:adf:f84a:: with SMTP id d10mr536294wrq.208.1583168235249; Mon, 02 Mar 2020 08:57:15 -0800 (PST) MIME-Version: 1.0 References: <20200301230436.2246909-1-nivedita@alum.mit.edu> <20200301230436.2246909-4-nivedita@alum.mit.edu> <20200302165359.GA2599505@rani.riverdale.lan> In-Reply-To: <20200302165359.GA2599505@rani.riverdale.lan> From: Ard Biesheuvel Date: Mon, 2 Mar 2020 17:57:04 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/5] efi/x86: Make efi32_pe_entry more readable To: Arvind Sankar Cc: linux-efi , "the arch/x86 maintainers" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Mar 2020 at 17:54, Arvind Sankar wrote: > > On Mon, Mar 02, 2020 at 08:49:17AM +0100, Ard Biesheuvel wrote: > > On Mon, 2 Mar 2020 at 00:04, Arvind Sankar wrote: > ... > > > call 1f > > > -1: pop %ebp > > > - subl $1b, %ebp > > > +1: pop %ebx > > > + subl $1b, %ebx > ... > > > > > > + movl %ebx, %ebp // startup_32 for efi32_pe_stub_entry > > > > The code that follows efi32_pe_stub_entry still expects the runtime > > displacement in %ebp, so we'll need to pass that in another way here. > > > > > jmp efi32_pe_stub_entry > > Didn't follow -- what do you mean by runtime displacement? > > efi32_pe_stub_entry expects the runtime address of startup_32 to be in > %ebp, but with the changes for keeping the frame pointer in %ebp, I > changed the runtime address to be in %ebx instead. Hence I added that > movl %ebx, %ebp to put it in %ebp just before calling efi32_pe_stub_entry. > That should be fine, no? But how does that work with: SYM_INNER_LABEL(efi32_pe_stub_entry, SYM_L_LOCAL) movl %ecx, efi32_boot_args(%ebp) movl %edx, efi32_boot_args+4(%ebp) movb $0, efi_is64(%ebp) ?