From nobody Thu May 16 10:11:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+108824+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108824+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1695122431; cv=none; d=zohomail.com; s=zohoarc; b=jerc39U0ehvymYNjFw118j/f15nIHW9M5/BiC8nTT0iyANf94w2+/DoQzWMXT765l6RGLfcV5XDmUj57SKxaz0wbKNkO9GsVaUrFDVMVNpzGo4KOh3ebH+gB5FtS7IsLrgZgfVRz6KecRnuZsYdrF67eWTF8cCGEACXHaRNwFzg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695122431; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=iPQJB0zoLSpfEYOrnSqRNUVxfkPehcL7PnSu+xuk4bs=; b=Vlstxs9yBQf1OKoECWZA208NDiv73pTzOA1V8JDQ3v4qyQKrPFLikxiTCPPQfU6eYutLX/54VgW+EHI9eNK1fDjideDbXz70MMVwcme/aDRUlkCkL0Loiz+Vr/iPUd9FKgIoxLR0CtLURLOg/Sx4XvgSM2wcg8pQxxUTR7Brf2g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108824+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695122431238462.39495813787994; Tue, 19 Sep 2023 04:20:31 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=8ePkPZA4qGAbRKxE6zcCzko0gHenh4AsIdOtgni8S/E=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1695122430; v=1; b=UKgY8R33saoQknUSwzmM8HL6uO+FoYQ91PXjd9Jw2UkR7TMV9mwiUIOf8eUHUhE3dJlal6Xa IuK5ws8nL/WFJkKKOBfXkc5DLf2yu0gSKWjGmYziERiXBfKAph8sNvoaN9Uk9tCbFM9hDSRj6+j jRHqbhJjiCHVYjuwFdDZU08w= X-Received: by 127.0.0.2 with SMTP id QiHkYY1788612x3lpopf0OcB; Tue, 19 Sep 2023 04:20:30 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web11.6033.1695122430347945346 for ; Tue, 19 Sep 2023 04:20:30 -0700 X-Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38JAXixR008395; Tue, 19 Sep 2023 11:20:26 GMT X-Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t791806f9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 11:20:26 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38JBKPeb016888 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 11:20:25 GMT X-Received: from qc-i7.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Tue, 19 Sep 2023 04:20:24 -0700 From: "Leif Lindholm" To: CC: Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH 1/2] ArmPkg: add EL2 virtual timer interrupt Pcd Date: Tue, 19 Sep 2023 12:20:14 +0100 Message-ID: <20230919112015.229479-2-quic_llindhol@quicinc.com> In-Reply-To: <20230919112015.229479-1-quic_llindhol@quicinc.com> References: <20230919112015.229479-1-quic_llindhol@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-ORIG-GUID: Dfss7CL3h0AXYpb7W43k3XRUT3TGNGFq X-Proofpoint-GUID: Dfss7CL3h0AXYpb7W43k3XRUT3TGNGFq Precedence: Bulk List-Subscribe: List-Help: 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,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 8sono13fVauXHnPIH5YRudK2x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695122432307100006 Content-Type: text/plain; charset="utf-8" PcdArmArchTimerHypVirtIntrNum, defaults to 28 as defined in Arm's Base System Architecture (current version DEN0094C 1.0C). Relevant for systems implementing FEAT_VHE, added in ARMv8.1. Signed-off-by: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Signed-off-by: Leif Lindholm Reported-by: Peter Maydell Reviewed-by: Ard Biesheuvel --- ArmPkg/ArmPkg.dec | 1 + 1 file changed, 1 insertion(+) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index 1a16d044c94b..7fe2b9bca43b 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -328,6 +328,7 @@ [PcdsFixedAtBuild.common, PcdsDynamic.common] gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|30|UINT32|0x00000036 gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|26|UINT32|0x00000040 gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|27|UINT32|0x00000041 + gArmTokenSpaceGuid.PcdArmArchTimerHypVirtIntrNum|28|UINT32|0x0000004A =20 # # ARM Generic Watchdog --=20 2.30.2 -=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 (#108824): https://edk2.groups.io/g/devel/message/108824 Mute This Topic: https://groups.io/mt/101453749/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 16 10:11:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+108825+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108825+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1695122431; cv=none; d=zohomail.com; s=zohoarc; b=IqvZY0TLpwHjcoxsWX/giQRn9McUdcRhin35faw3q2k7l0Q81FLelGBvrO2Hv15oWD9xI95eGSs1TN2QeTl1Ght6KBe5Y9YyIU6lwug17Hc7QHjVraoM4xRTqeNJM+3rFQZ7JXcNL2DhNBFcLjSPtilNYTRHpox3ySZx8I+UlMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695122431; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8uCb8DYRux1svXU0jfsaVngl0P3VKO/seEhTTbhtXAE=; b=Mmuk/YVmH5fKc368QcWc8bnVFNgVornSzcsCG9N2LQmGHoB6AmgQGyMVCmbO1VPqUcobTbDLyg/XPJ8RA0A23TWdAsCIOkXI5/3mlahoID4rTmVUFMR3VeVBH/iYpN7wK60yBfvslCx7/MXgb5vx1EWOKj/2XbYwLh0X0ybFWjw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108825+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169512243166585.53774497453594; Tue, 19 Sep 2023 04:20:31 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=On4euBAuU/R138loBHF/iqU0mIVKkr/NywflWZ9Z5Xo=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1695122431; v=1; b=g8OfwjPU7tLsgS5YMVTjpoYn+RbfbaxpYc+RHh+1wCkpnDOybOWkna1D6xDDQLyckgxGLJHr QDlftZTDfGKACckT5+OPKf7ZQQBOOFeIieQm9CqTpoJgV6FaJsOzAjDXmKewFAzZds56tZm5aIB KGfwee0qmdW20zh30srp/fFY= X-Received: by 127.0.0.2 with SMTP id OfTBYY1788612xa3rYBf8K7Z; Tue, 19 Sep 2023 04:20:31 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.5888.1695122430751898776 for ; Tue, 19 Sep 2023 04:20:30 -0700 X-Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38JB0CeO006604; Tue, 19 Sep 2023 11:20:28 GMT X-Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t78upg6yg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 11:20:27 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38JBKRjN001516 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 11:20:27 GMT X-Received: from qc-i7.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Tue, 19 Sep 2023 04:20:25 -0700 From: "Leif Lindholm" To: CC: Peter Maydell , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH 2/2] ArmVirtPkg: handle virtual EL2 timer in DT Date: Tue, 19 Sep 2023 12:20:15 +0100 Message-ID: <20230919112015.229479-3-quic_llindhol@quicinc.com> In-Reply-To: <20230919112015.229479-1-quic_llindhol@quicinc.com> References: <20230919112015.229479-1-quic_llindhol@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: NBc7EnEvXX4583LBHwc6bcNlKeMOvBe0 X-Proofpoint-ORIG-GUID: NBc7EnEvXX4583LBHwc6bcNlKeMOvBe0 Precedence: Bulk List-Subscribe: List-Help: 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,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: LhxUBfYVVB6p84lw40mYSDlfx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695122432333100008 Content-Type: text/plain; charset="utf-8" FEAT_VHE, introduced in ARMv8.1, adds a virtual EL2 timer. However, this library verifies that exactly 3 or 4 12-byte timer interrupts are provided in input DT, ASSERTing when the new timer is added. Change the assert to >=3D 36. Extend the current logic, also initializing PcdArmArchTimerHypVirtIntrNum if 5 interrupts are provided. Signed-off-by: Leif Lindholm Reported-by: Peter Maydell Cc: Ard Biesheuvel Cc: Sami Mujawar Reviewed-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtQemu.dsc |= 1 + ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf |= 1 + ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c |= 13 +++++++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 1e0225951aef..30e3cfc8b9cc 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -253,6 +253,7 @@ [PcdsDynamicDefault.common] gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|0x0 gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|0x0 gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|0x0 + gArmTokenSpaceGuid.PcdArmArchTimerHypVirtIntrNum|0x0 =20 # # ARM General Interrupt Controller diff --git a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtCli= entLib.inf b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtCli= entLib.inf index 9e6f6f63a5a2..f8fc013700ad 100644 --- a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.= inf +++ b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.= inf @@ -40,6 +40,7 @@ [Pcd] gArmTokenSpaceGuid.PcdArmArchTimerIntrNum gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum + gArmTokenSpaceGuid.PcdArmArchTimerHypVirtIntrNum =20 [Depex] gFdtClientProtocolGuid diff --git a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtCli= entLib.c b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClien= tLib.c index 38dd6c533329..3b8491525eb3 100644 --- a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c +++ b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c @@ -34,7 +34,8 @@ ArmVirtTimerFdtClientLibConstructor ( FDT_CLIENT_PROTOCOL *FdtClient; CONST INTERRUPT_PROPERTY *InterruptProp; UINT32 PropSize; - INT32 SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum; + INT32 SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum, + HypVirtIntrNum; RETURN_STATUS PcdStatus; =20 Status =3D gBS->LocateProtocol ( @@ -66,10 +67,10 @@ ArmVirtTimerFdtClientLibConstructor ( } =20 // - // - interrupts : Interrupt list for secure, non-secure, virtual and - // hypervisor timers, in that order. + // - interrupts : Interrupt list for secure, non-secure, virtual, + // hypervisor and hypervisor virtual timers, in that order. // - ASSERT (PropSize =3D=3D 36 || PropSize =3D=3D 48); + ASSERT (PropSize >=3D 36); =20 SecIntrNum =3D SwapBytes32 (InterruptProp[0].Number) + (InterruptProp[0].Type ? 16 : 0); @@ -79,6 +80,8 @@ ArmVirtTimerFdtClientLibConstructor ( + (InterruptProp[2].Type ? 16 : 0); HypIntrNum =3D PropSize < 48 ? 0 : SwapBytes32 (InterruptProp[3].Number) + (InterruptProp[3].Type ? 16 : 0); + HypVirtIntrNum =3D PropSize < 60 ? 0 : SwapBytes32 (InterruptProp[4].Num= ber) + + (InterruptProp[4].Type ? 16 : 0); =20 DEBUG (( DEBUG_INFO, @@ -97,6 +100,8 @@ ArmVirtTimerFdtClientLibConstructor ( ASSERT_RETURN_ERROR (PcdStatus); PcdStatus =3D PcdSet32S (PcdArmArchTimerHypIntrNum, HypIntrNum); ASSERT_RETURN_ERROR (PcdStatus); + PcdStatus =3D PcdSet32S (PcdArmArchTimerHypVirtIntrNum, HypVirtIntrNum); + ASSERT_RETURN_ERROR (PcdStatus); =20 return EFI_SUCCESS; } --=20 2.30.2 -=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 (#108825): https://edk2.groups.io/g/devel/message/108825 Mute This Topic: https://groups.io/mt/101453750/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-