From nobody Sun Dec 14 12:14:23 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6ED6720B20B for ; Thu, 12 Dec 2024 08:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733990960; cv=none; b=aRGaDGXHZu8EW4IRDUKOQtGncODXsCwd586ozc44cz8rcBMAjjbS3DViwnR0UTcKxgIpIn9wGHqnEtoZ0jcTfvvekjb1VU2tx4AN6Yvk+Os8cLuMah6Dyv8JBCaL8p75V3zxWhXmTtGRZ/dFXHpKPJrr/F+hLJSdS0QhyquhswY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733990960; c=relaxed/simple; bh=hdVsir5xwdWU1N+oSx55isIAUlAtsgjQ0MGltDXuKM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HZeolF3U20Vk8KlOYts2hz2AxIMcTzaK7PJz3WFGdlkC5dYHRFe7f2fL6Qz/gmxxprjEp1cnDVfKoH81RcfKBASfeHG0tAOdfy9/h+iBbYPoqDbHKtIHc9AG25fli1UgOY8rXcMXfkks2vOOVcL2zXBq2a1IidM1GEEEXRMRaWo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 701451756; Thu, 12 Dec 2024 00:09:40 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 213A03F5A1; Thu, 12 Dec 2024 00:09:11 -0800 (PST) From: Kevin Brodsky To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , bp@alien8.de, dan.j.williams@intel.com, dave.hansen@linux.intel.com, david@redhat.com, jane.chu@oracle.com, osalvador@suse.de, tglx@linutronix.de Subject: [PATCH v2 1/2] x86/mm: Remove unused __set_memory_prot() Date: Thu, 12 Dec 2024 08:09:03 +0000 Message-ID: <20241212080904.2089632-2-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241212080904.2089632-1-kevin.brodsky@arm.com> References: <20241212080904.2089632-1-kevin.brodsky@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" __set_memory_prot() is unused since commit 5c11f00b09c1 ("x86: remove memory hotplug support on X86_32"). Let's remove it. Signed-off-by: Kevin Brodsky Acked-by: David Hildenbrand --- arch/x86/include/asm/set_memory.h | 1 - arch/x86/mm/pat/set_memory.c | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/arch/x86/include/asm/set_memory.h b/arch/x86/include/asm/set_m= emory.h index cc62ef70ccc0..6586d533fe3a 100644 --- a/arch/x86/include/asm/set_memory.h +++ b/arch/x86/include/asm/set_memory.h @@ -38,7 +38,6 @@ int set_memory_rox(unsigned long addr, int numpages); * The caller is required to take care of these. */ =20 -int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot); int _set_memory_uc(unsigned long addr, int numpages); int _set_memory_wc(unsigned long addr, int numpages); int _set_memory_wt(unsigned long addr, int numpages); diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c index 95bc50a8541c..2dc1145cfdb8 100644 --- a/arch/x86/mm/pat/set_memory.c +++ b/arch/x86/mm/pat/set_memory.c @@ -1944,19 +1944,6 @@ static inline int cpa_clear_pages_array(struct page = **pages, int numpages, CPA_PAGES_ARRAY, pages); } =20 -/* - * __set_memory_prot is an internal helper for callers that have been pass= ed - * a pgprot_t value from upper layers and a reservation has already been t= aken. - * If you want to set the pgprot to a specific page protocol, use the - * set_memory_xx() functions. - */ -int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot) -{ - return change_page_attr_set_clr(&addr, numpages, prot, - __pgprot(~pgprot_val(prot)), 0, 0, - NULL); -} - int _set_memory_uc(unsigned long addr, int numpages) { /* --=20 2.47.0 From nobody Sun Dec 14 12:14:23 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B4BB20C004 for ; Thu, 12 Dec 2024 08:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733990963; cv=none; b=HsQLHlAK+/IjfazntnSgTqNzblTy8gRudTUAvnM8TiZpRMLykZ56qCBqu8lcR87SgpDy7UVv/O4aRWbNrpulQmprU/Vtu6XHOtFFMNrhd91QZK6EMns/7f91YOzVnXFYzZXeVwpGMxAe4c4FQwXXe83SURBEnDhuHpn28fcVGWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733990963; c=relaxed/simple; bh=+mMtbs8cmKrUlUmSEk+yek9cpP8G0N2EYmh4zIg2Yv0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C7MNNFG6nb2/MLZCqnNa0fZs1mXvB2x0l13GHrIdtFryITac2UYdnjdRXEWhQhlo0tRHuZwAqWYVaf7g9FvJ9it4Ql48wXTdQCbGbJLI6m6/mDg+gW1oQXbD+cFZUaoWfXrUYS9/+JifMqZkxzIShJlplww8hPNeyBSg9wZYTMQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA8771758; Thu, 12 Dec 2024 00:09:41 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9C0E23F5A1; Thu, 12 Dec 2024 00:09:12 -0800 (PST) From: Kevin Brodsky To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , bp@alien8.de, dan.j.williams@intel.com, dave.hansen@linux.intel.com, david@redhat.com, jane.chu@oracle.com, osalvador@suse.de, tglx@linutronix.de Subject: [PATCH v2 2/2] x86/mm: Remove unnecessary include in set_memory.h Date: Thu, 12 Dec 2024 08:09:04 +0000 Message-ID: <20241212080904.2089632-3-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241212080904.2089632-1-kevin.brodsky@arm.com> References: <20241212080904.2089632-1-kevin.brodsky@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 03b122da74b2 ("x86/sgx: Hook arch_memory_failure() into mainline code") included in asm/set_memory.h to provide some helper. However commit b3fdf9398a16 ("x86/mce: relocate set{clear}_mce_nospec() functions") moved the inline definitions someplace else, and now set_memory.h just declares a bunch of functions. No need for the whole linux/mm.h for declaring functions; just remove that include. This helps avoid circular dependency headaches (e.g. if linux/mm.h ends up including ). This change requires a couple of include fixups not to break the build: * asm/smp.h: including directly relies on having already been included, because the former needs the BAD_STACK/NOT_STACK constants defined in the latter. This is no longer the case when asm/smp.h is included from some driver file - just include to stay out of trouble. * sev-guest.c relies on including , so we just need to make that include explicit. Signed-off-by: Kevin Brodsky Acked-by: David Hildenbrand --- arch/x86/include/asm/set_memory.h | 1 - arch/x86/include/asm/smp.h | 2 +- drivers/virt/coco/sev-guest/sev-guest.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/set_memory.h b/arch/x86/include/asm/set_m= emory.h index 6586d533fe3a..8d9f1c9aaa4c 100644 --- a/arch/x86/include/asm/set_memory.h +++ b/arch/x86/include/asm/set_memory.h @@ -2,7 +2,6 @@ #ifndef _ASM_X86_SET_MEMORY_H #define _ASM_X86_SET_MEMORY_H =20 -#include #include #include =20 diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index ca073f40698f..2ca1da5f16d9 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -3,10 +3,10 @@ #define _ASM_X86_SMP_H #ifndef __ASSEMBLY__ #include +#include =20 #include #include -#include =20 DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map); DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_map); diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/se= v-guest/sev-guest.c index b699771be029..e134bee818fa 100644 --- a/drivers/virt/coco/sev-guest/sev-guest.c +++ b/drivers/virt/coco/sev-guest/sev-guest.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include =20 --=20 2.47.0