public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Dhaval Sharma" <dhaval@rivosinc.com>
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	[thread overview]
Message-ID: <20231017121755.190285-1-dhaval@rivosinc.com> (raw)

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]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2023-10-17 12:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 12:17 Dhaval Sharma [this message]
2023-10-17 12:17 ` [edk2-devel] [PATCH v5 1/2] MdePkg:Implement RISCV CMO Dhaval Sharma
2023-10-17 14:22   ` Laszlo Ersek
2023-10-17 14:32     ` Laszlo Ersek
2023-10-17 12:17 ` [edk2-devel] [PATCH v5 2/2] OvmfPkg/RiscVVirt: Override for RV CPU Features Dhaval Sharma
2023-10-17 14:25   ` Laszlo Ersek
2023-10-17 14:39   ` Laszlo Ersek
2023-10-19  6:48     ` Dhaval Sharma
2023-10-19  9:22       ` Laszlo Ersek
2023-10-19 12:17         ` Laszlo Ersek
2023-10-19 14:37           ` Dhaval Sharma
2023-10-19 15:51             ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231017121755.190285-1-dhaval@rivosinc.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox