From nobody Thu May 16 21:49:45 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+110698+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+110698+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699239253; cv=none; d=zohomail.com; s=zohoarc; b=OmBUCrT0l0BHWVAOqtrWkAmMMeX40C4oLmi48B4dfqeH0pV+UM0UIdtIBQAxZy70adGRYH9NsI15ky3KbVeDTIB2ogIfTqxCm4/pdgfEz0E81GnxAwCwa160i3DhLU++umLYDprYO31EzMInIvtf70zFsaby7seErnYskleEeZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699239253; 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=OyfNNcKJMtjonqBgzjLD5Ywqa3ueaFTjGRoPD3jwSyY=; b=JfpzmOYFMzTf01FcH2rozyCDAGvssPSOlLNNHLEYwoJqWSnIO4E7ip5VQl/sEiQcpEUux7kziwMExwoB4+ocgQYMq8kgen+gJq/wDAWfT1+pTN2QffYhpxizI3e9EZLd9cYJOgEwYeI5Xdg3ROS5xkQRp8oLZYoEkh+72FQrBkg= 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+110698+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699239253700243.38419281388997; Sun, 5 Nov 2023 18:54:13 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=eSgjuVmixjj2VMVbdxGCZ/m/sEHKc5oje1i/FyCgClE=; 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=1699239253; v=1; b=AM/FlqGqgaen9eTTq68g/+cQUkqJIrnqmK9rL2PVCGnNgIgvDm0qXC2tfhE60wZeON77cIwP mNqXcfULE4/jcIpWjboZ+FEF1GDRJXbbCmlJ53ymtpv9Law8SgfZ6yQHdQZerduS9IOf64TmAYp vlN8u7FIj8DvAtONPqJbcZNE= X-Received: by 127.0.0.2 with SMTP id PbvaYY1788612xkoxWhjPh23; Sun, 05 Nov 2023 18:54:13 -0800 X-Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mx.groups.io with SMTP id smtpd.web10.46618.1699239247225182097 for ; Sun, 05 Nov 2023 18:54:07 -0800 X-Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso3160475b3a.1 for ; Sun, 05 Nov 2023 18:54:07 -0800 (PST) X-Gm-Message-State: Bgw3CDQSAvKVl3MqBWWU6Ivcx1787277AA= X-Google-Smtp-Source: AGHT+IGo9M7a+0mBon3DY2zuTW2aLTY3w16nqfRzwSj73rZt+YHnuT3wdqvpN4E+Cx4PVuvxOPoE6Q== X-Received: by 2002:a05:6a00:1819:b0:690:f877:aa1e with SMTP id y25-20020a056a00181900b00690f877aa1emr12353769pfa.12.1699239246304; Sun, 05 Nov 2023 18:54:06 -0800 (PST) X-Received: from dhaval.. ([171.76.87.118]) by smtp.gmail.com with ESMTPSA id fa16-20020a056a002d1000b0068fece2c190sm2679724pfb.70.2023.11.05.18.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 18:54:06 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Laszlo Ersek Subject: [edk2-devel] [PATCH v8 1/5] MdePkg: Move RISC-V Cache Management Declarations Into BaseLib Date: Mon, 6 Nov 2023 08:23:52 +0530 Message-Id: <20231106025356.167717-2-dhaval@rivosinc.com> In-Reply-To: <20231106025356.167717-1-dhaval@rivosinc.com> References: <20231106025356.167717-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: 1699239256041100001 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 --- 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 (#110698): https://edk2.groups.io/g/devel/message/110698 Mute This Topic: https://groups.io/mt/102413466/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 Thu May 16 21:49:45 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+110699+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+110699+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699239251; cv=none; d=zohomail.com; s=zohoarc; b=Wn+Wzy5pu53zrVYEG/RaopU4l7zj+fIm6JQZcBzebHQVmbkAbXkuQ56XlRSrG2kYiIM7AoO/wXTctr43ieQ5/3oY7Qm3tzbt9eI+JWWTgJBBNaU2z6sf+T8Yf9VUSAoLYDoveg6a9Td6akN1p3QE+LSpMdtuLKt7umk+c2DvlnU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699239251; 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=4/GlocRciWyzeQs0N6J9lGI4PtdS4gMxFPGzyS+5wJ8=; b=Hsb3BpWhW8XBbVhkKtlnxCJTch0Uz4mtnjnscyEf6wSOgzR6JEBwE4ooWZNDRd1R6oRyw6bQlrQgq7RNd+9yRazkvc3M0njqJH5nLi+Orug079QAWM47ps3dK1W3/H/HWj8wnySDukcicgJr6f9oStUWBSLmkuuzS1ZQP4cTLaw= 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+110699+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699239251266369.77048057600916; Sun, 5 Nov 2023 18:54:11 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=cM9dKXqi4PW4gLusqmLLr6RkS6wUKZ3ATlUuN6q+/7s=; 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=1699239250; v=1; b=V1H8aIOYfBfPc/fR0KoGCWlEfxBEUPSdHaxF7hxC92W2Mf8ytb7JlrAvlFfNQ1tshO8jv643 qcqJMFwFXP6PgZfjSv/cpqw24hldIBO+xSPH9dmKBK6tcnk5iXtZHPWlhIQGCtEQwupJwIcLbbP VoAv7ijkog8fVXVmpKbvjt6s= X-Received: by 127.0.0.2 with SMTP id 5ya1YY1788612xZryc0auwH5; Sun, 05 Nov 2023 18:54:10 -0800 X-Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by mx.groups.io with SMTP id smtpd.web10.46620.1699239250278316848 for ; Sun, 05 Nov 2023 18:54:10 -0800 X-Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3b2b1af964dso2694081b6e.1 for ; Sun, 05 Nov 2023 18:54:10 -0800 (PST) X-Gm-Message-State: wWFW3W9T75vcgYKHDuIDbo0Qx1787277AA= X-Google-Smtp-Source: AGHT+IHR8bQPGUcPFpYNc9AsGbE1ev8rPkCLBbJ7yHN6Rf46m6+kXfazAAGBsPWeve8JD/RfOoMbSg== X-Received: by 2002:a05:6808:1b14:b0:3a7:2390:3583 with SMTP id bx20-20020a0568081b1400b003a723903583mr35726693oib.38.1699239249330; Sun, 05 Nov 2023 18:54:09 -0800 (PST) X-Received: from dhaval.. ([171.76.87.118]) by smtp.gmail.com with ESMTPSA id fa16-20020a056a002d1000b0068fece2c190sm2679724pfb.70.2023.11.05.18.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 18:54:09 -0800 (PST) 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 v8 2/5] MdePkg: Rename Cache Management Function To Clarify Fence Based Op Date: Mon, 6 Nov 2023 08:23:53 +0530 Message-Id: <20231106025356.167717-3-dhaval@rivosinc.com> In-Reply-To: <20231106025356.167717-1-dhaval@rivosinc.com> References: <20231106025356.167717-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: 1699239252038100003 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 --- Notes: V8: - Update function name to udpate *asm* in the end 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..d80e27285424 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -212,7 +212,7 @@ RiscVClearPendingTimerInterrupt ( **/ VOID EFIAPI -RiscVInvalidateInstCacheAsm ( +RiscVInvalidateInstCacheFenceAsm ( VOID ); =20 @@ -222,7 +222,7 @@ RiscVInvalidateInstCacheAsm ( **/ VOID EFIAPI -RiscVInvalidateDataCacheAsm ( +RiscVInvalidateDataCacheFenceAsm ( VOID ); =20 diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/L= ibrary/BaseCacheMaintenanceLib/RiscVCache.c index d5efcf49a4bf..ac2a3c23a249 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c @@ -21,7 +21,7 @@ InvalidateInstructionCache ( VOID ) { - RiscVInvalidateInstCacheAsm (); + RiscVInvalidateInstCacheFenceAsm (); } =20 /** @@ -193,7 +193,7 @@ InvalidateDataCache ( VOID ) { - RiscVInvalidateDataCacheAsm (); + RiscVInvalidateDataCacheFenceAsm (); } =20 /** diff --git a/MdePkg/Library/BaseLib/RiscV64/FlushCache.S b/MdePkg/Library/B= aseLib/RiscV64/FlushCache.S index 7c10fdd268af..8cfb85097996 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(RiscVInvalidateInstCacheFenceAsm) +ASM_GLOBAL ASM_PFX(RiscVInvalidateDataCacheFenceAsm) =20 -ASM_PFX(RiscVInvalidateInstCacheAsm): +ASM_PFX(RiscVInvalidateInstCacheFenceAsm): fence.i ret =20 -ASM_PFX(RiscVInvalidateDataCacheAsm): +ASM_PFX(RiscVInvalidateDataCacheFenceAsm): 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 (#110699): https://edk2.groups.io/g/devel/message/110699 Mute This Topic: https://groups.io/mt/102413467/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 Thu May 16 21:49:45 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+110700+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+110700+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699239336; cv=none; d=zohomail.com; s=zohoarc; b=G29GQIOLoTHqbK37/S7gB3Dgmi7pUkVcMpXp+WiVtb6p25uAm+TmqOGx0qUsJVkhG7E5O6d4nOFWApPFgzwoCP4VzHjVQdhVD73hhb+qpKlBzhbw5Rpv5l774DLL+QK/wOsORaR78xVEygpzOBjSzrDjf0APEgCP+B68UMryZ14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699239336; 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=GIEnAzENloQriPic7LTNH6cGVMg1YnQpTbhzGkNKjnE=; b=i0Gogo6aEEIRZyzrDMmh+3TPyVhSKd9rc9nEVEeS+1dBSaIWfNcpFvI7M7QhoVwfT1et9DPdqk2aC9GQgTXOxf0xgoUSSo5MZns4/9ENv/X+h3NnKZmROWdIxPds66b+bZMSd/AUIjk42r0CDV3fCMpI7tk1hMvAHkqlrBejl9o= 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+110700+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699239336706311.6968097503103; Sun, 5 Nov 2023 18:55:36 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=UNT9Gnxo9UKcnWlCRHJ3zqVwZQAYa5iRlCVt4vsLgKE=; 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=1699239336; v=1; b=Y+SmxIWx/9r8HqIx/XnmRh517VwUfgWd+sLY+x4hyjUp9z91/HKdsZC5YG+/qyjkoriRYlQw jYJl64NTH9QpTFlxu0EVKdwR8zw8aBLpokAFPmqZLwPV7r7neLYYA1ka1rR5Vz6jVvMWzak/Yxe p4i6zOv1iptkfBobk+b3MLHI= X-Received: by 127.0.0.2 with SMTP id GTIkYY1788612xnX1NRccYRU; Sun, 05 Nov 2023 18:55:36 -0800 X-Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web10.46648.1699239335849045377 for ; Sun, 05 Nov 2023 18:55:35 -0800 X-Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6b44befac59so3832962b3a.0 for ; Sun, 05 Nov 2023 18:55:35 -0800 (PST) X-Gm-Message-State: xzrF2hACS7pTBo8VfTLtTeXZx1787277AA= X-Google-Smtp-Source: AGHT+IFfWL3Em9f2Ewj1ZqmfZ2z+4d6kxWePVQYa+/HMu6CybwTmA1ZULJk1fva6qgqoOthKAEe1Zg== X-Received: by 2002:a05:6a21:788b:b0:177:a131:f31c with SMTP id bf11-20020a056a21788b00b00177a131f31cmr14256239pzc.13.1699239334836; Sun, 05 Nov 2023 18:55:34 -0800 (PST) X-Received: from dhaval.. ([171.76.87.118]) by smtp.gmail.com with ESMTPSA id fa16-20020a056a002d1000b0068fece2c190sm2679724pfb.70.2023.11.05.18.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 18:55:34 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Sunil V L , Daniel Schaefer , Laszlo Ersek , jingyulee98@gmail.com Subject: [edk2-devel] [PATCH v8 3/5] MdePkg: Implement RISC-V Cache Management Operations Date: Mon, 6 Nov 2023 08:23:54 +0530 Message-Id: <20231106025356.167717-4-dhaval@rivosinc.com> In-Reply-To: <20231106025356.167717-1-dhaval@rivosinc.com> References: <20231106025356.167717-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: 1699239338339100003 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. Qemu implements basic support for CMO operations in that it allwos instructions without exceptions. Verified it works properly in that sense. 3. SG2042Pkg implements CMO-like instructions. It was verified that CpuFlushCpuDataCache works fine. This more of less confirms that framework is alright. 4. TODO: Once Silicon is available with exact instructions, we will further verify this. 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: Sunil V L Reviewed-by: Jingyu Li --- Notes: v8: - Add *asm* postfix to cmo functions - Add reviewed by tags 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 d80e27285424..47424709cd72 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -226,6 +226,39 @@ RiscVInvalidateDataCacheFenceAsm ( VOID ); =20 +/** + RISC-V flush cache block. Atomically perform a clean operation + followed by an invalidate operation + +**/ +VOID +EFIAPI +RiscVCpuCacheFlushCmoAsm ( + 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 +RiscVCpuCacheCleanCmoAsm ( + IN UINTN + ); + +/** +Deallocate the copy of the cache block + +**/ +VOID +EFIAPI +RiscVCpuCacheInvalCmoAsm ( + 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 8cfb85097996..4752aa72d95e 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(RiscVInvalidateInstCacheFenceAsm) @@ -19,3 +21,18 @@ ASM_PFX(RiscVInvalidateInstCacheFenceAsm): ASM_PFX(RiscVInvalidateDataCacheFenceAsm): fence ret + +ASM_GLOBAL ASM_PFX (RiscVCpuCacheFlushCmoAsm) +ASM_PFX (RiscVCpuCacheFlushCmoAsm): + RISCVCMOFLUSH + ret + +ASM_GLOBAL ASM_PFX (RiscVCpuCacheCleanCmoAsm) +ASM_PFX (RiscVCpuCacheCleanCmoAsm): + RISCVCMOCLEAN + ret + +ASM_GLOBAL ASM_PFX (RiscVCpuCacheInvalCmoAsm) +ASM_PFX (RiscVCpuCacheInvalCmoAsm): + 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 (#110700): https://edk2.groups.io/g/devel/message/110700 Mute This Topic: https://groups.io/mt/102413483/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 Thu May 16 21:49: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+110701+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+110701+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699239339; cv=none; d=zohomail.com; s=zohoarc; b=dE1VFnPEuTMXqNnWe08Q3Hz43ntgA6C8nALCbuRM/rjoumD2ObLjD0ryh0bI5S70K2xIkSzRUuETLsZ0FOtTUeQS77wqefBXEFLrIQpZ0XPft/oO4WtKpdK5XS+2lwLZI9FnjN8Tooq6WjZ04mcS2nrsfWpIQBDTNA5FrNv1Cs4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699239339; 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=YPeY8GCeUVBR1wErHGciq9F5kyjcqfVrb18+9CL3MKE=; b=DzNOZq3PzARGr9SgyIJvhOHN21s2zY0OzlaWDvIQuV6u8WNFi10Kk8zBur/olcIXxGXTi2w18B0pz8GJ+7NOHAOjpKkc9sK3ftvnkzYxQn73e00nDm9BlGffd1BvV5Cc/HYWkL+bu9Z9Rdrqmfd6bks9k4jHwmO+P4e3hOAI54o= 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+110701+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699239339331767.2285970147921; Sun, 5 Nov 2023 18:55:39 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=X5vG7DCCs8gVk2d9mclBimZMe5ZhXTwKP9opQTv6EDw=; 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=1699239339; v=1; b=hlxk2PskdlK2RIt9tGVj7Is6+wShm57q8INI8w6NiCglZ4o23kXm0PFSIEosxSK7TRtuO/H/ BTGvJCBuHTrLtOMOW6kdlN2WoKmUo9WbbD7Kjgzu1vuCnZHk0nYbzMkNPtgajUFUR/PTaMkTY9h m2TnS2WDsgUiTJoiezsmXe6w= X-Received: by 127.0.0.2 with SMTP id 8GrOYY1788612xVRE9793j1F; Sun, 05 Nov 2023 18:55:39 -0800 X-Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) by mx.groups.io with SMTP id smtpd.web10.46649.1699239338437609370 for ; Sun, 05 Nov 2023 18:55:38 -0800 X-Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6ce344fa7e4so2511714a34.0 for ; Sun, 05 Nov 2023 18:55:38 -0800 (PST) X-Gm-Message-State: oaGwVNAPSHVUBjkIq6A9f7YUx1787277AA= X-Google-Smtp-Source: AGHT+IGf/YPDN0hnCD3qMf0GzynH9LE4ES8SY2gVM8U/pS/UQJCLwddPIoD9anDZrBA9uccqRX3Zhg== X-Received: by 2002:a05:6830:7190:b0:6c4:a42b:9cd8 with SMTP id el16-20020a056830719000b006c4a42b9cd8mr34630736otb.1.1699239337543; Sun, 05 Nov 2023 18:55:37 -0800 (PST) X-Received: from dhaval.. ([171.76.87.118]) by smtp.gmail.com with ESMTPSA id fa16-20020a056a002d1000b0068fece2c190sm2679724pfb.70.2023.11.05.18.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 18:55:37 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Laszlo Ersek Subject: [edk2-devel] [PATCH v8 4/5] MdePkg: Utilize Cache Management Operations Implementation For RISC-V Date: Mon, 6 Nov 2023 08:23:55 +0530 Message-Id: <20231106025356.167717-5-dhaval@rivosinc.com> In-Reply-To: <20231106025356.167717-1-dhaval@rivosinc.com> References: <20231106025356.167717-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: 1699239340366100007 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 --- Notes: V8: - Added note to convert PCD into RISC-V feature bitmap pointer - Modified function names to be more explicit about cache ops - Added RB tag 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 | 170 += ++++++++++++++++--- MdePkg/MdePkg.uni | 4 + 4 files changed, 167 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 ac2a3c23a249..16a09db009cd 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,117 @@ #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 and convert PcdRiscVFeatureOverride +// PCD to a pointer that contains pointer to bitmap structure +// which can be operated more elegantly. +// +#define RISCV_CACHE_BLOCK_SIZE 64 +#define RISCV_CPU_FEATURE_CMO_BITMASK 0x1 + +typedef enum { + CacheOpClean, + CacheOpFlush, + CacheOpInvld, +} 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 CacheOpInvld) && (Op !=3D CacheOpFlush) && (Op !=3D CacheOp= 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 CacheOpInvld: + RiscVCpuCacheInvalCmoAsm (Start); + break; + case CacheOpFlush: + RiscVCpuCacheFlushCmoAsm (Start); + break; + case CacheOpClean: + RiscVCpuCacheCleanCmoAsm (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 +164,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, CacheOpInvld); + } else { + DEBUG ( + (DEBUG_VERBOSE, + "InvalidateInstructionCacheRange:\ + Zicbom not supported.\n" \ + "Invalidating the whole instruction cache instead.\n") + ); + InvalidateInstructionCache (); + } + return Address; } =20 @@ -81,7 +195,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 +232,12 @@ WriteBackInvalidateDataCacheRange ( IN UINTN Length ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + if (RiscVIsCMOEnabled ()) { + CacheOpCacheRange (Address, Length, CacheOpFlush); + } else { + ASSERT (FALSE); + } + return Address; } =20 @@ -137,7 +257,7 @@ WriteBackDataCache ( VOID ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + ASSERT (FALSE); } =20 /** @@ -156,10 +276,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 +289,12 @@ WriteBackDataCacheRange ( IN UINTN Length ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + if (RiscVIsCMOEnabled ()) { + CacheOpCacheRange (Address, Length, CacheOpClean); + } else { + ASSERT (FALSE); + } + return Address; } =20 @@ -214,10 +336,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 +349,17 @@ InvalidateDataCacheRange ( IN UINTN Length ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __func__)); + if (RiscVIsCMOEnabled ()) { + CacheOpCacheRange (Address, Length, CacheOpInvld); + } 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 (#110701): https://edk2.groups.io/g/devel/message/110701 Mute This Topic: https://groups.io/mt/102413484/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 Thu May 16 21:49: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+110702+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+110702+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699239365; cv=none; d=zohomail.com; s=zohoarc; b=TK9TzP5+c26402jlKd5GQC03b4JQoOE20+H6sGTIMO9WKUZcKuOlfvnifL5r9AVDiLRLg7CoEkfMlFX+D3Si4LpcnOO38ELuq0ePJ/N1QmzJgtwMaWIt9dGX8EVAtqboPeA9hX7oGjOfOGwmckCfyPZytVdJQA583PXMzU6I95o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699239365; 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=npQ9oGSg/1O1JZ8hyFPZXKbo/Xk14ZX2psbJaXVT6iU=; b=mMbPwkEBnH/Azd2G3q7pa5gJrR07VbFM2uLjtNqGh4bgXV54iWIjMgqBS3NG3ASC6yMAO+bZKJcKPtqYOMgSnhu1vSJxq+EIpSTeara58ZKrhdAviahI0F6KMglRhnAGjW12N49jVBLR2tuBO9KFk8g9OHpg+0g3M/+82dUSe0I= 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+110702+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699239365978796.4284421530208; Sun, 5 Nov 2023 18:56:05 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=3BwPQHwhTALFzlAwff+UyqFksXAoYabzIvf/e2+tICo=; 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=1699239365; v=1; b=kNu77NsrnG+oaN/stP5TJohZuMgNcnxvetiSoFg85puMZuzbKaR5LO/vBLB1ptDJVsNZCLzZ Qzw5VoCsmql8eF2xW8CiKaYqxlRaIo4s8y0E5fpzRq8eeqJnNhTiIa4/0yreFnF5yDr/4Zkb0PG vFTA/vjXFG+lwtT3dqbWOi7k= X-Received: by 127.0.0.2 with SMTP id xPIoYY1788612xseltD1uohd; Sun, 05 Nov 2023 18:56:05 -0800 X-Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mx.groups.io with SMTP id smtpd.web11.46039.1699239365068016008 for ; Sun, 05 Nov 2023 18:56:05 -0800 X-Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6b5e6301a19so4104727b3a.0 for ; Sun, 05 Nov 2023 18:56:04 -0800 (PST) X-Gm-Message-State: osFJhhxqxIlYYVMWzbcZqXeyx1787277AA= X-Google-Smtp-Source: AGHT+IE8m6pu1GApzKWuCIFypZ6qADzYiEJgkjcO3M6TcZ42Xj1997KnjrR8fi7MWHOM1S8orZHaVA== X-Received: by 2002:a05:6a00:cd1:b0:6c3:44e2:3e96 with SMTP id b17-20020a056a000cd100b006c344e23e96mr13150180pfv.27.1699239364157; Sun, 05 Nov 2023 18:56:04 -0800 (PST) X-Received: from dhaval.. ([171.76.87.118]) by smtp.gmail.com with ESMTPSA id fa16-20020a056a002d1000b0068fece2c190sm2679724pfb.70.2023.11.05.18.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 18:56:03 -0800 (PST) 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 v8 5/5] OvmfPkg/RiscVVirt: Override for RV CPU Features Date: Mon, 6 Nov 2023 08:23:56 +0530 Message-Id: <20231106025356.167717-6-dhaval@rivosinc.com> In-Reply-To: <20231106025356.167717-1-dhaval@rivosinc.com> References: <20231106025356.167717-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: 1699239366505100001 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 --- Notes: V8: - Added RV tag 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 (#110702): https://edk2.groups.io/g/devel/message/110702 Mute This Topic: https://groups.io/mt/102413488/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-