From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 75AD4D80047 for ; Fri, 24 May 2024 05:45:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=tl9uCuX7H5dUKb9vu7Lw1RvTIneAEKbGIJDbAwy3z5E=; 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:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1716529536; v=1; b=4aJsYkMcZsGv3oCOzQCMhru0NA7NioFaWGM/5sMPL/PoMYdrDOJv1WhA4PVCO4k1J6CLqZNe zP+giRRJEy53t0/IRXWSnHkMInLeOEe3MeXsR67kHX8EMxoN/Sk0Ry/fma7KfvcA/5/qnO4bsU2 mpMvZAFGapzOegmUQWpnUs4bqVsdFvsq6vcaHrq1J0tYiCnwbcRYTrV7B7gyJh1DUoqE0GwX0eg mbGN7Cd+iX1PXF4IOE+VL3NeG7mCtALCFxIZXlEgMe283/UrfySrxgMsyb4l9MOTb7A6FIPBuZz DeqeuMmThy247A8CRzHg0pAwXkSDX++tQnHsWsWC+YDcQ== X-Received: by 127.0.0.2 with SMTP id gResYY7687511xe3VXOMPynb; Thu, 23 May 2024 22:45:36 -0700 X-Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by mx.groups.io with SMTP id smtpd.web11.9355.1716529529384529656 for ; Thu, 23 May 2024 22:45:29 -0700 X-Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3c99e8958faso3602931b6e.3 for ; Thu, 23 May 2024 22:45:29 -0700 (PDT) X-Gm-Message-State: Lnhg6dSjUptAF4spNDa2XnALx7686176AA= X-Google-Smtp-Source: AGHT+IHrH4jjS4dKwrTggAnq5gYErLvkyE8ScZNR/oZf/xiTxMdpzZuOus1DbzwUUc1iNuh5lUn53w== X-Received: by 2002:a05:6808:4cf:b0:3c8:2fec:c83e with SMTP id 5614622812f47-3d1a7d28724mr1314387b6e.53.1716529528603; Thu, 23 May 2024 22:45:28 -0700 (PDT) X-Received: from localhost.localdomain (c-67-160-15-86.hsd1.wa.comcast.net. [67.160.15.86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fcfe64a4sm471919b3a.158.2024.05.23.22.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 22:45:28 -0700 (PDT) From: "Doug Flick via groups.io" X-Google-Original-From: Flickdm To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v3 14/20] ArmPkg: Allow SMC/HVC monitor conduit to be specified at runtime Date: Thu, 23 May 2024 22:45:06 -0700 Message-Id: <20240524054512.523329-15-douglas.flick@microsoft.com> In-Reply-To: <20240524054512.523329-1-douglas.flick@microsoft.com> References: <20240524054512.523329-1-douglas.flick@microsoft.com> MIME-Version: 1.0 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 Resent-Date: Thu, 23 May 2024 22:45:29 -0700 Resent-From: dougflick@microsoft.com Reply-To: devel@edk2.groups.io,dougflick@microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=4aJsYkMc; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io From: Ard Biesheuvel ArmVirtQemu may execute at EL2, in which case monitor calls are generally made using SMC instructions instead of HVC instructions. Whether or not this is the case can only be decided at runtime, and so the associated PCD needs to be settable at runtime, if the platform definition chooses so. This implies a boolean PCD, given that a feature PCD is build-time configurable only. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Committed-by: Ard Biesheuvel Signed-off-by: Doug Flick [MSFT] --- ArmPkg/ArmPkg.dec | 10 +++++----- ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index 7fe2b9bca4..ac030e295b 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -139,11 +139,6 @@ # Define if the GICv3 controller should use the GICv2 legacy=0D gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042=0D =0D - ## Define the conduit to use for monitor calls.=0D - # Default PcdMonitorConduitHvc =3D FALSE, conduit =3D SMC=0D - # If PcdMonitorConduitHvc =3D TRUE, conduit =3D HVC=0D - gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047=0D -=0D # Whether to remap all unused memory NX before installing the CPU arch=0D # protocol driver. This is needed on platforms that map all DRAM with RW= X=0D # attributes initially, and can be disabled otherwise.=0D @@ -317,6 +312,11 @@ gArmTokenSpaceGuid.PcdSystemBiosRelease|0xFFFF|UINT16|0x30000058=0D gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease|0xFFFF|UINT16|0x= 30000059=0D =0D + ## Define the conduit to use for monitor calls.=0D + # Default PcdMonitorConduitHvc =3D FALSE, conduit =3D SMC=0D + # If PcdMonitorConduitHvc =3D TRUE, conduit =3D HVC=0D + gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047=0D +=0D [PcdsFixedAtBuild.common, PcdsDynamic.common]=0D #=0D # ARM Architectural Timer=0D diff --git a/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c b/ArmPkg/Library/= ArmMonitorLib/ArmMonitorLib.c index 741f5c6157..ec5b0b6619 100644 --- a/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c +++ b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c @@ -26,7 +26,7 @@ ArmMonitorCall ( IN OUT ARM_MONITOR_ARGS *Args=0D )=0D {=0D - if (FeaturePcdGet (PcdMonitorConduitHvc)) {=0D + if (PcdGetBool (PcdMonitorConduitHvc)) {=0D ArmCallHvc ((ARM_HVC_ARGS *)Args);=0D } else {=0D ArmCallSmc ((ARM_SMC_ARGS *)Args);=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119241): https://edk2.groups.io/g/devel/message/119241 Mute This Topic: https://groups.io/mt/106276866/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-