All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment
@ 2018-11-01 15:53 Borislav Petkov
  2018-11-01 17:09 ` Thomas Gleixner
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Borislav Petkov @ 2018-11-01 15:53 UTC (permalink / raw)
  To: X86 ML; +Cc: Mike Rapoport, LKML

From: Borislav Petkov <bp@suse.de>

... to actually explain what the function is trying to do.

Reported-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/kernel/aperture_64.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 2c4d5ece7456..4fb4b7f53568 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -264,18 +264,23 @@ static int __init parse_gart_mem(char *p)
 }
 early_param("gart_fix_e820", parse_gart_mem);
 
+/*
+ * With kexec/kdump, if the first kernel doesn't shutdown the GART and the
+ * second kernel allocates a different GART region, there might be two
+ * overlapping GART regions present:
+ *
+ * - the first still used by the GART initialized in the first kernel.
+ * - (sub-)set of it used as normal RAM by the second kernel.
+ *
+ * which leads to memory corruptions and a kernel panic eventually.
+ *
+ * This can also happen if the BIOS has forgotten to mark the GART region
+ * as reserved.
+ *
+ * Try to update the e820 map to mark that new region as reserved.
+ */
 void __init early_gart_iommu_check(void)
 {
-	/*
-	 * in case it is enabled before, esp for kexec/kdump,
-	 * previous kernel already enable that. memset called
-	 * by allocate_aperture/__alloc_bootmem_nopanic cause restart.
-	 * or second kernel have different position for GART hole. and new
-	 * kernel could use hole as RAM that is still used by GART set by
-	 * first kernel
-	 * or BIOS forget to put that in reserved.
-	 * try to update e820 to make that region as reserved.
-	 */
 	u32 agp_aper_order = 0;
 	int i, fix, slot, valid_agp = 0;
 	u32 ctl;
-- 
2.19.1


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

* Re: [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment
  2018-11-01 15:53 [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment Borislav Petkov
@ 2018-11-01 17:09 ` Thomas Gleixner
  2018-11-05 13:39 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2018-11-01 17:09 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: X86 ML, Mike Rapoport, LKML

On Thu, 1 Nov 2018, Borislav Petkov wrote:

> From: Borislav Petkov <bp@suse.de>
> 
> ... to actually explain what the function is trying to do.
> 
> Reported-by: Mike Rapoport <rppt@linux.ibm.com>
> Signed-off-by: Borislav Petkov <bp@suse.de>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

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

* [tip:x86/cleanups] x86/gart: Rewrite early_gart_iommu_check() comment
  2018-11-01 15:53 [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment Borislav Petkov
  2018-11-01 17:09 ` Thomas Gleixner
@ 2018-11-05 13:39 ` tip-bot for Borislav Petkov
  2018-11-05 15:35 ` [PATCH] " Ingo Molnar
  2018-11-05 20:24 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  3 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Borislav Petkov @ 2018-11-05 13:39 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, bp, tglx, hpa, x86, rppt, mingo

Commit-ID:  59d130cc9b92b92feaada94a0802fa747038d17f
Gitweb:     https://git.kernel.org/tip/59d130cc9b92b92feaada94a0802fa747038d17f
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Thu, 1 Nov 2018 16:24:43 +0100
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Mon, 5 Nov 2018 14:35:10 +0100

x86/gart: Rewrite early_gart_iommu_check() comment

... to actually explain what the function is trying to do.

Reported-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: <x86@kernel.org>
Link: http://lkml.kernel.org/r/20181101155314.30690-1-bp@alien8.de
---
 arch/x86/kernel/aperture_64.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 2c4d5ece7456..4fb4b7f53568 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -264,18 +264,23 @@ static int __init parse_gart_mem(char *p)
 }
 early_param("gart_fix_e820", parse_gart_mem);
 
+/*
+ * With kexec/kdump, if the first kernel doesn't shutdown the GART and the
+ * second kernel allocates a different GART region, there might be two
+ * overlapping GART regions present:
+ *
+ * - the first still used by the GART initialized in the first kernel.
+ * - (sub-)set of it used as normal RAM by the second kernel.
+ *
+ * which leads to memory corruptions and a kernel panic eventually.
+ *
+ * This can also happen if the BIOS has forgotten to mark the GART region
+ * as reserved.
+ *
+ * Try to update the e820 map to mark that new region as reserved.
+ */
 void __init early_gart_iommu_check(void)
 {
-	/*
-	 * in case it is enabled before, esp for kexec/kdump,
-	 * previous kernel already enable that. memset called
-	 * by allocate_aperture/__alloc_bootmem_nopanic cause restart.
-	 * or second kernel have different position for GART hole. and new
-	 * kernel could use hole as RAM that is still used by GART set by
-	 * first kernel
-	 * or BIOS forget to put that in reserved.
-	 * try to update e820 to make that region as reserved.
-	 */
 	u32 agp_aper_order = 0;
 	int i, fix, slot, valid_agp = 0;
 	u32 ctl;

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

* Re: [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment
  2018-11-01 15:53 [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment Borislav Petkov
  2018-11-01 17:09 ` Thomas Gleixner
  2018-11-05 13:39 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
@ 2018-11-05 15:35 ` Ingo Molnar
  2018-11-05 20:20   ` Borislav Petkov
  2018-11-05 20:24 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  3 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2018-11-05 15:35 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: X86 ML, Mike Rapoport, LKML


* Borislav Petkov <bp@alien8.de> wrote:

> From: Borislav Petkov <bp@suse.de>
> 
> ... to actually explain what the function is trying to do.
> 
> Reported-by: Mike Rapoport <rppt@linux.ibm.com>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>  arch/x86/kernel/aperture_64.c | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
> index 2c4d5ece7456..4fb4b7f53568 100644
> --- a/arch/x86/kernel/aperture_64.c
> +++ b/arch/x86/kernel/aperture_64.c
> @@ -264,18 +264,23 @@ static int __init parse_gart_mem(char *p)
>  }
>  early_param("gart_fix_e820", parse_gart_mem);
>  
> +/*
> + * With kexec/kdump, if the first kernel doesn't shutdown the GART and the
> + * second kernel allocates a different GART region, there might be two
> + * overlapping GART regions present:

s/shutdown
 /shut down

Thanks,

	Ingo

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

* Re: [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment
  2018-11-05 15:35 ` [PATCH] " Ingo Molnar
@ 2018-11-05 20:20   ` Borislav Petkov
  0 siblings, 0 replies; 6+ messages in thread
From: Borislav Petkov @ 2018-11-05 20:20 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: X86 ML, Mike Rapoport, LKML

On Mon, Nov 05, 2018 at 04:35:40PM +0100, Ingo Molnar wrote:
> s/shutdown
>  /shut down

Fixed.

Thx.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

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

* [tip:x86/cleanups] x86/gart: Rewrite early_gart_iommu_check() comment
  2018-11-01 15:53 [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment Borislav Petkov
                   ` (2 preceding siblings ...)
  2018-11-05 15:35 ` [PATCH] " Ingo Molnar
@ 2018-11-05 20:24 ` tip-bot for Borislav Petkov
  3 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Borislav Petkov @ 2018-11-05 20:24 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, rppt, bp, tglx, hpa, mingo, x86

Commit-ID:  63ecd3b13d5cf07959a2315ec62a7c62e20df114
Gitweb:     https://git.kernel.org/tip/63ecd3b13d5cf07959a2315ec62a7c62e20df114
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Thu, 1 Nov 2018 16:24:43 +0100
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Mon, 5 Nov 2018 21:18:31 +0100

x86/gart: Rewrite early_gart_iommu_check() comment

... to actually explain what the function is trying to do.

Reported-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: <x86@kernel.org>
Link: http://lkml.kernel.org/r/20181101155314.30690-1-bp@alien8.de
---
 arch/x86/kernel/aperture_64.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 2c4d5ece7456..58176b56354e 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -264,18 +264,23 @@ static int __init parse_gart_mem(char *p)
 }
 early_param("gart_fix_e820", parse_gart_mem);
 
+/*
+ * With kexec/kdump, if the first kernel doesn't shut down the GART and the
+ * second kernel allocates a different GART region, there might be two
+ * overlapping GART regions present:
+ *
+ * - the first still used by the GART initialized in the first kernel.
+ * - (sub-)set of it used as normal RAM by the second kernel.
+ *
+ * which leads to memory corruptions and a kernel panic eventually.
+ *
+ * This can also happen if the BIOS has forgotten to mark the GART region
+ * as reserved.
+ *
+ * Try to update the e820 map to mark that new region as reserved.
+ */
 void __init early_gart_iommu_check(void)
 {
-	/*
-	 * in case it is enabled before, esp for kexec/kdump,
-	 * previous kernel already enable that. memset called
-	 * by allocate_aperture/__alloc_bootmem_nopanic cause restart.
-	 * or second kernel have different position for GART hole. and new
-	 * kernel could use hole as RAM that is still used by GART set by
-	 * first kernel
-	 * or BIOS forget to put that in reserved.
-	 * try to update e820 to make that region as reserved.
-	 */
 	u32 agp_aper_order = 0;
 	int i, fix, slot, valid_agp = 0;
 	u32 ctl;

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

end of thread, other threads:[~2018-11-05 20:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 15:53 [PATCH] x86/gart: Rewrite early_gart_iommu_check() comment Borislav Petkov
2018-11-01 17:09 ` Thomas Gleixner
2018-11-05 13:39 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
2018-11-05 15:35 ` [PATCH] " Ingo Molnar
2018-11-05 20:20   ` Borislav Petkov
2018-11-05 20:24 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.