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 56B67941716 for ; Tue, 17 Oct 2023 12:18:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=V2+HYtINZkj1d/pWjwRVPo6J/+0NtpVDqUUy1eCMMSI=; c=relaxed/simple; d=groups.io; h=From:To:Subject:Date:Message-Id: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=1697545081; v=1; b=WppaXMSP/gAs175D1DSBTNyEy+r6PfgNDjYNwE3DA7QVlN2PeQg8hdxXhVGw9M+U+pY+hIif 2qvnwUpep2sPJ6LnbabwBgg4OeMsklHvTPatY5QjUSaB2AaGcJm9budWOM/iB9T6TLvv2FQJw9j xugPyiI8RhKEoi58wF7+i13g= X-Received: by 127.0.0.2 with SMTP id 9I0QYY7687511x0jOmDJkSWm; Tue, 17 Oct 2023 05:18:01 -0700 X-Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mx.groups.io with SMTP id smtpd.web11.211391.1697545080789526456 for ; Tue, 17 Oct 2023 05:18:01 -0700 X-Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1c434c33ec0so36174525ad.3 for ; Tue, 17 Oct 2023 05:18:00 -0700 (PDT) X-Gm-Message-State: X5XAraGwREuPRKLgYchExWSWx7686176AA= X-Google-Smtp-Source: AGHT+IFByQHXjhmYR2HI1iCuMeOdPrj3bVlNtA20LYO6mHYpSBVQHxjk1GbMcOjoR9VTY7qqjY+kvg== X-Received: by 2002:a17:903:41c9:b0:1c9:d111:9b28 with SMTP id u9-20020a17090341c900b001c9d1119b28mr2343564ple.49.1697545079822; Tue, 17 Oct 2023 05:17:59 -0700 (PDT) X-Received: from dhaval.. ([2401:4900:1c80:4a26:d125:5df7:226b:329]) by smtp.gmail.com with ESMTPSA id f7-20020a17090274c700b001c62b9a51a4sm1379511plt.239.2023.10.17.05.17.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:17:59 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH v5 0/2] MdePkg:Implement RISCV CMO Date: Tue, 17 Oct 2023 17:47:53 +0530 Message-Id: <20231017121755.190285-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: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=WppaXMSP; dmarc=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 Implementing code to support Cache Management Operations (CMO) defined by RV spec https://github.com/riscv/riscv-CMOs Notes: CMO only supports block based Operations. Meaning complete cache flush/invd/clean Operations are not available. In that case we fallback on fence.i instructions. Rely on the fact that platform init has initialized CMO and this implementation just checks if it is enabled. In order to avoid compiler dependency injecting byte code. Code branch https://github.com/rivosinc/edk2/tree/dev_rv_cmo_v5 Test: Ensured correct instructions are refelecting in asm Able to boot platform with RiscVVirtQemu config Not able to verify actual instruction in HW as Qemu ignores any actual cache operations. Dhaval (2): MdePkg:Implement RISCV CMO OvmfPkg/RiscVVirt: Override for RV CPU Features MdePkg/MdePkg.dec | 7 + OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 2 + MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf | 3 +- MdePkg/Library/BaseLib/BaseLib.inf | 2 +- MdePkg/Include/Register/RiscV64/RiscVEncoding.h | 6 + MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 203 +++++++++++++++++--- MdePkg/Library/BaseLib/RiscV64/FlushCache.S | 21 -- MdePkg/Library/BaseLib/RiscV64/RiscVCacheMgmt.S | 38 ++++ 8 files changed, 236 insertions(+), 46 deletions(-) delete mode 100644 MdePkg/Library/BaseLib/RiscV64/FlushCache.S create mode 100644 MdePkg/Library/BaseLib/RiscV64/RiscVCacheMgmt.S -- 2.39.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109677): https://edk2.groups.io/g/devel/message/109677 Mute This Topic: https://groups.io/mt/102016147/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-