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

From: Nikolay Borisov

Date: Tue Nov 24 2026 - 12:57:14 EST




On 24.11.26 г. 19:10 ч., Pedro Falcato wrote:
Holy cow the CC list is stale.
Fixing some up.

On Tue, Nov 24, 2026 at 08:36:45AM -0800, Dave Hansen wrote:
On 11/24/26 08:00, Nikolay Borisov wrote:
Resending this with the hope of either getting it accepted or
arriving at a consensus what exactly is missing so that I can take
it from there and eventually get something merged. As previously
mentioned this results in real problems for confidential guests both
on TDX as well as SEV-SNP.>
arch/x86/Kconfig | 4 ++++
mm/char-mem.c | 10 ++++++++++
2 files changed, 14 insertions(+)

I'm still OK with doing this.

But I didn't want to sneak an mm/ change in via the tip tree. Any mm
acks or naks on this?

For what it's worth, I don't love this fix. Yes, it fixes issues in /dev/mem,
but it:
1) skips any other potential problem spots (I don't know which)

Well that's not saying much. Of course there are thousands of bugs lurking around the kernel and not any one patch fixes them all.

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".

/me doesn't know much about CC other than *if you touch something you shouldn't,
it goes boom*