From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::244; helo=mail-io0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 2083D2232BDE6 for ; Wed, 17 Jan 2018 01:50:30 -0800 (PST) Received: by mail-io0-x244.google.com with SMTP id n7so3749961iob.0 for ; Wed, 17 Jan 2018 01:55:51 -0800 (PST) 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=Us0RwkJcWOPJcKtpLhCq5nhNkcSfcKobALHcR+oXZCI=; b=H/uctINRRKHkUXK3/nLvPm7D4/uZx5NWxG+XcLV9mxoLgo1qbDpAxLjdr03sVLEkK0 /0c+7ZnRm+gEdtn4xKG1DKaYWzZqnvBe+AO4P8mGd4yt02GqlXhrWS+p/HIt262OzQys ORXi+XTmflksFdQt/eN7eRzPTRf6L2GBDxWR4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Us0RwkJcWOPJcKtpLhCq5nhNkcSfcKobALHcR+oXZCI=; b=AxFCZy0bJG0pOinNaS2dpP/mY0XZou1tq5WBol2cHTdqQJTkhphVju2NO64+CBKmgK Dkc39vQGtjXLG+/44dZrdIWR7K3SqNatzU7++nlzVQq9zyuesjl5BM0XcDBJ3S7A5/HO cVl63dErt6/+JaM30w2EbZQ4WF4tjRxVhKv1AZg1CuWnhcuRWjKbA1ojRcecIj+b6XJs vBAgwRtbS4sbRaU9LheXMbqkfeWiErglXL48x/90B4zRSV5SRYQ5jsisZwt7k8/DIfNJ dqAhs4CDZUnx/Ho7Bfub73uDnLDzQGq1xTBQ6cjPJWKIOIGp3FZxTx9Bhph3IIQ1kz/h Ba9Q== X-Gm-Message-State: AKGB3mJrlrkJ0puF3aZBSK2Q8poRt5btLfGK4W66f8osVGCwf9tRF7ff rfDyZH7jsO2nHlfmS/Wp9chDcjU7T2IR/EwxT9abMg== X-Google-Smtp-Source: ACJfBouyyl4at52hYHJC7fOMwgtlNRGQPig2/XpP6gvyIWchBT1smVZRsxhniZjg8TwnQAJnXuYwN1dO7EGUA2fytx0= X-Received: by 10.107.160.196 with SMTP id j187mr43746820ioe.186.1516182950446; Wed, 17 Jan 2018 01:55:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.37.197 with HTTP; Wed, 17 Jan 2018 01:55:50 -0800 (PST) In-Reply-To: <1516139494-7354-1-git-send-email-udit.kumar@nxp.com> References: <1516139494-7354-1-git-send-email-udit.kumar@nxp.com> From: Ard Biesheuvel Date: Wed, 17 Jan 2018 09:55:50 +0000 Message-ID: To: Udit Kumar Cc: "edk2-devel@lists.01.org" , Leif Lindholm , varun.sethi@nxp.com Subject: Re: [ArmPlatformPkg][Patch] reset x11 before use X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 09:50:31 -0000 Content-Type: text/plain; charset="UTF-8" On 16 January 2018 at 21:51, Udit Kumar wrote: > This patch reset x11 to zero before using it. > x11 is marked as caller saved register, therefore before using it > default (reset) value should be assigned. > > If ArmPlatformPeiBootAction function is using x11 then some of > calculation in this routine may go wrong. > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Udit Kumar > --- > ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S > index a81709d..d391fc1 100644 > --- a/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S > +++ b/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S > @@ -60,6 +60,7 @@ _SetupStack: > // Because the 'push' instruction is equivalent to 'stmdb' (decrement before), we need to increment > // one to the top of the stack. We check if incrementing one does not overflow (case of DRAM at the > // top of the memory space) > + mov x11, 0 > adds x11, x1, #1 > b.cs _SetupOverflowStack > x11 is used as an output only by the adds instruction, so there is no point in setting a value first.