Re: Help required in understanding assembly code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Thomas and List,

Thomas Petazzoni <thomas.petazzoni <at> free-electrons.com> writes:
> 
[...]
> 
> I suspect that the argument "struct page *" is passed in %rdi. It first
> dereferences it to get the page->flags value (which is at the beginning
> of the page structure). Once this value is in %rax, it shifts it right
> by 38 bits, which I suspect is the >> ZONETABLE_PGSHIFT in your source
> code. Then, it accesses to the zone_table[] array : it access to the
> %rax-th entry, in an array of elements with an 8 byte size (and
> zone_table[] is an array of "struct zone *", so it's an array of 8
> bytes elements). In %rdx, we now have a pointer to a "struct zone *"...
> which in fact happens to be NULL.

Thanks for the explanation, now it makes sense to me.

> 
> So, I would say that either your page->flags are broken, either your
> zone_table[] array is incorrect.

Yup, The flags field of the page was broken and the value was going beyond 
the available zone_table index. And hence the problem in dereferencing.

> 
> > 2) for "RIP: 0010:[<ffffffff801212a7>] " what does
> > "0010" mean?
> 
> It's the segment selector. It selects through which segment we are
> accessing the code. It is an offset in the Global Descriptor Table
> (GDT). These are x86/x86_64 specific bits, I don't think you care about
> this for your particular issue.

Actually yes, I doesn't relate to my problem but anyways, thanks.

> 
> > 3) Does "EFLAGS: 00010217" signify any error value, and
> > if it does, how to interpret it?
> 
> Take the Intel Developer manual, volume 1 (available at
> http://www.intel.com/products/processor/manuals/), page 78. It
> describes the contents of the EFLAGS register.

Done.

> 
> Sincerly,
> 
> Thomas

And sorry, Cannot put Thomas in CC as I am mailing from the Gmane.org web 
interface and it doesn't give me any option for that.

Your help is highly appreciated.
Shreyansh





--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux