lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090114184834.GC1290@linux-os.sc.intel.com>
Date:	Wed, 14 Jan 2009 10:48:34 -0800
From:	Suresh Siddha <suresh.b.siddha@...el.com>
To:	mingo@...e.hu, hpa@...or.com, tglx@...utronix.de
Cc:	venkatesh.pallipadi@...el.com, linux-kernel@...r.kernel.org
Subject: [patch] x86, pat: fix free_memtype() for legacy 1MB range

commit 0e95c190cf1b4adbf1fc67decff3f2bb20158ba8 in tip tree
is n't complete, as we left out adding similar logic to free_memtype().

Appended is the delta patch against tip.

thanks,
suresh
---

[patch] x86, pat: fix free_memtype() for legacy 1MB range

Starting this commit:

>	commit 0e95c190cf1b4adbf1fc67decff3f2bb20158ba8
>	Author: Suresh Siddha <suresh.b.siddha@...el.com>
>	Date:   Fri Jan 9 14:35:20 2009 -0800
>
>	    x86, pat: fix reserve_memtype() for legacy 1MB range

Attribute requests with in this 1MB region are tracked in reserve_memtype()
using linear linked list (and don't bother if the range is RAM or non-RAM or
mixed).

free_memtype() also needs to follow similar logic.

Signed-off-by: Suresh Siddha <suresh.b.siddha@...el.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
Cc: stable@...nel.org
---

diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index ec8cd49..3be3990 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -446,11 +446,19 @@ int free_memtype(u64 start, u64 end)
 	if (is_ISA_range(start, end - 1))
 		return 0;
 
-	is_range_ram = pagerange_is_ram(start, end);
-	if (is_range_ram == 1)
-		return free_ram_pages_type(start, end);
-	else if (is_range_ram < 0)
-		return -EINVAL;
+	/*
+	 * For legacy reasons, some parts of the physical address range in the
+	 * legacy 1MB region is treated as non-RAM (even when listed as RAM in
+	 * the e820 tables).  So we will track the memory attributes of this
+	 * legacy 1MB region using the linear memtype_list always.
+	 */
+	if (end >= ISA_END_ADDRESS) {
+		is_range_ram = pagerange_is_ram(start, end);
+		if (is_range_ram == 1)
+			return free_ram_pages_type(start, end);
+		else if (is_range_ram < 0)
+			return -EINVAL;
+	}
 
 	spin_lock(&memtype_lock);
 	list_for_each_entry(entry, &memtype_list, nd) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ