From: "Anatoliy Sivov" <mm05@mail.ru>
To: linux-newbie <linux-newbie@vger.kernel.org>,
e1000-devel@lists.sourceforge.net,
ratheesh kannoth <ratheesh.ksz@gmail.com>
Subject: Re: ia64 linux question
Date: Wed, 14 Nov 2012 21:22:51 +0400 [thread overview]
Message-ID: <op.wnrw8dqqsqfl9w@xn---hp-soa> (raw)
In-Reply-To: <CAGZFCEFJrGD8aUu8kBHD8C0WGEv0NnD1=RAs=ve-DwisWA50oA@mail.gmail.com>
Hello Ratheesh,
I have no kernel 2.6.29.1 and any ia-64 harware, but looked on modern
(3.6) kernel sources.
From arch/ia64/include/asm/io.h you can see that virt_to_phys and
virt_to_bus are actually the same function.
It's implementation is to return (unsigned long) address - PAGE_OFFSET.
I guess, PAGE_OFFSET for ia-64 is defined in arch/ia64/include/asm/page.h
as RGN_BASE(RGN_KERNEL).
RGN_KERNEL is a simple constant (equals 7), which obviously determines
region. Region number (here, 7) is located in top three bits of 64 bit
address, so RGN_BASE simply shifts its argument with 61 bit (see RGN_SHIFT
define).
So, writing in numbers: vitr_to_phys (and virt_to_bus) simply returns
(unsigned long) address - 0xE000000000000000.
The only way you can get ptr == virt_to_phys(ptr) is incorrectly treating
operands as 32-bit numbers (i.e. printk("%u", ptr) instead of
printk("%lu", ptr)).
BR, Anatoliy Sivov
ratheesh kannoth <ratheesh.ksz@gmail.com> писал(а) в своём письме Wed, 14
Nov 2012 14:11:14 +0400:
> Hi,
>
> I am running 2.6.29.1 on ia-64 hardware.
>
>
> when i run below code in a module
>
> void *ptr = kmalloc( 10 ,GFP_KERNEL )
>
> i got a valid ptr ( ptr != NULL ) ..but i saw that
>
> ptr == vitr_to_phy(ptr ) == virt_to_bus(ptr )
>
> 1. why the physical and vitrual address are same ?
> 2. is this sthing that we can change in kernel config during kernel
> compilation ?
>
> -Ratheesh
> --
> To unsubscribe from this list: send the line "unsubscribe linux-newbie"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
prev parent reply other threads:[~2012-11-14 17:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 10:11 ia64 linux question ratheesh kannoth
2012-11-14 17:22 ` Anatoliy Sivov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.wnrw8dqqsqfl9w@xn---hp-soa \
--to=mm05@mail.ru \
--cc=e1000-devel@lists.sourceforge.net \
--cc=linux-newbie@vger.kernel.org \
--cc=ratheesh.ksz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox