From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web09.14828.1664304707891186938 for ; Tue, 27 Sep 2022 11:51:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=msgiXxT7; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.168.131, mailfrom: quic_llindhol@quicinc.com) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28RHULLl016966; Tue, 27 Sep 2022 18:51:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=NsvTWFhax04v4KfT3jN0WErkuwZQUT1MU77Hn1DxsJg=; b=msgiXxT7mCUqXPugzYqCUhdQDa6rKP95XphdW2Mn8ckgzdguzTK4QLw6yVFUCIhJHddJ 0Zc1w8yH1cY0d5j/CAGrEVN2CYjz38yp1noZM3/ukZPkUk+lHgZ3080eb+VSh8b18Tq1 h9O/hOMiCcwSdsGj0f1ktTVHF7zlrmJBiV8dyBVVT9Svbtpt5D8ar//rYizi1H1tjd+u ub0HfJObtfykkH+yrlR+Qqk6qfExjnOMgvOf+kCrWTzVjnwkG1c+iE5UyKjsRM+lGLh8 Uu2/YatKtbWi/zqp/kPkSRrEMolpTMvRJjokzYYLVLAWlk9wSUjrxceWhxKB8bKr7JTo EA== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jupssu6g9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Sep 2022 18:51:31 +0000 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 28RIpVv2018700 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Sep 2022 18:51:31 GMT Received: from [10.110.17.52] (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.986.29; Tue, 27 Sep 2022 11:51:30 -0700 Message-ID: <26c73947-6fdd-f401-7b34-b249a7efeb40@quicinc.com> Date: Tue, 27 Sep 2022 11:51:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v5 03/21] ArmPkg/ArmMonitorLib: Add ArmMonitorLib To: , CC: Sami Mujawar , Ard Biesheuvel , Rebecca Cran , Michael D Kinney , Liming Gao , Jiewen Yao , Jian J Wang References: <20220919192207.637786-1-Pierre.Gondois@arm.com> <20220919192207.637786-4-Pierre.Gondois@arm.com> From: "Leif Lindholm" In-Reply-To: <20220919192207.637786-4-Pierre.Gondois@arm.com> 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-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: NDFncCPrUy_nqii3FhZvp6cjW8371j6Z X-Proofpoint-ORIG-GUID: NDFncCPrUy_nqii3FhZvp6cjW8371j6Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-27_09,2022-09-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 priorityscore=1501 mlxscore=0 malwarescore=0 bulkscore=0 mlxlogscore=847 phishscore=0 adultscore=0 impostorscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209270117 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Hi Pierre, Apologies for delay in feedback. On 2022-09-19 12:21, Pierre.Gondois@arm.com wrote: > From: Pierre Gondois > > The ArmMonitorLib provides an abstract interface to issue > an HyperVisor Call (HVC) or System Monitor Call (SMC) depending > on the default conduit. > The PcdMonitorConduitHvc PCD allows to select the default conduit. > > Signed-off-by: Pierre Gondois For 1-3/21: Reviewed-by: Leif Lindholm / Leif > --- > ArmPkg/ArmPkg.dsc | 1 + > ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c | 34 +++++++++++++++++++ > .../Library/ArmMonitorLib/ArmMonitorLib.inf | 29 ++++++++++++++++ > 3 files changed, 64 insertions(+) > create mode 100644 ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c > create mode 100644 ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf > > diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc > index 59fd8f295d4f..3afd212f472b 100644 > --- a/ArmPkg/ArmPkg.dsc > +++ b/ArmPkg/ArmPkg.dsc > @@ -135,6 +135,7 @@ [Components.common] > ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf > ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf > ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf > + ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf > ArmPkg/Library/OpteeLib/OpteeLib.inf > > ArmPkg/Filesystem/SemihostFs/SemihostFs.inf > diff --git a/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c > new file mode 100644 > index 000000000000..5e91f2957325 > --- /dev/null > +++ b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c > @@ -0,0 +1,34 @@ > +/** @file > + Arm Monitor Library. > + > + Copyright (c) 2022, Arm Limited. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > + > +/** Monitor call. > + > + An HyperVisor Call (HVC) or System Monitor Call (SMC) will be issued > + depending on the default conduit. PcdMonitorConduitHvc determines the type > + of the call: if true, do an HVC. > + > + @param [in, out] Args Arguments for the HVC/SMC. > +**/ > +VOID > +EFIAPI > +ArmMonitorCall ( > + IN OUT ARM_MONITOR_ARGS *Args > + ) > +{ > + if (FeaturePcdGet (PcdMonitorConduitHvc)) { > + ArmCallHvc ((ARM_HVC_ARGS *)Args); > + } else { > + ArmCallSmc ((ARM_SMC_ARGS *)Args); > + } > +} > diff --git a/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf > new file mode 100644 > index 000000000000..abaeb556d471 > --- /dev/null > +++ b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf > @@ -0,0 +1,29 @@ > +## @file > +# Arm Monitor Library > +# > +# Copyright (c) 2022, Arm Limited. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +## > + > +[Defines] > + INF_VERSION = 0x0001001B > + BASE_NAME = ArmMonitorLib > + FILE_GUID = F918DACB-FBB8-4CB6-A61D-08E75AF0E7CD > + MODULE_TYPE = BASE > + VERSION_STRING = 1.0 > + LIBRARY_CLASS = ArmMonitorLib > + > +[Sources] > + ArmMonitorLib.c > + > +[Packages] > + ArmPkg/ArmPkg.dec > + MdePkg/MdePkg.dec > + > +[LibraryClasses] > + ArmHvcLib > + ArmSmcLib > + > +[Pcd] > + gArmTokenSpaceGuid.PcdMonitorConduitHvc