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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <48D37FDA.76E4.0078.0@novell.com>
Date:	Fri, 19 Sep 2008 09:32:58 +0100
From:	"Jan Beulich" <jbeulich@...ell.com>
To:	"Jeremy Fitzhardinge" <jeremy@...p.org>
Cc:	"Ingo Molnar" <mingo@...e.hu>, <tglx@...utronix.de>,
	<linux-kernel@...r.kernel.org>, <hpa@...or.com>
Subject: Re: [PATCH] x86: x86_{phys,virt}_bits field also for i386 (v3)

>>> Jeremy Fitzhardinge <jeremy@...p.org> 18.09.08 20:00 >>>
>I take it we're talking about this chunk:
>
>-static inline int phys_addr_valid(unsigned long addr)
>+static inline int phys_addr_valid(resource_size_t addr)
> {
>-	return addr < (1UL << boot_cpu_data.x86_phys_bits);
>+#ifdef CONFIG_RESOURCES_64BIT
>+	return !(addr >> boot_cpu_data.x86_phys_bits);
>+#else
>+	return 1;
>+#endif

Yes.

>Is x86_phys_bits defined to be the actual number of address lines poking
>out of the CPU package, or the number of address bits we can
>meaningfully put into a pte?

The intention is for it to express a CPU capability.

>I would say the simplest thing to do here is be explicit:
>
>	if (sizeof(addr) == sizeof(u64))
>		return !(addr >> boot_cpu_data.x86_phys_bits);
>	else
>		return 1; 
>
>That's not ideal, but I guess its good enough.  I assume x86_phys_bits
>can never be less than 32?

Yes, one could do it that way. But what's the point of having RESOURCES_64BIT
set and resource_size_t nevertheless being a 32-bit quantity? And why,
independent of that, was ioremap() not changed to use phys_addr_t?

Jan

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