Re: [RESEND PATCH] x86/devmem: Drop /dev/mem access for confidential guests

From: Nikolay Borisov

Date: Thu Nov 26 2026 - 02:18:01 EST




On 25.11.26 г. 18:51 ч., Naveen N Rao wrote:
On Tue, Nov 24, 2026 at 07:57:05PM +0200, Nikolay Borisov wrote:
On 24.11.26 г. 19:10 ч., Pedro Falcato wrote:
On Tue, Nov 24, 2026 at 08:36:45AM -0800, Dave Hansen wrote:
On 11/24/26 08:00, Nikolay Borisov wrote:

2) open-codes random CC checks in mm, which is kind-of regrettable

OTOH, it's unclear to me why that CC check is needed. If configs select
STRICT_DEVMEM and IO_STRICT_DEVMEM, shouldn't it Just Do The Right thing?
in iomem_is_exclusive, etc. If not, could the CC awareness sit there
instead?

Well, you are right that if we retain just the select
STRICT_DEVMEM/IO_STRICT_DEVMEM it might fix the immediate issue. I don't
know why eventually Dan decided to also add this check, I guess it's an
instance of "fail fast".

Actually no? On x86, devmem_is_allowed() allows access to the first 1 MB
area, so STRICT_DEVMEM alone isn't sufficient.

For the first megabyte of memory (BIOS) is return 2, meaning "Just return 0, rather than trying to access the address range".


- Naveen