From nobody Wed Dec 17 12:48:27 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4F2A2046B9 for ; Tue, 10 Dec 2024 18:46:25 +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=1733856388; cv=none; b=QrqSLuJAaC/Lc09+3zXn/D/uLe4OPEKQzUBpClCl4kr2sB+TPynd655zkKK3tRVv8i6Vh/fZgs1O5WEY2PRzIavF+vU8jo6fVGHT8EoYn9AzqnmQ7MUWf8EyaQMTTxFbSaM8JsP1bIOCYOIdwHXx8mh4jkCbBL5dfHeqxyKBvTw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856388; c=relaxed/simple; bh=CTlBCvNJrEkicTyO1DepJXPgXB+HXtAILCY2tlalbLY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GuNqFybmzZnPKI+O/OfavxaqwBooxxGAK9K0exvn95ymeN7nSzo1C5Y/MzBn/Lqvv9n6sn6rq7mixKog6gNHMBdYFEFXs1tgPetE5Q09aulaWehN8sqcylBz8yxZ3jZ10rYp9Z+CXFXSeWvcUFQ5T5gr7rJWmHJylY3rwFPx7Jc= 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 462BA113E; Tue, 10 Dec 2024 10:46:53 -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 7CC353F58B; Tue, 10 Dec 2024 10:46:23 -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 1/4] x86/smp: Explicitly include Date: Tue, 10 Dec 2024 18:46:07 +0000 Message-ID: <20241210184610.2080727-2-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241210184610.2080727-1-kevin.brodsky@arm.com> References: <20241210184610.2080727-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" Including directly relies on having already been included, because the former needs the BAD_STACK/NOT_STACK constants defined in the latter. A subsequent patch will break that assumption in a file that includes asm/smp.h. Include the full to avoid getting into troubles. Signed-off-by: Kevin Brodsky Acked-by: David Hildenbrand --- arch/x86/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index ca073f40698f..88e72b414bfa 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -6,7 +6,7 @@ =20 #include #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); --=20 2.47.0 From nobody Wed Dec 17 12:48:27 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 168B321423F for ; Tue, 10 Dec 2024 18:46:27 +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=1733856390; cv=none; b=fG5SjizLlOm8OFcvr0UsFGVOtdw28TRdLBw063FG+74+82tI9qBCKyykQ0D0BIabYEyYD72TGnKK0kbJgM8bORL81LII0A+ksIGS9p8E3TUjNTdpdM+M2xjrmxkwesD6sFLaCAC3J6pWYIDVjjVJM8rpuwaAPMCvdIv+5+Z30ms= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856390; c=relaxed/simple; bh=Rb/+N6JWpHDtBCfUQCYpUwBhYVt6N90U8G6DN1hvoqQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HpqFk0zOJXjy2b9JxuCvRFQNlDTr+QIuLktq2BEibUUkJ/R3sU3WIlRUliV/+qTw4wZFSYF3v8Is59j2IqBUHDpjJTBgmZCDnu4pnVv4G/hHOLRHQJZgrAExdA+Z5dm+0TcH4nCvoT+eLntw5Mxl5V3RBWNQHIiGOudBHzJuPvU= 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 539BC1570; Tue, 10 Dec 2024 10:46:55 -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 8A3863F58B; Tue, 10 Dec 2024 10:46:25 -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 2/4] x86/sev: Explicitly include Date: Tue, 10 Dec 2024 18:46:08 +0000 Message-ID: <20241210184610.2080727-3-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241210184610.2080727-1-kevin.brodsky@arm.com> References: <20241210184610.2080727-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" sev-guest.c relies on including , but that include is about to go away. Explicitly include not to run into troubles. Signed-off-by: Kevin Brodsky Acked-by: David Hildenbrand --- drivers/virt/coco/sev-guest/sev-guest.c | 1 + 1 file changed, 1 insertion(+) 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 From nobody Wed Dec 17 12:48:27 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E683E22618B for ; Tue, 10 Dec 2024 18:46:29 +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=1733856391; cv=none; b=TGIjFbmxgZ47XV59j3EuvO4+Ci+0hmDMCLUl4tC/nioERKu3qqoY0eKyLmMQgwlXxWZpPi2Y2qQqZh9NQr5mCAEUl821y7CHx1fc8Ug4M9IK2EgZW/LVTz8e7VBiRVf0qiNttjanbJ+i8d3b9iS0fiBhUDXerFtYjI13kHfZjis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856391; c=relaxed/simple; bh=hdVsir5xwdWU1N+oSx55isIAUlAtsgjQ0MGltDXuKM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E7oKMu5hvt1Ucd6hb1tfLVqrbfdIxXm3bTe8dnKJyz/lyt41WkAHZ/hEYXEVbdoiXEJG/C+DC0cF5YlH4ALhpSmIO759J0y1iJ8t0l8JZMF/Xd5xC0m+pyEjqYwAcekw+KyUpoBAXNapDxr8VOZzJvvFZqRgsrvjgUcwCTww78w= 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 679E316A3; Tue, 10 Dec 2024 10:46:57 -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 97CE13F58B; Tue, 10 Dec 2024 10:46:27 -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 3/4] x86/mm: Remove unused __set_memory_prot() Date: Tue, 10 Dec 2024 18:46:09 +0000 Message-ID: <20241210184610.2080727-4-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241210184610.2080727-1-kevin.brodsky@arm.com> References: <20241210184610.2080727-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 Wed Dec 17 12:48:27 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A2EB224AEC for ; Tue, 10 Dec 2024 18:46:31 +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=1733856393; cv=none; b=m0wEKzlp3GCWOjUv5fFULuKq9vcwFiJYD0E88PFkPl3sNqsgkrK2JW8zGPNieXK9pcQKdwZ0XPdortp2560eE8tMn2raja4jmDh3EmmqBrKg188dgTEcw0rS+Kn/VdHUDPDM2dGCfQWJt7wJ5soWfm9Pq3stjJydTH6tuopeMfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856393; c=relaxed/simple; bh=e5PXCn07MN03XDCW/EIwWcJwKPd78HoTdyEK924UwyE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AEbMIbZqOCDq0HYiZzPwYWFYzRt8Go3jNeA7MmMGPd/UkLtjjMcJfRAa+HaDr89cl9sShZBHujartnidsMXrxPIVgt6gzPxgoimczAsijiGPS2N9uTMMUSUf5l1J6m1Cn7EkbBmqThWpMrw7WJGcjn4K3fMvcQimf0JDvpIM9gA= 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 8006D16F2; Tue, 10 Dec 2024 10:46:59 -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 A52EC3F58B; Tue, 10 Dec 2024 10:46:29 -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 4/4] x86/mm: Remove unnecessary include in set_memory.h Date: Tue, 10 Dec 2024 18:46:10 +0000 Message-ID: <20241210184610.2080727-5-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241210184610.2080727-1-kevin.brodsky@arm.com> References: <20241210184610.2080727-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 ). Signed-off-by: Kevin Brodsky Acked-by: David Hildenbrand --- arch/x86/include/asm/set_memory.h | 1 - 1 file changed, 1 deletion(-) 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 --=20 2.47.0