From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796030927; b=POohjHX/5sBGEoLrrGH2mZkbFQ51kJmcNX35JJa7eA4CZL+2bU58Ud4mFYXco7MzGgdJ cAL7HOuF2aYK0Gjtd1nmRe3bIzeG8yvUY607n6SlD8CpcusfhnUvOl7V06i2aV6oraZSP pYoR+9bxKt8A1gcD09EswJ9RSonn3ol9iHfnH08rtl37+4BmGcKJjsDWh45AdT/ZAE/FA 6j96fhGJYXcsZ1geiLziaXx0WZozFltSWTrOAiZgT79njaj7BPXzKERpylhyCzfKn+gJK LQobyWHUaUPHIW2yvWxFO9mQ6wVGU5K/jQCju8Ze54ykh7ZT8efYRdbFyUxn0lZnEew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796030927; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=JWH0NIxOteMxQSimtDfqC0vyF064sWNvCZUVj1hZKBY=; b=lshLihrtern2vEKbkHtMVbyyNDQ3aLC9NAoysMjpljM1us4cOGFT9JrAWRE/fU1OzwS3 Z4vUHX8O+PgVshMbLfE0DqoptLtpsIs61rJD7mwrOLamuz0wkIINlzgsElfckvHtrreIG eR3YGrHfxALzkX5dAPJjPXj/DVhF3kcKHa/P9XuUDbHlryzFX1nKrN1ACmCuWIolVU28K 5WHbhGTdLgoFxU47mUsFeDHG/DoTHWjmDoPOJKu6NEb272ggLYGfpSlAkFi7VKvdU/79x bUZo40s+pz+1rz9R9BRkjAkR9NPE5mHrzT/YIlzD7ZWDGJvdMsA1RbIrgmYrSvfcg5w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dz1AwBQI; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFF1C606A33D; Mon, 30 Nov 2026 09:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dz1AwBQI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11A6D1F00919; Mon, 30 Nov 2026 09:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796030927; bh=JWH0NIxOteMxQSimtDfqC0vyF064sWNvCZUVj1hZKBY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dz1AwBQIgjB/wvLxwRePv8NFUXxfR7OeYq5wjDzHWILevrygEn7L2MyAYfrmOhTRS j3hUnPcpadHy2asu07G9Fw26970wLyIjbUx8nQkHUFaNPjMkzqDg2dk+n8T5ZeeZka ZK6OF7vdF5XrC2H67I4FtCmVMNIihTO+L2zRrrTfehYKm37Mv9LfjxIjq5F2YQfByP +qYTrjxd8Vbq/OGBA000cyEVK3i1rQ/vpTT7eopeOV92myOuPrP19OJDYoEjILXR5U PIi0q1fLyb7UjEn5cPvIDHGIEkk6FxpcFIgknSvnZKOZJY01nVK0S42KdA4h3G+Q4z zxroNRoDPNB9A== Date: Mon, 30 Nov 2026 14:52:05 +0530 From: Naveen N Rao To: Nikolay Borisov Cc: x86@kernel.org, mhocko@suse.com, kas@kernel.org, linux-kernel@vger.kernel.org, Dan Williams , Kees Cook , Ingo Molnar , Vishal Annapurve , Kirill Shutemov , Arnd Bergmann , Greg Kroah-Hartman , Michael Ellerman , Suzuki K Poulose , stable@vger.kernel.org Subject: Re: [PATCH v2] x86/devmem: Drop /dev/mem access for confidential guests Message-ID: References: <20261127154211.21360-2-nik.borisov@suse.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261127154211.21360-2-nik.borisov@suse.com> On Fri, Nov 27, 2026 at 05:42:12PM +0200, Nikolay Borisov wrote: > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 3159852fd6b3..1490e0019c71 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -901,6 +901,8 @@ config INTEL_TDX_GUEST > depends on X86_X2APIC > depends on EFI_STUB > depends on PARAVIRT > + select STRICT_DEVMEM > + select IO_STRICT_DEVMEM > select ARCH_HAS_CC_PLATFORM > select X86_MEM_ENCRYPT > select X86_MCE > @@ -1490,6 +1492,8 @@ config AMD_MEM_ENCRYPT > bool "AMD Secure Memory Encryption (SME) support" > depends on X86_64 && CPU_SUP_AMD > depends on EFI_STUB > + select STRICT_DEVMEM > + select IO_STRICT_DEVMEM > select DMA_COHERENT_POOL > select ARCH_USE_MEMREMAP_PROT > select INSTRUCTION_DECODER Sashiko had a comment on the previous posting about this, which I agree with: http://lore.kernel.org/r/sashiko-outbox-233694@kernel.org With the selects above, it will not be possible to disable CONFIG_DEVMEM completely if also selecting AMD_MEM_ENCRYPT/INTEL_TDX_GUEST. In addition, I don't see the need for IO_STRICT_DEVMEM, at least in terms of the issue being addressed and the fix below in devmem_is_allowed(). Dan's commit message refers to confidential MMIO, and I think that series can add the select if necessary. Note that adding this select will force-enable IO_STRICT_DEVMEM on baremetal as well. So, a simple 'select STRICT_DEVMEM if DEVMEM' instead? - Naveen