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