From nobody Tue Nov 26 14:32:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52968+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52968+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1578388946; cv=none; d=zohomail.com; s=zohoarc; b=e6ofFJZWbzryYDAxZzkXtXo1Kz+mmhiBIzVJqPNxtngVG6g3PZ/IFC8Ban0WVTAO0FGWQB4sB+LvxtHazO/MgVTDRlMOp/VHWSMQkBWbTuxS7+t8UHoC2OpAvrevf5AqIFBY6SEJCF/HGkqX4sgqcddguMuiOpNRCjLy/j7Vso4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578388946; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ooyfM0xE6u4/ZK+EZPFa6VRtldacobo7TrqA8I6R0Mg=; b=IWzR07Wt4F2Zmbwb90UX5bbbVrzxSVl0jT4AQBi4795Oi52DlHtRaxk7oWKanzssB+hoSXOuHBsgOIj6xFikipQp6K0mCaGpNzLN60nvVBG1JUk1yECJvFbHQ1BfnKHI2FraY9J6An+oZnTf7GX8RU9+EmwrNkufqA/h1kYxymI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52968+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 157838894661590.2879725066341; Tue, 7 Jan 2020 01:22:26 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id yeJJYY1788612x6nsgtFYfOS; Tue, 07 Jan 2020 01:22:25 -0800 X-Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.groups.io with SMTP id smtpd.web10.3576.1578388944916976593 for ; Tue, 07 Jan 2020 01:22:25 -0800 X-Received: by mail-wm1-f66.google.com with SMTP id a5so18120793wmb.0 for ; Tue, 07 Jan 2020 01:22:24 -0800 (PST) X-Gm-Message-State: LeGClaJheVjOTIff1Jp9oonTx1787277AA= X-Google-Smtp-Source: APXvYqwySLWJb/EDjU5hfjXWEHtiMhSdjQRwYJp07Y1avZYKkbxBBvC65CHH5+wclaQSnqnek0UkSg== X-Received: by 2002:a05:600c:d6:: with SMTP id u22mr40853980wmm.77.1578388943186; Tue, 07 Jan 2020 01:22:23 -0800 (PST) X-Received: from localhost.localdomain ([2a01:cb1d:112:6f00:cc7e:d2b6:8b0c:cb36]) by smtp.gmail.com with ESMTPSA id h66sm27445476wme.41.2020.01.07.01.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:22:22 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, Ard Biesheuvel Subject: [edk2-devel] [PATCH 2/2] ArmPlatformPkg/PrePeiCore: enable VFP at startup Date: Tue, 7 Jan 2020 10:22:15 +0100 Message-Id: <20200107092215.3271-3-ard.biesheuvel@linaro.org> In-Reply-To: <20200107092215.3271-1-ard.biesheuvel@linaro.org> References: <20200107092215.3271-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@linaro.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1578388945; bh=kXnSdC5AkBbva6XyNTjsqqA5hUJQWKxx52JhXUcfPYM=; h=Cc:Date:From:Reply-To:Subject:To; b=hPZ1xjO7JGkFYphxKwrAj0H6vbcShay/nfKspNHwcuUEx/rFsIbjkBkuoaUPTlRRhWi rch8rHwjR/FIaBHS0bEFcrvmZEDHNhxHXjTiQKgooidLdoP419sLcixg7nkyCWoHLJGI9 l+yjA53Jd1ibljrh7QCbaR4NweinahqmZiE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" While the alternative PEI-less SEC implementation in PrePi already takes the EnableVFP PCD into account, the PrePeiCore code does not, and so we may end up triggering synchronous exception when code attempts to use FP or SIMD registers, which is permitted by the spec. So enable the VFP as early as feasible. Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf | 1 + ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 1 + ArmPlatformPkg/PrePeiCore/PrePeiCore.c | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b/ArmPlatformPk= g/PrePeiCore/PrePeiCoreMPCore.inf index f2ac45d171bc..104c7da53317 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf @@ -62,6 +62,7 @@ [FeaturePcd] [FixedPcd] gArmTokenSpaceGuid.PcdFvBaseAddress gArmTokenSpaceGuid.PcdFvSize + gArmTokenSpaceGuid.PcdVFPEnabled =20 gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf b/ArmPlatformP= kg/PrePeiCore/PrePeiCoreUniCore.inf index 84c319c3679b..ceb173d34f5d 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf @@ -60,6 +60,7 @@ [FeaturePcd] [FixedPcd] gArmTokenSpaceGuid.PcdFvBaseAddress gArmTokenSpaceGuid.PcdFvSize + gArmTokenSpaceGuid.PcdVFPEnabled =20 gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c b/ArmPlatformPkg/PrePei= Core/PrePeiCore.c index 4911f67577a2..4f691d62cf3b 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c @@ -77,6 +77,11 @@ CEntryPoint ( ASSERT (((UINTN)PeiVectorTable & ARM_VECTOR_TABLE_ALIGNMENT) =3D=3D 0); ArmWriteVBar ((UINTN)PeiVectorTable); =20 + // Enable Floating Point + if (FixedPcdGet32 (PcdVFPEnabled)) { + ArmEnableVFP (); + } + //Note: The MMU will be enabled by MemoryPeim. Only the primary core wil= l have the MMU on. =20 // If not primary Jump to Secondary Main --=20 2.20.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52968): https://edk2.groups.io/g/devel/message/52968 Mute This Topic: https://groups.io/mt/69498791/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-