Skip to contentSkip to conversation

Question about output for PAL_VM_TR_READ call

DISCUSSION Christian Kandeler 2 participants 2 messages May 24, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

I'd like to know why in the tr_info function in arch/ia64/kernel/palinfo.c the ppn and vpn values are left-shifted by 12 bits in the sprintf call. They are supposed to be page numbers, but this shift turns them into byte addresses, doesn't it?

Regards,
Christian Kandeler

#1 lore raw
Quoted 4 lines

I'd like to know why in the tr_info function in arch/ia64/kernel/palinfo.c the ppn and vpn values are left-shifted by 12 bits in the sprintf call. They are supposed to be page numbers, but this shift turns them into byte addresses, doesn't it?

Looks like a mistake ... 'ppn' and 'vpn' sound like they stand for physical and virtual page number, but we are printing addresses.

Printing "page numbers" here might be confusing (in what pagesize units should we compute the page number? Current complied in PAGE_SIZE for the kernel? Or the "ps" for this entry?

It would be better to just change the tags to "phys" and "virt" and keep the numeric field the same.

Any change raises a user-space API change issue though ... does anyone know of any applications that look at the tr_info file? It seems highly improbable (if someone had written code to parse this, perhaps they might have noticed that this has been wrong since the dawn of time ... well at least since 2.4.0).

-Tony