From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x232.google.com (mail-wr0-x232.google.com [IPv6:2a00:1450:400c:c0c::232]) (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 990C18222D for ; Wed, 22 Feb 2017 05:13:02 -0800 (PST) Received: by mail-wr0-x232.google.com with SMTP id 97so1652937wrb.0 for ; Wed, 22 Feb 2017 05:13:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=km8VEHM9mobajDdxwpB51Z3YVMCfIFKhjSxJFCciZGY=; b=BlG0gzm0VkdLjNuF5sD7+hmaIDFBz3ClB8im6/oI1RL4q5BMEMjEq2J9mUNUL6gc5u cPljmMHevOQ5EMojrqo6kitnm5mcGyPGuI3BG45422CN/y/yi01RWeJrOINP3JWTpcOT a6mpEOF/mWndzxLByO+7K4go1m4Vj4/67cOrc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=km8VEHM9mobajDdxwpB51Z3YVMCfIFKhjSxJFCciZGY=; b=rzcESO9cX09QTjfJeHQDMpnRYIIy2Zt7c1yxXx/pQUXT3P07ayf7Wx7GTFsgEydxiZ X/33/KVUNYEtIh/7iGTkzIkOIdy0QVElwl4Jt3LV/0FaTyhAmsnd29yIApw3fbPy7XDf SoK5bqZ0gD6ckynqfgFeQP+/9LDSsIzQznG2OidO3qLOSVqrIGKsKDzysn8Z1rOUybqy VThN4/dZKfhbMsyH9Jc01qCbzG/ngYzzqluLQiEyf9ued5j7UiifeXdDhGJBvHBugMTv E6NMGKIgBkm1MN+ixxpjNjVqpZmWwHl81YyWv42YjnjVtV52v5zlR4S3jc3WYnhAdCgA Eu6Q== X-Gm-Message-State: AMke39mS/t0p2Beu0Jk55pWbMolFyNkG+V3hiKD3qVxyxfFdpyypXRTI2OjLaOLoutJ6Kra8 X-Received: by 10.223.143.36 with SMTP id p33mr11154048wrb.2.1487769181234; Wed, 22 Feb 2017 05:13:01 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id i29sm1690363wrc.64.2017.02.22.05.13.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Feb 2017 05:13:00 -0800 (PST) Date: Wed, 22 Feb 2017 13:12:58 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Heyi Guo Message-ID: <20170222131258.GV16034@bivouac.eciton.net> References: <1487756301-15646-1-git-send-email-ard.biesheuvel@linaro.org> <1487756301-15646-3-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 2/4] ArmPkg/ArmLib: AARCH64: set frame pointer in cache maintenance routine 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: Wed, 22 Feb 2017 13:13:03 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 22, 2017 at 12:56:04PM +0000, Ard Biesheuvel wrote: > On 22 February 2017 at 09:38, Ard Biesheuvel wrote: > > Stack and unstack the frame pointer according to the AAPCS in > > AArch64AllDataCachesOperation (). > > > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Ard Biesheuvel > > --- > > ArmPkg/Library/ArmLib/AArch64/AArch64Support.S | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S > > index 5cee7c1519c3..c35c05fdf681 100644 > > --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S > > +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S > > @@ -273,7 +273,7 @@ ASM_FUNC(ArmDisableBranchPrediction) > > ASM_FUNC(AArch64AllDataCachesOperation) > > // We can use regs 0-7 and 9-15 without having to save/restore. > > // Save our link register on the stack. - The stack must always be quad-word aligned > > - str x30, [sp, #-16]! > > + stp x29, x30, [sp, #-16]! > > As discussed over IRC, this needs > > mov x29, sp > > appended as well. > > This ensures that this function will show up in a backtrace when an > exception is taken (and not handled) in the callback invoked by this > function. Without setting (and preserving) x29, it will still point to > the caller of AArch64AllDataCachesOperation() Sounds good. With that addition: Reviewed-by: Leif Lindholm > > mov x1, x0 // Save Function call in x1 > > mrs x6, clidr_el1 // Read EL1 CLIDR > > and x3, x6, #0x7000000 // Mask out all but Level of Coherency (LoC) > > @@ -324,7 +324,7 @@ L_Skip: > > L_Finished: > > dsb sy > > isb > > - ldr x30, [sp], #0x10 > > + ldp x29, x30, [sp], #0x10 > > ret > > > > > > -- > > 2.7.4 > >