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: <4FF70EFC020000780008E195@nat28.tlf.novell.com>
Date:	Fri, 06 Jul 2012 15:14:52 +0100
From:	"Jan Beulich" <JBeulich@...e.com>
To:	<mingo@...e.hu>, <tglx@...utronix.de>, <hpa@...or.com>
Cc:	<linux-kernel@...r.kernel.org>
Subject: [PATCH] x86: adjust generic_get_mtrr() for 64-bit

Needing to deal with potentially large memory configurations, the
variables here should be "unsigned long" instead of "unsigned int".

Signed-off-by: Jan Beulich <jbeulich@...e.com>

---
 arch/x86/kernel/cpu/mtrr/generic.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- 3.5-rc5/arch/x86/kernel/cpu/mtrr/generic.c
+++ 3.5-rc5-x86-mtrr-generic-types/arch/x86/kernel/cpu/mtrr/generic.c
@@ -514,8 +514,8 @@ generic_get_free_region(unsigned long ba
 static void generic_get_mtrr(unsigned int reg, unsigned long *base,
 			     unsigned long *size, mtrr_type *type)
 {
-	unsigned int mask_lo, mask_hi, base_lo, base_hi;
-	unsigned int tmp, hi;
+	unsigned long mask_lo, mask_hi, base_lo, base_hi, tmp;
+	unsigned int hi;
 
 	/*
 	 * get_mtrr doesn't need to update mtrr_state, also it could be called
@@ -540,9 +540,9 @@ static void generic_get_mtrr(unsigned in
 	mask_lo = size_or_mask | tmp;
 
 	/* Expand tmp with high bits to all 1s: */
-	hi = fls(tmp);
+	hi = fls_long(tmp);
 	if (hi > 0) {
-		tmp |= ~((1<<(hi - 1)) - 1);
+		tmp |= ~((1UL<<(hi - 1)) - 1);
 
 		if (tmp != mask_lo) {
 			printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n");



--
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