Thread (2 messages) 2 messages, 2 authors, 2013-02-25

valid address space ?

From: Abu Rasheda <hidden>
Date: 2013-02-25 14:59:40

On Sun, Feb 24, 2013 at 11:23 PM, [off-list ref] wrote:
On Sun, 24 Feb 2013 21:37:48 -0800, Abu Rasheda said:
quoted
   tmp_long_ptr = ((long_ptr & 0x800000000000) ? (long_ptr |
0xffff800000000000) : (long_ptr & 0xFFFFFFFFFFFF));
This will not do what you think it does when compiled for a 32-bit
system.
This code will never run on 32 bit system, but on 64 bit Intel. So does
this cover all possible valid addresses where kernel data structure can
reside ? here is the expression again:

 if (long_ptr > 0x1000)
  {
   tmp_long_ptr = ((long_ptr & 0x800000000000) ? (long_ptr |
0xffff800000000000) : (long_ptr & 0xFFFFFFFFFFFF));
printf("tmp_long_ptr :0x%llx\n", (long long int) tmp_long_ptr);
   if ((long_ptr == tmp_long_ptr) & (long_ptr >= 0x30000000))
      printf("valid 64 addr\n");
  }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130225/a3bacd09/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help