From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A6F64941BCF for ; Mon, 24 Jul 2023 20:15:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=RNgGTva9MfZp/rCFOdG2sgBN0s1RL6xHtdZ3XWznG9w=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Gm-Message-State:X-Google-Smtp-Source:X-Received:X-Received: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; s=20140610; t=1690229729; v=1; b=kcBBXqADyFTY7D3c+SQ/jtnFmoqW9akWk7Oe881AivIl67/oCY6tWpFeSKQyJR1/mn+OfQvv Gb4FyYfaIBssU3fz0xy+MQLkn/XoKyOJEMrAWbnebAsL2He8/R+VSfl8PPxSNBqwVeLwdgGMFFt rYh9NQu+ql4l64HB23ilVJOo= X-Received: by 127.0.0.2 with SMTP id JrklYY7687511xy7rXikLa7b; Mon, 24 Jul 2023 13:15:29 -0700 X-Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mx.groups.io with SMTP id smtpd.web10.4781.1690229728761817249 for ; Mon, 24 Jul 2023 13:15:28 -0700 X-Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1b8bd586086so38450495ad.2 for ; Mon, 24 Jul 2023 13:15:28 -0700 (PDT) X-Gm-Message-State: AP6XRf2sy6mDvd72MCMlP3ZIx7686176AA= X-Google-Smtp-Source: APBJJlHY6yBpyjvlRFYu3QEE67bpPanuVyYPUFqgtSKOabUe81/m+KR4D4TZfEGJMwZcthUM3faMFA== X-Received: by 2002:a17:902:8209:b0:1bb:8f37:dd0b with SMTP id x9-20020a170902820900b001bb8f37dd0bmr7026700pln.52.1690229727998; Mon, 24 Jul 2023 13:15:27 -0700 (PDT) X-Received: from MININT-0U7P5GU.redmond.corp.microsoft.com ([2001:4898:80e8:0:18a3:9b95:e44:14fd]) by smtp.gmail.com with ESMTPSA id y7-20020a1709029b8700b001b89045ff03sm9398104plp.233.2023.07.24.13.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 13:15:27 -0700 (PDT) From: "Kun Qin" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v1 1/3] ArmPkg: ArmGic: Added support to send SGI to NS G1 EL1 Date: Mon, 24 Jul 2023 13:15:20 -0700 Message-ID: <20230724201523.852-2-kuqin12@gmail.com> In-Reply-To: <20230724201523.852-1-kuqin12@gmail.com> References: <20230724201523.852-1-kuqin12@gmail.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 Reply-To: devel@edk2.groups.io,kuqin12@gmail.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=20140610 header.b=kcBBXqAD; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Kun Qin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4466 This change extended the functionality of ArmGic to support sending software generated interrupts to non-secure group 1 at EL1. The change made here follows the ARM documentation `ICC_SGI1R_EL1, Interrupt Controller Software Generated Interrupt Group 1 Register`. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Signed-off-by: Kun Qin --- ArmPkg/ArmPkg.ci.yaml | 1 + ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S | 11 +++++++++++ ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S | 10 ++++++++++ ArmPkg/Include/Library/ArmGicLib.h | 5 +++++ 4 files changed, 27 insertions(+) diff --git a/ArmPkg/ArmPkg.ci.yaml b/ArmPkg/ArmPkg.ci.yaml index d31248161189..8a8f738437d5 100644 --- a/ArmPkg/ArmPkg.ci.yaml +++ b/ArmPkg/ArmPkg.ci.yaml @@ -158,6 +158,7 @@ "ipriority",=0D "irouter",=0D "isenabler",=0D + "ishst",=0D "istatus",=0D "itargets",=0D "lable",=0D diff --git a/ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S b/ArmPkg/Driver= s/ArmGic/GicV3/AArch64/ArmGicV3.S index 20f83aa85f3b..f2ab57174be3 100644 --- a/ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S +++ b/ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S @@ -23,6 +23,7 @@ #define ICC_IAR1_EL1 S3_0_C12_C12_0=0D #define ICC_PMR_EL1 S3_0_C4_C6_0=0D #define ICC_BPR1_EL1 S3_0_C12_C12_3=0D +#define ICC_SGI1R_EL1 S3_0_C12_C11_5=0D =0D #endif=0D =0D @@ -55,6 +56,16 @@ ASM_FUNC(ArmGicV3SetControlSystemRegisterEnable) 4: isb=0D ret=0D =0D +// VOID=0D +// ArmGicV3SendNsG1Sgi (=0D +// IN UINT64 SgiVal=0D +// );=0D +ASM_FUNC(ArmGicV3SendNsG1Sgi)=0D + dsb ishst=0D + msr ICC_SGI1R_EL1, x0=0D + isb=0D + ret=0D +=0D //VOID=0D //ArmGicV3EnableInterruptInterface (=0D // VOID=0D diff --git a/ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S b/ArmPkg/Drivers/Ar= mGic/GicV3/Arm/ArmGicV3.S index 8c43a613dc57..79e57e4afb70 100644 --- a/ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S +++ b/ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S @@ -29,6 +29,16 @@ ASM_FUNC(ArmGicV3SetControlSystemRegisterEnable) isb=0D bx lr=0D =0D +// VOID=0D +// ArmGicV3SendNsG1Sgi (=0D +// IN UINT64 SgiVal=0D +// );=0D +ASM_FUNC(ArmGicV3SendNsG1Sgi)=0D + dsb ishst=0D + mcrr p15, 0, r0, r1, c12 // ICC_SGI1R_EL1=0D + isb=0D + bx lr=0D +=0D //VOID=0D //ArmGicV3EnableInterruptInterface (=0D // VOID=0D diff --git a/ArmPkg/Include/Library/ArmGicLib.h b/ArmPkg/Include/Library/Ar= mGicLib.h index 93ce8aeb1994..773b27954522 100644 --- a/ArmPkg/Include/Library/ArmGicLib.h +++ b/ArmPkg/Include/Library/ArmGicLib.h @@ -332,4 +332,9 @@ ArmGicV3SetPriorityMask ( IN UINTN Priority=0D );=0D =0D +VOID=0D +ArmGicV3SendNsG1Sgi (=0D + IN UINT64 SgiVal=0D + );=0D +=0D #endif // ARMGIC_H_=0D --=20 2.41.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107188): https://edk2.groups.io/g/devel/message/107188 Mute This Topic: https://groups.io/mt/100337222/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-