From ffc89f3edf7eaff7eacab8f8fa9c11fa3c10dc08 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Wed, 16 Jun 2021 13:35:47 +0200 Subject: [PATCH] gpu/intel: let guard page handling up to client For mesa-21 the client takes care and manages the virtual address space of the vGPU by itself and the intel/gpu driver can't add silently a guard page anymore. Move the patch to the drm/ioctl of the former mesa version. Issue #4148 #4233 --- repos/libports/src/lib/drm/ioctl.cc | 3 ++- repos/os/src/drivers/gpu/intel/main.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/repos/libports/src/lib/drm/ioctl.cc b/repos/libports/src/lib/drm/ioctl.cc index 914f225543..079a27c77f 100644 --- a/repos/libports/src/lib/drm/ioctl.cc +++ b/repos/libports/src/lib/drm/ioctl.cc @@ -380,7 +380,8 @@ class Drm_call { drm_i915_gem_create * const p = reinterpret_cast(arg); - uint64_t const size = (p->size + 0xfff) & ~0xfff; + /* roundup to next page size and add guarding page */ + uint64_t const size = ((p->size + 0xfff) & ~0xfff) + 0x1000; Handle handle = _alloc_buffer(size); if (handle == INVALID_HANDLE) { return -1; } diff --git a/repos/os/src/drivers/gpu/intel/main.cc b/repos/os/src/drivers/gpu/intel/main.cc index d4613efd36..e92f9133bd 100644 --- a/repos/os/src/drivers/gpu/intel/main.cc +++ b/repos/os/src/drivers/gpu/intel/main.cc @@ -1443,8 +1443,8 @@ class Gpu::Session_component : public Genode::Session_object * => better construct Buffer object as whole */ - /* roundup to next page size and add guarding page */ - size = ((size + 0xffful) & ~0xffful) + 0x1000; + /* roundup to next page size */ + size = ((size + 0xffful) & ~0xffful); try { Genode::Dataspace_capability cap = _device.alloc_buffer(_heap, size);