From patchwork Mon Feb 29 17:09:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 63231 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1366168lbc; Mon, 29 Feb 2016 09:09:52 -0800 (PST) X-Received: by 10.98.42.150 with SMTP id q144mr23615059pfq.73.1456765792485; Mon, 29 Feb 2016 09:09:52 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id l80si44129294pfj.31.2016.02.29.09.09.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 09:09:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 351C71A1E1F; Mon, 29 Feb 2016 09:09:59 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (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 654261A1DF9 for ; Mon, 29 Feb 2016 09:09:58 -0800 (PST) Received: by mail-io0-x22a.google.com with SMTP id z135so194081496iof.0 for ; Mon, 29 Feb 2016 09:09: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:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=oqXsuCEeofdBfloz2NmqyPFS0bLd94lDuNQgBwAziPI=; b=WnrbW9q97tuNOjr/CFB8hhaOng5NluzpGQ7P6KQYh3iuwrf/CAb+6i8H6az68cEdfC KrHMf+ceBfcg0cBZhShuhfVk3pMwMaXIp7sELtcAji4gZ2WgUnQqxrqm+QsM+p5exTRA LRaPOSxUqLhWCCcx5QXH0pAfvTgLx/q5iuLnY= 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:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=oqXsuCEeofdBfloz2NmqyPFS0bLd94lDuNQgBwAziPI=; b=SJa5oGgdCZASI5Ju4uVf9d3+VNebogNq2DQN3xVYTqL8A+D0qTNyv9ety/v9Z/TMOU +CtiEzDRFGI7yys47TSURZYJs2HfECbw9pJn1S/sMOwJshmyNaGEW5IeqCXWbealJMI1 FFJ+cc4N6ocXfzqu2Qs43aNCDkJY991JyZm7+gXOyLXmXw/puM6RSH7O/HHbZqVtJao4 vVhWpk8tsYeDTPJ+UR2XcyDsQNMQlrX5dzRD0bepL231AGgLWnHJtEmnrotSBMqaP1VA KcVOQFklUabcRioPcmdlQ7iHcwE6pDs32wAlzW3ouwgEfuQro1sxbXX3NMfwrgCD8eqk QfMg== X-Gm-Message-State: AG10YOTHoyFpwUwdjPpEhTFg/PEJpiZCe2iRhJhfU0IB/dIOqZdt/zLg38F11D04KQvrypK42XMNp9RPuh/c/mzs MIME-Version: 1.0 X-Received: by 10.107.40.11 with SMTP id o11mr19268335ioo.183.1456765790300; Mon, 29 Feb 2016 09:09:50 -0800 (PST) Received: by 10.36.29.6 with HTTP; Mon, 29 Feb 2016 09:09:50 -0800 (PST) In-Reply-To: References: Date: Mon, 29 Feb 2016 18:09:50 +0100 Message-ID: From: Ard Biesheuvel To: "Cohen, Eugene" Cc: "edk2-devel@lists.01.org" Subject: Re: [edk2] [PATCH] BaseTools: Update ARM/AArch64 GenFv vector processing for encapsulated FVs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" On 17 February 2016 at 14:39, Cohen, Eugene wrote: > Instead of only handling SEC Core or PEI Core instances in the outer FV, > the GenFv tool will now recurse into FV image FFS files to look for instances > in encapsulated FVs so the vector area can be updated appropriately. > > Tested on ARM and AArch64 platforms. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Eugene Cohen Hello Eugene, This patch fails to build: GenFvInternalLib.c: In function ‘UpdateArmResetVectorIfNeeded’: GenFvInternalLib.c:2197:25: error: ‘ARMT_UNCONDITIONAL_JUMP_INSTRUCTION’ undeclared (first use in this function) ResetVector[0] |= ARMT_UNCONDITIONAL_JUMP_INSTRUCTION; ^ GenFvInternalLib.c:2197:25: note: each undeclared identifier is reported only once for each function it appears in GenFvInternalLib.c:2254:25: error: ‘ARM64_UNCONDITIONAL_JUMP_INSTRUCTION’ undeclared (first use in this function) ResetVector[0] |= ARM64_UNCONDITIONAL_JUMP_INSTRUCTION; Also, after patching this manually to 0x14000000, I did not end up with a working image. Perhaps you could share some instructions? What I tried was the following: # The idea is to wrap my top level FV in a CRC32 wrapper, and still be able to boot it XIP Unfortunately, the reset vector and PEI pointer are zero, and with verbose output enabled, i never see any output related to the entry vector. Also, in the debugger, it does not seem mArm ever assumes the TRUE value. diff --git a/ArmVirtPkg/ArmVirtQemu.fdf b/ArmVirtPkg/ArmVirtQemu.fdf index ef456539cc62..9b1ecd5eb65b 100644 --- a/ArmVirtPkg/ArmVirtQemu.fdf +++ b/ArmVirtPkg/ArmVirtQemu.fdf @@ -67,7 +67,7 @@ [FD.QEMU_EFI] 0x00001000|0x001ff000 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize -FV = FVMAIN_COMPACT +FV = FVMAIN_SIGNED ################################################################################ @@ -280,6 +280,30 @@ [FV.FVMAIN_COMPACT] } } +[FV.FVMAIN_SIGNED] +FvAlignment = 16 +ERASE_POLARITY = 1 +MEMORY_MAPPED = TRUE +STICKY_WRITE = TRUE +LOCK_CAP = TRUE +LOCK_STATUS = TRUE +WRITE_DISABLED_CAP = TRUE +WRITE_ENABLED_CAP = TRUE +WRITE_STATUS = TRUE +WRITE_LOCK_CAP = TRUE +WRITE_LOCK_STATUS = TRUE +READ_DISABLED_CAP = TRUE +READ_ENABLED_CAP = TRUE +READ_STATUS = TRUE +READ_LOCK_CAP = TRUE +READ_LOCK_STATUS = TRUE + + FILE FV_IMAGE = 4C4A9ABE-71E1-4D2E-8FF6-AA8801FEB9AA { + SECTION GUIDED FC1BCDB0-7D31-49AA-936A-A4600D9DD083 PROCESSING_REQUIRED = FALSE { + SECTION FV_IMAGE = FVMAIN_COMPACT + } + } + ################################################################################