From: "yorange" <yangcheng.work@foxmail.com>
To: Laszlo Ersek <lersek@redhat.com>,devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v10 4/5] MdePkg: Utilize Cache Management Operations Implementation For RISC-V
Date: Mon, 08 Jan 2024 07:26:27 -0800 [thread overview]
Message-ID: <17828.1704727587183697949@groups.io> (raw)
In-Reply-To: <71b9c7de-7686-a3f2-0deb-63d9cc66f4c4@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]
Hi, all
I`m yangcheng, and I found this bug when using the *edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe* driver on my VisionFive2 development board, which does not support the *CMO* instruction set. There are many functions in *DwEmmcDxe.c* that call Cache operations. For example, the *DwEmmcReadBlockData* function below calls *WriteBackDataCacheRange* ().
EFI_STATUS
*DwEmmcReadBlockData* (
IN EFI_MMC_HOST_PROTOCOL *This,
IN EFI_LBA Lba,
IN UINTN Length,
IN UINT32* Buffer
)
{
.......
*WriteBackDataCacheRange* (gpIdmacDesc, DescPages * EFI_PAGE_SIZE);
StartDma (Length);
Status = SendCommand (mDwEmmcCommand, mDwEmmcArgument);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to read data, mDwEmmcCommand:%x, mDwEmmcArgument:%x, Status:%r\n", mDwEmmcCommand, mDwEmmcArgument, Status));
goto out;
}
out:
// Restore Tpl
gBS->RestoreTPL (Tpl);
return Status;
}
Initially, I didn't set *PcdRiscVFeatureOverride* , so I got an illegal instruction exception. Then I set my *PcdRiscVFeatureOverride* to *0xFFFFFFFFFFFFFFFE* to avoid using the *CMO* instruction set, and I got an *ASSERT*.
Most cross-platform driver codes may call Cache management operations. Modifying these driver codes may cost a lot, and I think we may need some better way than ASSERT.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113404): https://edk2.groups.io/g/devel/message/113404
Mute This Topic: https://groups.io/mt/103150435/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 3014 bytes --]
next prev parent reply other threads:[~2024-01-08 15:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-13 14:59 [edk2-devel] [PATCH v10 0/5] Cache Management Operations Support For RISC-V Dhaval Sharma
2023-12-13 14:59 ` [edk2-devel] [PATCH v10 1/5] MdePkg: Move RISC-V Cache Management Declarations Into BaseLib Dhaval Sharma
2023-12-13 14:59 ` [edk2-devel] [PATCH v10 2/5] MdePkg: Rename Cache Management Function To Clarify Fence Based Op Dhaval Sharma
2023-12-13 14:59 ` [edk2-devel] [PATCH v10 3/5] MdePkg: Implement RISC-V Cache Management Operations Dhaval Sharma
2023-12-13 14:59 ` [edk2-devel] [PATCH v10 4/5] MdePkg: Utilize Cache Management Operations Implementation For RISC-V Dhaval Sharma
2023-12-19 7:28 ` Sunil V L
2023-12-19 7:33 ` Dhaval Sharma
2024-01-08 13:21 ` Laszlo Ersek
2024-01-08 15:26 ` yorange [this message]
2024-01-08 16:23 ` Dhaval Sharma
2024-01-08 21:53 ` Pedro Falcato
2024-01-09 5:31 ` Sunil V L
2024-01-09 16:19 ` Andrei Warkentin
2024-01-12 7:15 ` Dhaval Sharma
2024-01-09 2:14 ` yorange
2023-12-13 14:59 ` [edk2-devel] [PATCH v10 5/5] OvmfPkg/RiscVVirt: Override for RISC-V CPU Features Dhaval Sharma
2023-12-19 7:31 ` Sunil V L
2023-12-19 14:01 ` [edk2-devel] [PATCH v10 0/5] Cache Management Operations Support For RISC-V Sunil V L
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=17828.1704727587183697949@groups.io \
--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