Skip to content

Commit 63ecd3b

Browse files
committed
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
1 parent 6510223 commit 63ecd3b

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

arch/x86/kernel/aperture_64.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,23 @@ static int __init parse_gart_mem(char *p)
264264
}
265265
early_param("gart_fix_e820", parse_gart_mem);
266266

267+
/*
268+
* With kexec/kdump, if the first kernel doesn't shut down the GART and the
269+
* second kernel allocates a different GART region, there might be two
270+
* overlapping GART regions present:
271+
*
272+
* - the first still used by the GART initialized in the first kernel.
273+
* - (sub-)set of it used as normal RAM by the second kernel.
274+
*
275+
* which leads to memory corruptions and a kernel panic eventually.
276+
*
277+
* This can also happen if the BIOS has forgotten to mark the GART region
278+
* as reserved.
279+
*
280+
* Try to update the e820 map to mark that new region as reserved.
281+
*/
267282
void __init early_gart_iommu_check(void)
268283
{
269-
/*
270-
* in case it is enabled before, esp for kexec/kdump,
271-
* previous kernel already enable that. memset called
272-
* by allocate_aperture/__alloc_bootmem_nopanic cause restart.
273-
* or second kernel have different position for GART hole. and new
274-
* kernel could use hole as RAM that is still used by GART set by
275-
* first kernel
276-
* or BIOS forget to put that in reserved.
277-
* try to update e820 to make that region as reserved.
278-
*/
279284
u32 agp_aper_order = 0;
280285
int i, fix, slot, valid_agp = 0;
281286
u32 ctl;

0 commit comments

Comments
 (0)