<div dir="ltr">On Sun, Feb 24, 2013 at 11:23 PM, <span dir="ltr"><<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sun, 24 Feb 2013 21:37:48 -0800, Abu Rasheda said:<br>
<br>
> tmp_long_ptr = ((long_ptr & 0x800000000000) ? (long_ptr |<br>
> 0xffff800000000000) : (long_ptr & 0xFFFFFFFFFFFF));<br>
<br>
</div>This will not do what you think it does when compiled for a 32-bit<br>
system.<br>
</blockquote></div><br><div>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:</div><div>
<br></div><div><div> if (long_ptr > 0x1000)</div><div> {</div><div> tmp_long_ptr = ((long_ptr & 0x800000000000) ? (long_ptr | 0xffff800000000000) : (long_ptr & 0xFFFFFFFFFFFF));</div><div>printf("tmp_long_ptr :0x%llx\n", (long long int) tmp_long_ptr);</div>
<div> if ((long_ptr == tmp_long_ptr) & (long_ptr >= 0x30000000))</div><div> printf("valid 64 addr\n");</div><div> }</div></div></div>