From nobody Tue May 14 22:36:46 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+110263+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+110263+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1698590785; cv=none; d=zohomail.com; s=zohoarc; b=PFHuoQiHdSrNkW8zXg/xpulEiyWkQlMwPxM2m8pIFdXJ6jhxql6bGXbByqpqLp1YnbSUN3bMbsjfQTTc7ljqcB9JWbvttVdRU60ITV/V0GCdbOU82WeAyPdx3qShc3Osv46jMscNZSBAC7fEUuSaEMaNDN3lcGiQG2/lSc2wxH0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698590785; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=FsIlJviHwn/IoBW9cO6zTWU28ox0gAGBI6J4nPSGebE=; b=H9KXM89k91IxgDJeaNL62Th2v2zkGyAZ4S14lPj8Eu/mnpiRC/d5CYiVh7syZ9UHt2P+yq5z0TMrOR7wGOqQvlPrd9ubn1Njp6730tJ+UHIx8FroFONqUoCbpJbGv8VIde53QcTdyO094CNoV/1C9byM47UoBNVaj4INmii8Zj4= 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+110263+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1698590785240262.4480747777385; Sun, 29 Oct 2023 07:46:25 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=ME1HTY6Fq+23vJv/9lRrDgGkNfbS3cUPX7E5ZJh28Tg=; 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; s=20140610; t=1698590784; v=1; b=BBs99h5Hfszl4Mv16LbrX0J+XZNKF20HgGSpydP9D0/Hhi2//Kd7dHEnZBGhlH0TJ8iZbmNK FG0+lhKJ22GyLGWPyaGbV4HJT3Pa8gESDqN3qj1RGj0Ix4kIHHy3FbmOfQ73ARt5fxTgy3GY0T4 P/IsGZCLu3uaCasoDDZnZ87M= X-Received: by 127.0.0.2 with SMTP id rF2aYY1788612xqzFG3TPI4D; Sun, 29 Oct 2023 07:46:24 -0700 X-Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.web11.73625.1698590784377672582 for ; Sun, 29 Oct 2023 07:46:24 -0700 X-Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-27db9fdec0dso3141032a91.0 for ; Sun, 29 Oct 2023 07:46:24 -0700 (PDT) X-Gm-Message-State: SAhnzgzrUlKXUDDsmAhgumylx1787277AA= X-Google-Smtp-Source: AGHT+IHgUTzGXLzFRPpx9BuDBHtQOrxYXCp38GePKi4levRx8XrzGeyTW4dnLs3RobNq2HUX4d1oEw== X-Received: by 2002:a17:90b:23d7:b0:280:29cd:4802 with SMTP id md23-20020a17090b23d700b0028029cd4802mr2578360pjb.3.1698590783659; Sun, 29 Oct 2023 07:46:23 -0700 (PDT) X-Received: from dhaval.. ([171.76.85.25]) by smtp.gmail.com with ESMTPSA id pt11-20020a17090b3d0b00b0027d15bd9fa2sm3783336pjb.35.2023.10.29.07.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 07:46:23 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Laszlo Ersek Subject: [edk2-devel] [PATCH v7 1/5] MdePkg: Move RISC-V Cache Management Declarations Into BaseLib Date: Sun, 29 Oct 2023 20:16:09 +0530 Message-Id: <20231029144613.150580-2-dhaval@rivosinc.com> In-Reply-To: <20231029144613.150580-1-dhaval@rivosinc.com> References: <20231029144613.150580-1-dhaval@rivosinc.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,dhaval@rivosinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698590785954100005 Content-Type: text/plain; charset="utf-8" The declarations for cache Management functions belong to BaseLib instead of instance source file. This helps with further restructuring of cache management code for RISC-V. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Laszlo Ersek Signed-off-by: Dhaval Sharma Reviewed-by: Laszlo Ersek Reviewed-by: Pedro Falcato --- Notes: V7: - Added RB tag V6: - Move cache management function declaration in baselib where it belongs MdePkg/Include/Library/BaseLib.h | 20 +++++++++++++++++= +++ MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 20 -----------------= --- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index 5d7067ee854e..7142bbfa42f2 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -206,6 +206,26 @@ RiscVClearPendingTimerInterrupt ( VOID ); =20 +/** + RISC-V invalidate instruction cache. + +**/ +VOID +EFIAPI +RiscVInvalidateInstCacheAsm ( + VOID + ); + +/** + RISC-V invalidate data cache. + +**/ +VOID +EFIAPI +RiscVInvalidateDataCacheAsm ( + VOID + ); + #endif // defined (MDE_CPU_RISCV64) =20 #if defined (MDE_CPU_LOONGARCH64) diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/L= ibrary/BaseCacheMaintenanceLib/RiscVCache.c index d08fb9f193ca..d5efcf49a4bf 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c @@ -10,26 +10,6 @@ #include #include =20 -/** - RISC-V invalidate instruction cache. - -**/ -VOID -EFIAPI -RiscVInvalidateInstCacheAsm ( - VOID - ); - -/** - RISC-V invalidate data cache. - -**/ -VOID -EFIAPI -RiscVInvalidateDataCacheAsm ( - VOID - ); - /** Invalidates the entire instruction cache in cache coherency domain of the calling CPU. --=20 2.39.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 (#110263): https://edk2.groups.io/g/devel/message/110263 Mute This Topic: https://groups.io/mt/102256462/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- From nobody Tue May 14 22:36:46 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+110264+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+110264+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1698590788; cv=none; d=zohomail.com; s=zohoarc; b=nd1zhPxsYU4oNpoGJT9kluCRRnvUpWd+OpnHYZ9WwcVA5zNVunfW8ZDRNOH98xVoC24az0xl5uKLrE1Ii45vZVconBeWunALPlp9xurIOXkjxOx6rn6OOSseglXIuWC6cJyi80oNODAyrX8esDfU3Go5GHTzIILbXvp4a43IISA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698590788; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=CDyknGVE6d1AiwNt2eOvY2INwruSRJMRpmYG/nVOre4=; b=PmoKcHVW9IB9HKmso9PanDInh4DlSAWqrlncmU2KXZo6ebn4USlBGKNKxkCaihw0XlBPh4ltrPUHehjNUi6DWl9GJHLRhiev9mvWMD35yEQ1O1bxGFYTwJOGU2VinMqE7+J/gtU0NSbd4zhJNeTOa8MCdmWSaxV5yW3ijybGhQc= 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+110264+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1698590788568435.08773137772073; Sun, 29 Oct 2023 07:46:28 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=kntC/Cd+wCmYadsEw62sThLBtmDcfe2zAOCHglKB2dE=; 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; s=20140610; t=1698590788; v=1; b=onSv4oDFmUC7a9OPmWRJD7lVPXoLB0XvE2a3Zgoswqdponw3afsOOUny0VMAz4nHB/mcslbx fyKBietPXo2JbnGIz9gDYbnQvSnODX99/Ge/1FMeat+2LQrqMOJG2BBjGPO5taZG1tIShaAlua4 NnZz1HMglvDeywJN+7T91vCM= X-Received: by 127.0.0.2 with SMTP id WTAzYY1788612xRAwFpCyJUY; Sun, 29 Oct 2023 07:46:28 -0700 X-Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mx.groups.io with SMTP id smtpd.web11.73627.1698590787620268938 for ; Sun, 29 Oct 2023 07:46:27 -0700 X-Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-5859a7d6556so2976149a12.0 for ; Sun, 29 Oct 2023 07:46:27 -0700 (PDT) X-Gm-Message-State: 48aOAeQ0mO9T9rC4ha2zb9zpx1787277AA= X-Google-Smtp-Source: AGHT+IEobh28ubQOLEyIu/Cg0IHv8lU082PIpRi1AXzJhn0T0KTfcmGSlmDNqvVtAJsDHwk1ZWNgoA== X-Received: by 2002:a17:90b:120a:b0:27d:9f6:47a3 with SMTP id gl10-20020a17090b120a00b0027d09f647a3mr6931774pjb.31.1698590786851; Sun, 29 Oct 2023 07:46:26 -0700 (PDT) X-Received: from dhaval.. ([171.76.85.25]) by smtp.gmail.com with ESMTPSA id pt11-20020a17090b3d0b00b0027d15bd9fa2sm3783336pjb.35.2023.10.29.07.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 07:46:26 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Sunil V L , Daniel Schaefer , Laszlo Ersek Subject: [edk2-devel] [PATCH v7 2/5] MdePkg: Rename Cache Management Function To Clarify Fence Based Op Date: Sun, 29 Oct 2023 20:16:10 +0530 Message-Id: <20231029144613.150580-3-dhaval@rivosinc.com> In-Reply-To: <20231029144613.150580-1-dhaval@rivosinc.com> References: <20231029144613.150580-1-dhaval@rivosinc.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,dhaval@rivosinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698590790115100001 Content-Type: text/plain; charset="utf-8" There are different ways to manage cache on RISC-V Processors. One way is to use fence instruction. Another way is to use CPU specific cache management operation instructions ratified as per RISC-V ISA specifications to be introduced in future patches. Current method is fence instruction based, rename the function accordingly to add that clarity. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Sunil V L Cc: Daniel Schaefer Cc: Laszlo Ersek Signed-off-by: Dhaval Sharma Reviewed-by: Laszlo Ersek Reviewed-by: Pedro Falcato --- Notes: V7: - Add RB tag V6: - As part of restructuring, adding cache instruction differentiation in function naming MdePkg/Include/Library/BaseLib.h | 4 ++-- MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 4 ++-- MdePkg/Library/BaseLib/RiscV64/FlushCache.S | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index 7142bbfa42f2..d4b56a9601da 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -212,7 +212,7 @@ RiscVClearPendingTimerInterrupt ( **/ VOID EFIAPI -RiscVInvalidateInstCacheAsm ( +RiscVInvalidateInstCacheAsmFence ( VOID ); =20 @@ -222,7 +222,7 @@ RiscVInvalidateInstCacheAsm ( **/ VOID EFIAPI -RiscVInvalidateDataCacheAsm ( +RiscVInvalidateDataCacheAsmFence ( VOID ); =20 diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/L= ibrary/BaseCacheMaintenanceLib/RiscVCache.c index d5efcf49a4bf..4eb18edb9aa7 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c @@ -21,7 +21,7 @@ InvalidateInstructionCache ( VOID ) { - RiscVInvalidateInstCacheAsm (); + RiscVInvalidateInstCacheAsmFence (); } =20 /** @@ -193,7 +193,7 @@ InvalidateDataCache ( VOID ) { - RiscVInvalidateDataCacheAsm (); + RiscVInvalidateDataCacheAsmFence (); } =20 /** diff --git a/MdePkg/Library/BaseLib/RiscV64/FlushCache.S b/MdePkg/Library/B= aseLib/RiscV64/FlushCache.S index 7c10fdd268af..e0eea0b5fb25 100644 --- a/MdePkg/Library/BaseLib/RiscV64/FlushCache.S +++ b/MdePkg/Library/BaseLib/RiscV64/FlushCache.S @@ -9,13 +9,13 @@ //------------------------------------------------------------------------= ------ =20 .align 3 -ASM_GLOBAL ASM_PFX(RiscVInvalidateInstCacheAsm) -ASM_GLOBAL ASM_PFX(RiscVInvalidateDataCacheAsm) +ASM_GLOBAL ASM_PFX(RiscVInvalidateInstCacheAsmFence) +ASM_GLOBAL ASM_PFX(RiscVInvalidateDataCacheAsmFence) =20 -ASM_PFX(RiscVInvalidateInstCacheAsm): +ASM_PFX(RiscVInvalidateInstCacheAsmFence): fence.i ret =20 -ASM_PFX(RiscVInvalidateDataCacheAsm): +ASM_PFX(RiscVInvalidateDataCacheAsmFence): fence ret --=20 2.39.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 (#110264): https://edk2.groups.io/g/devel/message/110264 Mute This Topic: https://groups.io/mt/102256464/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- From nobody Tue May 14 22:36:46 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+110265+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+110265+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1698590791; cv=none; d=zohomail.com; s=zohoarc; b=ix7j7R6A/fZaEv8BExuk4BQ+9oldGRdX7InyT1DvMV+NSbZHrDBFbsipvginz7xjo7eS2x8xB4qxDtU5utf+jB0xrsk10FBmhJPTnKqZ+h+OswGOB68LheN+PK/qgDSH7MfzkZyMfhpvnjZ71z6SJD35Syj46Bij3jCcvVwJadw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698590791; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=j0YIwgjqsmWE89sJjSmpE2mbMVrmGah7prS5Gkn029Y=; b=a4iHeDcs+4J+O+oajMrn5Qcm9Z2LXNM80nvwUACPJxZYIjTl119CWWxeT4X001B7utZLvibRQSr0QIsDt63lxC5on1E9cL5eh+Zo/I96KSRbEovi9iRoFXIx/bhR9q2gac3FG7c4RsV36r3MllzWiWtAs3BgyW1ZwcHYgYEIYtk= 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+110265+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169859079168066.70287546122063; Sun, 29 Oct 2023 07:46:31 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=X7xVkBq+tEaPuD9oSmKzeGoOH9HA95nY4z4Jw+RpJZQ=; 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; s=20140610; t=1698590791; v=1; b=TwmqE9XcOSLZmu9QN3HazMzOT0rnQaP4miM4lPi7XtxeIIh+aRPNcmsiubq7qa7LXHZom0gT ebdQhrTNzJDz3oIDNHat3dWygY0JY2ZFu/LjGPSUuomrld8sXhGOZa4Fh3xrcosa+S+7XRYARaG +JIzRqccSACKR0GIqKnfYiSE= X-Received: by 127.0.0.2 with SMTP id D20hYY1788612xE8ekMAUPr3; Sun, 29 Oct 2023 07:46:31 -0700 X-Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mx.groups.io with SMTP id smtpd.web10.73332.1698590790685511867 for ; Sun, 29 Oct 2023 07:46:30 -0700 X-Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-28016496133so1578703a91.0 for ; Sun, 29 Oct 2023 07:46:30 -0700 (PDT) X-Gm-Message-State: 9AI1rqX2GloHvvr4QMLlYAJDx1787277AA= X-Google-Smtp-Source: AGHT+IEa1bRtNHb/p4mryexd+alIfW9gzYzIsIN3qnSAqgERt8AVrq7LSQvourqbDxYCNbx5yqFHvQ== X-Received: by 2002:a17:90b:fd4:b0:27d:6d9c:6964 with SMTP id gd20-20020a17090b0fd400b0027d6d9c6964mr6871850pjb.26.1698590790018; Sun, 29 Oct 2023 07:46:30 -0700 (PDT) X-Received: from dhaval.. ([171.76.85.25]) by smtp.gmail.com with ESMTPSA id pt11-20020a17090b3d0b00b0027d15bd9fa2sm3783336pjb.35.2023.10.29.07.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 07:46:29 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Sunil V L , Daniel Schaefer , Laszlo Ersek Subject: [edk2-devel] [PATCH v7 3/5] MdePkg: Implement RISC-V Cache Management Operations Date: Sun, 29 Oct 2023 20:16:11 +0530 Message-Id: <20231029144613.150580-4-dhaval@rivosinc.com> In-Reply-To: <20231029144613.150580-1-dhaval@rivosinc.com> References: <20231029144613.150580-1-dhaval@rivosinc.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,dhaval@rivosinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698590792023100005 Content-Type: text/plain; charset="utf-8" Implement Cache Management Operations (CMO) defined by RISC-V spec https://github.com/riscv/riscv-CMOs. Notes: 1. CMO only supports block based Operations. Meaning cache flush/invd/clean Operations are not available for the entire range. In that case we fallback on fence.i instructions. 2. Operations are implemented using Opcodes to make them compiler independent. binutils 2.39+ compilers support CMO instructions. Test: 1. Ensured correct instructions are refelecting in asm 2. Not able to verify actual instruction in HW as Qemu ignores any actual cache operations. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Sunil V L Cc: Daniel Schaefer Cc: Laszlo Ersek Signed-off-by: Dhaval Sharma Reviewed-by: Laszlo Ersek Reviewed-by: Jingyu Li Reviewed-by: Pedro Falcato Reviewed-by: Sunil V L --- Notes: V7: - Modify instruction names as per feedback from V6 - Added RB V6: - Implement Cache management instructions in Baselib MdePkg/Library/BaseLib/BaseLib.inf | 2 +- MdePkg/Include/Library/BaseLib.h | 33 +++= +++++++++++++++++ MdePkg/Include/RiscV64/RiscVasm.inc | 19 +++= ++++++++ MdePkg/Library/BaseLib/RiscV64/{FlushCache.S =3D> RiscVCacheMgmt.S} | 17 += +++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/Ba= seLib.inf index 03c7b02e828b..53389389448c 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -400,7 +400,7 @@ [Sources.RISCV64] RiscV64/RiscVCpuBreakpoint.S | GCC RiscV64/RiscVCpuPause.S | GCC RiscV64/RiscVInterrupt.S | GCC - RiscV64/FlushCache.S | GCC + RiscV64/RiscVCacheMgmt.S | GCC RiscV64/CpuScratch.S | GCC RiscV64/ReadTimer.S | GCC RiscV64/RiscVMmu.S | GCC diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index d4b56a9601da..c42cc165dc82 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -226,6 +226,39 @@ RiscVInvalidateDataCacheAsmFence ( VOID ); =20 +/** + RISC-V flush cache block. Atomically perform a clean operation + followed by an invalidate operation + +**/ +VOID +EFIAPI +RiscVCpuCacheFlushAsmCmo ( + IN UINTN + ); + +/** +Perform a write transfer to another cache or to memory if the +data in the copy of the cache block have been modified by a store +operation + +**/ +VOID +EFIAPI +RiscVCpuCacheCleanAsmCmo ( + IN UINTN + ); + +/** +Deallocate the copy of the cache block + +**/ +VOID +EFIAPI +RiscVCpuCacheInvalAsmCmo ( + IN UINTN + ); + #endif // defined (MDE_CPU_RISCV64) =20 #if defined (MDE_CPU_LOONGARCH64) diff --git a/MdePkg/Include/RiscV64/RiscVasm.inc b/MdePkg/Include/RiscV64/R= iscVasm.inc new file mode 100644 index 000000000000..29de7358855c --- /dev/null +++ b/MdePkg/Include/RiscV64/RiscVasm.inc @@ -0,0 +1,19 @@ +/* + * + * RISC-V cache operation encoding. + * Copyright (c) 2023, Rivos Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-2-Clause-Patent + * + */ + +.macro RISCVCMOFLUSH + .word 0x25200f +.endm + +.macro RISCVCMOINVALIDATE + .word 0x05200f +.endm + +.macro RISCVCMOCLEAN + .word 0x15200f +.endm diff --git a/MdePkg/Library/BaseLib/RiscV64/FlushCache.S b/MdePkg/Library/B= aseLib/RiscV64/RiscVCacheMgmt.S similarity index 56% rename from MdePkg/Library/BaseLib/RiscV64/FlushCache.S rename to MdePkg/Library/BaseLib/RiscV64/RiscVCacheMgmt.S index e0eea0b5fb25..3c7be3229e3b 100644 --- a/MdePkg/Library/BaseLib/RiscV64/FlushCache.S +++ b/MdePkg/Library/BaseLib/RiscV64/RiscVCacheMgmt.S @@ -3,10 +3,12 @@ // RISC-V cache operation. // // Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
+// Copyright (c) 2023, Rivos Inc. All rights reserved.
// // SPDX-License-Identifier: BSD-2-Clause-Patent // //------------------------------------------------------------------------= ------ +.include "RiscVasm.inc" =20 .align 3 ASM_GLOBAL ASM_PFX(RiscVInvalidateInstCacheAsmFence) @@ -19,3 +21,18 @@ ASM_PFX(RiscVInvalidateInstCacheAsmFence): ASM_PFX(RiscVInvalidateDataCacheAsmFence): fence ret + +ASM_GLOBAL ASM_PFX (RiscVCpuCacheFlushAsmCmo) +ASM_PFX (RiscVCpuCacheFlushAsmCmo): + RISCVCMOFLUSH + ret + +ASM_GLOBAL ASM_PFX (RiscVCpuCacheCleanAsmCmo) +ASM_PFX (RiscVCpuCacheCleanAsmCmo): + RISCVCMOCLEAN + ret + +ASM_GLOBAL ASM_PFX (RiscVCpuCacheInvalAsmCmo) +ASM_PFX (RiscVCpuCacheInvalAsmCmo): + RISCVCMOINVALIDATE + ret --=20 2.39.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 (#110265): https://edk2.groups.io/g/devel/message/110265 Mute This Topic: https://groups.io/mt/102256466/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- From nobody Tue May 14 22:36:46 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+110266+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+110266+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1698590794; cv=none; d=zohomail.com; s=zohoarc; b=W20izImfqL3B7Rt9BYAUIN1Yk2oyFt6Rg98+LSb7JZCe6WAh4UAO1/PDDFuWTnuIWHENkLJPwjcgXFjXwqr/fCX4mObhsrgxhEkSiv2uKM/pj2WxPGDNpf4Vi6UBVEDG2o5shO7NnB87nvUFn0sBcrLWRfRnOpWeogZI9S5uSZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698590794; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=FqJzloaVnbNJBiGBaf5cPVxaPN/367EnqJ8TTXFekcc=; b=Z97bvsLBPhKUWpkE1jnbNQ71lrCK+jrxlwSH3aAaY95ynt8Y+Fe7GWHBnTtvg15Y2t5t/+/t7Lo7N+rhleyhk9c9k0pQdKuNO6egVKhAN3tT70vr2cYetdHuiVo4mLL+H7ki1tAej+XuSIQ2KnW3vedP/NUVybgiburV2qCyZjw= 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+110266+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1698590794317394.5820858812517; Sun, 29 Oct 2023 07:46:34 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=2FfM/laAPwS91S3YKdEJrVSZnq4nHAxa7bl2C4tG24g=; 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; s=20140610; t=1698590794; v=1; b=UQr/rDUGBYDYnday2JHpiCtnlhqCyhSR3BmN8+8ZD6eevb/tsnSzR3ohv2uQ2MouZp9aWM48 vKO5wAMOT7tftMcNOpHEAXdMqA++jTvTjPgwUb6AaQMh6XMXAFCIimN4ZSjx/BLF7GqKzIdrrzf yrqdADqlxsKxvKV0BhZc5tAc= X-Received: by 127.0.0.2 with SMTP id Un4HYY1788612xR6IXhNI1ax; Sun, 29 Oct 2023 07:46:34 -0700 X-Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mx.groups.io with SMTP id smtpd.web10.73333.1698590793498983580 for ; Sun, 29 Oct 2023 07:46:33 -0700 X-Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-577fff1cae6so2446798a12.1 for ; Sun, 29 Oct 2023 07:46:33 -0700 (PDT) X-Gm-Message-State: vPFMyzwyHFv0RHt4YLfCxVPPx1787277AA= X-Google-Smtp-Source: AGHT+IETh1OjqiuEWfe4eAGd73cGolEV+jgqEuFN2Jg/uVzsoDG2q6OI6oz5iEtZgnuGgXDtQNYY/Q== X-Received: by 2002:a17:90b:190c:b0:280:3173:5861 with SMTP id mp12-20020a17090b190c00b0028031735861mr3652270pjb.2.1698590792784; Sun, 29 Oct 2023 07:46:32 -0700 (PDT) X-Received: from dhaval.. ([171.76.85.25]) by smtp.gmail.com with ESMTPSA id pt11-20020a17090b3d0b00b0027d15bd9fa2sm3783336pjb.35.2023.10.29.07.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 07:46:32 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Laszlo Ersek Subject: [edk2-devel] [PATCH v7 4/5] MdePkg: Utilize Cache Management Operations Implementation For RISC-V Date: Sun, 29 Oct 2023 20:16:12 +0530 Message-Id: <20231029144613.150580-5-dhaval@rivosinc.com> In-Reply-To: <20231029144613.150580-1-dhaval@rivosinc.com> References: <20231029144613.150580-1-dhaval@rivosinc.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,dhaval@rivosinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698590796137100003 Content-Type: text/plain; charset="utf-8" Use newly defined cache management operations for RISC-V where possible It builds up on the support added for RISC-V cache management instructions in BaseLib. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Laszlo Ersek Signed-off-by: Dhaval Sharma Acked-by: Laszlo Ersek Reviewed-by: Pedro Falcato --- Notes: V7: - Added PcdLib - Restructure DEBUG message based on feedback on V6 - Make naming consistent to CMO, remove all CBO references - Add ASSERT for not supported functions instead of plain debug message - Added RB tag V6: - Utilize cache management instructions if HW supports it This patch is part of restructuring on top of v5 MdePkg/MdePkg.dec | 8 + MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf | 5 + MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 168 += ++++++++++++++++--- MdePkg/MdePkg.uni | 4 + 4 files changed, 165 insertions(+), 20 deletions(-) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index ac54338089e8..fa92673ff633 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2399,6 +2399,14 @@ [PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AAR= CH64] # @Prompt CPU Rng algorithm's GUID. gEfiMdePkgTokenSpaceGuid.PcdCpuRngSupportedAlgorithm|{0x00,0x00,0x00,0x0= 0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}|VOID*|0x0000= 0037 =20 +[PcdsFixedAtBuild.RISCV64, PcdsPatchableInModule.RISCV64] + # + # Configurability to override RISC-V CPU Features + # BIT 0 =3D Cache Management Operations. This bit is relevant only if + # previous stage has feature enabled and user wants to disable it. + # + gEfiMdePkgTokenSpaceGuid.PcdRiscVFeatureOverride|0xFFFFFFFFFFFFFFFF|UINT= 64|0x69 + [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## This value is used to set the base address of PCI express hierarchy. # @Prompt PCI Express Base Address. diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib= .inf b/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf index 6fd9cbe5f6c9..601a38d6c109 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf +++ b/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf @@ -56,3 +56,8 @@ [LibraryClasses] BaseLib DebugLib =20 +[LibraryClasses.RISCV64] + PcdLib + +[Pcd.RISCV64] + gEfiMdePkgTokenSpaceGuid.PcdRiscVFeatureOverride ## CONSUMES diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/L= ibrary/BaseCacheMaintenanceLib/RiscVCache.c index 4eb18edb9aa7..5b3104afb67e 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c @@ -2,6 +2,7 @@ RISC-V specific functionality for cache. =20 Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All right= s reserved.
+ Copyright (c) 2023, Rivos Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -9,10 +10,115 @@ #include #include #include +#include + +// +// TODO: Grab cache block size and make Cache Management Operation +// enabling decision based on RISC-V CPU HOB in +// future when it is available. +// +#define RISCV_CACHE_BLOCK_SIZE 64 +#define RISCV_CPU_FEATURE_CMO_BITMASK 0x1 + +typedef enum { + Clean, + Flush, + Invld, +} CACHE_OP; + +/** +Verify CBOs are supported by this HW +TODO: Use RISC-V CPU HOB once available. + +**/ +STATIC +BOOLEAN +RiscVIsCMOEnabled ( + VOID + ) +{ + // If CMO is disabled in HW, skip Override check + // Otherwise this PCD can override settings + return ((PcdGet64 (PcdRiscVFeatureOverride) & RISCV_CPU_FEATURE_CMO_BITM= ASK) !=3D 0); +} + +/** + Performs required opeartion on cache lines in the cache coherency domain + of the calling CPU. If Address is not aligned on a cache line boundary, + then entire cache line containing Address is operated. If Address + Leng= th + is not aligned on a cache line boundary, then the entire cache line + containing Address + Length -1 is operated. + If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT(). + @param Address The base address of the cache lines to + invalidate. + @param Length The number of bytes to invalidate from the instruction + cache. + @param Op Type of CMO operation to be performed + @return Address. + +**/ +STATIC +VOID +CacheOpCacheRange ( + IN VOID *Address, + IN UINTN Length, + IN CACHE_OP Op + ) +{ + UINTN CacheLineSize; + UINTN Start; + UINTN End; + + if (Length =3D=3D 0) { + return; + } + + if ((Op !=3D Invld) && (Op !=3D Flush) && (Op !=3D Clean)) { + return; + } + + ASSERT ((Length - 1) <=3D (MAX_ADDRESS - (UINTN)Address)); + + CacheLineSize =3D RISCV_CACHE_BLOCK_SIZE; + + Start =3D (UINTN)Address; + // + // Calculate the cache line alignment + // + End =3D (Start + Length + (CacheLineSize - 1)) & ~(CacheLineSize - 1); + Start &=3D ~((UINTN)CacheLineSize - 1); + + DEBUG ( + (DEBUG_INFO, + "CacheOpCacheRange:\ + Performing Cache Management Operation %d \n", Op) + ); + + do { + switch (Op) { + case Invld: + RiscVCpuCacheInvalAsmCmo (Start); + break; + case Flush: + RiscVCpuCacheFlushAsmCmo (Start); + break; + case Clean: + RiscVCpuCacheCleanAsmCmo (Start); + break; + default: + break; + } + + Start =3D Start + CacheLineSize; + } while (Start !=3D End); +} =20 /** Invalidates the entire instruction cache in cache coherency domain of the - calling CPU. + calling CPU. Risc-V does not have currently an CBO implementation which = can + invalidate the entire I-cache. Hence using Fence instruction for now. P.= S. + Fence instruction may or may not implement full I-cache invd functionali= ty + on all implementations. =20 **/ VOID @@ -56,12 +162,18 @@ InvalidateInstructionCacheRange ( IN UINTN Length ) { - DEBUG ( - (DEBUG_WARN, - "%a:RISC-V unsupported function.\n" - "Invalidating the whole instruction cache instead.\n", __func__) - ); - InvalidateInstructionCache (); + if (RiscVIsCMOEnabled ()) { + CacheOpCacheRange (Address, Length, Invld); + } else { + DEBUG ( + (DEBUG_VERBOSE, + "InvalidateInstructionCacheRange:\ + Zicbom not supported.\n" \ + "Invalidating the whole instruction cache instead.\n") + ); + InvalidateInstructionCache (); + } + return Address; } =20 @@ -81,7 +193,8 @@ WriteBackInvalidateDataCache ( VOID ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + DEBUG ((DEBUG_ERROR, "WriteBackInvalidateDataCache:\ + RISC-V unsupported function.\n")); } =20 /** @@ -117,7 +230,12 @@ WriteBackInvalidateDataCacheRange ( IN UINTN Length ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + if (RiscVIsCMOEnabled ()) { + CacheOpCacheRange (Address, Length, Flush); + } else { + ASSERT (FALSE); + } + return Address; } =20 @@ -137,7 +255,7 @@ WriteBackDataCache ( VOID ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + ASSERT (FALSE); } =20 /** @@ -156,10 +274,7 @@ WriteBackDataCache ( =20 If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT(). =20 - @param Address The base address of the data cache lines to write back. = If - the CPU is in a physical addressing mode, then Address i= s a - physical address. If the CPU is in a virtual addressing - mode, then Address is a virtual address. + @param Address The base address of the data cache lines to write back. @param Length The number of bytes to write back from the data cache. =20 @return Address of cache written in main memory. @@ -172,7 +287,12 @@ WriteBackDataCacheRange ( IN UINTN Length ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + if (RiscVIsCMOEnabled ()) { + CacheOpCacheRange (Address, Length, Clean); + } else { + ASSERT (FALSE); + } + return Address; } =20 @@ -214,10 +334,7 @@ InvalidateDataCache ( =20 If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT(). =20 - @param Address The base address of the data cache lines to invalidate. = If - the CPU is in a physical addressing mode, then Address i= s a - physical address. If the CPU is in a virtual addressing = mode, - then Address is a virtual address. + @param Address The base address of the data cache lines to invalidate. @param Length The number of bytes to invalidate from the data cache. =20 @return Address. @@ -230,6 +347,17 @@ InvalidateDataCacheRange ( IN UINTN Length ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + if (RiscVIsCMOEnabled ()) { + CacheOpCacheRange (Address, Length, Invld); + } else { + DEBUG ( + (DEBUG_VERBOSE, + "InvalidateDataCacheRange:\ + Zicbom not supported.\n" \ + "Invalidating the whole Data cache instead.\n") + ); + InvalidateDataCache (); + } + return Address; } diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni index 5c1fa24065c7..f49c33191054 100644 --- a/MdePkg/MdePkg.uni +++ b/MdePkg/MdePkg.uni @@ -287,6 +287,10 @@ =20 #string STR_gEfiMdePkgTokenSpaceGuid_PcdGuidedExtractHandlerTableAddress_H= ELP #language en-US "This value is used to set the available memory addres= s to store Guided Extract Handlers. The required memory space is decided by= the value of PcdMaximumGuidedExtractHandler." =20 +#string STR_gEfiMdePkgTokenSpaceGuid_PcdRiscVFeatureOverride_PROMPT #lang= uage en-US "RISC-V Feature Override" + +#string STR_gEfiMdePkgTokenSpaceGuid_PcdRiscVFeatureOverride_HELP #langua= ge en-US "This value is used to Override Any RISC-V specific features suppo= rted by this PCD" + #string STR_gEfiMdePkgTokenSpaceGuid_PcdPciExpressBaseAddress_PROMPT #lan= guage en-US "PCI Express Base Address" =20 #string STR_gEfiMdePkgTokenSpaceGuid_PcdPciExpressBaseAddress_HELP #langu= age en-US "This value is used to set the base address of PCI express hierar= chy." --=20 2.39.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 (#110266): https://edk2.groups.io/g/devel/message/110266 Mute This Topic: https://groups.io/mt/102256468/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- From nobody Tue May 14 22:36:46 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+110267+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+110267+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1698590797; cv=none; d=zohomail.com; s=zohoarc; b=TVAE25UsToIzk5n8bePMyPILukgZn9TNulN5ZHaUMrVyPlxuJxKP9WhjQO4nCrBfNCLtLVo2cFXHPQvOOOHF/Oi9pzfajBN10URTZFCPwDlXvoAdGcX+e/OuU8vAs/RGjwiQ7jUF7/sG+04pKqu2Nr6yQ5GEmknWrVEFgt+GdO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698590797; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=YE5glPdXRxj0NaHnQGwml/8SYn4ZackRVaiFBXzOOKw=; b=VkRcIRoIzdsqjay04sJZuulqRQPKyfmwEMGkYIb5CB3MIEzpVaNqOg2PEn/Kb5UKhXKhJTVkc0vniiylyIuqLrsHF2qItDeHeikC5liX5T4R5Te+N5Iix0pNh2yWeHKASNtwjKlOQPUBvkmTRcyMF4kKRCx06SuBvNSTFxnL2GM= 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+110267+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1698590797798458.7826865974737; Sun, 29 Oct 2023 07:46:37 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=DCUDjPETh+OlVeNnCuNG18dOPIen7rGBNTv9ovUhJ4o=; 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; s=20140610; t=1698590797; v=1; b=gLw3u1WKIYqOHgFJZ2UAovg69aYsAXIBo4hAP476hIi8G6qba3anCk60jAYfbKXlf8kAZQVP A6eebuIVNPVSQuQ815p0zi1t/Bla+OLq891jSeGx8qii9OdI5i19TXcxos6HPymySX4E2YrPeHr mvS95TMN8plYWtY2veuFTAjM= X-Received: by 127.0.0.2 with SMTP id epMFYY1788612xZNKmVp83uW; Sun, 29 Oct 2023 07:46:37 -0700 X-Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mx.groups.io with SMTP id smtpd.web10.73337.1698590797034310285 for ; Sun, 29 Oct 2023 07:46:37 -0700 X-Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-565334377d0so2868900a12.2 for ; Sun, 29 Oct 2023 07:46:36 -0700 (PDT) X-Gm-Message-State: xxWV9vRxDmz7a9yXynJngSzzx1787277AA= X-Google-Smtp-Source: AGHT+IFMad81MvLhzHzeF4UD5Ln1l8/rLPQqSphiF7hn/fxnq2cEbur5JnhyRw1EDgTSc/XvacmvyA== X-Received: by 2002:a17:90b:190c:b0:27c:e062:c464 with SMTP id mp12-20020a17090b190c00b0027ce062c464mr7349337pjb.37.1698590796417; Sun, 29 Oct 2023 07:46:36 -0700 (PDT) X-Received: from dhaval.. ([171.76.85.25]) by smtp.gmail.com with ESMTPSA id pt11-20020a17090b3d0b00b0027d15bd9fa2sm3783336pjb.35.2023.10.29.07.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 07:46:36 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Sunil V L , Andrei Warkentin , Laszlo Ersek Subject: [edk2-devel] [PATCH v7 5/5] OvmfPkg/RiscVVirt: Override for RV CPU Features Date: Sun, 29 Oct 2023 20:16:13 +0530 Message-Id: <20231029144613.150580-6-dhaval@rivosinc.com> In-Reply-To: <20231029144613.150580-1-dhaval@rivosinc.com> References: <20231029144613.150580-1-dhaval@rivosinc.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,dhaval@rivosinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698590798213100005 Content-Type: text/plain; charset="utf-8" This PCD provides a way for platform to override any HW features that are default enabled by previous stages of FW (like OpenSBI). For the case where previous/prev stage has disabled the feature, this override is not useful and its usage should be avoided. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Sunil V L Cc: Andrei Warkentin Cc: Laszlo Ersek Signed-off-by: Dhaval Sharma Acked-by: Laszlo Ersek Reviewed-by: Andrei Warkentin =20 Reviewed-by: Pedro Falcato --- Notes: V7: - Added RB tag v6: - Modify PCD name according to changes made in Baselib implementation V5: - Introduce PCD for platform OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc b/OvmfPkg/RiscVVirt/RiscVV= irt.dsc.inc index fe320525153f..5d66f7fe6ae6 100644 --- a/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc +++ b/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc @@ -203,6 +203,7 @@ [PcdsFeatureFlag] gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE =20 [PcdsFixedAtBuild.common] + gEfiMdePkgTokenSpaceGuid.PcdRiscVFeatureOverride|0 gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|0 --=20 2.39.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 (#110267): https://edk2.groups.io/g/devel/message/110267 Mute This Topic: https://groups.io/mt/102256471/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-