gpu/intel: do not clflush on MMIO but on ppgtt

Executing a clflush operation on MMIO memory freezes embedded
platforms such as the Celeron N3450 used on the ZimaBlade. Looking into
the current linux code confirms that clflush is only used for ppgtt
entries and not on MMIO memory.

Fixes #5176
This commit is contained in:
Johannes Schlatow 2024-04-11 13:01:52 +02:00 committed by Christian Helmuth
parent 7a042925fc
commit 8b43554a27
4 changed files with 3 additions and 22 deletions

View File

@ -21,7 +21,6 @@
/* local includes */
#include <types.h>
#include <commands.h>
#include <utils.h>
namespace Igd {
@ -727,8 +726,6 @@ class Igd::Hardware_status_page : public Igd::Common_context_regs<0x32*4 + 4>
uint64_t sequence_number()
{
/* invalidates cache before reading */
Utils::clflush((void *)(base() + Sequence_number::OFFSET));
return read<Sequence_number>();
}

View File

@ -947,8 +947,6 @@ struct Igd::Device
return false;
}
ring.flush(tail, tail + advance);
/* tail_offset must be specified in qword */
rcs.with_context([&](auto &context) {
context.tail_offset((offset % (rcs.ring_size())) / 8);

View File

@ -313,6 +313,7 @@ class Genode::Level_4_translation_table
throw Invalid_address();
func(vo, pa, sz, _entries[i]);
Utils::clflush(&_entries[i]);
/* check whether we wrap */
if (end < vo) return;
@ -535,6 +536,7 @@ class Genode::Page_directory
throw Invalid_address();
func(vo, pa, sz, _entries[i]);
Utils::clflush(&_entries[i]);
/* check whether we wrap */
if (end < vo) { return; }
@ -724,6 +726,7 @@ class Genode::Pml4_table
throw Invalid_address();
func(vo, pa, sz, _entries[i]);
Utils::clflush(&_entries[i]);
/* check whether we wrap */
if (end < vo) { return; }

View File

@ -182,23 +182,6 @@ class Igd::Ring_buffer
*/
Index max() const { return _max; }
/**
* Flush range of commands in ring buffer
*
* \param from index to start from
* \param to index to end on
*/
void flush(Index from, Index to) const
{
with_dwords([&](auto dwords) {
uint32_t *start = dwords + from;
for (Index i = 0; i < (to - from); i++) {
uint32_t *addr = start++;
Utils::clflush(addr);
}
});
}
/*********************
** Debug interface **
*********************/