From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com [IPv6:2607:f8b0:4003:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 49E701A1DFA for ; Fri, 9 Sep 2016 05:04:00 -0700 (PDT) Received: by mail-oi0-x22f.google.com with SMTP id q188so21906300oia.3 for ; Fri, 09 Sep 2016 05:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=waGb/jT3DdydGp8y3Kl93O58nZV/zEPcpxfPeOeO1Rs=; b=fBZjRKRwQVUXq2X7HLdX32xA/H1W9eOzEqsgAvR03eTPIQKo4iUmZF3NQF3D+ky+Ue XJqkOT47Y68OyYNSB1pnbrLnftydTmyddEfje2yqwy+I5r7RSCLhbXvPzZXjavonEOjq u6jYRyu6tsCABGnqAFTYZ+nWBx2mWRtPEMBEE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=waGb/jT3DdydGp8y3Kl93O58nZV/zEPcpxfPeOeO1Rs=; b=gsGIADo+b6lJ2h+dRIJLmR6eycZG18y/HhuO42LInUSTeIyBcZc2pNj9WeRiQ8tqNI a+/j7xSSyKf3nd9slvJxEsX4GysUtnndm13lbynSP8CzWkuoYlWGy/lmbumTG5kb+kSz Jzn1QbpGZIL6X4YocNSpJPJGb+iBnHyABZWLcZddK0CPCyEsfXvcqLYn5tyb1WP2c3LY WLOzBG7R7dgXv077e7xbe+eyxedJC7UZJGveiSYOEBBuJLX6a8pU2ctlrI7exyOT1eC9 /mqC/PWvdvk1P+V7mOBKrsMziDGWoqTJo4iiNjeVayE+MNtZ8+EqDAgi1HZQ0sitUbZI fQFg== X-Gm-Message-State: AE9vXwNBf7IMKfJnIkfvJqcYv/Qru1vAmTHOwjtC8WUlCnen+DYhWo/KcdW8xn1fgHqG8Wl2NG0YpR7ZpAuIs/wI X-Received: by 10.202.49.66 with SMTP id x63mr5059759oix.7.1473422639539; Fri, 09 Sep 2016 05:03:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.204.195 with HTTP; Fri, 9 Sep 2016 05:03:59 -0700 (PDT) In-Reply-To: <20160909111810.GM16080@bivouac.eciton.net> References: <1473405686-5465-1-git-send-email-ard.biesheuvel@linaro.org> <20160909111810.GM16080@bivouac.eciton.net> From: Ard Biesheuvel Date: Fri, 9 Sep 2016 13:03:59 +0100 Message-ID: To: Leif Lindholm Cc: edk2-devel-01 , "Gao, Liming" Subject: Re: [PATCH] MdePkg/BaseLib AARCH64: terminate stack frame list on stack switch X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2016 12:04:00 -0000 Content-Type: text/plain; charset=UTF-8 On 9 September 2016 at 12:18, Leif Lindholm wrote: > On Fri, Sep 09, 2016 at 08:21:26AM +0100, Ard Biesheuvel wrote: >> When switching to the DXE phase stack, set the frame pointer to zero so >> that code walking the stack frame will not try to access stack frames\ > > Trailing '\'. > >> belonging to the old stack. > > Do you mean that code will check for zero and stop processing, or that > it will be accessing rubbish instead of parsing a valid-looking frame? > I don't understand this question. If it is zero, it will stop processing. If it is not zero, it will proceed, and potentially traverse stack frames in memory that is now owned by someone else. > Either is an improvement, but if it is the latter I would prefer it > more explicitly stated. > > You can fix up on commit: > Reviewed-by: Leif Lindholm > >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Ard Biesheuvel >> --- >> MdePkg/Library/BaseLib/AArch64/SwitchStack.S | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/MdePkg/Library/BaseLib/AArch64/SwitchStack.S b/MdePkg/Library/BaseLib/AArch64/SwitchStack.S >> index 2bce9c998f4f..c3ac8d7e4dfe 100644 >> --- a/MdePkg/Library/BaseLib/AArch64/SwitchStack.S >> +++ b/MdePkg/Library/BaseLib/AArch64/SwitchStack.S >> @@ -40,6 +40,7 @@ InternalSwitchStackAsm ( >> ); >> **/ >> ASM_PFX(InternalSwitchStackAsm): >> + mov x29, #0 >> mov x30, x0 >> mov sp, x3 >> mov x0, x1 >> -- >> 2.7.4 >>