linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crash_dump: remove saved_max_pfn
@ 2020-03-30 18:15 Kairui Song
  2020-03-30 20:14 ` Eric W. Biederman
  2020-04-15  9:32 ` [tip: x86/cleanups] crash_dump: Remove no longer used saved_max_pfn tip-bot2 for Kairui Song
  0 siblings, 2 replies; 3+ messages in thread
From: Kairui Song @ 2020-03-30 18:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Young,
	Eric Biederman, kexec, Kairui Song

This variable is no longer used.

saved_max_pfn was originally introduce in commit 92aa63a5a1bf ("[PATCH]
kdump: Retrieve saved max pfn"), used to make sure that user does not
try to read the physical memory beyond saved_max_pfn. But since
commit 921d58c0e699 ("vmcore: remove saved_max_pfn check")
it's no longer used for the check.

Only user left is Calary IOMMU, which start using it from
commit 95b68dec0d52 ("calgary iommu: use the first kernels TCE tables
in kdump"). But again, recently in commit 90dc392fc445 ("x86: Remove
the calgary IOMMU driver"), Calary IOMMU is removed and this variable
no longer have any user.

So just remove it.

Signed-off-by: Kairui Song <kasong@redhat.com>
---
 arch/x86/kernel/e820.c     | 8 --------
 include/linux/crash_dump.h | 2 --
 kernel/crash_dump.c        | 6 ------
 3 files changed, 16 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index c5399e80c59c..4d13c57f370a 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -910,14 +910,6 @@ static int __init parse_memmap_one(char *p)
 		return -EINVAL;
 
 	if (!strncmp(p, "exactmap", 8)) {
-#ifdef CONFIG_CRASH_DUMP
-		/*
-		 * If we are doing a crash dump, we still need to know
-		 * the real memory size before the original memory map is
-		 * reset.
-		 */
-		saved_max_pfn = e820__end_of_ram_pfn();
-#endif
 		e820_table->nr_entries = 0;
 		userdef = 1;
 		return 0;
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 4664fc1871de..bc156285d097 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -97,8 +97,6 @@ extern void unregister_oldmem_pfn_is_ram(void);
 static inline bool is_kdump_kernel(void) { return 0; }
 #endif /* CONFIG_CRASH_DUMP */
 
-extern unsigned long saved_max_pfn;
-
 /* Device Dump information to be filled by drivers */
 struct vmcoredd_data {
 	char dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Unique name of the dump */
diff --git a/kernel/crash_dump.c b/kernel/crash_dump.c
index 9c23ae074b40..92da32275af5 100644
--- a/kernel/crash_dump.c
+++ b/kernel/crash_dump.c
@@ -5,12 +5,6 @@
 #include <linux/errno.h>
 #include <linux/export.h>
 
-/*
- * If we have booted due to a crash, max_pfn will be a very low value. We need
- * to know the amount of memory that the previous kernel used.
- */
-unsigned long saved_max_pfn;
-
 /*
  * stores the physical address of elf header of crash image
  *
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crash_dump: remove saved_max_pfn
  2020-03-30 18:15 [PATCH] crash_dump: remove saved_max_pfn Kairui Song
@ 2020-03-30 20:14 ` Eric W. Biederman
  2020-04-15  9:32 ` [tip: x86/cleanups] crash_dump: Remove no longer used saved_max_pfn tip-bot2 for Kairui Song
  1 sibling, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2020-03-30 20:14 UTC (permalink / raw)
  To: Kairui Song
  Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Young, kexec

Kairui Song <kasong@redhat.com> writes:

> This variable is no longer used.
>
> saved_max_pfn was originally introduce in commit 92aa63a5a1bf ("[PATCH]
> kdump: Retrieve saved max pfn"), used to make sure that user does not
> try to read the physical memory beyond saved_max_pfn. But since
> commit 921d58c0e699 ("vmcore: remove saved_max_pfn check")
> it's no longer used for the check.
>
> Only user left is Calary IOMMU, which start using it from
> commit 95b68dec0d52 ("calgary iommu: use the first kernels TCE tables
> in kdump"). But again, recently in commit 90dc392fc445 ("x86: Remove
> the calgary IOMMU driver"), Calary IOMMU is removed and this variable
> no longer have any user.
>
> So just remove it.
>
> Signed-off-by: Kairui Song <kasong@redhat.com>

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

Can we merge this through the tip tree?


> ---
>  arch/x86/kernel/e820.c     | 8 --------
>  include/linux/crash_dump.h | 2 --
>  kernel/crash_dump.c        | 6 ------
>  3 files changed, 16 deletions(-)
>
> diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
> index c5399e80c59c..4d13c57f370a 100644
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -910,14 +910,6 @@ static int __init parse_memmap_one(char *p)
>  		return -EINVAL;
>  
>  	if (!strncmp(p, "exactmap", 8)) {
> -#ifdef CONFIG_CRASH_DUMP
> -		/*
> -		 * If we are doing a crash dump, we still need to know
> -		 * the real memory size before the original memory map is
> -		 * reset.
> -		 */
> -		saved_max_pfn = e820__end_of_ram_pfn();
> -#endif
>  		e820_table->nr_entries = 0;
>  		userdef = 1;
>  		return 0;
> diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
> index 4664fc1871de..bc156285d097 100644
> --- a/include/linux/crash_dump.h
> +++ b/include/linux/crash_dump.h
> @@ -97,8 +97,6 @@ extern void unregister_oldmem_pfn_is_ram(void);
>  static inline bool is_kdump_kernel(void) { return 0; }
>  #endif /* CONFIG_CRASH_DUMP */
>  
> -extern unsigned long saved_max_pfn;
> -
>  /* Device Dump information to be filled by drivers */
>  struct vmcoredd_data {
>  	char dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Unique name of the dump */
> diff --git a/kernel/crash_dump.c b/kernel/crash_dump.c
> index 9c23ae074b40..92da32275af5 100644
> --- a/kernel/crash_dump.c
> +++ b/kernel/crash_dump.c
> @@ -5,12 +5,6 @@
>  #include <linux/errno.h>
>  #include <linux/export.h>
>  
> -/*
> - * If we have booted due to a crash, max_pfn will be a very low value. We need
> - * to know the amount of memory that the previous kernel used.
> - */
> -unsigned long saved_max_pfn;
> -
>  /*
>   * stores the physical address of elf header of crash image
>   *

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: x86/cleanups] crash_dump: Remove no longer used saved_max_pfn
  2020-03-30 18:15 [PATCH] crash_dump: remove saved_max_pfn Kairui Song
  2020-03-30 20:14 ` Eric W. Biederman
@ 2020-04-15  9:32 ` tip-bot2 for Kairui Song
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Kairui Song @ 2020-04-15  9:32 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Kairui Song, Borislav Petkov, Eric W. Biederman, x86, LKML

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     4c5b566c2193e2af82c891daa5303c8899e61044
Gitweb:        https://git.kernel.org/tip/4c5b566c2193e2af82c891daa5303c8899e61044
Author:        Kairui Song <kasong@redhat.com>
AuthorDate:    Tue, 31 Mar 2020 02:15:44 +08:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Wed, 15 Apr 2020 11:21:54 +02:00

crash_dump: Remove no longer used saved_max_pfn

saved_max_pfn was originally introduced in commit

  92aa63a5a1bf ("[PATCH] kdump: Retrieve saved max pfn")

It used to make sure that the user does not try to read the physical memory
beyond saved_max_pfn. But since commit

  921d58c0e699 ("vmcore: remove saved_max_pfn check")

it's no longer used for the check. This variable doesn't have any users
anymore so just remove it.

 [ bp: Drop the Calgary IOMMU reference from the commit message. ]

Signed-off-by: Kairui Song <kasong@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Link: https://lkml.kernel.org/r/20200330181544.1595733-1-kasong@redhat.com
---
 arch/x86/kernel/e820.c     | 8 --------
 include/linux/crash_dump.h | 2 --
 kernel/crash_dump.c        | 6 ------
 3 files changed, 16 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index c5399e8..4d13c57 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -910,14 +910,6 @@ static int __init parse_memmap_one(char *p)
 		return -EINVAL;
 
 	if (!strncmp(p, "exactmap", 8)) {
-#ifdef CONFIG_CRASH_DUMP
-		/*
-		 * If we are doing a crash dump, we still need to know
-		 * the real memory size before the original memory map is
-		 * reset.
-		 */
-		saved_max_pfn = e820__end_of_ram_pfn();
-#endif
 		e820_table->nr_entries = 0;
 		userdef = 1;
 		return 0;
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 4664fc1..bc15628 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -97,8 +97,6 @@ extern void unregister_oldmem_pfn_is_ram(void);
 static inline bool is_kdump_kernel(void) { return 0; }
 #endif /* CONFIG_CRASH_DUMP */
 
-extern unsigned long saved_max_pfn;
-
 /* Device Dump information to be filled by drivers */
 struct vmcoredd_data {
 	char dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Unique name of the dump */
diff --git a/kernel/crash_dump.c b/kernel/crash_dump.c
index 9c23ae0..92da322 100644
--- a/kernel/crash_dump.c
+++ b/kernel/crash_dump.c
@@ -6,12 +6,6 @@
 #include <linux/export.h>
 
 /*
- * If we have booted due to a crash, max_pfn will be a very low value. We need
- * to know the amount of memory that the previous kernel used.
- */
-unsigned long saved_max_pfn;
-
-/*
  * stores the physical address of elf header of crash image
  *
  * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-15  9:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 18:15 [PATCH] crash_dump: remove saved_max_pfn Kairui Song
2020-03-30 20:14 ` Eric W. Biederman
2020-04-15  9:32 ` [tip: x86/cleanups] crash_dump: Remove no longer used saved_max_pfn tip-bot2 for Kairui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).